Rather than use a if statement for every interrupt vector in the library a more maintainable solution might be to use a macro such as RUN_TIME_RESOLVE_INT: #include #include #include #include #include #include /* * At runtime resolve the TMC4C123 or TM4C129 class specific interrupt vector. * This will result in a compile error if intname doesn't exist on both TMC4C123 or TM4C129 class processors. */ #define RUN_TIME_RESOLVE_INT(intname) (CLASS_IS_TM4C129 ? intname##_TM4C129 : intname##_TM4C123) void enable_timer_interrupt (void) { IntEnable(RUN_TIME_RESOLVE_INT (INT_TIMER5A)); }
↧