diff --git a/CYD-Klipper/.vscode/settings.json b/CYD-Klipper/.vscode/settings.json index 378bfd4..e9997e2 100644 --- a/CYD-Klipper/.vscode/settings.json +++ b/CYD-Klipper/.vscode/settings.json @@ -11,6 +11,7 @@ "initializer_list": "cpp", "algorithm": "cpp", "cstddef": "cpp", - "functional": "cpp" + "functional": "cpp", + "*.tcc": "cpp" } } \ No newline at end of file diff --git a/CYD-Klipper/src/core/device/ESP32-2432S028R.cpp b/CYD-Klipper/src/core/device/ESP32-2432S028R.cpp index 418721b..6e4ef3d 100644 --- a/CYD-Klipper/src/core/device/ESP32-2432S028R.cpp +++ b/CYD-Klipper/src/core/device/ESP32-2432S028R.cpp @@ -125,6 +125,8 @@ void screen_lv_touchRead(lv_indev_drv_t *indev_driver, lv_indev_data_t *data) return; } + screen_timer_wake(); + TS_Point p = touchscreen_point(); data->state = LV_INDEV_STATE_PR; data->point.x = p.x; diff --git a/CYD-Klipper/src/core/device/ESP32-3248S035C.cpp b/CYD-Klipper/src/core/device/ESP32-3248S035C.cpp index 8ac8611..80bdb87 100644 --- a/CYD-Klipper/src/core/device/ESP32-3248S035C.cpp +++ b/CYD-Klipper/src/core/device/ESP32-3248S035C.cpp @@ -55,6 +55,17 @@ void screen_lv_touchRead(lv_indev_drv_t *indev_driver, lv_indev_data_t *data) } else { + if (is_screen_asleep()) + { + screen_timer_wake(); + while (tp.isTouched) { + tp.read(); + } + return; + } + + screen_timer_wake(); + data->state = LV_INDEV_STATE_PR; for (int i = 0; i < tp.touches; i++) { @@ -74,12 +85,6 @@ void screen_lv_touchRead(lv_indev_drv_t *indev_driver, lv_indev_data_t *data) data->point.x = magicX; data->point.y = magicY; } - - if (is_screen_asleep()) - { - screen_timer_wake(); - } - } } diff --git a/CYD-Klipper/src/core/lv_setup.cpp b/CYD-Klipper/src/core/lv_setup.cpp index 18f352a..c7ea35a 100644 --- a/CYD-Klipper/src/core/lv_setup.cpp +++ b/CYD-Klipper/src/core/lv_setup.cpp @@ -25,6 +25,11 @@ void set_screen_brightness() void screen_timer_wake() { lv_timer_reset(screenSleepTimer); + + if (!isScreenInSleep){ + return; + } + isScreenInSleep = false; set_screen_brightness();