1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
use table::table; use hal::blocking::delay::DelayMs; pub fn get_seconds() -> u32 { (table().getSeconds)() } pub fn get_ticks() -> u32 { (table().systickGetTicks)() } pub fn delay_ms(ms: u32) { (table().delayms)(ms) } pub struct Delay; impl<T: Into<u32>> DelayMs<T> for Delay { fn delay_ms(&mut self, ms: T) { self::delay_ms(ms.into()) } }