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

Split UART errors #3138

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ 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. (#3138)
- `{Uart, UartTx}::flush()` is now fallible. (#3138)
- 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
Loading