Hi - I noticed an issue in the esb library as of nRF5 SDK v17.0.2 and am looking for clarification.
In the function update_radio_bitrate, the minimum retransmission delay is checked by the following code:
// Ensure that we do not attempt retransmitting before ack timeout.
if (m_config_local.retransmit_delay < m_wait_for_ack_timeout_us + RETRANSMIT_DELAY_US_OFFSET)
{
m_config_local.retransmit_delay = m_wait_for_ack_timeout_us + RETRANSMIT_DELAY_US_OFFSET;
}
With 2 Mbps bit rate, this implies that the minimum delay is (48 + 62 = ) 110 µs. But when the retransmit_delay value is actually used in the on_radio_disabled_tx function:
NRF_ESB_SYS_TIMER->CC[1] = m_config_local.retransmit_delay - 130;
Any value less than 130 µs would then underflow and give unintended behavior.
Could you clarify if this reading of the code is correct? And why is 130 subtracted from the retransmit delay when it's used for the compare interrupt?