This commit is contained in:
Crsarmv7l 2025-02-11 19:52:08 +01:00 committed by GitHub
parent 19b85ee75e
commit 1bee00bc64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -240,7 +240,8 @@ int16_t CC1101::startTransmit(const uint8_t* data, size_t len, uint8_t addr) {
SPIsendCommand(RADIOLIB_CC1101_CMD_FSTXON); SPIsendCommand(RADIOLIB_CC1101_CMD_FSTXON);
// Check MARCSTATE and wait until ready to tx // Check MARCSTATE and wait until ready to tx
RadioLibTime_T start = this->mod->hal->micros(); // 724us is the longest time for callibrate per datasheet
RadioLibTime_t start = this->mod->hal->micros();
while(SPIgetRegValue(RADIOLIB_CC1101_REG_MARCSTATE, 4, 0) != 0x12) { while(SPIgetRegValue(RADIOLIB_CC1101_REG_MARCSTATE, 4, 0) != 0x12) {
if(this->mod->hal->micros() - start > 724) { if(this->mod->hal->micros() - start > 724) {
standby(); standby();
@ -308,8 +309,8 @@ int16_t CC1101::finishTransmit() {
// Check MARCSTATE for Idle // Check MARCSTATE for Idle
// Timeout is 2x FIFO transmit time // Timeout is 2x FIFO transmit time
RadioLibTime_T timeout = (1.0f/(this->bitRate))*(RADIOLIB_CC1101_FIFO_SIZE*2.0f); RadioLibTime_t timeout = (1.0f/(this->bitRate))*(RADIOLIB_CC1101_FIFO_SIZE*2.0f);
RadioLibTime_T start = this->mod->hal->millis(); RadioLibTime_t start = this->mod->hal->millis();
while(SPIgetRegValue(RADIOLIB_CC1101_REG_MARCSTATE, 4, 0) != 0x01) { while(SPIgetRegValue(RADIOLIB_CC1101_REG_MARCSTATE, 4, 0) != 0x01) {
if(this->mod->hal->millis() - start > timeout) { if(this->mod->hal->millis() - start > timeout) {
return(RADIOLIB_ERR_TX_TIMEOUT); return(RADIOLIB_ERR_TX_TIMEOUT);