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?
-
- Posts: 359
- Joined: Sat Jan 07, 2012 6:22 pm
- Location: Brazil
- Has thanked: 1 time
- Been thanked: 20 times
- Contact:
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: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
-
- Posts: 71
- Joined: Tue Mar 17, 2015 2:32 am
- Location: Munich, Germany
- 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: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
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
Who is online
Users browsing this forum: No registered users and 22 guests