Skip to content

Commit

Permalink
Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Dec 6, 2024
1 parent 1c00d34 commit 4434326
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion embassy-executor/src/raw/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ impl TaskRef {
/// Returns a reference to the executor that the task is currently running on.
#[cfg(feature = "integrated-timers")]
pub unsafe fn executor(self) -> Option<&'static Executor> {
core::mem::transmute(self.header().executor.get())
// Transmute so that we can expose the executor, without exposing the
// private `SyncExecutor` type.
mem::transmute(self.header().executor.get())
}

/// The returned pointer is valid for the entire TaskStorage.
Expand Down
2 changes: 1 addition & 1 deletion embassy-nrf/src/time_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ struct RtcDriver {

embassy_time_driver::time_driver_impl!(static DRIVER: RtcDriver = RtcDriver {
period: AtomicU32::new(0),
alarms: Mutex::const_new(CriticalSectionRawMutex::new(), const {AlarmState::new()}),
alarms: Mutex::const_new(CriticalSectionRawMutex::new(), AlarmState::new()),
});

impl RtcDriver {
Expand Down
4 changes: 2 additions & 2 deletions embassy-rp/src/time_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ struct TimerDriver {
}

embassy_time_driver::time_driver_impl!(static DRIVER: TimerDriver = TimerDriver{
alarms: Mutex::const_new(CriticalSectionRawMutex::new(), const{ AlarmState {
alarms: Mutex::const_new(CriticalSectionRawMutex::new(), AlarmState {
timestamp: Cell::new(0),
}}),
}),
});

impl Driver for TimerDriver {
Expand Down

0 comments on commit 4434326

Please sign in to comment.