Skip to content

Commit

Permalink
[SX126x] Use dummy SPI transfer for wakeup (#1364)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgromes committed Dec 27, 2024
1 parent ff387e9 commit b2b4c9e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/modules/SX126x/SX126x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ int16_t SX126x::standby(uint8_t mode, bool wakeup) {
this->mod->setRfSwitchState(Module::MODE_IDLE);

if(wakeup) {
// pull NSS low to wake up
this->mod->hal->digitalWrite(this->mod->getCs(), this->mod->hal->GpioLevelLow);
// send a NOP command - this pulls the NSS low to exit the sleep mode,
// while preventing interference with possible other SPI transactions
// see https://github.com/jgromes/RadioLib/discussions/1364
(void)this->mod->SPIwriteStream(RADIOLIB_SX126X_CMD_NOP, NULL, 0, false, false);
}

uint8_t data[] = { mode };
Expand Down

0 comments on commit b2b4c9e

Please sign in to comment.