Open
Description
I've just discovered that the nice errors we may create in HAL implementations have no standard way to get cleared which often means that the peripheral is stuck in that error.
E.g. If we use a hal::serial:Read
implementation we may get an Error::Overrun
reported by the implementation but without clearing the error flag in the MCU peripheral, any consecutive calls will return the same error over and over again.
There're three ways to address this:
- Have each HAL implementation create their own custom method to do this
- Automatically clear the error in hardware before returning it
- Add a method to the HAL traits allowing the user to clear errors
2.) and 3.) have a set of pros and cons attached to them so I'd like to feel public opinion on this.