hi,
After the TX interrupt event occurs, on_radio_disabled_tx() is executed.
// Make sure the timer is started the next time the radio is ready,
// and that it will disable the radio automatically if no packet is
// received by the time defined in m_wait_for_ack_timeout_us
NRF_ESB_SYS_TIMER->CC[0] = m_wait_for_ack_timeout_us;
NRF_ESB_SYS_TIMER->CC[1] = m_config_local.retransmit_delay - 130;
NRF_ESB_SYS_TIMER->TASKS_CLEAR = 1;
NRF_ESB_SYS_TIMER->EVENTS_COMPARE[0] = 0;
NRF_ESB_SYS_TIMER->EVENTS_COMPARE[1] = 0;
#define NRF_ESB_SYS_TIMER NRF_TIMER2 //!< The timer that is used by the module.
#define NRF_ESB_SYS_TIMER_IRQ_Handler TIMER2_IRQHandler //!< The handler that is used by @ref NRF_ESB_SYS_TIMER.
There is a timeout event for receiving an ACK.I noticed that the timer timeout was set using TIMER2, but I didn't see where the timer interrupt was generated.
But I found an interrupt event for Timer3.
// Workaround neccessary on nRF52832 Rev. 1.
void NRF_ESB_BUGFIX_TIMER_IRQHandler(void)
{
if (NRF_ESB_BUGFIX_TIMER->EVENTS_COMPARE[0])
{
NRF_ESB_BUGFIX_TIMER->EVENTS_COMPARE[0] = 0;
// If the timeout timer fires and we are in the PTX receive ACK state, disable the radio
if (m_nrf_esb_mainstate == NRF_ESB_STATE_PTX_RX_ACK)
{
NRF_RADIO->TASKS_DISABLE = 1;
}
}
}
#define NRF_ESB_BUGFIX_TIMER NRF_TIMER3
#define NRF_ESB_BUGFIX_TIMER_IRQn TIMER3_IRQn
#define NRF_ESB_BUGFIX_TIMER_IRQHandler TIMER3_IRQHandler
How does this ACK receive timeout?
Best regards,
Ellison