time: replace dyn clock/alarm with a global Driver trait
This commit is contained in:
@ -9,7 +9,6 @@ mod example_common;
|
||||
|
||||
use core::fmt::Write;
|
||||
use embassy::executor::Executor;
|
||||
use embassy::time::Clock;
|
||||
use embassy::util::Forever;
|
||||
use embassy_stm32::time::U32Ext;
|
||||
use embassy_traits::spi::FullDuplex;
|
||||
@ -34,14 +33,6 @@ async fn main_task(mut spi: spi::Spi<'static, SPI3, DMA1_CH3, DMA1_CH4>) {
|
||||
}
|
||||
}
|
||||
|
||||
struct ZeroClock;
|
||||
|
||||
impl Clock for ZeroClock {
|
||||
fn now(&self) -> u64 {
|
||||
0
|
||||
}
|
||||
}
|
||||
|
||||
static EXECUTOR: Forever<Executor> = Forever::new();
|
||||
|
||||
#[entry]
|
||||
@ -65,7 +56,6 @@ fn main() -> ! {
|
||||
spi::Config::default(),
|
||||
);
|
||||
|
||||
unsafe { embassy::time::set_clock(&ZeroClock) };
|
||||
let executor = EXECUTOR.put(Executor::new());
|
||||
|
||||
executor.run(|spawner| {
|
||||
|
Reference in New Issue
Block a user