From 9bff1582bdab7f55a7a320e88e9757a6ff18cb4f Mon Sep 17 00:00:00 2001 From: jgromes Date: Fri, 27 Dec 2024 16:25:52 +0000 Subject: [PATCH] [LR11x0] Use dummy SPI transfer for wakeup --- src/modules/LR11x0/LR11x0.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/LR11x0/LR11x0.cpp b/src/modules/LR11x0/LR11x0.cpp index 7b988371..a360b935 100644 --- a/src/modules/LR11x0/LR11x0.cpp +++ b/src/modules/LR11x0/LR11x0.cpp @@ -356,10 +356,9 @@ int16_t LR11x0::standby(uint8_t mode, bool wakeup) { this->mod->setRfSwitchState(Module::MODE_IDLE); if(wakeup) { - // pull NSS low for a while to wake up - this->mod->hal->digitalWrite(this->mod->getCs(), this->mod->hal->GpioLevelLow); - this->mod->hal->delay(1); - this->mod->hal->digitalWrite(this->mod->getCs(), this->mod->hal->GpioLevelHigh); + // send a NOP command - this pulls the NSS low to exit the sleep mode, + // while preventing interference with possible other SPI transactions + (void)this->mod->SPIwriteStream(RADIOLIB_LR11X0_CMD_NOP, NULL, 0, false, false); } uint8_t buff[] = { mode };