diff --git a/src/hasp_dispatch.cpp b/src/hasp_dispatch.cpp index ab227e64..2d6fd889 100644 --- a/src/hasp_dispatch.cpp +++ b/src/hasp_dispatch.cpp @@ -260,6 +260,7 @@ void dispatchJsonl(Stream & stream) uint8_t savedPage = haspGetPage(); Log.notice(F("DISPATCH: jsonl")); + Serial.println(F("DISPATCH: jsonl")); while(deserializeJson(jsonl, stream) == DeserializationError::Ok) { // serializeJson(jsonl, Serial); diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 84b1f07b..92751883 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -40,8 +40,10 @@ /* ---------- Screenshot Variables ---------- */ #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)|| defined(STM32F4xx) +#if HASP_USE_SPIFFS>0 File pFileOut; #endif +#endif uint8_t guiSnapshot = 0; #if defined(STM32F4xx) @@ -558,14 +560,14 @@ bool IRAM_ATTR my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * { //#ifdef TOUCH_CS uint16_t touchX, touchY; - +bool touched; #if TOUCH_DRIVER == 0 - bool touched = tft.getTouch(&touchX, &touchY, 600); + touched = tft.getTouch(&touchX, &touchY, 600); #elif TOUCH_DRIVER == 1 // return false; - bool touched = GT911_getXY(&touchX, &touchY, true); -#else - bool touched = Touch_getXY(&touchX, &touchY, false); + touched = GT911_getXY(&touchX, &touchY, true); +#elif TOUCH_DRIVER == 2 + touched = Touch_getXY(&touchX, &touchY, false); #endif if(!touched) return false; @@ -826,13 +828,18 @@ void IRAM_ATTR guiLoop() // lv_tick_handler(); lv_task_handler(); /* let the GUI do its work */ - guiCheckSleep(); + // guiCheckSleep(); #if TOUCH_DRIVER == 1 touch.loop(); #endif } +void guiEverySecond() +{ + guiCheckSleep(); +} + void guiStop() {} @@ -952,7 +959,9 @@ bool guiSetConfig(const JsonObject & settings) changed |= configSet(guiSleepTime1, settings[FPSTR(F_GUI_IDLEPERIOD1)], PSTR("guiSleepTime1")); changed |= configSet(guiSleepTime2, settings[FPSTR(F_GUI_IDLEPERIOD2)], PSTR("guiSleepTime2")); changed |= configSet(guiRotation, settings[FPSTR(F_GUI_ROTATION)], PSTR("guiRotation")); - + Serial.print("Backlight = "); + Serial.println(guiBacklightPin); + if(!settings[FPSTR(F_GUI_POINTER)].isNull()) { if(guiShowPointer != settings[FPSTR(F_GUI_POINTER)].as()) { Log.trace(F("guiShowPointer set")); diff --git a/src/hasp_gui.h b/src/hasp_gui.h index 76166eae..621159f3 100644 --- a/src/hasp_gui.h +++ b/src/hasp_gui.h @@ -21,6 +21,7 @@ void guiTakeScreenshot(); void guiSetup(); void guiLoop(void); void guiStop(void); +void guiEverySecond(void); void guiCalibrate(); void guiTakeScreenshot(const char * pFileName); diff --git a/src/main.cpp b/src/main.cpp index e03e3c21..8b411f0b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,7 +15,8 @@ unsigned long mainLastLoopTime = 0; void setup() { - + Serial.begin(115200); /* prepare for possible serial debug */ + delay(10); /**************************** * Constant initialzations ***************************/ @@ -149,6 +150,8 @@ void loop() /* Timer Loop */ if(millis() - mainLastLoopTime >= 1000) { + guiEverySecond(); + /* Run Every Second */ #if HASP_USE_OTA>0 otaEverySecond();