use delay loop in sanity test to check that works right

This commit is contained in:
Tangent 128 2019-10-27 00:56:48 -04:00
parent 7a7d5f1a48
commit 724a621bc1

View file

@ -5,11 +5,13 @@ extern crate itsybitsy_m0 as hal;
extern crate panic_halt; extern crate panic_halt;
use hal::clock::GenericClockController; use hal::clock::GenericClockController;
use hal::delay::Delay; //use hal::delay::Delay;
use hal::prelude::*; use hal::prelude::*;
use hal::entry; use hal::entry;
use hal::pac::{CorePeripherals, Peripherals}; use hal::pac::{CorePeripherals, Peripherals};
use lights_hal::delay;
#[entry] #[entry]
fn main() -> ! { fn main() -> ! {
let mut peripherals = Peripherals::take().unwrap(); let mut peripherals = Peripherals::take().unwrap();
@ -22,11 +24,13 @@ fn main() -> ! {
); );
let mut pins = hal::Pins::new(peripherals.PORT); let mut pins = hal::Pins::new(peripherals.PORT);
let mut red_led = pins.d13.into_open_drain_output(&mut pins.port); let mut red_led = pins.d13.into_open_drain_output(&mut pins.port);
let mut delay = Delay::new(core.SYST, &mut clocks); //let mut delay = Delay::new(core.SYST, &mut clocks);
loop { loop {
delay.delay_ms(200u8); //delay.delay_ms(200u8);
delay(48_000 * 100);
red_led.set_high().unwrap(); red_led.set_high().unwrap();
delay.delay_ms(200u8); //delay.delay_ms(200u8);
delay(48_000 * 100);
red_led.set_low().unwrap(); red_led.set_low().unwrap();
} }
} }