Add IRAM_ATTR

This commit is contained in:
fvanroie 2021-05-06 02:39:35 +02:00
parent 037da81cee
commit e9a4359f4d
7 changed files with 19 additions and 18 deletions

View File

@ -174,7 +174,7 @@ static inline bool drv_touchpad_getXY(int16_t* touchX, int16_t* touchY)
return touched; 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 #if TOUCH_DRIVER > 0
int16_t touchX = 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; return false;
} }
void drv_touch_loop() void IRAM_ATTR drv_touch_loop()
{ {
#if TOUCH_DRIVER == 911 #if TOUCH_DRIVER == 911
GT911_loop(); GT911_loop();

View File

@ -123,7 +123,7 @@ void TftEspi::set_invert(bool invert)
tft.invertDisplay(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); size_t len = lv_area_get_size(area);

View File

@ -1,17 +1,17 @@
#if TOUCH_DRIVER == 6336 #if TOUCH_DRIVER == 6336
#include <Wire.h> #include <Wire.h>
#include "FT6336U.h" #include "FT6336U.h"
#include "ArduinoLog.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 // 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; 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; return true;
} }
void scan(TwoWire & i2c) void scan(TwoWire& i2c)
{ {
byte error, address; byte error, address;
int nDevices; int nDevices;

View File

@ -102,7 +102,7 @@ lv_font_t* hasp_get_font(uint8_t fontid)
/** /**
* Check if sleep state needs to be updated * 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); uint32_t idle = lv_disp_get_inactive_time(NULL);

View File

@ -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 * @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 * @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(); // unsigned long start = millis();
if(!obj) { if(!obj) {

View File

@ -72,7 +72,8 @@ gui_conf_t gui_settings = {.show_pointer = false,
// { // {
// lv_tick_inc(LVGL_TICK_PERIOD); // 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); haspTft.flush_pixels(disp, area, color_p);
} }
@ -284,7 +285,7 @@ void guiSetup(void)
LOG_INFO(TAG_LVGL, F(D_SERVICE_STARTED)); LOG_INFO(TAG_LVGL, F(D_SERVICE_STARTED));
} }
void guiLoop(void) void IRAM_ATTR guiLoop(void)
{ {
#if defined(STM32F4xx) #if defined(STM32F4xx)
// tick.update(); // tick.update();

View File

@ -104,12 +104,12 @@ void setup()
slaveSetup(); slaveSetup();
#endif #endif
mainLastLoopTime = millis() - 1000; // reset loop counter mainLastLoopTime = -1000; // reset loop counter
delay(250); delay(20);
// guiStart(); // guiStart();
} }
void loop() void IRAM_ATTR loop()
{ {
guiLoop(); guiLoop();
haspLoop(); haspLoop();