[SX126x] Fixed wakeup sequence - NSS first, BUSY second (#69)

This commit is contained in:
jgromes 2019-11-14 21:11:17 +01:00
parent 300e7f48fd
commit 3db5134367

View file

@ -1297,6 +1297,9 @@ int16_t SX126x::SPItransfer(uint8_t* cmd, uint8_t cmdLen, bool write, uint8_t* d
uint8_t debugBuff[256]; uint8_t debugBuff[256];
#endif #endif
// pull NSS low
digitalWrite(_mod->getCs(), LOW);
// ensure BUSY is low (state meachine ready) // ensure BUSY is low (state meachine ready)
RADIOLIB_VERBOSE_PRINTLN(F("Wait for BUSY ... ")); RADIOLIB_VERBOSE_PRINTLN(F("Wait for BUSY ... "));
uint32_t start = millis(); uint32_t start = millis();
@ -1307,7 +1310,6 @@ int16_t SX126x::SPItransfer(uint8_t* cmd, uint8_t cmdLen, bool write, uint8_t* d
} }
// start transfer // start transfer
digitalWrite(_mod->getCs(), LOW);
spi->beginTransaction(spiSettings); spi->beginTransaction(spiSettings);
// send command byte(s) // send command byte(s)