mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-11 04:51:31 +11:00
Merge pull request #472 from Sizurka/uart-rx-discard
Fix UART read error discard data
This commit is contained in:
commit
2b941db745
|
@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
(Non-blocking traits were moved to embedded-hal-nb, which is not yet supported)
|
(Non-blocking traits were moved to embedded-hal-nb, which is not yet supported)
|
||||||
- Implement UartConfig::new constructor method - @jannic
|
- Implement UartConfig::new constructor method - @jannic
|
||||||
- Deprecate uart::common_configs - @jannic
|
- Deprecate uart::common_configs - @jannic
|
||||||
|
- Fix spelling error in UART error discarded field - @Sizurka
|
||||||
|
|
||||||
## [0.6.0] - 2022-08-26
|
## [0.6.0] - 2022-08-26
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@ pub struct ReadError<'err> {
|
||||||
/// The type of error
|
/// The type of error
|
||||||
pub err_type: ReadErrorType,
|
pub err_type: ReadErrorType,
|
||||||
|
|
||||||
/// Reference to the data that was read but eventually discared because of the error.
|
/// Reference to the data that was read but eventually discarded because of the error.
|
||||||
pub discared: &'err [u8],
|
pub discarded: &'err [u8],
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Possible types of read errors. See Chapter 4, Section 2 §8 - Table 436: "UARTDR Register"
|
/// Possible types of read errors. See Chapter 4, Section 2 §8 - Table 436: "UARTDR Register"
|
||||||
|
@ -149,7 +149,7 @@ pub(crate) fn read_raw<'b, D: UartDevice>(
|
||||||
if let Some(err_type) = error {
|
if let Some(err_type) = error {
|
||||||
return Err(Other(ReadError {
|
return Err(Other(ReadError {
|
||||||
err_type,
|
err_type,
|
||||||
discared: buffer,
|
discarded: &buffer[..bytes_read],
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue