Skip to content
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

Proposal(s): support for display timeouts, introducing a local Error type #158

Open
eflukx opened this issue Jun 5, 2023 · 1 comment
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@eflukx
Copy link

eflukx commented Jun 5, 2023

I have an embedded device that may or may not have an EPD display connected. When the device is initialized without a display attached (but is not configured as such), the initialization routine hangs indefinitely waiting for the device to get 'idle'. Also this can happen when the display module is defective or not properly connected. As a faulty/not connected display is not a total failure in our use case, I would like to gracefully handle such cases.

For this I would like to introduce a timeout to the typical wait_until_idle functions (e.g. introduce wait_until_idle_with_timeout or have the timeout by default).

What makes this hard to do this properly, is that across the epd-waveshare library SPI::Error is used as the general error type, but now we also need to support errors like e.g. Timeout or DisplayNotFound. So the proposal here is to move away from using the external generic SPI::Error in this library and instead use a predefined local epd_waveshare::Error type or possibly an associated type to the WaveshareDisplay Trait.

I'm interested in your opinion on this!

@caemor
Copy link
Owner

caemor commented Sep 28, 2023

Sounds like a great idea!

For the error issue: The new eh-1.0 spi makes this easier since we can use https://docs.rs/embedded-hal/1.0.0-rc.1/embedded_hal/spi/enum.ErrorKind.html now.

@caemor caemor added enhancement New feature or request help wanted Extra attention is needed labels Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants