File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,8 @@ bool espnowIsPaired()
230230
231231 // Enable radio. User may have arrived here from the setup menu rather than serial menu.
232232 settings.radioType = RADIO_ESPNOW;
233- recordSystemSettings ();
233+
234+ recordSystemSettings (); // Record radioType and espnowPeerCount to NVM
234235
235236 espnowSetState (ESPNOW_PAIRED);
236237 return (true );
Original file line number Diff line number Diff line change @@ -920,7 +920,9 @@ void updateSystemState()
920920 if (espnowIsPaired () == true )
921921 {
922922 paintEspNowPaired ();
923- changeState (STATE_ROVER_NOT_STARTED);
923+
924+ // Return to the previous state
925+ changeState (lastSystemState);
924926 }
925927 else
926928 {
Original file line number Diff line number Diff line change @@ -415,7 +415,7 @@ void ButtonCheckTask(void *e)
415415 case STATE_WIFI_CONFIG:
416416 case STATE_ESPNOW_PAIRING_NOT_STARTED:
417417 case STATE_ESPNOW_PAIRING:
418- lastSystemState = systemState; // Remember this state to return after we mark an event
418+ lastSystemState = systemState; // Remember this state to return after we mark an event or ESP-Now pair
419419 requestChangeState (STATE_DISPLAY_SETUP);
420420 setupState = STATE_MARK_EVENT;
421421 lastSetupMenuChange = millis ();
@@ -535,7 +535,7 @@ void ButtonCheckTask(void *e)
535535 case STATE_WIFI_CONFIG:
536536 case STATE_ESPNOW_PAIRING_NOT_STARTED:
537537 case STATE_ESPNOW_PAIRING:
538- lastSystemState = systemState; // Remember this state to return after we mark an event
538+ lastSystemState = systemState; // Remember this state to return after we mark an event or ESP-Now pair
539539 requestChangeState (STATE_DISPLAY_SETUP);
540540 setupState = STATE_MARK_EVENT;
541541 lastSetupMenuChange = millis ();
You can’t perform that action at this time.
0 commit comments