Skip to content

Commit 24a2b59

Browse files
author
Henrik Alsér
committed
cargo fmt
1 parent 9e8e1d8 commit 24a2b59

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

examples/gpiote-demo/src/main.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ const APP: () = {
5050
gpiote.port().enable_interrupt();
5151

5252
// PPI usage, channel 2 event triggers "task out" (toggle) on channel 1 (toggles led1)
53-
gpiote.channel(1).output_pin(&led1).task_out_polarity(TaskOutPolarity::Toggle).init_high();
53+
gpiote
54+
.channel(1)
55+
.output_pin(&led1)
56+
.task_out_polarity(TaskOutPolarity::Toggle)
57+
.init_high();
5458
gpiote.channel(2).input_pin(&btn2).hi_to_lo(false);
5559
let ppi_channels = ppi::Parts::new(ctx.device.PPI);
5660
let mut channel0 = ppi_channels.ppi0;
@@ -100,8 +104,12 @@ const APP: () = {
100104
// Manually run "task out" (toggle) on channel 1 (toggles led1)
101105
ctx.resources.gpiote.channel(1).out();
102106
}
103-
if btn3_pressed { rprintln!("Button 3 was pressed!"); }
104-
if btn4_pressed { rprintln!("Button 4 was pressed!"); }
107+
if btn3_pressed {
108+
rprintln!("Button 3 was pressed!");
109+
}
110+
if btn4_pressed {
111+
rprintln!("Button 4 was pressed!");
112+
}
105113
}
106114

107115
extern "C" {

0 commit comments

Comments
 (0)