From ec59d7ef70e5a251b8d8bd7deb0b516aa199e12e Mon Sep 17 00:00:00 2001 From: Piotr Szkotak Date: Fri, 6 Apr 2018 23:53:49 +0200 Subject: [PATCH] [nrf52840] improve timeslot_request in timeslot_request_prepare (#2649) --- .../drivers/radio/raal/softdevice/nrf_raal_softdevice.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/third_party/NordicSemiconductor/drivers/radio/raal/softdevice/nrf_raal_softdevice.c b/third_party/NordicSemiconductor/drivers/radio/raal/softdevice/nrf_raal_softdevice.c index 0a6467f87..07854641c 100644 --- a/third_party/NordicSemiconductor/drivers/radio/raal/softdevice/nrf_raal_softdevice.c +++ b/third_party/NordicSemiconductor/drivers/radio/raal/softdevice/nrf_raal_softdevice.c @@ -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);