* 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. */
| 70 | * will be received. For more information and description of parameters see file CO_driver.h. |
| 71 | */ |
| 72 | static void |
| 73 | CO_LSSmaster_receive(void* object, void* msg) { |
| 74 | CO_LSSmaster_t* LSSmaster; |
| 75 | uint8_t DLC = CO_CANrxMsg_readDLC(msg); |
| 76 | const uint8_t* data = CO_CANrxMsg_readData(msg); |
| 77 | |
| 78 | LSSmaster = (CO_LSSmaster_t*)object; /* this is the correct pointer type of the first argument */ |
| 79 | |
| 80 | /* verify message length and message overflow (previous message was not processed yet). */ |
| 81 | if ((DLC == 8U) && !CO_FLAG_READ(LSSmaster->CANrxNew) && (LSSmaster->command != CO_LSSmaster_COMMAND_WAITING)) { |
| 82 | |
| 83 | /* copy data and set 'new message' flag */ |
| 84 | (void)memcpy(LSSmaster->CANrxData, data, sizeof(LSSmaster->CANrxData)); |
| 85 | |
| 86 | CO_FLAG_SET(LSSmaster->CANrxNew); |
| 87 | |
| 88 | #if ((CO_CONFIG_LSS)&CO_CONFIG_FLAG_CALLBACK_PRE) != 0 |
| 89 | /* Optional signal to RTOS, which can resume task, which handles further processing. */ |
| 90 | if (LSSmaster->pFunctSignal != NULL) { |
| 91 | LSSmaster->pFunctSignal(LSSmaster->functSignalObject); |
| 92 | } |
| 93 | #endif |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | /* |
| 98 | * Check LSS timeout. |
nothing calls this directly
no test coverage detected