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
piotrva edited this page Oct 18, 2014
·
1 revision
Low level:
Timer0 as SysTick generation
Interrupt without default initialisation code
Save actual context to stack (ASM)
Tick Processing (Priority etc. done by C++ code)
Change context by changing stack's pointer (done by C++ code)
Restore context (ASM)
So each process would have its own stack also used to store context
Local variables are stored in registers or on stack if this is not possible, so mentioned above instructions cover whole context switching.
Size of the stack for each task should be: 32 bytes (R0...31) + 1 byte (SREG) + size of local variables in bytes.
Also on the stack there is return address, so it will automatically change PC after execution