mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Rename haspWakeUp to guiWakeUp
This commit is contained in:
parent
c10d3f3ede
commit
c80a9efca6
@ -79,6 +79,7 @@ static Ticker tick; /* timer for interrupt handler */
|
|||||||
static Ticker tick(lv_tick_handler, LVGL_TICK_PERIOD); // guiTickPeriod);
|
static Ticker tick(lv_tick_handler, LVGL_TICK_PERIOD); // guiTickPeriod);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* **************************** SLEEP & WAKEUP ************************************** */
|
||||||
bool IRAM_ATTR guiCheckSleep()
|
bool IRAM_ATTR guiCheckSleep()
|
||||||
{
|
{
|
||||||
uint32_t idle = lv_disp_get_inactive_time(NULL);
|
uint32_t idle = lv_disp_get_inactive_time(NULL);
|
||||||
@ -103,6 +104,16 @@ bool IRAM_ATTR guiCheckSleep()
|
|||||||
return (guiSleeping != HASP_SLEEP_OFF);
|
return (guiSleeping != HASP_SLEEP_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WakeUp the display using a command instead of touch
|
||||||
|
*/
|
||||||
|
void guiWakeUp()
|
||||||
|
{
|
||||||
|
lv_disp_trig_activity(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* **************************** SCREENSHOTS ************************************** */
|
||||||
|
|
||||||
/* After flusing to the file stream or web client, we also send the buffer to the tft */
|
/* After flusing to the file stream or web client, we also send the buffer to the tft */
|
||||||
static void IRAM_ATTR printscreen_flush_cb(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p)
|
static void IRAM_ATTR printscreen_flush_cb(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p)
|
||||||
{
|
{
|
||||||
@ -131,6 +142,8 @@ static void IRAM_ATTR printscreen_flush_cb(lv_disp_drv_t * disp, const lv_area_t
|
|||||||
// lv_disp_flush_ready(disp); ===> moved into the drivers
|
// lv_disp_flush_ready(disp); ===> moved into the drivers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* **************************** GUI TICKER ************************************** */
|
||||||
|
|
||||||
/* Interrupt driven periodic handler */
|
/* Interrupt driven periodic handler */
|
||||||
static void ICACHE_RAM_ATTR lv_tick_handler(void)
|
static void ICACHE_RAM_ATTR lv_tick_handler(void)
|
||||||
{
|
{
|
||||||
@ -404,23 +417,12 @@ bool IRAM_ATTR my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t *
|
|||||||
|
|
||||||
// Ignore first press?
|
// Ignore first press?
|
||||||
|
|
||||||
// if(touchX > tft.width() || touchY > tft.height()) {
|
|
||||||
// Serial.print(F("Y or y outside of expected parameters.. x: "));
|
|
||||||
// Serial.print(touchX);
|
|
||||||
// Serial.print(F(" / y: "));
|
|
||||||
// Serial.println(touchY);
|
|
||||||
// } else {
|
|
||||||
/*Save the state and save the pressed coordinate for cursor position */
|
/*Save the state and save the pressed coordinate for cursor position */
|
||||||
data->state = touched ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL;
|
data->state = touched ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL;
|
||||||
if(touched) {
|
if(touched) {
|
||||||
data->point.x = touchX;
|
data->point.x = touchX;
|
||||||
data->point.y = touchY;
|
data->point.y = touchY;
|
||||||
}
|
}
|
||||||
/* Serial.print("Data x");
|
|
||||||
Serial.println(touchX);
|
|
||||||
Serial.print("Data y");
|
|
||||||
Serial.println(touchY);*/
|
|
||||||
//}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return false; /*Return `false` because we are not buffering and no more data to read*/
|
return false; /*Return `false` because we are not buffering and no more data to read*/
|
||||||
@ -679,6 +681,7 @@ void guiStop()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
bool guiGetBacklight()
|
bool guiGetBacklight()
|
||||||
{
|
{
|
||||||
return guiBacklightIsOn;
|
return guiBacklightIsOn;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user