* Read received message from CAN module. * * Function will be called (by CAN receive interrupt) every time, when CAN message with correct identifier * will be received. For more information and description of parameters see file CO_driver.h. */
| 31 | * will be received. For more information and description of parameters see file CO_driver.h. |
| 32 | */ |
| 33 | static void |
| 34 | CO_TIME_receive(void* object, void* msg) { |
| 35 | CO_TIME_t* TIME = object; |
| 36 | uint8_t DLC = CO_CANrxMsg_readDLC(msg); |
| 37 | const uint8_t* data = CO_CANrxMsg_readData(msg); |
| 38 | |
| 39 | if (DLC == CO_TIME_MSG_LENGTH) { |
| 40 | (void)memcpy(TIME->timeStamp, data, sizeof(TIME->timeStamp)); |
| 41 | CO_FLAG_SET(TIME->CANrxNew); |
| 42 | |
| 43 | #if ((CO_CONFIG_TIME)&CO_CONFIG_FLAG_CALLBACK_PRE) != 0 |
| 44 | /* Optional signal to RTOS, which can resume task, which handles TIME. */ |
| 45 | if (TIME->pFunctSignalPre != NULL) { |
| 46 | TIME->pFunctSignalPre(TIME->functSignalObjectPre); |
| 47 | } |
| 48 | #endif |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | #if ((CO_CONFIG_TIME)&CO_CONFIG_FLAG_OD_DYNAMIC) != 0 |
| 53 | /* |
nothing calls this directly
no test coverage detected