Skip to content

Commit

Permalink
Split UART errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Feb 14, 2025
1 parent 0138d46 commit e74430a
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 48 deletions.
1 change: 1 addition & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Uart `write_bytes` and `read_bytes` are now blocking and return the number of bytes written/read (#2882)
- Uart `read_bytes` is now blocking returns the number of bytes read (#2882)
- Uart `flush` is now blocking (#2882)
- Uart errors have been split into `RxError` and `TxError`. A combined `IoError` has been created for embedded-io. (#3???)
- Removed `embedded-hal-nb` traits (#2882)
- `timer::wait` is now blocking (#2882)
- By default, set `tx_idle_num` to 0 so that bytes written to TX FIFO are always immediately transmitted. (#2859)
Expand Down
10 changes: 10 additions & 0 deletions esp-hal/MIGRATING-0.23.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ e.g.
+ uart.read_bytes(&mut byte);
```

### UART errors have been split into `TxError` and `RxError`.

`read_*` and `write_*` functions now return different types. In practice this means you no longer
need to check for RX errors that can't be returned by `write_*`.

The error type used by `embedded-io` has been updated to reflect this. A new `IoError` enum has been
added for `embedded-io` errors associated to the unsplit `Uart` driver. On `Uart` (but not `UartRx`
or `UartTx`) TX-related trait methods return `IoError::Tx(TxError)`, while RX-related methods return
`IoError::Rx(RxError)`.

### UART halves have their configuration split too

`Uart::Config` structure now contains separate `RxConfig` and `TxConfig`:
Expand Down
Loading

0 comments on commit e74430a

Please sign in to comment.