#include "tpl_os_kernel.h" /* tpl_schedule */ #include "tpl_os_timeobj_kernel.h" /* tpl_counter_tick */ #include "tpl_machine_interface.h" /* tpl_switch_context_from_it */ #define OS_START_SEC_CODE #include "tpl_memmap.h" //gcc uses ISR as a keyword to define an interrupt handler. //Osek uses ISR to define an ISR2 :-/ #ifdef ISR #undef ISR #endif #include //function defined in avr assembly files. FUNC(void, OS_CODE) tpl_avr_counter_tick( P2VAR(tpl_counter, AUTOMATIC, OS_APPL_DATA) counter); %foreach counter in HARDWARECOUNTERS do # special case for SystemCounter, as it is connected # to Arduino SysTick (TIMER0_OVF_vect) in # machines/avr/arduino/cores/arduino/wiring.c if counter::NAME == "SystemCounter" then % void trampolineSystemCounter() { tpl_avr_counter_tick(&%!counter::NAME%_counter_desc); } % elsif counter::SOURCE != "" then % ISR(%!counter::SOURCE%_vect) { tpl_avr_counter_tick(&% !counter::NAME %_counter_desc); } % end if end foreach % #define OS_STOP_SEC_CODE #include "tpl_memmap.h"