| 42 | |
| 43 | |
| 44 | void init_communication_interfaces( void ) |
| 45 | { |
| 46 | #ifdef DEBUG |
| 47 | init_serial( ); |
| 48 | #endif |
| 49 | |
| 50 | DEBUG_PRINT( "init Control CAN - " ); |
| 51 | init_can( g_control_can ); |
| 52 | |
| 53 | // Filter CAN messages - accept if (CAN_ID & mask) == (filter & mask) |
| 54 | // Set buffer 0 to filter only throttle module and global messages |
| 55 | g_control_can.init_Mask( 0, 0, 0x7F0 ); // Filter for 0x0N0 to 0x0NF |
| 56 | g_control_can.init_Filt( 0, 0, OSCC_THROTTLE_CAN_ID_INDEX ); |
| 57 | g_control_can.init_Filt( 1, 0, OSCC_FAULT_CAN_ID_INDEX ); |
| 58 | // Accept only CAN Disable when buffer overflow occurs in buffer 0 |
| 59 | g_control_can.init_Mask( 1, 0, 0x7FF ); // Filter for one CAN ID |
| 60 | g_control_can.init_Filt( 2, 1, OSCC_THROTTLE_DISABLE_CAN_ID ); |
| 61 | } |
| 62 | |
| 63 | void start_timers( void ) |
| 64 | { |
no test coverage detected