Skip to content

Commit 06f8735

Browse files
Szynkaarlubos
authored andcommitted
esb: add note about using irq_disable
Add note about effects of using irq_disable(RADIO) in esb functions. Signed-off-by: Szymon Antkowiak <[email protected]>
1 parent 6558266 commit 06f8735

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

subsys/esb/esb.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,6 +2220,12 @@ int esb_write_payload(const struct esb_payload *payload)
22202220
new_ack_payload->p_next = NULL;
22212221
memcpy(new_ack_payload->p_payload, payload, sizeof(struct esb_payload));
22222222

2223+
/* If system usage is high, other interrupts can postpone re-enabling of
2224+
* RADIO IRQ, and therefore handling of the interrupt. This can result in
2225+
* delay of sending ACK packet or air loss of next RX packet.
2226+
* Adding @ref irq_lock can improve timing of RADIO IRQ handling at the cost
2227+
* of delaying other interrupts.
2228+
*/
22232229
irq_disable(ESB_RADIO_IRQ_NUMBER);
22242230

22252231
if (ack_pl_wrap_pipe[payload->pipe] == NULL) {
@@ -2373,6 +2379,7 @@ int esb_flush_rx(void)
23732379
return -EACCES;
23742380
}
23752381

2382+
/* see note about irq_disable in @ref esb_write_payload */
23762383
irq_disable(ESB_RADIO_IRQ_NUMBER);
23772384

23782385
atomic_clear(&rx_fifo.count);

0 commit comments

Comments
 (0)