mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 20:56:35 +00:00
LVGL fix byte order for DMA and non-DMA (#11897)
Co-authored-by: Stephan Hadinger <stephan.hadinger@gmail.com>
This commit is contained in:
parent
589ccb0f2f
commit
7cb30b07da
@ -1064,6 +1064,8 @@ void uDisplay::pushColors(uint16_t *data, uint16_t len, boolean first) {
|
|||||||
if (lvgl_param.use_dma) {
|
if (lvgl_param.use_dma) {
|
||||||
pushPixelsDMA(data, len );
|
pushPixelsDMA(data, len );
|
||||||
} else {
|
} else {
|
||||||
|
// reversed order for DMA, so non-DMA needs to get back to normal order
|
||||||
|
for (uint32_t i = 0; i < len; i++) (data[i] = data[i] << 8 | data[i] >> 8);
|
||||||
uspi->writePixels(data, len * 2);
|
uspi->writePixels(data, len * 2);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1923,11 +1925,6 @@ void uDisplay::pushPixelsDMA(uint16_t* image, uint32_t len) {
|
|||||||
|
|
||||||
dmaWait();
|
dmaWait();
|
||||||
|
|
||||||
/*
|
|
||||||
if(_swapBytes) {
|
|
||||||
for (uint32_t i = 0; i < len; i++) (image[i] = image[i] << 8 | image[i] >> 8);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
esp_err_t ret;
|
esp_err_t ret;
|
||||||
|
|
||||||
memset(&trans, 0, sizeof(spi_transaction_t));
|
memset(&trans, 0, sizeof(spi_transaction_t));
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
* Useful if the display has a 8 bit interface (e.g. SPI)*/
|
* Useful if the display has a 8 bit interface (e.g. SPI)*/
|
||||||
// #define LV_COLOR_16_SWAP 1
|
// #define LV_COLOR_16_SWAP 1
|
||||||
// #if defined(ADAFRUIT_PYPORTAL)
|
// #if defined(ADAFRUIT_PYPORTAL)
|
||||||
// #define LV_COLOR_16_SWAP 1
|
#define LV_COLOR_16_SWAP 1 // needed for DMA transfer
|
||||||
// #else
|
// #else
|
||||||
// #define LV_COLOR_16_SWAP 0
|
// #define LV_COLOR_16_SWAP 0
|
||||||
// #endif
|
// #endif
|
||||||
|
@ -168,7 +168,7 @@ void lv_flush_callback(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *c
|
|||||||
|
|
||||||
lv_disp_flush_ready(disp);
|
lv_disp_flush_ready(disp);
|
||||||
|
|
||||||
if (pixels_len >= 10000) {
|
if (pixels_len >= 10000 && (!display->lvgl_param.use_dma)) {
|
||||||
AddLog(LOG_LEVEL_DEBUG, D_LOG_LVGL "Refreshed %d pixels in %d ms (%i pix/ms)", pixels_len, chrono_time,
|
AddLog(LOG_LEVEL_DEBUG, D_LOG_LVGL "Refreshed %d pixels in %d ms (%i pix/ms)", pixels_len, chrono_time,
|
||||||
chrono_time > 0 ? pixels_len / chrono_time : -1);
|
chrono_time > 0 ? pixels_len / chrono_time : -1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user