Skip to content

Commit 2994d83

Browse files
tekka007mfalkvidd
authored andcommitted
RF24: Minor power optimization (#1069)
1 parent 3c0b272 commit 2994d83

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/RF24/RF24.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,14 @@ LOCAL bool RF24_sendMessage(const uint8_t recipient, const void *buf, const uint
302302
RF24_CMD_WRITE_TX_PAYLOAD, (uint8_t *)buf, len, false );
303303
// go, TX starts after ~10us, CE high also enables PA+LNA on supported HW
304304
RF24_ce(HIGH);
305+
delayMicroseconds(10); // datasheet: Pulse CE at least 10us
306+
RF24_ce(LOW);
305307
// timeout counter to detect HW issues
306308
uint16_t timeout = 0xFFFF;
307309
do {
308310
RF24_status = RF24_getStatus();
309311
} while (!(RF24_status & ( _BV(RF24_MAX_RT) | _BV(RF24_TX_DS) )) && timeout--);
310312
// timeout value after successful TX on 16Mhz AVR ~ 65500, i.e. msg is transmitted after ~36 loop cycles
311-
RF24_ce(LOW);
312313
// reset interrupts
313314
RF24_setStatus(_BV(RF24_TX_DS) | _BV(RF24_MAX_RT) );
314315
// Max retries exceeded

0 commit comments

Comments
 (0)