I am using SDK 15.3 and wanted to ask that if there is a while loop where I can check flags and increment tickers. The program at the moment gets stuck inside
for (;;) { idle_state_handle(); }
Suggestions would be greatly appreciated.
I am using SDK 15.3 and wanted to ask that if there is a while loop where I can check flags and increment tickers. The program at the moment gets stuck inside
for (;;) { idle_state_handle(); }
Suggestions would be greatly appreciated.
Hi,
I'm not sure I understand your question, could you elaborate? Which example are you using? Idle_state_handle() is a function that puts the nRF to sleep until the next event.
regards
Jared
Ok so if I want to check an if statement inside the for loop, would it be checked? like e.g.
for (;;) { idle_state_handle(); if (flag == 1) { perform_blink(); flag == 0; } }
will the perform_blink() function be performed each time the flag is raised?
Hi,
Yes, perform_blink() function should be called after the CPU has returned after waking up from IDLE.
regards
Jared
Great will give it a go.
Will this cause a problem in the sleep function of the controller? As I am using BLE as well and I do not want to compromise the battery life due to it. This is only the perform_blink() function but I was hoping to add some other tickers for checking other things as well, would that be wise? Considering the device will be run on a battery.