Add SPM Relay scan timeout message

This commit is contained in:
Theo Arends 2022-01-05 12:43:26 +01:00
parent 923feb2096
commit fce0104035
1 changed files with 7 additions and 1 deletions

View File

@ -1025,9 +1025,15 @@ void SSPMEvery100ms(void) {
Sspm->module_max = 0; Sspm->module_max = 0;
SSPMSendInitScan(); SSPMSendInitScan();
Sspm->mstate = SPM_WAIT_FOR_SCAN; Sspm->mstate = SPM_WAIT_FOR_SCAN;
Sspm->last_totals = 0;
break; break;
case SPM_WAIT_FOR_SCAN: case SPM_WAIT_FOR_SCAN:
// Wait for scan sequence to complete // Wait for scan sequence to complete within 60 seconds
if (Sspm->last_totals > 600) {
AddLog(LOG_LEVEL_DEBUG, PSTR("SPM: Relay scan timeout"));
Sspm->mstate = SPM_NONE;
Sspm->error_led_blinks = 255;
}
break; break;
case SPM_SCAN_COMPLETE: case SPM_SCAN_COMPLETE:
// Scan sequence finished // Scan sequence finished