Go Down

Topic: Preemptive multitasking for mega and uno (OS48) (Read 14712 times) previous topic - next topic



Sorry for the delay, the domain is now avalaible again.

Thank you all for your interest !

jonbarril :
Is it just a matter of time, know-how and energy, or is there some fundamental reason?
It's a common compilation error and it's part of the C++ language.
Use a wrapper instead, see this example : cpp.sh/47ox



I'm currently using os48 for a temperature control project, but at a certain point, the core is randomly freezing.
I have create an overflow control method wich send data on the serial. But it seem it's not an overflow.

Is it possible to have a return each time the kernel switch of task to undestand why it's freezing? in wich task?





Hello Thomas,

From the documentation, you have 4 functions related to what you want.

void    setPreContextSwitchFnc (void_fnc_t fnc=NULL)
void    setPostContextSwitchFnc (void_fnc_t fnc=NULL)
void    setKernelTickEnterFnc (void_fnc_t fnc=NULL)
void    setKernelTickExitFnc (void_fnc_t fnc=NULL)

You can post your code also (in private or public).

Hope it helps,




I am using your framework to control five tasks where actually Task 1 to 3 doing nothing as just saying they are alive. Task 4 is changing some pictures on OLED modules and task 5 is a monitoring task to send print and printMem information to serial.

Basically it works but after a while the task fall asleep and don't wake up anymore :(

The only bahaviour I could see is that the first task dying is task 4 controling my OLEDs normally in the directly after a OS48_NO_CS_BLOCK.
Then tasks 1 and 3 start dying where task 3 strangly wakes up sporadically until it is completely dead.

The only tasks running perfectly is task 2 who is printing "I am Task 4" on Serial and the monitoring task giving me information about the tasks.

Unfotunately based on the information I see I don't understand why this is happening.

Has anybody an idea how I can prevent this behavour?

Thanks for your advice and help!



I'm sorry, I can't answer without your sketch. Can you paste it?

Thank you for your interest

Go Up