Skip to content

Commit 5d2f2b5

Browse files
Szynkaarlubos
authored andcommitted
esb: change time of updating last_tx_attempts
Move update of the last_tx_attempts to after completing TX. Before this change the variable would be quickly overwritten by new TX from fifo. Signed-off-by: Szymon Antkowiak <[email protected]>
1 parent e13e2de commit 5d2f2b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/esb/esb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,6 @@ static void start_tx_transaction(void)
11661166
bool ack = true;
11671167
bool is_tx_idle = false;
11681168
struct esb_radio_pdu *pdu = (struct esb_radio_pdu *)tx_payload_buffer;
1169-
last_tx_attempts = 1;
11701169
/* Prepare the payload */
11711170
current_payload = tx_fifo.payload[tx_fifo.front];
11721171

@@ -1303,6 +1302,7 @@ static void on_timer_compare1_tx_noack(void)
13031302
nrf_timer_int_disable(esb_timer.p_reg, NRF_TIMER_INT_COMPARE1_MASK);
13041303
esb_ppi_for_wait_for_rx_clear();
13051304

1305+
last_tx_attempts = 1;
13061306
atomic_set_bit(&interrupt_flags, ESB_EVENT_TX_SUCCESS);
13071307
tx_fifo_remove_first();
13081308

@@ -1320,6 +1320,7 @@ static void on_radio_disabled_tx_noack(void)
13201320
esb_fem_pa_reset();
13211321
esb_ppi_for_txrx_clear(false, false);
13221322

1323+
last_tx_attempts = 1;
13231324
atomic_set_bit(&interrupt_flags, ESB_EVENT_TX_SUCCESS);
13241325
tx_fifo_remove_first();
13251326

0 commit comments

Comments
 (0)