[nrf52840] improve timeslot_request in timeslot_request_prepare (#2649)

This commit is contained in:
Piotr Szkotak
2018-04-06 14:53:49 -07:00
committed by Jonathan Hui
parent d3b26a0558
commit ec59d7ef70
@@ -327,12 +327,14 @@ static void timeslot_request(void)
{
timeslot_request_prepare();
m_timeslot_state = TIMESLOT_STATE_REQUESTED;
// Request timeslot from SoftDevice.
uint32_t err_code = sd_radio_request(&m_request);
if (err_code == NRF_SUCCESS)
if (err_code != NRF_SUCCESS)
{
m_timeslot_state = TIMESLOT_STATE_REQUESTED;
m_timeslot_state = TIMESLOT_STATE_IDLE;
}
nrf_802154_log(EVENT_TIMESLOT_REQUEST, m_request.params.earliest.length_us);