File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed
Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -274,24 +274,25 @@ void updateButton()
274274 // Update the LEDs
275275 deltaTime = millis () - pressedTime;
276276 buttonLeds (deltaTime);
277+
278+ // Check for reset to factory settings
279+ if (deltaTime >= trainButtonFactoryResetTime)
280+ {
281+ // Erase the EEPROM
282+ nvmErase ();
283+
284+ // Reboot the radio
285+ commandReset ();
286+ }
287+
277288 if (!buttonPressed)
278289 {
279290 // Button just released
280291 settings = originalSettings;
281292
282- // Check for reset to factory settings
283- if (deltaTime >= trainButtonFactoryResetTime)
284- {
285- // Erase the EEPROM
286- nvmErase ();
287-
288- // Reboot the radio
289- commandReset ();
290- }
291-
292293 // Starting training or exiting training via the button is only possible
293294 // when the radio is not in command mode!
294- else if (!inCommandMode)
295+ if (!inCommandMode)
295296 {
296297 // Check for server training request
297298 if (deltaTime >= trainButtonServerTime)
@@ -342,7 +343,7 @@ void updateButton()
342343
343344 // Save the previous led state
344345 if (!inTraining)
345- originalSettings = settings;
346+ originalSettings = settings;
346347 }
347348 }
348349
You can’t perform that action at this time.
0 commit comments