diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md
index 2768261da..5e19c7caa 100644
--- a/esp-hal/CHANGELOG.md
+++ b/esp-hal/CHANGELOG.md
@@ -14,7 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- i2c: i2c1_handler used I2C0 register block by mistake (#1487)
-- Smart LEDs docs example (#1504)
+- Removed ESP32 specific code for resolutions > 16 bit in ledc embedded_hal::pwm max_duty_cycle function. (#1441)
+- Fixed division by zero in ledc embedded_hal::pwm set_duty_cycle function and converted to set_duty_hw instead of set_duty to eliminate loss of granularity. (#1441)
### Changed
@@ -23,9 +24,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `IO`, `ADC`, `DAC`, `RTC*`, `LEDC`, `PWM` and `PCNT` drivers have been converted to camel case format (#1473)
- RNG is no longer TRNG, the `CryptoRng` implementation has been removed. To track this being re-added see #1499 (#1498)
- Make software interrupts shareable (#1500)
+- The `SystemParts` struct has been renamed to `SystemControl`, and now has a constructor which takes the `SYSTEM` peripheral (#1495)
### Removed
+- Removed the `SystemExt` trait (#1495)
+
## [0.17.0] - 2024-04-18
### Added
@@ -62,8 +66,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed writes to SPI not flushing before attempting to write, causing corrupted writes (#1381)
- fix AdcConfig::adc_calibrate for xtensa targets (#1379)
- Fixed a divide by zero panic when setting the LEDC duty cycle to 0 with `SetDutyCycle::set_duty_cycle` (#1403)
-- Fix for issue #1419. Removed ESP32 specific code for resolutions > 16 bit in ledc embedded_hal::pwm max_duty_cycle function.
-- Fix for issue #1419. Fixed division by zero in ledc embedded_hal::pwm set_duty_cycle function and converted to set_duty_hw instead of set_duty to eliminate loss of granularity.
- Support 192 and 256-bit keys for AES (#1316)
- Fixed MCPWM DeadTimeCfg bit values (#1378)
- ESP32 LEDC `set_duty_cycle` used HighSpeedChannel for LowSpeedChannel (#1457)
diff --git a/esp-hal/src/prelude.rs b/esp-hal/src/prelude.rs
index ea4518c14..0475184ef 100644
--- a/esp-hal/src/prelude.rs
+++ b/esp-hal/src/prelude.rs
@@ -36,8 +36,6 @@ pub use crate::ledc::{
},
timer::{TimerHW as _esp_hal_ledc_timer_TimerHW, TimerIFace as _esp_hal_ledc_timer_TimerIFace},
};
-#[cfg(any(dport, pcr, system))]
-pub use crate::system::SystemExt as _esp_hal_system_SystemExt;
#[cfg(any(timg0, timg1))]
pub use crate::timer::{
Instance as _esp_hal_timer_Instance,
diff --git a/esp-hal/src/system.rs b/esp-hal/src/system.rs
index 3c4843c7e..d28398818 100755
--- a/esp-hal/src/system.rs
+++ b/esp-hal/src/system.rs
@@ -23,7 +23,7 @@
//! ## Example
//! ```no_run
//! let peripherals = Peripherals::take();
-//! let system = peripherals.SYSTEM.split();
+//! let system = SystemControl::new(peripherals.SYSTEM);
//! let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
//! ```
@@ -99,9 +99,30 @@ pub enum Peripheral {
LcdCam,
}
+/// The `DPORT`/`PCR`/`SYSTEM` peripheral split into its different logical
+/// components.
+pub struct SystemControl<'d> {
+ _inner: PeripheralRef<'d, SYSTEM>,
+ pub clock_control: SystemClockControl,
+ pub software_interrupt_control: SoftwareInterruptControl,
+}
+
+impl<'d> SystemControl<'d> {
+ /// Construct a new instance of [`SystemControl`].
+ pub fn new(system: impl crate::peripheral::Peripheral
+ 'd) -> Self {
+ crate::into_ref!(system);
+
+ Self {
+ _inner: system,
+ clock_control: SystemClockControl::new(),
+ software_interrupt_control: SoftwareInterruptControl::new(),
+ }
+ }
+}
+
/// A software interrupt can be triggered by software.
#[non_exhaustive]
-pub struct SoftwareInterrupt {}
+pub struct SoftwareInterrupt;
impl SoftwareInterrupt {
/// Sets the interrupt handler for this software-interrupt
@@ -192,7 +213,7 @@ impl SoftwareInterrupt {
/// time.
#[inline]
pub unsafe fn steal() -> Self {
- Self {}
+ Self
}
}
@@ -221,17 +242,17 @@ pub struct SoftwareInterruptControl {
}
impl SoftwareInterruptControl {
- fn new_internal() -> Self {
+ fn new() -> Self {
// the thread-executor uses SW-INT0 when used on a multi-core system
// we cannot easily require `software_interrupt0` there since it's created
// before `main` via proc-macro
SoftwareInterruptControl {
#[cfg(not(all(feature = "embassy-executor-thread", multi_core)))]
- software_interrupt0: SoftwareInterrupt {},
- software_interrupt1: SoftwareInterrupt {},
- software_interrupt2: SoftwareInterrupt {},
- software_interrupt3: SoftwareInterrupt {},
+ software_interrupt0: SoftwareInterrupt,
+ software_interrupt1: SoftwareInterrupt,
+ software_interrupt2: SoftwareInterrupt,
+ software_interrupt3: SoftwareInterrupt,
}
}
}
@@ -1077,6 +1098,29 @@ pub struct SystemClockControl {
_private: (),
}
+impl SystemClockControl {
+ pub fn new() -> Self {
+ Self { _private: () }
+ }
+}
+
+impl Default for SystemClockControl {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
+impl crate::peripheral::Peripheral for SystemClockControl {
+ type P = SystemClockControl;
+
+ #[inline]
+ unsafe fn clone_unchecked(&mut self) -> Self::P {
+ SystemClockControl { _private: () }
+ }
+}
+
+impl crate::private::Sealed for SystemClockControl {}
+
/// Enumeration of the available radio peripherals for this chip.
#[cfg(any(bt, ieee802154, wifi))]
pub enum RadioPeripherals {
@@ -1110,42 +1154,3 @@ pub trait RadioClockController {
fn reset_rpa(&mut self);
}
-
-/// The SYSTEM/DPORT splitted into it's different logical parts.
-pub struct SystemParts<'d> {
- _private: PeripheralRef<'d, SYSTEM>,
- pub clock_control: SystemClockControl,
- pub software_interrupt_control: SoftwareInterruptControl,
-}
-
-/// Extension trait to split a SYSTEM/DPORT peripheral in independent logical
-/// parts
-pub trait SystemExt<'d> {
- type Parts;
-
- /// Splits the SYSTEM/DPORT peripheral into it's parts.
- fn split(self) -> Self::Parts;
-}
-
-impl<'d, T: crate::peripheral::Peripheral + 'd> SystemExt<'d> for T {
- type Parts = SystemParts<'d>;
-
- fn split(self) -> Self::Parts {
- Self::Parts {
- _private: self.into_ref(),
- clock_control: SystemClockControl { _private: () },
- software_interrupt_control: SoftwareInterruptControl::new_internal(),
- }
- }
-}
-
-impl crate::peripheral::Peripheral for SystemClockControl {
- type P = SystemClockControl;
-
- #[inline]
- unsafe fn clone_unchecked(&mut self) -> Self::P {
- SystemClockControl { _private: () }
- }
-}
-
-impl crate::private::Sealed for SystemClockControl {}
diff --git a/examples/src/bin/adc.rs b/examples/src/bin/adc.rs
index a8b0722b4..399807bb2 100644
--- a/examples/src/bin/adc.rs
+++ b/examples/src/bin/adc.rs
@@ -17,13 +17,14 @@ use esp_hal::{
gpio::Io,
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
};
use esp_println::println;
#[entry]
fn main() -> ! {
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
diff --git a/examples/src/bin/adc_cal.rs b/examples/src/bin/adc_cal.rs
index c69518903..8a2c9e957 100644
--- a/examples/src/bin/adc_cal.rs
+++ b/examples/src/bin/adc_cal.rs
@@ -15,13 +15,14 @@ use esp_hal::{
gpio::Io,
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
};
use esp_println::println;
#[entry]
fn main() -> ! {
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
diff --git a/examples/src/bin/advanced_serial.rs b/examples/src/bin/advanced_serial.rs
index 2236ba7a0..c19f27a02 100644
--- a/examples/src/bin/advanced_serial.rs
+++ b/examples/src/bin/advanced_serial.rs
@@ -19,6 +19,7 @@ use esp_hal::{
gpio::Io,
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
uart::{config::Config, TxRxPins, Uart},
};
use esp_println::println;
@@ -27,7 +28,7 @@ use nb::block;
#[entry]
fn main() -> ! {
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
diff --git a/examples/src/bin/blinky.rs b/examples/src/bin/blinky.rs
index 4704ee3c7..27d2d00d3 100644
--- a/examples/src/bin/blinky.rs
+++ b/examples/src/bin/blinky.rs
@@ -8,12 +8,19 @@
#![no_main]
use esp_backtrace as _;
-use esp_hal::{clock::ClockControl, delay::Delay, gpio::Io, peripherals::Peripherals, prelude::*};
+use esp_hal::{
+ clock::ClockControl,
+ delay::Delay,
+ gpio::Io,
+ peripherals::Peripherals,
+ prelude::*,
+ system::SystemControl,
+};
#[entry]
fn main() -> ! {
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
// Set GPIO0 as an output, and set its state high initially.
diff --git a/examples/src/bin/blinky_erased_pins.rs b/examples/src/bin/blinky_erased_pins.rs
index 984f14030..9864fa524 100644
--- a/examples/src/bin/blinky_erased_pins.rs
+++ b/examples/src/bin/blinky_erased_pins.rs
@@ -17,12 +17,13 @@ use esp_hal::{
gpio::{AnyPin, Input, Io, Output, PullDown, PushPull},
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
};
#[entry]
fn main() -> ! {
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
diff --git a/examples/src/bin/clock_monitor.rs b/examples/src/bin/clock_monitor.rs
index a72f68608..3c080be47 100644
--- a/examples/src/bin/clock_monitor.rs
+++ b/examples/src/bin/clock_monitor.rs
@@ -11,7 +11,13 @@ use core::cell::RefCell;
use critical_section::Mutex;
use esp_backtrace as _;
-use esp_hal::{clock::ClockControl, peripherals::Peripherals, prelude::*, rtc_cntl::Rtc};
+use esp_hal::{
+ clock::ClockControl,
+ peripherals::Peripherals,
+ prelude::*,
+ rtc_cntl::Rtc,
+ system::SystemControl,
+};
use esp_println::println;
static RTC: Mutex>> = Mutex::new(RefCell::new(None));
@@ -19,7 +25,7 @@ static RTC: Mutex>> = Mutex::new(RefCell::new(None));
#[entry]
fn main() -> ! {
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let mut rtc = Rtc::new(peripherals.LPWR, Some(interrupt_handler));
diff --git a/examples/src/bin/crc.rs b/examples/src/bin/crc.rs
index 4b2d6c0bc..9cd9727a9 100644
--- a/examples/src/bin/crc.rs
+++ b/examples/src/bin/crc.rs
@@ -14,13 +14,14 @@ use esp_hal::{
peripherals::Peripherals,
prelude::*,
rom::{crc, md5},
+ system::SystemControl,
uart::Uart,
};
#[entry]
fn main() -> ! {
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let delay = Delay::new(&clocks);
diff --git a/examples/src/bin/dac.rs b/examples/src/bin/dac.rs
index ede3d334e..4eb86ddb0 100644
--- a/examples/src/bin/dac.rs
+++ b/examples/src/bin/dac.rs
@@ -19,12 +19,13 @@ use esp_hal::{
gpio::Io,
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
};
#[entry]
fn main() -> ! {
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
diff --git a/examples/src/bin/debug_assist.rs b/examples/src/bin/debug_assist.rs
index a648f24f0..f0d969870 100644
--- a/examples/src/bin/debug_assist.rs
+++ b/examples/src/bin/debug_assist.rs
@@ -16,6 +16,7 @@ use esp_hal::{
clock::ClockControl,
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
};
use esp_println::println;
@@ -24,7 +25,7 @@ static DA: Mutex>> = Mutex::new(RefCell::new(None));
#[entry]
fn main() -> ! {
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let _clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let mut da = DebugAssist::new(peripherals.ASSIST_DEBUG, Some(interrupt_handler));
diff --git a/examples/src/bin/direct_vectoring.rs b/examples/src/bin/direct_vectoring.rs
index 2b063a217..3f2a5fd70 100644
--- a/examples/src/bin/direct_vectoring.rs
+++ b/examples/src/bin/direct_vectoring.rs
@@ -11,7 +11,7 @@ use esp_hal::{
interrupt::{self, CpuInterrupt, Priority},
peripherals::{Interrupt, Peripherals},
prelude::*,
- system::SoftwareInterrupt,
+ system::{SoftwareInterrupt, SystemControl},
};
static SWINT0: Mutex>>> = Mutex::new(RefCell::new(None));
@@ -28,7 +28,7 @@ fn main() -> ! {
}
let sw0_trigger_addr = cpu_intr.cpu_intr_from_cpu_0() as *const _ as u32;
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let sw_int = system.software_interrupt_control;
critical_section::with(|cs| {
diff --git a/examples/src/bin/embassy_hello_world.rs b/examples/src/bin/embassy_hello_world.rs
index bd92de2fc..6506df51e 100644
--- a/examples/src/bin/embassy_hello_world.rs
+++ b/examples/src/bin/embassy_hello_world.rs
@@ -18,6 +18,7 @@ use esp_hal::{
embassy::{self},
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
timer::TimerGroup,
};
@@ -33,7 +34,7 @@ async fn run() {
async fn main(spawner: Spawner) {
esp_println::println!("Init!");
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let timg0 = TimerGroup::new_async(peripherals.TIMG0, &clocks);
diff --git a/examples/src/bin/embassy_hello_world_systimer.rs b/examples/src/bin/embassy_hello_world_systimer.rs
index d3ecb4f41..af3c11aa7 100644
--- a/examples/src/bin/embassy_hello_world_systimer.rs
+++ b/examples/src/bin/embassy_hello_world_systimer.rs
@@ -20,6 +20,7 @@ use esp_hal::{
embassy,
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
systimer::SystemTimer,
};
@@ -35,7 +36,7 @@ async fn run() {
async fn main(spawner: Spawner) {
esp_println::println!("Init!");
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let systimer = SystemTimer::new_async(peripherals.SYSTIMER);
diff --git a/examples/src/bin/embassy_i2c.rs b/examples/src/bin/embassy_i2c.rs
index 51669bbc2..c5b97b6ab 100644
--- a/examples/src/bin/embassy_i2c.rs
+++ b/examples/src/bin/embassy_i2c.rs
@@ -27,6 +27,7 @@ use esp_hal::{
i2c::I2C,
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
timer::TimerGroup,
};
use lis3dh_async::{Lis3dh, Range, SlaveAddr};
@@ -34,7 +35,7 @@ use lis3dh_async::{Lis3dh, Range, SlaveAddr};
#[main]
async fn main(_spawner: Spawner) {
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let timg0 = TimerGroup::new_async(peripherals.TIMG0, &clocks);
diff --git a/examples/src/bin/embassy_i2s_read.rs b/examples/src/bin/embassy_i2s_read.rs
index 34ad8e5e5..11df65a68 100644
--- a/examples/src/bin/embassy_i2s_read.rs
+++ b/examples/src/bin/embassy_i2s_read.rs
@@ -29,6 +29,7 @@ use esp_hal::{
i2s::{asynch::*, DataFormat, I2s, Standard},
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
timer::TimerGroup,
};
use esp_println::println;
@@ -37,7 +38,7 @@ use esp_println::println;
async fn main(_spawner: Spawner) {
println!("Init!");
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let timg0 = TimerGroup::new_async(peripherals.TIMG0, &clocks);
diff --git a/examples/src/bin/embassy_i2s_sound.rs b/examples/src/bin/embassy_i2s_sound.rs
index 644e16664..29dcd2751 100644
--- a/examples/src/bin/embassy_i2s_sound.rs
+++ b/examples/src/bin/embassy_i2s_sound.rs
@@ -44,6 +44,7 @@ use esp_hal::{
i2s::{asynch::*, DataFormat, I2s, Standard},
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
timer::TimerGroup,
};
use esp_println::println;
@@ -60,7 +61,7 @@ const SINE: [i16; 64] = [
async fn main(_spawner: Spawner) {
println!("Init!");
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let timg0 = TimerGroup::new_async(peripherals.TIMG0, &clocks);
diff --git a/examples/src/bin/embassy_multicore.rs b/examples/src/bin/embassy_multicore.rs
index 91dc2d0a5..7ab88bdab 100644
--- a/examples/src/bin/embassy_multicore.rs
+++ b/examples/src/bin/embassy_multicore.rs
@@ -24,6 +24,7 @@ use esp_hal::{
gpio::{GpioPin, Io, Output, PushPull},
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
timer::TimerGroup,
};
use esp_println::println;
@@ -53,7 +54,7 @@ async fn control_led(
#[main]
async fn main(_spawner: Spawner) {
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
diff --git a/examples/src/bin/embassy_multicore_interrupt.rs b/examples/src/bin/embassy_multicore_interrupt.rs
index 181656c7a..649146cb0 100644
--- a/examples/src/bin/embassy_multicore_interrupt.rs
+++ b/examples/src/bin/embassy_multicore_interrupt.rs
@@ -24,6 +24,7 @@ use esp_hal::{
interrupt::Priority,
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
timer::TimerGroup,
};
use esp_println::println;
@@ -72,7 +73,7 @@ async fn enable_disable_led(control: &'static Signal ! {
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let io = Io::new(peripherals.GPIO, peripherals.IO_MUX);
diff --git a/examples/src/bin/embassy_multiprio.rs b/examples/src/bin/embassy_multiprio.rs
index ec12e2c93..c58b17b49 100644
--- a/examples/src/bin/embassy_multiprio.rs
+++ b/examples/src/bin/embassy_multiprio.rs
@@ -31,6 +31,7 @@ use esp_hal::{
interrupt::Priority,
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
timer::TimerGroup,
};
use esp_println::println;
@@ -76,7 +77,7 @@ async fn main(low_prio_spawner: Spawner) {
esp_println::logger::init_logger_from_env();
println!("Init!");
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let timg0 = TimerGroup::new_async(peripherals.TIMG0, &clocks);
diff --git a/examples/src/bin/embassy_parl_io_rx.rs b/examples/src/bin/embassy_parl_io_rx.rs
index 3cfd38732..07612d237 100644
--- a/examples/src/bin/embassy_parl_io_rx.rs
+++ b/examples/src/bin/embassy_parl_io_rx.rs
@@ -22,6 +22,7 @@ use esp_hal::{
parl_io::{BitPackOrder, NoClkPin, ParlIoRxOnly, RxFourBits},
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
timer::TimerGroup,
};
use esp_println::println;
@@ -30,7 +31,7 @@ use esp_println::println;
async fn main(_spawner: Spawner) {
esp_println::println!("Init!");
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let timg0 = TimerGroup::new_async(peripherals.TIMG0, &clocks);
diff --git a/examples/src/bin/embassy_parl_io_tx.rs b/examples/src/bin/embassy_parl_io_tx.rs
index 1698d65e0..67f673f62 100644
--- a/examples/src/bin/embassy_parl_io_tx.rs
+++ b/examples/src/bin/embassy_parl_io_tx.rs
@@ -33,6 +33,7 @@ use esp_hal::{
},
peripherals::Peripherals,
prelude::*,
+ system::SystemControl,
timer::TimerGroup,
};
use esp_println::println;
@@ -41,7 +42,7 @@ use esp_println::println;
async fn main(_spawner: Spawner) {
esp_println::println!("Init!");
let peripherals = Peripherals::take();
- let system = peripherals.SYSTEM.split();
+ let system = SystemControl::new(peripherals.SYSTEM);
let clocks = ClockControl::boot_defaults(system.clock_control).freeze();
let timg0 = TimerGroup::new_async(peripherals.TIMG0, &clocks);
diff --git a/examples/src/bin/embassy_rmt_rx.rs b/examples/src/bin/embassy_rmt_rx.rs
index 8eb40c8fe..d3d2378f8 100644
--- a/examples/src/bin/embassy_rmt_rx.rs
+++ b/examples/src/bin/embassy_rmt_rx.rs
@@ -18,6 +18,7 @@ use esp_hal::{
peripherals::Peripherals,
prelude::*,
rmt::{asynch::RxChannelAsync, PulseCode, Rmt, RxChannelConfig, RxChannelCreatorAsync},
+ system::SystemControl,
};
use esp_println::{print, println};
@@ -41,7 +42,7 @@ async fn signal_task(mut pin: Gpio5