faster tft spi for esp32

This commit is contained in:
gemu2015 2021-04-25 19:18:55 +02:00
parent 1e230e1f2d
commit 45b38c9bf2
2 changed files with 33 additions and 28 deletions

View File

@ -1026,9 +1026,19 @@ void uDisplay::pushColors(uint16_t *data, uint16_t len, boolean first) {
return;
}
while (len--) {
color = *data++;
WriteColor(color);
if ( (col_mode != 18) && (spi_dc >= 0) && (spi_nr <= 2) ) {
// special version 8 bit spi I or II
#ifdef ESP8266
while (len--) {
uspi->write(*data++);
}
#else
uspi->writePixels(data, len * 2);
#endif
} else {
while (len--) {
WriteColor(*data++);
}
}
}

View File

@ -2629,7 +2629,7 @@ chknext:
len = 0;
goto exit;
}
#endif
#endif // USE_LVGL
break;
case 'm':
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) {
AddLog_P(LOG_LEVEL_INFO,PSTR(">>> clicked"));
}
AddLog_P(LOG_LEVEL_INFO,PSTR(">>> clicked"));
}
int32_t lvgl_test(int32_t p) {
start_lvgl(ili9342);
lv_obj_clean(lv_scr_act());
lv_obj_t *label1 = lv_label_create(lv_scr_act(), NULL);
/*Modify the Label's text*/
lv_label_set_text(label1, "Hello world!");
if (p == 0) {
lv_obj_t *label1 = lv_label_create(lv_scr_act(), NULL);
/*Modify the Label's text*/
lv_label_set_text(label1, "Hello world!");
/* Align the Label to the center
* NULL means align on parent (which is the screen now)
* 0, 0 at the end means an x, y offset after alignment*/
lv_obj_align(label1, NULL, LV_ALIGN_CENTER, 0, 0);
lvgl_setup();
/*Add a button*/
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_size(btn1, 96, 30); /* set size of button */
lv_obj_set_event_cb(btn1, btn_event_cb);
/*Add text*/
lv_obj_t *label = lv_label_create(btn1, NULL); /*Put on 'btn1'*/
lv_label_set_text(label, "Click");
lv_obj_align(label1, NULL, LV_ALIGN_CENTER, 0, 0);
/*Add a button*/
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_size(btn1, 96, 30); /* set size of button */
lv_obj_set_event_cb(btn1, btn_event_cb);
/*Add text*/
lv_obj_t *label = lv_label_create(btn1, NULL); /*Put on 'btn1'*/
lv_label_set_text(label, "Click");
} else {
lvgl_setup();
}
return 0;
}
@ -7898,7 +7893,7 @@ void lvgl_setup(void) {
}
#endif
#endif // USE_LVGL
/*********************************************************************************************\
* Interface