Move MARC State check for Idle to finishTransmit function

Change allows startTransmit to stop blocking once the last bytes are added to the FIFO
This commit is contained in:
Crsarmv7l 2025-02-01 17:02:20 +01:00 committed by GitHub
parent e517fdc5f2
commit 34f0d2fd2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -294,13 +294,16 @@ int16_t CC1101::startTransmit(const uint8_t* data, size_t len, uint8_t addr) {
dataSent += bytesToWrite;
}
}
// Check MARCSTATE for Idle
while(SPIgetRegValue(RADIOLIB_CC1101_REG_MARCSTATE, 4, 0) != 0x01) {};
return(state);
}
int16_t CC1101::finishTransmit() {
// set mode to standby to disable transmitter/RF switch
// Check MARCSTATE for Idle
while(SPIgetRegValue(RADIOLIB_CC1101_REG_MARCSTATE, 4, 0) != 0x01) {};
//TODO: Timeout
int16_t state = standby();
RADIOLIB_ASSERT(state);