-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exponential backoff for timeout and Rotation functionality. #8
Conversation
For M5EPD display often times out on big operations. This mitigates it by setting it configurable. Additionaly, I beleive EpsDelay implementation does busy-loop uncinditionally, however esp_idf_svc::hal::delay::Delay conditionally flips to FreeRtos task based delay, once delay interval is past tick threshold. Adding exponential backoff here, enables other tasks in free-rtos proceed on longer waits.
Allows to draw on a rotated screen. Images passed in load_image_area are rotated by the controller automatically, while display_area calls perform rotation via software for consumer convinience. Tested on M5EPD, rotated 90 degrees.
Hi, rotation is a great feature, thanks for implementing. We do have timeout issues on the busy wait too, but no solution yet. (on esp32c3 with esp32-hal) I'll not be able to test your code till next thursday. The CI shows some clippy warnings, could you fix them? |
Interesting, never noticed that on mine, sleep/wakeup cycle works fine as well. However, at times takes up to ~600ms.
Completely missed that clippy exists, thanks, fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall i dont think exposing MemoryConverterSettings as whole is a good approach for the normal embedded_graphics user.
It allows the user of the API to set random values for e.g. endians and bit per pixel, and the impl for embedded_graphics does not check if the settings are correctly set.
Instead we should provide a dedicated rotation setting.
Yes, lets add an Rotation Enum for the Display Rotation and add it to the the config struct.
Am 10. Januar 2025 18:13:12 MEZ schrieb kolupaev ***@***.***>:
…
@kolupaev commented on this pull request.
> @@ -127,18 +127,43 @@ pub struct IT8951<IT8951Interface, State> {
dev_info: Option<DevInfo>,
marker: core::marker::PhantomData<State>,
config: Config,
+ memory_converter_settings: MemoryConverterSetting,
Good point, I'll see how separate enum would work out. Initially wanted to minimize new entities and reuse as much as possible to minimize api changes. You are onboard with a new enum for public surface API?
--
Reply to this email directly or view it on GitHub:
#8 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
Looks good. |
Thanks, pushed a commit with format-fix. |
Many thanks for your contribution. |
Happy to help! |
Hi,
Was using your library for M5EPD, and it worked perfectly, except 2 minor features:
Anyhow, here is a pull request. I've tried to minimize modifications to the public interfaces, however to prevent extra copying needed to make some. However I don't think it will break any code.
I took liberty to add a bit more logging to simplify debugging, which is disabled by default (via log-max-level).
Rotation itself ported from M5EPD driver (see https://github.com/m5stack/M5EPD/blob/main/src/M5EPD_Driver.cpp#L368 )
Example use:
Code is tested on M5EPD (0, and 90 rotation), and works as expected.