* Helper function - wait for confirmation */
| 215 | * Helper function - wait for confirmation |
| 216 | */ |
| 217 | static CO_LSSmaster_return_t |
| 218 | CO_LSSmaster_switchStateSelectWait(CO_LSSmaster_t* LSSmaster, uint32_t timeDifference_us) { |
| 219 | CO_LSSmaster_return_t ret; |
| 220 | |
| 221 | if (CO_FLAG_READ(LSSmaster->CANrxNew)) { |
| 222 | uint8_t cs = LSSmaster->CANrxData[0]; |
| 223 | CO_FLAG_CLEAR(LSSmaster->CANrxNew); |
| 224 | |
| 225 | if (cs == CO_LSS_SWITCH_STATE_SEL) { |
| 226 | /* confirmation received */ |
| 227 | ret = CO_LSSmaster_OK; |
| 228 | } else { |
| 229 | ret = CO_LSSmaster_check_timeout(LSSmaster, timeDifference_us); |
| 230 | } |
| 231 | } else { |
| 232 | ret = CO_LSSmaster_check_timeout(LSSmaster, timeDifference_us); |
| 233 | } |
| 234 | |
| 235 | return ret; |
| 236 | } |
| 237 | |
| 238 | CO_LSSmaster_return_t |
| 239 | CO_LSSmaster_swStateSelect(CO_LSSmaster_t* LSSmaster, uint32_t timeDifference_us, CO_LSS_address_t* lssAddress) { |
no test coverage detected