You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current sleep API feels a bit icky. Some ideas for improvement:
Add prepare method to trait, use associated type for parameters.
Provide module-level sleep function for convenience, so the user doesn't need the two-step sleep.
Deep power-down mode resets the microcontroller upon wake-up. This means a sleep function based on that mode needs to return ! instead of (). The Sleep trait should have an associated type to define the return type.
Think about Clock: Should it be an associated type instead of a type parameter?
Once the API has matured a bit, it can be submitted to embedded-hal.
The text was updated successfully, but these errors were encountered:
I'm not sure if this is suitable for embedded-hal at all, as a sleep API is blocking by nature. It might be undesirable to have anything beyond timers and power modes in there.
I think it's best to defer this until a power mode API has been fleshed out and submitted, then think about this issue later on.
I'm removing the upstream label. I aleady expressed doubts on whether this should be submitted to embedded-hal, and in addition, embedded-hal has gained a sleep API in the meantime.
If we come up with something worthwhile, we can think about submitting it to embedded-hal later. For now, this issue is only about improving the sleep API in this crate.
The current sleep API feels a bit icky. Some ideas for improvement:
prepare
method to trait, use associated type for parameters.!
instead of()
. TheSleep
trait should have an associated type to define the return type.Clock
: Should it be an associated type instead of a type parameter?Once the API has matured a bit, it can be submitted to embedded-hal.
The text was updated successfully, but these errors were encountered: