* Helper function - verify 32 bit LSS address, request node(s) to switch their state machine to the next state */
| 790 | * Helper function - verify 32 bit LSS address, request node(s) to switch their state machine to the next state |
| 791 | */ |
| 792 | static CO_LSSmaster_return_t |
| 793 | CO_LSSmaster_FsVerifyWait(CO_LSSmaster_t* LSSmaster, uint32_t timeDifference_us, CO_LSSmaster_scantype_t scan, |
| 794 | uint32_t* idNumberRet) { |
| 795 | CO_LSSmaster_return_t ret; |
| 796 | |
| 797 | if (scan == CO_LSSmaster_FS_SKIP) { |
| 798 | return CO_LSSmaster_SCAN_FAILED; |
| 799 | } |
| 800 | |
| 801 | ret = CO_LSSmaster_check_timeout(LSSmaster, timeDifference_us); |
| 802 | if (ret == CO_LSSmaster_TIMEOUT) { |
| 803 | |
| 804 | *idNumberRet = 0; |
| 805 | ret = CO_LSSmaster_SCAN_NOACK; |
| 806 | |
| 807 | if (CO_FLAG_READ(LSSmaster->CANrxNew)) { |
| 808 | uint8_t cs = LSSmaster->CANrxData[0]; |
| 809 | CO_FLAG_CLEAR(LSSmaster->CANrxNew); |
| 810 | |
| 811 | if (cs == CO_LSS_IDENT_SLAVE) { |
| 812 | *idNumberRet = LSSmaster->fsIdNumber; |
| 813 | ret = CO_LSSmaster_SCAN_FINISHED; |
| 814 | } else { |
| 815 | ret = CO_LSSmaster_SCAN_FAILED; |
| 816 | } |
| 817 | } |
| 818 | } |
| 819 | |
| 820 | return ret; |
| 821 | } |
| 822 | |
| 823 | /* |
| 824 | * Helper function - check which 32 bit to scan for next, if any |
no test coverage detected