for (;;) { idle_state_handle(); }

Hi,

I wonder if the 

"for (;;)
{
idle_state_handle();

}" can add additional code. Because I don't see that happening in the examples.

  • Hi,

    In principle you can add any code in the main loop, and you can see that done in various exsamples. the idle_state_handle is just a static function in the main.c file, so adding more there is equivalent to adding code to the main loop.

    When you have code in the main loop, it runs once every time the device wakes up based on an event or interrupt. Most applications will do normal/low pririty work there, and high priority work in interrupt/event handlers.

  • What exampes are you talking about?

    That function is usually located right above main() function, thus easy to locate and see what it does.

    Note that you don't want to use the old SDK, look at the NRF connect SDK instead.

Related