made active faction recovery configurable
This commit is contained in:
		| @@ -207,6 +207,9 @@ void setup() | ||||
| 	tmrFactionTicker.start(); | ||||
| 	tmrInputGetter.start(); | ||||
|  | ||||
| 	if (ConfigData.active_faction_on_reboot == false) | ||||
| 		PersistenceData.activeFaction = NONE; | ||||
|  | ||||
| 	Serial.print("\nSetup Done\n"); | ||||
| } | ||||
|  | ||||
| @@ -246,7 +249,7 @@ void loop() | ||||
| 		/* code */ | ||||
| 		break; | ||||
| 	case sysStat_Shutdown: | ||||
| 		OverrideDisplay(SHUTDOWN_DELAY_MS , "  re", "boot", "    "); | ||||
| 		OverrideDisplay(SHUTDOWN_DELAY_MS, "  re", "boot", "    "); | ||||
| 		SystemShutdown(); | ||||
| 		break; | ||||
| 	case sysStat_Startup: | ||||
| @@ -371,6 +374,7 @@ void tmrCallback_InputGetter() | ||||
| 		if (PersistenceData.activeFaction != FACTION_1) | ||||
| 		{ | ||||
| 			Serial.println("Faction 1 captured !"); | ||||
| 			globals.requestEEAction = EE_PDS_SAVE; | ||||
| 		} | ||||
| 		PersistenceData.activeFaction = FACTION_1; | ||||
| 	} | ||||
| @@ -380,6 +384,7 @@ void tmrCallback_InputGetter() | ||||
| 		if (PersistenceData.activeFaction != FACTION_2) | ||||
| 		{ | ||||
| 			Serial.println("Faction 2 captured !"); | ||||
| 			globals.requestEEAction = EE_PDS_SAVE; | ||||
| 		} | ||||
| 		PersistenceData.activeFaction = FACTION_2; | ||||
| 	} | ||||
| @@ -389,6 +394,7 @@ void tmrCallback_InputGetter() | ||||
| 		if (PersistenceData.activeFaction != FACTION_3) | ||||
| 		{ | ||||
| 			Serial.println("Faction 3 captured !"); | ||||
| 			globals.requestEEAction = EE_PDS_SAVE; | ||||
| 		} | ||||
| 		PersistenceData.activeFaction = FACTION_3; | ||||
| 	} | ||||
| @@ -583,7 +589,7 @@ void ProcessKeyCombos(bool *btnState) | ||||
| 		if (keyCount_Fac2 == 2 && keyCount_Fac3 == 0) | ||||
| 		{ | ||||
| 			Serial.println("KeyCombo: WiFi AP ON"); | ||||
| 			OverrideDisplay(5000, "NET ", "    ","    "); | ||||
| 			OverrideDisplay(5000, "NET ", "    ", "    "); | ||||
| 			toggleWiFiAP(false); | ||||
| 		} | ||||
| 		else if (keyCount_Fac2 == 4 && keyCount_Fac3 == 0) | ||||
|   | ||||
| @@ -200,6 +200,12 @@ String processor(const String &var) | ||||
|     return temp; | ||||
|   } | ||||
|  | ||||
|   if (var == "FACTIONREBOOT_CHECKED") | ||||
|     return String(ConfigData.active_faction_on_reboot == true ? "checked" : ""); | ||||
|  | ||||
|   if (var == "FACTION_RECOVERY") | ||||
|     return String(ConfigData.active_faction_on_reboot); | ||||
|  | ||||
|   return String(); | ||||
| } | ||||
|  | ||||
| @@ -256,6 +262,15 @@ void WebserverPOST_Callback(AsyncWebServerRequest *request) | ||||
|       ConfigData.batteryType = temp; | ||||
|     } | ||||
|  | ||||
|     if (request->hasParam("factionreboot_cont", true)) | ||||
|     { | ||||
|       AsyncWebParameter *param = request->getParam("factionreboot_cont", true); | ||||
|       if (param->value() == "on") | ||||
|         ConfigData.active_faction_on_reboot = true; | ||||
|       else | ||||
|         ConfigData.active_faction_on_reboot = false; | ||||
|     } | ||||
|  | ||||
|     if (p->name() == "settingssave") | ||||
|       globals.requestEEAction = EE_CFG_SAVE; | ||||
|     // end: POST Form Settings | ||||
|   | ||||
		Reference in New Issue
	
	Block a user