Skip to content

Commit ac0eaac

Browse files
committed
zephyr: Update rustfmt
Update the formatting. Signed-off-by: David Brown <[email protected]>
1 parent db93ee7 commit ac0eaac

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

zephyr/src/embassy/executor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl Executor {
4141
// itself is actually run. This means, specifically, that if the polled execution
4242
// causes this, or other threads to enqueue, this will return without running them.
4343
// `__pender` _will_ be called, but it isn't "sticky" like `wfe/sev` are. To
44-
// simulate this, we will use the 'pend' atomic to count
44+
// simulate this, we will use the 'pend' atomic to count
4545
inner.poll();
4646
if !self.pend.swap(false, Ordering::SeqCst) {
4747
// printkln!("_suspend");

zephyr/src/embassy/time_driver.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22
//!
33
//! Implements the time driver for Embassy using a `k_timer` in Zephyr.
44
5-
use core::{cell::{RefCell, UnsafeCell}, mem};
5+
use core::{
6+
cell::{RefCell, UnsafeCell},
7+
mem,
8+
};
69

710
use embassy_sync::blocking_mutex::{raw::CriticalSectionRawMutex, Mutex};
811
use embassy_time_driver::Driver;
912
use embassy_time_queue_utils::Queue;
1013

11-
use crate::raw::{
12-
k_timer,
13-
k_timer_init,
14-
k_timer_start,
15-
k_timeout_t,
16-
};
14+
use crate::raw::{k_timeout_t, k_timer, k_timer_init, k_timer_start};
1715
use crate::sys::K_FOREVER;
1816

1917
embassy_time_driver::time_driver_impl!(static DRIVER: ZephyrTimeDriver = ZephyrTimeDriver {
@@ -41,15 +39,21 @@ impl ZTimer {
4139

4240
// Otherwise, initialize our timer, and handle it.
4341
if !self.initialized {
44-
unsafe { k_timer_init(self.item.get(), Some(Self::timer_tick), None); }
42+
unsafe {
43+
k_timer_init(self.item.get(), Some(Self::timer_tick), None);
44+
}
4545
self.initialized = true;
4646
}
4747

4848
// There is a +1 here as the `k_timer_start()` for historical reasons, subtracts one from
4949
// the time, effectively rounding down, whereas we want to wait at least long enough.
50-
let delta = k_timeout_t { ticks: (next - now + 1) as i64 };
50+
let delta = k_timeout_t {
51+
ticks: (next - now + 1) as i64,
52+
};
5153
let period = K_FOREVER;
52-
unsafe { k_timer_start(self.item.get(), delta, period); }
54+
unsafe {
55+
k_timer_start(self.item.get(), delta, period);
56+
}
5357

5458
true
5559
}
@@ -94,4 +98,4 @@ impl ZephyrTimeDriver {
9498
}
9599

96100
// SAFETY: The timer access is always coordinated through a critical section.
97-
unsafe impl Send for ZTimer { }
101+
unsafe impl Send for ZTimer {}

0 commit comments

Comments
 (0)