* 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. */
| 101 | * expired. Only if no message has been received we have to check for timeouts. |
| 102 | */ |
| 103 | static inline CO_LSSmaster_return_t |
| 104 | CO_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 | |
| 116 | CO_ReturnError_t |
| 117 | CO_LSSmaster_init(CO_LSSmaster_t* LSSmaster, uint16_t timeout_ms, CO_CANmodule_t* CANdevRx, uint16_t CANdevRxIdx, |
no outgoing calls
no test coverage detected