@@ -237,10 +237,8 @@ static UINT tjd_output(
237
237
}
238
238
}
239
239
240
- // ESP_LOGI(TAG, "x1:%d y1:%d x2:%d y2:%d\n", dleft, dtop, dright, dbottom);
241
- tft->transmitCmdData (LCD_CASET, MAKEWORD (dleft >> 8 , dleft & 0xFF , dright >> 8 , dright & 0xFF ));
242
- tft->transmitCmdData (LCD_PASET, MAKEWORD (dtop >> 8 , dtop & 0xFF , dbottom >> 8 , dbottom & 0xFF ));
243
- tft->transmitCmd (LCD_RAMWR); // write to RAM
240
+ // ESP_LOGI(TAG, "x1:%d x2:%d y1:%d y2:%d\n", dleft, dright, dtop, dbottom);
241
+ tft->setAddrWindow (dleft, dtop, dright, dbottom);
244
242
245
243
uint16_t *p = (uint16_t *)malloc (sizeof (uint16_t ) * len);
246
244
if (!p) {
@@ -250,7 +248,7 @@ static UINT tjd_output(
250
248
for (uint32_t i = 0 ; i < len; i++) {
251
249
p[i] = tft->color565 (dev->linbuf [dev->linbuf_idx ][i].r , dev->linbuf [dev->linbuf_idx ][i].g , dev->linbuf [dev->linbuf_idx ][i].b );
252
250
}
253
- tft->_fastSendBuf (p, len);
251
+ tft->_fastSendBuf (p, len, true ); // TODO: Swapping bytes directly in the camera register could enhance display
254
252
free (p);
255
253
256
254
dev->linbuf_idx = ((dev->linbuf_idx + 1 ) & 1 );
@@ -450,7 +448,7 @@ void lvgl_lcd_hal_init()
450
448
451
449
/* screen initialize*/
452
450
tft->invertDisplay (true );
453
- tft->setRotation (0 );
451
+ tft->setRotation (2 ); // rotation needed if camera is on the back of the device
454
452
tft->fillScreen (COLOR_BLACK);
455
453
456
454
lv_disp_drv_t disp_drv; /* Descriptor of a display driver*/
0 commit comments