mirror of https://github.com/arendst/Tasmota.git
Merge branch 'development' of https://github.com/arendst/Tasmota into lvgl_chrono
This commit is contained in:
commit
f0fb65c56d
|
@ -1031,9 +1031,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++);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -481,6 +481,9 @@ void RA8876::DisplayInit(int8_t p,int8_t size,int8_t rot,int8_t font) {
|
|||
}
|
||||
|
||||
bool RA8876::initDisplay() {
|
||||
|
||||
lvgl_param = 10;
|
||||
|
||||
SPI.beginTransaction(m_spiSettings);
|
||||
|
||||
// Set chip config register
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
name=RA8876
|
||||
version=1.0.0
|
||||
author=Jaret Burkett / Gerhard Mutz
|
||||
maintainer=Gerhard Mutz
|
||||
sentence=Tasmota Library for RA8876 displays
|
||||
paragraph=Tasmota Library for RA8876 displays
|
||||
version=1.0.2
|
||||
author=Jaret Burkett
|
||||
maintainer=Jaret Burkett <jaretburkett@gmail.com>
|
||||
sentence=Library for RA8876 displays
|
||||
paragraph=Library for RA8876 displays
|
||||
category=Display
|
||||
url=https://github.com/arendst/Tasmota
|
||||
url=https://github.com/jaretburkett/ILI9488
|
||||
architectures=*
|
||||
|
|
|
@ -31,11 +31,9 @@ uint32_t Touch_Status(uint32_t sel);
|
|||
static bool touchscreen_read(struct _lv_indev_drv_t *indev_drv, lv_indev_data_t *data) {
|
||||
//lv_coord_t last_x = 0, last_y = 0;
|
||||
//static uint8_t release_count = 0;
|
||||
#if defined(USE_FT5206) || defined(USE_XPT2046)
|
||||
data->point.x = Touch_Status(1); // Last-pressed coordinates
|
||||
data->point.y = Touch_Status(2);
|
||||
data->state = Touch_Status(0);
|
||||
#endif
|
||||
return false; /*No buffering now so no more data read*/
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -2677,14 +2677,32 @@ void AddValue(uint8_t num,float fval) {
|
|||
* Touch panel control
|
||||
\*********************************************************************************************/
|
||||
|
||||
#if defined(USE_FT5206) || defined(USE_XPT2046)
|
||||
|
||||
bool FT5206_found = false;
|
||||
bool XPT2046_found = false;
|
||||
|
||||
int16_t touch_xp;
|
||||
int16_t touch_yp;
|
||||
bool touched;
|
||||
|
||||
uint32_t Touch_Status(uint32_t sel) {
|
||||
if (FT5206_found || XPT2046_found) {
|
||||
switch (sel) {
|
||||
case 0:
|
||||
return touched;
|
||||
case 1:
|
||||
return touch_xp;
|
||||
case 2:
|
||||
return touch_yp;
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(USE_FT5206) || defined(USE_XPT2046)
|
||||
|
||||
|
||||
#ifdef USE_M5STACK_CORE2
|
||||
uint8_t tbstate[3];
|
||||
#endif // USE_M5STACK_CORE2
|
||||
|
@ -2747,21 +2765,7 @@ int16_t XPT2046_y() {
|
|||
}
|
||||
#endif // USE_XPT2046
|
||||
|
||||
uint32_t Touch_Status(uint32_t sel) {
|
||||
if (FT5206_found || XPT2046_found) {
|
||||
switch (sel) {
|
||||
case 0:
|
||||
return touched;
|
||||
case 1:
|
||||
return touch_xp;
|
||||
case 2:
|
||||
return touch_yp;
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Touch_Check(void(*rotconvert)(int16_t *x, int16_t *y)) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue