From b917a9388c108cc5c62eef69df29a1992a2c908d Mon Sep 17 00:00:00 2001 From: Jesse Braham Date: Mon, 6 Jan 2025 12:39:07 +0100 Subject: [PATCH] Update migration guide --- esp-hal/MIGRATING-0.22.md | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/esp-hal/MIGRATING-0.22.md b/esp-hal/MIGRATING-0.22.md index b88c6e30277..6e2d8a256ff 100644 --- a/esp-hal/MIGRATING-0.22.md +++ b/esp-hal/MIGRATING-0.22.md @@ -199,7 +199,7 @@ is enabled. To retrieve the address and size of the initialized external memory, The usage of `esp_alloc::psram_allocator!` remains unchanged. -## embedded-hal 0.2.* is not supported anymore. +## embedded-hal 0.2.\* is not supported anymore. As per https://github.com/rust-embedded/embedded-hal/pull/640, our driver no longer implements traits from `embedded-hal 0.2.x`. Analogs of all traits from the above mentioned version are available in `embedded-hal 1.x.x` @@ -325,15 +325,15 @@ The reexports that were previously part of the prelude are available through oth - `ExtU64` and `RateExtU32` have been moved to `esp_hal::time` - `Clock` and `CpuClock`: `esp_hal::clock::{Clock, CpuClock}` - The following traits need to be individually imported when needed: - - `esp_hal::analog::dac::Instance` - - `esp_hal::gpio::Pin` - - `esp_hal::ledc::channel::ChannelHW` - - `esp_hal::ledc::channel::ChannelIFace` - - `esp_hal::ledc::timer::TimerHW` - - `esp_hal::ledc::timer::TimerIFace` - - `esp_hal::timer::timg::TimerGroupInstance` - - `esp_hal::timer::Timer` - - `esp_hal::interrupt::InterruptConfigurable` + - `esp_hal::analog::dac::Instance` + - `esp_hal::gpio::Pin` + - `esp_hal::ledc::channel::ChannelHW` + - `esp_hal::ledc::channel::ChannelIFace` + - `esp_hal::ledc::timer::TimerHW` + - `esp_hal::ledc::timer::TimerIFace` + - `esp_hal::timer::timg::TimerGroupInstance` + - `esp_hal::timer::Timer` + - `esp_hal::interrupt::InterruptConfigurable` - The `entry` macro can be imported as `esp_hal::entry`, while other macros are found under `esp_hal::macros` ## `AtCmdConfig` now uses builder-lite pattern @@ -343,11 +343,10 @@ The reexports that were previously part of the prelude are available through oth + uart0.set_at_cmd(AtCmdConfig::default().with_cmd_char(b'#')); ``` - ## Crate configuration changes To prevent ambiguity between configurations, we had to change the naming format of configuration -keys. Before, we used `{prefix}_{key}`, which meant that esp-hal and esp-hal-* configuration keys +keys. Before, we used `{prefix}_{key}`, which meant that esp-hal and esp-hal-\* configuration keys were impossible to tell apart. To fix this issue, we are changing the separator from one underscore character to `_CONFIG_`. This also means that users will have to change their `config.toml` configurations to match the new format. @@ -370,3 +369,16 @@ The `Config` struct's setters are now prefixed with `with_`. `parity_none`, `par - .parity_even(); + .with_parity(Parity::Even); ``` + +The `DataBits`, `Parity`, and `StopBits` enum variants are no longer prefixed with the name of the enum. + +e.g.) + +```diff +- DataBits::DataBits8 ++ DataBits::_8 +- Parity::ParityNone ++ Parity::None +- StopBits::Stop1 ++ StopBits::_1 +```