From 427d96d358c81849c2f3ae59470fe00ebecc07d0 Mon Sep 17 00:00:00 2001 From: Jonas Jacobsson <01joja@gamil.com> Date: Tue, 23 Feb 2021 11:56:45 +0100 Subject: [PATCH] changed main --- examples/rtic_blinky.rs | 2 +- examples/rtt-pwm.rs | 2 +- src/main.rs | 20 +------------------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/examples/rtic_blinky.rs b/examples/rtic_blinky.rs index 7d48c31..957c5ff 100644 --- a/examples/rtic_blinky.rs +++ b/examples/rtic_blinky.rs @@ -40,7 +40,7 @@ const APP: () = { let now = cx.start; // the start time of the system // Schedule `toggle` to run 8e6 cycles (clock cycles) in the future - cx.schedule.toggle(now + 8_000_000.cycles()).unwrap(); + cx.schedule.toggle(now +16_000_000.cycles()).unwrap(); // power on GPIOA, RM0368 6.3.11 device.RCC.ahb1enr.modify(|_, w| w.gpioaen().set_bit()); diff --git a/examples/rtt-pwm.rs b/examples/rtt-pwm.rs index 5bcfc80..ffaba3d 100644 --- a/examples/rtt-pwm.rs +++ b/examples/rtt-pwm.rs @@ -1,4 +1,4 @@ -//! cargo run --examples rtt-pwm +//! cargo run --example rtt-pwm #![deny(unsafe_code)] #![deny(warnings)] diff --git a/src/main.rs b/src/main.rs index 04dfbf9..53111a5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,8 +26,6 @@ const APP: () = { struct Resources { // late resources GPIOA: stm32::GPIOA, - GPIOC: stm32::GPIOC, - //button: <stm32::GPIOC as int>::PC13, } #[init(schedule = [toggle])] @@ -61,15 +59,9 @@ const APP: () = { // configure PA5 as output, RM0368 8.4.1 device.GPIOA.moder.modify(|_, w| w.moder5().bits(1)); - // Test button thingy. Think I put PC13 to input - device.GPIOC.moder.modify(|_, w| w.moder13().bits(0)); - // device.GPIOC.pupdr.modify(|_, w| w.pupdr13().bits(0)); - // pass on late resources init::LateResources { GPIOA: device.GPIOA, - GPIOC: device.GPIOC, - //button: device.button, } } @@ -84,7 +76,7 @@ const APP: () = { - #[task(resources = [GPIOA,GPIOC], schedule = [toggle])] + #[task(resources = [GPIOA], schedule = [toggle])] fn toggle(cx: toggle::Context) { static mut TOGGLE: bool = false; rprintln!("toggle @ {:?}", Instant::now()); @@ -94,20 +86,10 @@ const APP: () = { } else { cx.resources.GPIOA.bsrr.write(|w| w.br5().set_bit()); } - -<<<<<<< HEAD -======= - //cx.resources.GPIOC.PullDown; - ->>>>>>> 3104a68743e72194c1e8649cdee76a82240fc05e *TOGGLE = !*TOGGLE; cx.schedule .toggle(cx.scheduled + 16_000_000.cycles()) .unwrap(); -<<<<<<< HEAD -======= - ->>>>>>> 3104a68743e72194c1e8649cdee76a82240fc05e } extern "C" { -- GitLab