Skip to content

Commit ece1ddd

Browse files
committed
samples: blinky: Run cargo fmt
Format the source according to the default rules. This provides a baseline for future changes to require well-formatted source. Signed-off-by: David Brown <[email protected]>
1 parent cf08967 commit ece1ddd

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

samples/blinky/src/lib.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
#![no_std]
5-
65
// Sigh. The check config system requires that the compiler be told what possible config values
76
// there might be. This is completely impossible with both Kconfig and the DT configs, since the
87
// whole point is that we likely need to check for configs that aren't otherwise present in the
@@ -12,11 +11,13 @@
1211
use log::warn;
1312

1413
use zephyr::raw::GPIO_OUTPUT_ACTIVE;
15-
use zephyr::time::{ Duration, sleep };
14+
use zephyr::time::{sleep, Duration};
1615

1716
#[no_mangle]
1817
extern "C" fn rust_main() {
19-
unsafe { zephyr::set_logger().unwrap(); }
18+
unsafe {
19+
zephyr::set_logger().unwrap();
20+
}
2021

2122
warn!("Starting blinky");
2223

@@ -32,21 +33,23 @@ fn do_blink() {
3233

3334
if !led0.is_ready() {
3435
warn!("LED is not ready");
35-
loop {
36-
}
36+
loop {}
3737
}
3838

39-
unsafe { led0.configure(&mut gpio_token, GPIO_OUTPUT_ACTIVE); }
39+
unsafe {
40+
led0.configure(&mut gpio_token, GPIO_OUTPUT_ACTIVE);
41+
}
4042
let duration = Duration::millis_at_least(500);
4143
loop {
42-
unsafe { led0.toggle_pin(&mut gpio_token); }
44+
unsafe {
45+
led0.toggle_pin(&mut gpio_token);
46+
}
4347
sleep(duration);
4448
}
4549
}
4650

4751
#[cfg(not(dt = "aliases::led0"))]
4852
fn do_blink() {
4953
warn!("No leds configured");
50-
loop {
51-
}
54+
loop {}
5255
}

0 commit comments

Comments
 (0)