-
Notifications
You must be signed in to change notification settings - Fork 0
Low level
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
Reference: http://www.eetimes.com/document.asp?doc_id=1255034