Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Implementing context switch or thread using hi-tech PIC C

Status
Not open for further replies.

johncsl82

Advanced Member level 4
Joined
Aug 16, 2004
Messages
105
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
925
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....

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
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top