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

APP Timer and While loop in BLE

Hi,

I am using App Timer for measuring time and at the same time while loop to check if the timer reached particular time.

I have noticed during while loop App Timer event doesn't seems to work. Is this correct?

Regards Siva

  • Hi Einar, Thanks for your advise. I am also thinking to use another "App timer" with low priority such that I will use it to call "Peace_Mask-Active()" event once every few seconds(It doesn't has to be very accurate).

    I didn't find a correct syntax to change priorities for App timer can you advice on this please. Also want to know which RTCs has been used while using multiple app timer functions.

  • The app_timer uses RTC1 for all your timers, and always uses APP_LOW priority level. You should not configure RTC1 separately when using the app_timer. Also note that the SoftDevice uses RTC0, so you cannot use that from your application. My gut feeling is that you should clean-up your application, make sure not do unnecessary blocking stuff etc, rather than trying to fix too much with priorities. Do as little as possible in interrupt routines, only what must be done fast, and do the rest in main context. Use timers for waiting, not loops checking a timer value etc...

Related