[MOD] Fixed swapped NSS/BUSY order (#716)

pull/726/head
jgromes 2023-03-30 23:17:34 +02:00
rodzic d5b1521c54
commit 0210e10a24
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -336,9 +336,6 @@ int16_t Module::SPItransferStream(uint8_t* cmd, uint8_t cmdLen, bool write, uint
uint8_t debugBuff[RADIOLIB_STATIC_ARRAY_SIZE];
#endif
// pull NSS low
this->digitalWrite(this->getCs(), LOW);
// ensure GPIO is low
uint32_t start = this->millis();
while(this->digitalRead(this->getGpio())) {
@ -349,6 +346,9 @@ int16_t Module::SPItransferStream(uint8_t* cmd, uint8_t cmdLen, bool write, uint
}
}
// pull NSS low
this->digitalWrite(this->getCs(), LOW);
// start transfer
this->SPIbeginTransaction();