MCPcopy Create free account
hub / github.com/CANopenNode/CANopenNode / CO_TIME_receive

Function CO_TIME_receive

301/CO_TIME.c:33–50  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

31 * will be received. For more information and description of parameters see file CO_driver.h.
32 */
33static void
34CO_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/*

Callers

nothing calls this directly

Calls 2

CO_CANrxMsg_readDLCFunction · 0.85
CO_CANrxMsg_readDataFunction · 0.85

Tested by

no test coverage detected