Skip to content

Commit

Permalink
Fixed compilation errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frostie314159 committed Nov 13, 2024
1 parent 3b1fa46 commit 74dba57
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions esp-hal/src/radio_clock_ctrl.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use core::{
cell::RefCell,
sync::atomic::{AtomicBool, Ordering},
};
//! Control over the radio clocs.
use core::cell::RefCell;

use critical_section::Mutex;
use portable_atomic::{AtomicBool, Ordering};

use crate::peripherals::RADIO_CLK;

/// Enumeration of the available radio peripherals for this chip.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[cfg(any(bt, ieee802154, wifi))]
pub enum RadioPeripherals {
/// Represents the PHY (Physical Layer) peripheral.
Expand Down Expand Up @@ -50,8 +50,11 @@ pub trait RadioClockController {
}

static PHY_CLOCK_ENABLED: AtomicBool = AtomicBool::new(false);
/// The PHY clock couldn't be disabled, because some modem clocks are still
/// active.
pub struct ModemClocksEnabledError;

/// This struct allows shared access to the radio clocks.
pub struct SharedRadioClockControl {
radio_clock: Mutex<RefCell<RADIO_CLK>>,

Expand All @@ -63,6 +66,7 @@ pub struct SharedRadioClockControl {
ieee802154_clock_enabled: AtomicBool,
}
impl SharedRadioClockControl {
/// Create a new [SharedRadioClockControl].
pub const fn new(radio_clock: RADIO_CLK) -> Self {
Self {
radio_clock: Mutex::new(RefCell::new(radio_clock)),
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/rtc_cntl/rtc/esp32c6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ use crate::{
XtalClock,
},
peripherals::TIMG0,
radio_clock_ctrl::RadioPeripherals,
rtc_cntl::RtcClock,
soc::efuse::Efuse,
system::RadioPeripherals,
};

const I2C_DIG_REG: u8 = 0x6d;
Expand Down

0 comments on commit 74dba57

Please sign in to comment.