From 22b5f8a41af6a5461b6696c098ac59dec9165dcf Mon Sep 17 00:00:00 2001 From: Semjon Kerner Date: Wed, 15 May 2019 14:49:22 +0200 Subject: [PATCH] cpu/nrf5x/radio/nrfmin: wait for state transition --- cpu/nrf5x_common/radio/nrfmin/nrfmin.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpu/nrf5x_common/radio/nrfmin/nrfmin.c b/cpu/nrf5x_common/radio/nrfmin/nrfmin.c index d8670cc281..4edc736126 100644 --- a/cpu/nrf5x_common/radio/nrfmin/nrfmin.c +++ b/cpu/nrf5x_common/radio/nrfmin/nrfmin.c @@ -163,7 +163,9 @@ static void goto_target_state(void) NRF_RADIO->PACKETPTR = (uint32_t)(&rx_buf); NRF_RADIO->BASE0 = (CONF_ADDR_BASE | my_addr); /* goto RX mode */ + NRF_RADIO->EVENTS_READY = 0; NRF_RADIO->TASKS_RXEN = 1; + while (NRF_RADIO->EVENTS_READY == 0) {} state = STATE_RX; } @@ -347,8 +349,10 @@ static int nrfmin_send(netdev_t *dev, const iolist_t *iolist) /* trigger the actual transmission */ DEBUG("[nrfmin] send: putting %i byte into the ether\n", (int)hdr->len); - state = STATE_TX; + NRF_RADIO->EVENTS_READY = 0; NRF_RADIO->TASKS_TXEN = 1; + while (NRF_RADIO->EVENTS_READY == 0) {} + state = STATE_TX; return (int)pos; }