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

Function CO_LSSmaster_check_timeout

305/CO_LSSmaster.c:103–114  ·  view source on GitHub ↗

* Check LSS timeout. * * Generally, we do not really care if the message has been received before or after the timeout * expired. Only if no message has been received we have to check for timeouts. */

Source from the content-addressed store, hash-verified

101 * expired. Only if no message has been received we have to check for timeouts.
102 */
103static inline CO_LSSmaster_return_t
104CO_LSSmaster_check_timeout(CO_LSSmaster_t* LSSmaster, uint32_t timeDifference_us) {
105 CO_LSSmaster_return_t ret = CO_LSSmaster_WAIT_SLAVE;
106
107 LSSmaster->timeoutTimer += timeDifference_us;
108 if (LSSmaster->timeoutTimer >= LSSmaster->timeout_us) {
109 LSSmaster->timeoutTimer = 0;
110 ret = CO_LSSmaster_TIMEOUT;
111 }
112
113 return ret;
114}
115
116CO_ReturnError_t
117CO_LSSmaster_init(CO_LSSmaster_t* LSSmaster, uint16_t timeout_ms, CO_CANmodule_t* CANdevRx, uint16_t CANdevRxIdx,

Calls

no outgoing calls

Tested by

no test coverage detected