[SX126x] Use dummy SPI transfer for wakeup (#1364)

This commit is contained in:
jgromes 2024-12-27 16:26:24 +00:00
parent ff387e93ad
commit b2b4c9e0f7

View file

@ -467,8 +467,10 @@ int16_t SX126x::standby(uint8_t mode, bool wakeup) {
this->mod->setRfSwitchState(Module::MODE_IDLE); this->mod->setRfSwitchState(Module::MODE_IDLE);
if(wakeup) { if(wakeup) {
// pull NSS low to wake up // send a NOP command - this pulls the NSS low to exit the sleep mode,
this->mod->hal->digitalWrite(this->mod->getCs(), this->mod->hal->GpioLevelLow); // 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 }; uint8_t data[] = { mode };