diff --git a/src/hasp_config.h b/src/hasp_config.h index 9a05d065..cd556da5 100644 --- a/src/hasp_config.h +++ b/src/hasp_config.h @@ -3,12 +3,12 @@ #if HASP_USE_CONFIG > 0 -#ifndef HASP_CONFIG_H -#define HASP_CONFIG_H + #ifndef HASP_CONFIG_H + #define HASP_CONFIG_H -#include "hasp_conf.h" -#include "ArduinoJson.h" -#include "hasp_debug.h" // for TAG_CONF + #include "hasp_conf.h" + #include "ArduinoJson.h" + #include "hasp_debug.h" // for TAG_CONF /* ===== Default Event Processors ===== */ void configSetup(void); @@ -49,18 +49,19 @@ const char F_CONFIG_GROUP[] PROGMEM = "group"; const char F_CONFIG_BAUD[] PROGMEM = "baud"; const char F_CONFIG_LOG[] PROGMEM = "log"; const char F_CONFIG_PROTOCOL[] PROGMEM = "proto"; -const char F_GUI_ROTATION[] PROGMEM = "rotation"; -const char F_GUI_TICKPERIOD[] PROGMEM = "tickperiod"; +const char F_GUI_ROTATION[] PROGMEM = "rotate"; +const char F_GUI_INVERT[] PROGMEM = "invert"; +const char F_GUI_TICKPERIOD[] PROGMEM = "tick"; const char F_GUI_IDLEPERIOD1[] PROGMEM = "idle1"; const char F_GUI_IDLEPERIOD2[] PROGMEM = "idle2"; const char F_GUI_CALIBRATION[] PROGMEM = "calibration"; -const char F_GUI_BACKLIGHTPIN[] PROGMEM = "bcklpin"; -const char F_GUI_POINTER[] PROGMEM = "pointer"; -const char F_DEBUG_TELEPERIOD[] PROGMEM = "teleperiod"; +const char F_GUI_BACKLIGHTPIN[] PROGMEM = "bckl"; +const char F_GUI_POINTER[] PROGMEM = "cursor"; +const char F_DEBUG_TELEPERIOD[] PROGMEM = "tele"; const char F_GPIO_CONFIG[] PROGMEM = "config"; const char HASP_CONFIG_FILE[] PROGMEM = "/config.json"; -#endif + #endif #endif // HASP_USE_CONFIG \ No newline at end of file diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 681c4f00..da0217ff 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -506,6 +506,9 @@ bool guiGetConfig(const JsonObject & settings) if(guiShowPointer != settings[FPSTR(F_GUI_POINTER)].as()) changed = true; settings[FPSTR(F_GUI_POINTER)] = guiShowPointer; + if(guiInvertDisplay != settings[FPSTR(F_GUI_INVERT)].as()) changed = true; + settings[FPSTR(F_GUI_INVERT)] = guiInvertDisplay; + /* Check CalData array has changed */ JsonArray array = settings[FPSTR(F_GUI_CALIBRATION)].as(); uint8_t i = 0; @@ -559,6 +562,7 @@ bool guiSetConfig(const JsonObject & settings) changed |= configSet(guiSleepTime1, settings[FPSTR(F_GUI_IDLEPERIOD1)], F("guiSleepTime1")); changed |= configSet(guiSleepTime2, settings[FPSTR(F_GUI_IDLEPERIOD2)], F("guiSleepTime2")); changed |= configSet(guiRotation, settings[FPSTR(F_GUI_ROTATION)], F("guiRotation")); + changed |= configSet(guiInvertDisplay, settings[FPSTR(F_GUI_INVERT)], F("guiInvertDisplay")); if(!settings[FPSTR(F_GUI_POINTER)].isNull()) { if(guiShowPointer != settings[FPSTR(F_GUI_POINTER)].as()) { diff --git a/src/svc/hasp_http.cpp b/src/svc/hasp_http.cpp index 608e4815..37d08d78 100644 --- a/src/svc/hasp_http.cpp +++ b/src/svc/hasp_http.cpp @@ -237,7 +237,8 @@ void saveConfig() #endif } else if(save == String(PSTR("gui"))) { - settings[FPSTR(F_GUI_POINTER)] = webServer.hasArg(PSTR("pointer")); + settings[FPSTR(F_GUI_POINTER)] = webServer.hasArg(PSTR("cur")); + settings[FPSTR(F_GUI_INVERT)] = webServer.hasArg(PSTR("inv")); guiSetConfig(settings.as()); } else if(save == String(PSTR("debug"))) { @@ -1093,7 +1094,11 @@ void webHandleGuiConfig() httpMessage += getOption(5, F("270 degrees - mirrored"), rotation == 5); httpMessage += F("

"); - httpMessage += F("

()) httpMessage += F(" checked"); + httpMessage += F(">Invert Colors"); + + httpMessage += F("

()) httpMessage += F(" checked"); httpMessage += F(">Show Pointer");