Skip to content

Commit d6fb13b

Browse files
committed
Upgrade to Rust 2024 throughout workspace
Includes a combination of formatting changes and fixes for the new edition.
1 parent 7163f0b commit d6fb13b

24 files changed

Lines changed: 61 additions & 85 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ are still exposed when building with a chip feature.
6767
**BREAKING** Remove the `timer` module, including most embedded-hal 0.2 blocking
6868
delay implementations.
6969

70+
**BREAKING** Upgrade to Rust 2024.
71+
7072
Introduce an `imxrt1180` feature to support the RT1180 series.
7173

7274
Add a `defmt` feature targeting version 0.3. When enabled, select imxrt-hal

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ repository = "https://github.com/imxrt-rs/imxrt-hal"
118118
keywords = ["imxrt", "nxp", "embedded", "no_std", "embedded-hal"]
119119
categories = ["embedded", "no-std"]
120120
license = "MIT OR Apache-2.0"
121-
edition = "2021"
121+
edition = "2024"
122122

123123
[profile.dev]
124124
opt-level = 1

board/src/imxrt1010evk.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,9 @@ pub(crate) const CLOCK_GATES: &[clock_gate::Locator] = &[
300300
/// set alternates here.
301301
fn configure_pins(
302302
super::Pads {
303-
ref mut gpio,
304-
ref mut gpio_sd,
305-
ref mut gpio_ad,
303+
gpio,
304+
gpio_sd,
305+
gpio_ad,
306306
..
307307
}: &mut super::Pads,
308308
) {

board/src/imxrt1060evk.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ pub(crate) const CLOCK_GATES: &[clock_gate::Locator] = &[
255255
/// set alternates here.
256256
fn configure_pins(
257257
super::Pads {
258-
ref mut gpio_ad_b1,
259-
ref mut gpio_sd_b0,
258+
gpio_ad_b1,
259+
gpio_sd_b0,
260260
..
261261
}: &mut super::Pads,
262262
) {

board/src/imxrt10xx/clock.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
//! API, so we'll revisit this separation later.
77
88
use super::clock_tree;
9-
use crate::{board_impl, hal, ral, GPT1_DIVIDER, GPT2_DIVIDER, RUN_MODE};
9+
use crate::{GPT1_DIVIDER, GPT2_DIVIDER, RUN_MODE, board_impl, hal, ral};
1010

1111
/// Configure board clocks and power.
1212
///
1313
/// # Safety
1414
///
1515
/// Pokes at MMIO. Should only be done once.
1616
pub(crate) unsafe fn configure() {
17-
let mut ccm = ral::ccm::CCM::instance();
18-
let mut ccm_analog = ral::ccm_analog::CCM_ANALOG::instance();
19-
let mut dcdc = ral::dcdc::DCDC::instance();
17+
let mut ccm = unsafe { ral::ccm::CCM::instance() };
18+
let mut ccm_analog = unsafe { ral::ccm_analog::CCM_ANALOG::instance() };
19+
let mut dcdc = unsafe { ral::dcdc::DCDC::instance() };
2020

2121
hal::ccm::set_low_power_mode(&mut ccm, hal::ccm::LowPowerMode::RemainInRun);
2222
super::power::set_target_power(&mut dcdc, RUN_MODE);

board/src/imxrt10xx/clock_tree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
1313
pub(crate) use super::ahb::{ahb_frequency, configure_ahb_ipg};
1414
use crate::{
15+
RunMode,
1516
hal::ccm::{
16-
analog, clock_gate, lpi2c_clk, lpspi_clk, perclk_clk, sai_clk, uart_clk, XTAL_OSCILLATOR_HZ,
17+
XTAL_OSCILLATOR_HZ, analog, clock_gate, lpi2c_clk, lpspi_clk, perclk_clk, sai_clk, uart_clk,
1718
},
1819
ral::ccm::CCM,
19-
RunMode,
2020
};
2121

2222
pub(crate) const fn ipg_divider(run_mode: RunMode) -> u32 {

board/src/imxrt10xx/clock_tree/pll1_ahb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! It supports the 1060. It should also support the 1050.
44
55
use crate::ral;
6-
use crate::{hal::ccm, RunMode};
6+
use crate::{RunMode, hal::ccm};
77

88
/// Specify the PLL1 DIV_SEL for a given run mode.
99
const fn div_sel(run_mode: RunMode) -> u32 {

board/src/imxrt10xx/clock_tree/pll6_ahb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//! - if an ARM divider exists, it's set to 1.
77
//! - if a PERIPH_CLK2 divider exists, it's set to 1.
88
9-
use crate::{hal::ccm, ral, RunMode};
9+
use crate::{RunMode, hal::ccm, ral};
1010

1111
/// Specify the AHB divider for a given run mode.
1212
const fn ahb_divider(run_mode: RunMode) -> u32 {

board/src/imxrt10xx/power.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{hal::dcdc, ral, RunMode};
1+
use crate::{RunMode, hal::dcdc, ral};
22

33
/// Set the target power for the provided `run_mode`.
44
pub fn set_target_power(dcdc: &mut ral::dcdc::DCDC, run_mode: RunMode) {

board/src/imxrt1170evk-cm7.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! i.MX RT 1170 EVK board configuration, supporting CM7 applications.
22
3-
use crate::{hal, iomuxc::imxrt1170 as iomuxc, ral, GPT1_DIVIDER, GPT2_DIVIDER, RUN_MODE};
3+
use crate::{GPT1_DIVIDER, GPT2_DIVIDER, RUN_MODE, hal, iomuxc::imxrt1170 as iomuxc, ral};
44

55
mod imxrt11xx {
66
pub(super) mod clock_tree;
@@ -39,7 +39,7 @@ const CLOCK_GATES: &[clock_gate::Locator] = &[
3939
];
4040

4141
pub(crate) unsafe fn configure() {
42-
let mut ccm = ral::ccm::CCM::instance();
42+
let mut ccm = unsafe { ral::ccm::CCM::instance() };
4343

4444
prepare_clock_tree(&mut ccm);
4545
CLOCK_GATES

0 commit comments

Comments
 (0)