This commit is contained in:
parent
d25108f85d
commit
9b26f79bed
@ -12,6 +12,7 @@ use embassy_time_driver::{time_driver_impl, AlarmHandle, Driver, TICK_HZ};
|
|||||||
use va416xx_hal::{
|
use va416xx_hal::{
|
||||||
clock::Clocks,
|
clock::Clocks,
|
||||||
enable_interrupt,
|
enable_interrupt,
|
||||||
|
irq_router::enable_and_init_irq_router,
|
||||||
pac::{self, interrupt},
|
pac::{self, interrupt},
|
||||||
pwm::{assert_tim_reset, deassert_tim_reset, enable_tim_clk, ValidTim},
|
pwm::{assert_tim_reset, deassert_tim_reset, enable_tim_clk, ValidTim},
|
||||||
};
|
};
|
||||||
@ -24,10 +25,12 @@ pub type AlarmClk2 = pac::Tim12;
|
|||||||
/// This has to be called to initiate the time driver for embassy.
|
/// This has to be called to initiate the time driver for embassy.
|
||||||
pub fn init(
|
pub fn init(
|
||||||
syscfg: &mut pac::Sysconfig,
|
syscfg: &mut pac::Sysconfig,
|
||||||
|
irq_router: &pac::IrqRouter,
|
||||||
timekeeper: TimekeeperClk,
|
timekeeper: TimekeeperClk,
|
||||||
alarm: AlarmClk0,
|
alarm: AlarmClk0,
|
||||||
clocks: &Clocks,
|
clocks: &Clocks,
|
||||||
) {
|
) {
|
||||||
|
enable_and_init_irq_router(syscfg, irq_router);
|
||||||
DRIVER.init(syscfg, timekeeper, alarm, clocks)
|
DRIVER.init(syscfg, timekeeper, alarm, clocks)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,13 @@ async fn main(_spawner: Spawner) {
|
|||||||
.xtal_n_clk_with_src_freq(Hertz::from_raw(EXTCLK_FREQ))
|
.xtal_n_clk_with_src_freq(Hertz::from_raw(EXTCLK_FREQ))
|
||||||
.freeze(&mut dp.sysconfig)
|
.freeze(&mut dp.sysconfig)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
embassy_example::init(&mut dp.sysconfig, dp.tim15, dp.tim14, &clocks);
|
embassy_example::init(
|
||||||
|
&mut dp.sysconfig,
|
||||||
|
&dp.irq_router,
|
||||||
|
dp.tim15,
|
||||||
|
dp.tim14,
|
||||||
|
&clocks,
|
||||||
|
);
|
||||||
let portg = PinsG::new(&mut dp.sysconfig, dp.portg);
|
let portg = PinsG::new(&mut dp.sysconfig, dp.portg);
|
||||||
let mut led = portg.pg5.into_readable_push_pull_output();
|
let mut led = portg.pg5.into_readable_push_pull_output();
|
||||||
loop {
|
loop {
|
||||||
|
@ -10,12 +10,8 @@ use panic_rtt_target as _;
|
|||||||
use rtt_target::{rprintln, rtt_init_print};
|
use rtt_target::{rprintln, rtt_init_print};
|
||||||
use simple_examples::peb1;
|
use simple_examples::peb1;
|
||||||
use va416xx_hal::{
|
use va416xx_hal::{
|
||||||
clock::{
|
|
||||||
assert_periph_reset, deassert_periph_reset, disable_peripheral_clock,
|
|
||||||
enable_peripheral_clock, PeripheralSelect,
|
|
||||||
},
|
|
||||||
irq_router::enable_and_init_irq_router,
|
irq_router::enable_and_init_irq_router,
|
||||||
pac::{self, adc::rxfifoirqtrg::W, interrupt},
|
pac::{self, interrupt},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
timer::{default_ms_irq_handler, set_up_ms_tick, CountdownTimer, MS_COUNTER},
|
timer::{default_ms_irq_handler, set_up_ms_tick, CountdownTimer, MS_COUNTER},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user