Hi everyone,
I use the radio example as my basis. I call the read_packet() function from receiver example. And there is no incoming data, it stucks there. How can i set a timeout so that it continues to operate right after the function ?
Hi everyone,
I use the radio example as my basis. I call the read_packet() function from receiver example. And there is no incoming data, it stucks there. How can i set a timeout so that it continues to operate right after the function ?
Hi,
That is not included in the basic radio examples. If you add a timer instance to your example, you can use that as a timeout source.
However, if you need auto-ACK, re-transmissions, and other basic features, I'd recommend that you look at the ESB (Enhanced ShockBurst) examples.
Kind regards,
Håkon
I have set an app_timer instance but when that instance occur, it takes approximately 20 seconds to operate again. this is my handler function:
static void radio_timeout_handler(void * p_context){
NRF_RADIO->TASKS_DISABLE = 1U;
while (NRF_RADIO->EVENTS_DISABLED == 0U)
{
// wait
}
}Hi,
You should not implement the while loop in the timer handler.
Set a variable there instead, and check it in the original while-loop.
As mentioned, if you require such functionality, please see the ESB examples, as this includes basic functionality like re-transmission and so forth.
Kind regards,
Håkon
Hi,
You should not implement the while loop in the timer handler.
Set a variable there instead, and check it in the original while-loop.
As mentioned, if you require such functionality, please see the ESB examples, as this includes basic functionality like re-transmission and so forth.
Kind regards,
Håkon
okey i will check the ESB examples. By the way, i did implemented a bool in timer handler. This is the final version. I changed it a 100 times. Thanks for ESB suggestion. Will check it.