zmkfirmware / zmk

ZMK Firmware Repository
https://zmk.dev/
MIT License
2.48k stars 2.56k forks source link

Software Rotation Fails for Monochrome Displays #1749

Open Nicell opened 1 year ago

Nicell commented 1 year ago

Currently, if you try to turn on LVGL software rotation (sw_rotate), it fails on monochrome displays like the SSD1306 OLEDs and LS011xx nice!views.

Why? It seems from a quick look that the software rotation code on LVGL's side doesn't like how the Zephyr glue code packs the monochrome display bits.

What should we do? I haven't looked closely, but it seems that either the Zephyr glue code could be updated to allow for LVGL's software rotation to work nicely together or LVGL's software rotation could somehow be updated to work with monochrome bit packing.

Related issues: https://github.com/zephyrproject-rtos/zephyr/issues/46446 https://github.com/lvgl/lvgl/issues/3414

rainhood commented 4 months ago

Hey, do you know if there is a quick fix for this? I have been reading the other issues and the patche mentioned don't seem applicable to the current version of Zephyr.

caksoylar commented 4 months ago

For nice!view Nicell ended up using a canvas then rotating it 90 degrees before drawing: https://github.com/zmkfirmware/zmk/blob/c9c620d19f603ea0c9d4264eff885912803ff74d/app/boards/shields/nice_view/widgets/util.c#L13