I'm trying nill out and if I call chThdSleepMilliseconds(250); in main it throws an unhandled excpetion, yet if I move the code into another thread and do not sleep in main I have no issue.
Any ideas?
chThdSleepMilliseconds in main possible?
Re: chThdSleepMilliseconds in main possible?
from demos/STM32/NIL-STM32F100-DISCOVERY/main.c
I guess that would also apply to any code you put under main().
Cheers,
Fabio Utzig
Code: Select all
/* This is now the idle thread loop, you may perform here a low priority
task but you must never try to sleep or wait in this loop. Note that
this tasks runs at the lowest priority level so any instruction added
here will be executed after all other tasks have been started.*/
while (true) {
}
I guess that would also apply to any code you put under main().
Cheers,
Fabio Utzig
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
-
ulikoehler
- Posts: 71
- Joined: Tue Mar 17, 2015 2:32 am
- Been thanked: 3 times
Re: chThdSleepMilliseconds in main possible?
Is there any point in running `__WFI()` in the main() loop for Cortex-Mx?
Best regards,
Uli
Best regards,
Uli
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: chThdSleepMilliseconds in main possible?
Hi,
Yes, placing _WFI in the loop improves power usage, it is not there by default because it can affect some debuggers.
Giovanni
Yes, placing _WFI in the loop improves power usage, it is not there by default because it can affect some debuggers.
Giovanni