mirror of
https://github.com/suchmememanyskill/CYD-Klipper.git
synced 2026-03-21 05:33:24 +00:00
Fix broken auto sleep
This commit is contained in:
3
CYD-Klipper/.vscode/settings.json
vendored
3
CYD-Klipper/.vscode/settings.json
vendored
@@ -11,6 +11,7 @@
|
|||||||
"initializer_list": "cpp",
|
"initializer_list": "cpp",
|
||||||
"algorithm": "cpp",
|
"algorithm": "cpp",
|
||||||
"cstddef": "cpp",
|
"cstddef": "cpp",
|
||||||
"functional": "cpp"
|
"functional": "cpp",
|
||||||
|
"*.tcc": "cpp"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,6 +125,8 @@ void screen_lv_touchRead(lv_indev_drv_t *indev_driver, lv_indev_data_t *data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
screen_timer_wake();
|
||||||
|
|
||||||
TS_Point p = touchscreen_point();
|
TS_Point p = touchscreen_point();
|
||||||
data->state = LV_INDEV_STATE_PR;
|
data->state = LV_INDEV_STATE_PR;
|
||||||
data->point.x = p.x;
|
data->point.x = p.x;
|
||||||
|
|||||||
@@ -55,6 +55,17 @@ void screen_lv_touchRead(lv_indev_drv_t *indev_driver, lv_indev_data_t *data)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (is_screen_asleep())
|
||||||
|
{
|
||||||
|
screen_timer_wake();
|
||||||
|
while (tp.isTouched) {
|
||||||
|
tp.read();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
screen_timer_wake();
|
||||||
|
|
||||||
data->state = LV_INDEV_STATE_PR;
|
data->state = LV_INDEV_STATE_PR;
|
||||||
for (int i = 0; i < tp.touches; i++)
|
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.x = magicX;
|
||||||
data->point.y = magicY;
|
data->point.y = magicY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_screen_asleep())
|
|
||||||
{
|
|
||||||
screen_timer_wake();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ void set_screen_brightness()
|
|||||||
void screen_timer_wake()
|
void screen_timer_wake()
|
||||||
{
|
{
|
||||||
lv_timer_reset(screenSleepTimer);
|
lv_timer_reset(screenSleepTimer);
|
||||||
|
|
||||||
|
if (!isScreenInSleep){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
isScreenInSleep = false;
|
isScreenInSleep = false;
|
||||||
set_screen_brightness();
|
set_screen_brightness();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user