You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a question that's been asked a few times by different users and i think it's a good idea to put it there.
To create a custom idle, you have 2 options since v1.7.0:
Option 1
Since v1.7.0, all arch_idle(void *priv) functions on all architecture are weak. You just have to overload it in your main program and it will replace the default one.
But there's a catch ! The idle task has no stack space, so if you plan on using any kind of local variable, picoRTOS will stall on the next tick. And if you call any sleep function, i don't know what's gonna happen to be honest.
Option 2
OpenPicoRTOS is preemptive, so you can create any custom idle task and put it at the absolute lowest priority using picoRTOS_get_last_available_priority(). If you never call any sleep or schedule function, the system will be "stuck" here until the next schedule.
This way your task will be placed just before the idle task, that will never be executed, and you can get a stack any size you want.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is a question that's been asked a few times by different users and i think it's a good idea to put it there.
To create a custom idle, you have 2 options since v1.7.0:
Option 1
Since v1.7.0, all arch_idle(void *priv) functions on all architecture are weak. You just have to overload it in your main program and it will replace the default one.
But there's a catch ! The idle task has no stack space, so if you plan on using any kind of local variable, picoRTOS will stall on the next tick. And if you call any sleep function, i don't know what's gonna happen to be honest.
Option 2
OpenPicoRTOS is preemptive, so you can create any custom idle task and put it at the absolute lowest priority using picoRTOS_get_last_available_priority(). If you never call any sleep or schedule function, the system will be "stuck" here until the next schedule.
This way your task will be placed just before the idle task, that will never be executed, and you can get a stack any size you want.
Beta Was this translation helpful? Give feedback.
All reactions