Just spawn switch_leds task; drop unused crate
This commit is contained in:
parent
66aff9a87d
commit
283655e30e
|
@ -9,7 +9,6 @@ version = "0.1.0"
|
|||
cortex-m = "0.5.8"
|
||||
cortex-m-rt = "0.6.5"
|
||||
cortex-m-semihosting = "0.3.2"
|
||||
panic-abort = "0.3.1"
|
||||
panic-halt = "0.2.0"
|
||||
panic-semihosting = "0.5.1"
|
||||
|
||||
|
|
10
src/main.rs
10
src/main.rs
|
@ -6,9 +6,9 @@
|
|||
extern crate panic_semihosting;
|
||||
|
||||
//use cortex_m_semihosting::hprintln;
|
||||
use hal::gpio::{Output, PushPull};
|
||||
use hal::gpio::{ExtiPin, Output, PushPull};
|
||||
use hal::prelude::*;
|
||||
use rtfm::{app, Instant};
|
||||
use rtfm::app;
|
||||
|
||||
type Led = hal::gpio::gpiod::PD<Output<PushPull>>;
|
||||
|
||||
|
@ -19,9 +19,9 @@ const APP: () = {
|
|||
static mut index: usize = ();
|
||||
static mut leds: [Led; 4] = ();
|
||||
|
||||
#[init(schedule = [switch_leds])]
|
||||
#[init(spawn = [switch_leds])]
|
||||
fn init() -> init::LateResources {
|
||||
// Set up the LEDs.
|
||||
// Set up the LEDs and spawn the LEDs switch task.
|
||||
let gpiod = device.GPIOD.split();
|
||||
let leds = [
|
||||
gpiod.pd12.into_push_pull_output().downgrade(),
|
||||
|
@ -29,8 +29,8 @@ const APP: () = {
|
|||
gpiod.pd14.into_push_pull_output().downgrade(),
|
||||
gpiod.pd15.into_push_pull_output().downgrade(),
|
||||
];
|
||||
spawn.switch_leds().unwrap();
|
||||
|
||||
schedule.switch_leds(Instant::now() + PERIOD.cycles()).unwrap();
|
||||
|
||||
init::LateResources { index: 0, leds }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue