mirror of
https://github.com/mysensors/MySensors.git
synced 2026-02-20 01:21:27 +01:00
RF24: Fix TX issue regarding PA+LNA modules (#1189)
This commit is contained in:
@@ -314,14 +314,13 @@ LOCAL bool RF24_sendMessage(const uint8_t recipient, const void *buf, const uint
|
||||
RF24_CMD_WRITE_TX_PAYLOAD, (uint8_t *)buf, len, false );
|
||||
// go, TX starts after ~10us, CE high also enables PA+LNA on supported HW
|
||||
RF24_ce(HIGH);
|
||||
delayMicroseconds(10); // datasheet: Pulse CE at least 10us
|
||||
RF24_ce(LOW);
|
||||
// timeout counter to detect HW issues
|
||||
uint16_t timeout = 0xFFFF;
|
||||
do {
|
||||
RF24_status = RF24_getStatus();
|
||||
} while (!(RF24_status & ( _BV(RF24_MAX_RT) | _BV(RF24_TX_DS) )) && timeout--);
|
||||
// timeout value after successful TX on 16Mhz AVR ~ 65500, i.e. msg is transmitted after ~36 loop cycles
|
||||
RF24_ce(LOW);
|
||||
// reset interrupts
|
||||
RF24_setStatus(_BV(RF24_TX_DS) | _BV(RF24_MAX_RT) );
|
||||
// Max retries exceeded
|
||||
|
||||
Reference in New Issue
Block a user