A multitasking framework for an AVR microcontroller which can service multiple tasks based on a priority system