00001 00002 // This file is compiled with WinAVR version 4.1.2 00003 // 00004 // These routines mess with the stack 00005 // 00006 // you must use either of these optimizations: 00007 // -O1 00008 // -O3 00009 // -O2 00010 // 00011 // Whatever you do, do NOT use -O0....it will NOT work 00012 // 00013 // ///////////////////////////////////////////////////////////////////////////////////////// 00014 00015 #include "task.h" 00022 00033 void DoSwap(void) __attribute__ ( ( naked ) ); 00034 00035 void DoSwap(void) 00036 { 00037 SAVE_CONTEXT(); //save the context of the current task 00038 CurrentTask = NextTask; //set current task to next task 00039 RESTORE_CONTEXT(); //restore context of new task 00040 } 00041