Dialog Semiconductor customer support - sleep busy loop https://support.dialog-semiconductor.com/resource-keywords/sleep-busy-loop en Busy loop for hardware watchdog https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-42-%E2%80%93-software/busy-loop-hardware-watchdog

Hi,
We have a problem in our modules - ~5% of the modules do not start advertising right when the battery is inserted, and reset is needed - i.e. removing the battery and reinserting it.

We were advised to add the following line at the beginning of the main_func(void) in arch_main.c:
SetBits16(BANDGAP_REG, LDO_RET_TRIM, 0x08);

This did not work, so we were also advised to add a ~100ms sleep beforehand.
I know how to use app_easy_timer when my app is running, but I think it should not be used in main_func(void) - the data is not initialized for that....

How can I do a 100ms "busy-loop" sleep?
I could do something like:
for (int x = 0; x < LIMIT; x++) {
// do nothing
}

What should be LIMIT if I want the time to be ~100ms?

Regards,
Oren

Keywords: 
Device: 
Tue, 21 Mar 2017 14:42:40 +0000 oren 5690 at https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-42-%E2%80%93-software/busy-loop-hardware-watchdog#comments