johncsl82
Advanced Member level 4
hi....
is there any simple software context switch out there?
I try freertos, but the code kind of hard to understand.....
I need a simpler version like....
on the other hand, based on my research, if we implement context switch best to have multi-threading or threading...........
so if there any example, please reply...thank you
Thanks
is there any simple software context switch out there?
I try freertos, but the code kind of hard to understand.....
I need a simpler version like....
Code:
void t1() {...}
void t2() {...}
boolean contextSwitch(void (*t1)(), void (*t2)())
{
//code goes here
//like push all the context (i.e. register, variable, counter... etc etc) to stack
}
void main()
{
while(1)
{
contextSwitch(&t1, &t2);
contextSwitch(&t2, &t1);
}
}
on the other hand, based on my research, if we implement context switch best to have multi-threading or threading...........
so if there any example, please reply...thank you
Thanks