Skip to content

RFM69::initialize(...) doesn't always set the radio to the same state #172

Description

@jgillula

Say a radio is in listen mode, and then a new sketch that doesn't use listen mode is uploaded to the Moteino (e.g. via the Arduino IDE). When the new sketch runs RFM69::initialize(...) the radio stays in listen mode since nothing has told it to turn listen mode off. Only resetting the power will turn of listen mode, or making sure to always call RFM69::listenModeEnd() right after RFM69::initialize(...). The former is annoying, and the latter would force anyone to define RF69_LISTENMODE_ENABLE even if they're not using listen mode.

Instead, RFM69::initialize(...) should probably turn off listen mode if it's on, regardless of whether or not RF69_LISTENMODE_ENABLE is defined, so that calls to RFM69::initialize(...) always put the radio into the same starting state.

PR #171 fixes this by moving some of the code in RFM69::listenModeEnd() to RFM69::initialize().

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions