esp32-smartdisplay
esp32-smartdisplay copied to clipboard
esp32-1732S019N Rotation 90/270 Broken
On the 1732S019N (ST7789 170x320), rotation 0 and 180 work properly, but 90 and 270 result in garbage thin horizontal dotted lines on the screen.
I'm using the lines from your sample code:
smartdisplay_init();
//__attribute__((unused)) auto disp = lv_disp_get_default();
lv_disp_set_rotation(disp, LV_DISP_ROTATION_90);
// lv_disp_set_rotation(disp, LV_DISP_ROTATION_180);
// lv_disp_set_rotation(disp, LV_DISP_ROTATION_270);
ui_init();
Are you using the demo? It the dimensions might be out of bounds and this might result in writing outside the buffer (this creating strange images)...
I reproduced this too.
The bug seems to be correlated with the DISPLAY_GAP_X and DISPLAY_GAP_Y defines in the board file. The board definition is in vertical mode (height > width) and sets DISPLAY_GAP_X=35 and DISPLAY_GAP_Y=0.
If you want to use it in horizontal mode you have to swap the gaps, setting DISPLAY_GAP_X=0 and DISPLAY_GAP_Y=35. Then in the app code you can set lv_disp_set_rotation(disp, LV_DISP_ROTATION_90) or lv_disp_set_rotation(disp, LV_DISP_ROTATION_270) and it will work correctly.
This is not ideal, maybe a solution could be to implement a custom rotation function that also sets the gaps with the function esp_lcd_panel_set_gap in the swapped order if the chosen orientation is 90 or 270.
Any progress on this as I have the same problem. Workaround from antlanc7 didn't fix it for me.
antlanc7' workaround didn't work for me (see previous post) but using his workaround as a clue, I came up with working display for 90 deg and 270 deg by using "'-D DISPLAY_GAP_X=-20'", "'-D DISPLAY_GAP_Y=35'".
Yeah it depends on the specific display you have.
These values work with the built-in display (170 x 240) of the ESP32-1732S019N board, the same one that started the ball rolling on this bug report