Skip to content

[RFC] Should we add methods to clear errors?Β #85

Open
@therealprof

Description

@therealprof

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:

  1. Have each HAL implementation create their own custom method to do this
  2. Automatically clear the error in hardware before returning it
  3. 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.

CC @japaric @hannobraun @thejpster @astro @ilya-epifanov

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions