mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 05:06:32 +00:00
faster tft spi for esp32
This commit is contained in:
parent
1e230e1f2d
commit
45b38c9bf2
@ -1026,9 +1026,19 @@ void uDisplay::pushColors(uint16_t *data, uint16_t len, boolean first) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( (col_mode != 18) && (spi_dc >= 0) && (spi_nr <= 2) ) {
|
||||||
|
// special version 8 bit spi I or II
|
||||||
|
#ifdef ESP8266
|
||||||
while (len--) {
|
while (len--) {
|
||||||
color = *data++;
|
uspi->write(*data++);
|
||||||
WriteColor(color);
|
}
|
||||||
|
#else
|
||||||
|
uspi->writePixels(data, len * 2);
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
while (len--) {
|
||||||
|
WriteColor(*data++);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2629,7 +2629,7 @@ chknext:
|
|||||||
len = 0;
|
len = 0;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
#endif
|
#endif // USE_LVGL
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
if (!strncmp(vname, "med(", 4)) {
|
if (!strncmp(vname, "med(", 4)) {
|
||||||
@ -7764,39 +7764,34 @@ void btn_event_cb(lv_obj_t * btn, lv_event_t event) {
|
|||||||
if (event == LV_EVENT_CLICKED) {
|
if (event == LV_EVENT_CLICKED) {
|
||||||
AddLog_P(LOG_LEVEL_INFO,PSTR(">>> clicked"));
|
AddLog_P(LOG_LEVEL_INFO,PSTR(">>> clicked"));
|
||||||
}
|
}
|
||||||
AddLog_P(LOG_LEVEL_INFO,PSTR(">>> clicked"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t lvgl_test(int32_t p) {
|
int32_t lvgl_test(int32_t p) {
|
||||||
|
|
||||||
start_lvgl(ili9342);
|
start_lvgl(ili9342);
|
||||||
|
|
||||||
lv_obj_clean(lv_scr_act());
|
lv_obj_clean(lv_scr_act());
|
||||||
|
|
||||||
|
if (p == 0) {
|
||||||
lv_obj_t *label1 = lv_label_create(lv_scr_act(), NULL);
|
lv_obj_t *label1 = lv_label_create(lv_scr_act(), NULL);
|
||||||
|
|
||||||
/*Modify the Label's text*/
|
/*Modify the Label's text*/
|
||||||
lv_label_set_text(label1, "Hello world!");
|
lv_label_set_text(label1, "Hello world!");
|
||||||
|
|
||||||
/* Align the Label to the center
|
/* Align the Label to the center
|
||||||
* NULL means align on parent (which is the screen now)
|
* NULL means align on parent (which is the screen now)
|
||||||
* 0, 0 at the end means an x, y offset after alignment*/
|
* 0, 0 at the end means an x, y offset after alignment*/
|
||||||
lv_obj_align(label1, NULL, LV_ALIGN_CENTER, 0, 0);
|
lv_obj_align(label1, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||||
|
|
||||||
|
|
||||||
lvgl_setup();
|
|
||||||
|
|
||||||
/*Add a button*/
|
/*Add a button*/
|
||||||
lv_obj_t *btn1 = lv_btn_create(lv_scr_act(), NULL); /*Add to the active screen*/
|
lv_obj_t *btn1 = lv_btn_create(lv_scr_act(), NULL); /*Add to the active screen*/
|
||||||
lv_obj_set_pos(btn1, 2, 2); /*Adjust the position*/
|
lv_obj_set_pos(btn1, 2, 2); /*Adjust the position*/
|
||||||
lv_obj_set_size(btn1, 96, 30); /* set size of button */
|
lv_obj_set_size(btn1, 96, 30); /* set size of button */
|
||||||
lv_obj_set_event_cb(btn1, btn_event_cb);
|
lv_obj_set_event_cb(btn1, btn_event_cb);
|
||||||
|
|
||||||
/*Add text*/
|
/*Add text*/
|
||||||
lv_obj_t *label = lv_label_create(btn1, NULL); /*Put on 'btn1'*/
|
lv_obj_t *label = lv_label_create(btn1, NULL); /*Put on 'btn1'*/
|
||||||
lv_label_set_text(label, "Click");
|
lv_label_set_text(label, "Click");
|
||||||
|
} else {
|
||||||
|
lvgl_setup();
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7898,7 +7893,7 @@ void lvgl_setup(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif // USE_LVGL
|
||||||
|
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
* Interface
|
* Interface
|
||||||
|
Loading…
x
Reference in New Issue
Block a user