diff --git a/src/drv/hasp_drv_touch.cpp b/src/drv/hasp_drv_touch.cpp index 317d8f18..c89c0021 100644 --- a/src/drv/hasp_drv_touch.cpp +++ b/src/drv/hasp_drv_touch.cpp @@ -174,7 +174,7 @@ static inline bool drv_touchpad_getXY(int16_t* touchX, int16_t* touchY) return touched; } -bool drv_touch_read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data) +bool IRAM_ATTR drv_touch_read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data) { #if TOUCH_DRIVER > 0 int16_t touchX = 0; @@ -211,7 +211,7 @@ bool drv_touch_read(lv_indev_drv_t* indev_driver, lv_indev_data_t* data) return false; } -void drv_touch_loop() +void IRAM_ATTR drv_touch_loop() { #if TOUCH_DRIVER == 911 GT911_loop(); diff --git a/src/drv/tft_driver_tftespi.cpp b/src/drv/tft_driver_tftespi.cpp index ac418422..b849cf5a 100644 --- a/src/drv/tft_driver_tftespi.cpp +++ b/src/drv/tft_driver_tftespi.cpp @@ -123,7 +123,7 @@ void TftEspi::set_invert(bool invert) tft.invertDisplay(invert); } -void TftEspi::flush_pixels(lv_disp_drv_t* disp, const lv_area_t* area, lv_color_t* color_p) +void IRAM_ATTR TftEspi::flush_pixels(lv_disp_drv_t* disp, const lv_area_t* area, lv_color_t* color_p) { size_t len = lv_area_get_size(area); diff --git a/src/drv/touch/hasp_drv_ft6336u.cpp b/src/drv/touch/hasp_drv_ft6336u.cpp index 15cc921d..41835cd0 100644 --- a/src/drv/touch/hasp_drv_ft6336u.cpp +++ b/src/drv/touch/hasp_drv_ft6336u.cpp @@ -1,17 +1,17 @@ #if TOUCH_DRIVER == 6336 - #include - #include "FT6336U.h" - #include "ArduinoLog.h" +#include +#include "FT6336U.h" +#include "ArduinoLog.h" - #include "hasp_drv_ft6336u.h" +#include "hasp_drv_ft6336u.h" - #define RST_PIN (TOUCH_RST) // -1 if pin is connected to VCC else set pin number +#define RST_PIN (TOUCH_RST) // -1 if pin is connected to VCC else set pin number -FT6336U * touchpanel; +FT6336U* touchpanel; // Read touch points -bool FT6336U_getXY(int16_t * touchX, int16_t * touchY, bool debug) +bool IRAM_ATTR FT6336U_getXY(int16_t* touchX, int16_t* touchY, bool debug) { if(touchpanel->read_touch_number() != 1) return false; @@ -20,7 +20,7 @@ bool FT6336U_getXY(int16_t * touchX, int16_t * touchY, bool debug) return true; } -void scan(TwoWire & i2c) +void scan(TwoWire& i2c) { byte error, address; int nDevices; diff --git a/src/hasp/hasp.cpp b/src/hasp/hasp.cpp index 203080dc..3e6596b1 100644 --- a/src/hasp/hasp.cpp +++ b/src/hasp/hasp.cpp @@ -102,7 +102,7 @@ lv_font_t* hasp_get_font(uint8_t fontid) /** * Check if sleep state needs to be updated */ -bool hasp_update_sleep_state() +bool IRAM_ATTR hasp_update_sleep_state() { uint32_t idle = lv_disp_get_inactive_time(NULL); diff --git a/src/hasp/hasp_attribute.cpp b/src/hasp/hasp_attribute.cpp index 2ae49d51..6f2f23ac 100644 --- a/src/hasp/hasp_attribute.cpp +++ b/src/hasp/hasp_attribute.cpp @@ -1449,7 +1449,7 @@ static void hasp_process_obj_attribute_range(lv_obj_t* obj, const char* attr, co * @param update bool: change/set the value if true, dispatch/get value if false * @note setting a value won't return anything, getting will dispatch the value */ -void hasp_process_obj_attribute(lv_obj_t* obj, const char* attr_p, const char* payload, bool update) +void IRAM_ATTR hasp_process_obj_attribute(lv_obj_t* obj, const char* attr_p, const char* payload, bool update) { // unsigned long start = millis(); if(!obj) { diff --git a/src/hasp_gui.cpp b/src/hasp_gui.cpp index 54288d51..91b399e6 100644 --- a/src/hasp_gui.cpp +++ b/src/hasp_gui.cpp @@ -72,7 +72,8 @@ gui_conf_t gui_settings = {.show_pointer = false, // { // lv_tick_inc(LVGL_TICK_PERIOD); // } -void gui_flush_cb(lv_disp_drv_t* disp, const lv_area_t* area, lv_color_t* color_p) + +void IRAM_ATTR gui_flush_cb(lv_disp_drv_t* disp, const lv_area_t* area, lv_color_t* color_p) { haspTft.flush_pixels(disp, area, color_p); } @@ -284,7 +285,7 @@ void guiSetup(void) LOG_INFO(TAG_LVGL, F(D_SERVICE_STARTED)); } -void guiLoop(void) +void IRAM_ATTR guiLoop(void) { #if defined(STM32F4xx) // tick.update(); diff --git a/src/main_arduino.cpp b/src/main_arduino.cpp index d42604c5..2d5666d8 100644 --- a/src/main_arduino.cpp +++ b/src/main_arduino.cpp @@ -104,12 +104,12 @@ void setup() slaveSetup(); #endif - mainLastLoopTime = millis() - 1000; // reset loop counter - delay(250); + mainLastLoopTime = -1000; // reset loop counter + delay(20); // guiStart(); } -void loop() +void IRAM_ATTR loop() { guiLoop(); haspLoop();