00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <stdint.h>
00023 #include <string.h>
00024
00025 #include <aversive/timers.h>
00026
00027 #include <timer.h>
00028 #include <timer_definitions.h>
00029 #include <timer_intr.h>
00030
00031 #include <timer_config.h>
00032
00033 volatile timer_callback_t timer_OV_callback_table[SIG_OVERFLOW_TOTAL_NUM];
00034 volatile timer_callback_t timer_OC_callback_table[SIG_OUTPUT_COMPARE_TOTAL_NUM];
00035
00036
00037
00038 #if defined TIMER0_ENABLED && defined SIG_OVERFLOW0
00039 DEFINE_OV_INTR(SIG_OVERFLOW0)
00040 #endif
00041
00042 #if defined TIMER0_ENABLED && defined SIG_OUTPUT_COMPARE0
00043 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE0)
00044 #endif
00045
00046 #if defined TIMER0_ENABLED && defined SIG_OUTPUT_COMPARE0A
00047 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE0A)
00048 #endif
00049
00050 #if defined TIMER0_ENABLED && defined SIG_OUTPUT_COMPARE0B
00051 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE0B)
00052 #endif
00053
00054
00055
00056 #if defined TIMER1_ENABLED && defined SIG_OVERFLOW1
00057 DEFINE_OV_INTR(SIG_OVERFLOW1)
00058 #endif
00059
00060 #if defined TIMER1A_ENABLED && defined SIG_OUTPUT_COMPARE1A
00061 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE1A)
00062 #endif
00063
00064 #if defined TIMER1B_ENABLED && defined SIG_OUTPUT_COMPARE1B
00065 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE1B)
00066 #endif
00067
00068 #if defined TIMER1C_ENABLED && defined SIG_OUTPUT_COMPARE1C
00069 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE1C)
00070 #endif
00071
00072
00073
00074 #if defined TIMER2_ENABLED && defined SIG_OVERFLOW2
00075 DEFINE_OV_INTR(SIG_OVERFLOW2)
00076 #endif
00077
00078 #if defined TIMER2_ENABLED && defined SIG_OUTPUT_COMPARE2
00079 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE2)
00080 #endif
00081
00082 #if defined TIMER2_ENABLED && defined SIG_OUTPUT_COMPARE2A
00083 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE2A)
00084 #endif
00085
00086 #if defined TIMER2_ENABLED && defined SIG_OUTPUT_COMPARE2B
00087 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE2B)
00088 #endif
00089
00090
00091
00092 #if defined TIMER3_ENABLED && defined SIG_OVERFLOW3
00093 DEFINE_OV_INTR(SIG_OVERFLOW3)
00094 #endif
00095
00096 #if defined TIMER3A_ENABLED && defined SIG_OUTPUT_COMPARE3A
00097 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE3A)
00098 #endif
00099
00100 #if defined TIMER3B_ENABLED && defined SIG_OUTPUT_COMPARE3B
00101 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE3B)
00102 #endif
00103
00104 #if defined TIMER3C_ENABLED && defined SIG_OUTPUT_COMPARE3C
00105 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE3C)
00106 #endif
00107
00108
00109
00110 #if defined TIMER4_ENABLED && defined SIG_OVERFLOW4
00111 DEFINE_OV_INTR(SIG_OVERFLOW4)
00112 #endif
00113
00114 #if defined TIMER4A_ENABLED && defined SIG_OUTPUT_COMPARE4A
00115 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE4A)
00116 #endif
00117
00118 #if defined TIMER4B_ENABLED && defined SIG_OUTPUT_COMPARE4B
00119 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE4B)
00120 #endif
00121
00122 #if defined TIMER4C_ENABLED && defined SIG_OUTPUT_COMPARE4C
00123 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE4C)
00124 #endif
00125
00126
00127
00128 #if defined TIMER5_ENABLED && defined SIG_OVERFLOW5
00129 DEFINE_OV_INTR(SIG_OVERFLOW5)
00130 #endif
00131
00132 #if defined TIMER5A_ENABLED && defined SIG_OUTPUT_COMPARE5A
00133 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE5A)
00134 #endif
00135
00136 #if defined TIMER5B_ENABLED && defined SIG_OUTPUT_COMPARE5B
00137 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE5B)
00138 #endif
00139
00140 #if defined TIMER5C_ENABLED && defined SIG_OUTPUT_COMPARE5C
00141 DEFINE_OC_INTR(SIG_OUTPUT_COMPARE5C)
00142 #endif
00143
00144
00145
00146 void timer_intr_init(void)
00147 {
00148 memset((void*)timer_OV_callback_table, 0, sizeof(timer_OV_callback_table));
00149 memset((void*)timer_OC_callback_table, 0, sizeof(timer_OC_callback_table));
00150 }
00151
00152