Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RF24: Add 4-pin configuration support #1381

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions hal/transport/RF24/driver/RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,29 @@ LOCAL void RF24_openWritingPipe(const uint8_t recipient)
LOCAL void RF24_startListening(void)
{
RF24_DEBUG(PSTR("RF24:STL\n")); // start listening
#if MY_RF24_CE_PIN == NOT_A_PIN
RF24_sleep();
#endif
// toggle PRX
RF24_setRFConfiguration(RF24_CONFIGURATION | _BV(RF24_PWR_UP) | _BV(RF24_PRIM_RX) );
// all RX pipe addresses must be unique, therefore skip if node ID is RF24_BROADCAST_ADDRESS
if(RF24_NODE_ADDRESS!= RF24_BROADCAST_ADDRESS) {
RF24_setPipeLSB(RF24_REG_RX_ADDR_P0, RF24_NODE_ADDRESS);
}
#if MY_RF24_CE_PIN != NOT_A_PIN
// start listening
RF24_ce(HIGH);
#endif
}

LOCAL void RF24_stopListening(void)
{
RF24_DEBUG(PSTR("RF24:SPL\n")); // stop listening
#if MY_RF24_CE_PIN == NOT_A_PIN
RF24_sleep();
#else
RF24_ce(LOW);
#endif
// timing
delayMicroseconds(130);
RF24_setRFConfiguration(RF24_CONFIGURATION | _BV(RF24_PWR_UP) );
Expand Down