Just spawn switch_leds task; drop unused crate

This commit is contained in:
Paul van Tilburg 2019-03-05 17:03:46 +01:00
parent 66aff9a87d
commit 283655e30e
2 changed files with 5 additions and 6 deletions

View File

@ -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"

View File

@ -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 }
}