This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

application code flow(threads)

int main(void)
{
initialize();
execution_start(start);

for (;;)
{
(void)sd_app_evt_wait();
}
}

can you explain me the execution of code flow in the main with these APIs? 

Thanks,

Parents Reply
  • Yes, that is correct.

    I'm not sure I understand your question. What sensor data are you sending, and how/where are you sending it? If you want to send data at a fixed interval, you need to setup a timer that sample the sensor and send the data. The timer will generate interrupts. If you don't want to use interrupts, you need to constancly pull the sensor data, and stall the CPU to generate delays. This is bad practise, and is not something I would recommend. If you want something to happen on a button press, you either need interrupts or you need to constantly check the state of the button/GPIO.

Children
Related