Description
I am using a sharp memory display that must write whole lines. I can use the rounding (v8) or invalidate area (v9) to force the area to the display width in portrait mode. If use landscape mode (eg flip horizontal and vertical values), I cannot force the height to a fixed value. I get invalid values in my flush callback for area.
What MCU/Processor/Board and compiler are you using?
nRF52840
What do you want to achieve?
I would like to find the correct way to round the display area in landscape mode for this display.
What have you tried so far?
I have tried various values to round the display to a fixed height in landscape mode, but this seems to give invalid areas. Portrait works correctly.
Code to reproduce
In portrait mode, this works perfectly. My display is 230 (w) x (302) (h) in portrait mode. I must write the full 230 in the flush callback. This works well, forcing the width always to 230 and allowing the height to vary based on what needs to be written.
#define DISP_HOR_RES 230
#define DISP_VER_RES 302
// Rounding boundaries used instatic void event_cb(lv_event_t * e)
a->x1 = 0;
a->x2 = DISP_HOR_RES - 1;
Current Issue: In landscape mode, I cannot force the area to a fixed height. The following code gives me an invalid flush area of x1=0 and x2 = 0 and a warning of:
""Can’t set draw_buf height using the round function. (Wrong round_cb or to "
“small draw_buf)”
But my buffer should be large enough as it is 230*302/2;
#define DISP_DIV 2
lv_disp_draw_buf_init(&draw_buf, buf1, NULL,
DISP_HOR_RES * DISP_VER_RES / DISP_DIV); /*Initialize the display buffer.*/
#define DISP_HOR_RES 302
#define DISP_VER_RES 230
// Rounding boundaries used in static void event_cb(lv_event_t * e)
a->y1 = 0;
a->y2 = DISP_VER_RES - 1;
Question: What is the correct way to force the display to update in vertical strips, using the full Y height with an arbitrary x width, as opposed to horizontal?