From c9f7609eedc3cb6fdda43664480f58b164da170f Mon Sep 17 00:00:00 2001 From: fvanroie Date: Sat, 21 Nov 2020 23:41:14 +0100 Subject: [PATCH] Code cleanup --- src/hasp_gui.cpp | 10 +++++----- src/hasp_mqtt.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 3650b471..0a2a322a 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -105,8 +105,8 @@ bool guiCheckSleep() return (guiSleeping != HASP_SLEEP_OFF); } -/* Experimental Display flushing */ -static void IRAM_ATTR my_flush_cb(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * color_p) +/* 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) { #if 0 size_t len = (area->x2 - area->x1 + 1) * (area->y2 - area->y1 + 1); /* Number of pixels */ @@ -130,7 +130,7 @@ static void IRAM_ATTR my_flush_cb(lv_disp_drv_t * disp, const lv_area_t * area, #endif /* Tell lvgl that flushing is done */ - // lv_disp_flush_ready(disp); + // lv_disp_flush_ready(disp); ===> moved into the drivers } /* Interrupt driven periodic handler */ @@ -911,7 +911,7 @@ static void gui_screenshot_to_file(lv_disp_drv_t * disp, const lv_area_t * area, len *= sizeof(lv_color_t); /* Number of bytes */ size_t res = pFileOut.write((uint8_t *)color_p, len); if(res != len) gui_flush_not_complete(); - my_flush_cb(disp, area, color_p); + printscreen_flush_cb(disp, area, color_p); } /** Take Screenshot. @@ -965,7 +965,7 @@ static void gui_screenshot_to_http(lv_disp_drv_t * disp, const lv_area_t * area, len *= sizeof(lv_color_t); /* Number of bytes */ size_t res = httpClientWrite((uint8_t *)color_p, len); if(res != len) gui_flush_not_complete(); - my_flush_cb(disp, area, color_p); + printscreen_flush_cb(disp, area, color_p); } /** Take Screenshot. diff --git a/src/hasp_mqtt.cpp b/src/hasp_mqtt.cpp index c62b9b54..96e02627 100644 --- a/src/hasp_mqtt.cpp +++ b/src/hasp_mqtt.cpp @@ -486,7 +486,7 @@ void mqttStop() size_t len; snprintf_P(tmp_topic, sizeof(tmp_topic), PSTR("%sstatus"), mqttNodeTopic); - len = snprintf_P(tmp_payload, sizeof(tmp_payload), PSTR("OFF"), mqttNodeTopic); + len = snprintf_P(tmp_payload, sizeof(tmp_payload), PSTR("OFF")); mqttPublish(tmp_topic, tmp_payload, len); mqttClient.disconnect();