Skip to content

Commit 26d2148

Browse files
torkeldanielssontherealprof
authored andcommitted
fix check errors
1 parent db7428d commit 26d2148

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

examples/blinky.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ use cortex_m_rt::entry;
1212
#[entry]
1313
fn main() -> ! {
1414
if let Some(mut p) = pac::Peripherals::take() {
15-
let mut led = cortex_m::interrupt::free(|cs| {
16-
let mut rcc = p.RCC.configure().sysclk(8.mhz()).freeze(&mut p.FLASH);
15+
let mut rcc = p.RCC.configure().sysclk(8.mhz()).freeze(&mut p.FLASH);
1716

18-
let gpioa = p.GPIOA.split(&mut rcc);
17+
let gpioa = p.GPIOA.split(&mut rcc);
1918

20-
// (Re-)configure PA1 as output
21-
gpioa.pa1.into_push_pull_output(cs)
22-
});
19+
// (Re-)configure PA1 as output
20+
let mut led = cortex_m::interrupt::free(|cs| gpioa.pa1.into_push_pull_output(cs));
2321

2422
loop {
2523
// Turn PA1 on a million times in a row

examples/blinky_delay.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ fn main() -> ! {
1818
let gpioa = p.GPIOA.split(&mut rcc);
1919

2020
// (Re-)configure PA1 as output
21-
let mut led = cortex_m::interrupt::free(move |cs| {
22-
gpioa.pa1.into_push_pull_output(cs);
23-
});
21+
let mut led = cortex_m::interrupt::free(move |cs| gpioa.pa1.into_push_pull_output(cs));
2422

2523
// Get delay provider
2624
let mut delay = Delay::new(cp.SYST, &rcc);

examples/dac.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ enum Direction {
2323
fn main() -> ! {
2424
if let (Some(mut dp), Some(_cp)) = (pac::Peripherals::take(), cortex_m::Peripherals::take()) {
2525
let mut rcc = dp.RCC.configure().sysclk(8.mhz()).freeze(&mut dp.FLASH);
26+
let gpioa = dp.GPIOA.split(&mut rcc);
2627

27-
let mut dac = cortex_m::interrupt::free(move |cs| {
28-
let gpioa = dp.GPIOA.split(&mut rcc);
29-
dac(dp.DAC, gpioa.pa4.into_analog(cs), &mut rcc)
30-
});
28+
let pa4 = cortex_m::interrupt::free(move |cs| gpioa.pa4.into_analog(cs));
29+
30+
let mut dac = dac(dp.DAC, pa4, &mut rcc);
3131

3232
dac.enable();
3333

examples/serial_spi_bridge.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ fn main() -> ! {
3434
let mut flash = p.FLASH;
3535
let mut rcc = p.RCC.configure().freeze(&mut flash);
3636

37-
let (sck, miso, mosi, tx, rx) = cortex_m::interrupt::free(move |cs| {
38-
let gpioa = p.GPIOA.split(&mut rcc);
37+
let gpioa = p.GPIOA.split(&mut rcc);
3938

39+
let (sck, miso, mosi, tx, rx) = cortex_m::interrupt::free(move |cs| {
4040
(
4141
// SPI pins
4242
gpioa.pa5.into_alternate_af0(cs),

0 commit comments

Comments
 (0)