Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
robamu committed Sep 17, 2024
1 parent d25108f commit 9b26f79
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions examples/embassy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use embassy_time_driver::{time_driver_impl, AlarmHandle, Driver, TICK_HZ};
use va416xx_hal::{
clock::Clocks,
enable_interrupt,
irq_router::enable_and_init_irq_router,
pac::{self, interrupt},
pwm::{assert_tim_reset, deassert_tim_reset, enable_tim_clk, ValidTim},
};
Expand All @@ -24,10 +25,12 @@ pub type AlarmClk2 = pac::Tim12;
/// This has to be called to initiate the time driver for embassy.
pub fn init(
syscfg: &mut pac::Sysconfig,
irq_router: &pac::IrqRouter,
timekeeper: TimekeeperClk,
alarm: AlarmClk0,
clocks: &Clocks,
) {
enable_and_init_irq_router(syscfg, irq_router);
DRIVER.init(syscfg, timekeeper, alarm, clocks)
}

Expand Down
8 changes: 7 additions & 1 deletion examples/embassy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ async fn main(_spawner: Spawner) {
.xtal_n_clk_with_src_freq(Hertz::from_raw(EXTCLK_FREQ))
.freeze(&mut dp.sysconfig)
.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 mut led = portg.pg5.into_readable_push_pull_output();
loop {
Expand Down
6 changes: 1 addition & 5 deletions examples/simple/examples/timer-ticks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ use panic_rtt_target as _;
use rtt_target::{rprintln, rtt_init_print};
use simple_examples::peb1;
use va416xx_hal::{
clock::{
assert_periph_reset, deassert_periph_reset, disable_peripheral_clock,
enable_peripheral_clock, PeripheralSelect,
},
irq_router::enable_and_init_irq_router,
pac::{self, adc::rxfifoirqtrg::W, interrupt},
pac::{self, interrupt},
prelude::*,
timer::{default_ms_irq_handler, set_up_ms_tick, CountdownTimer, MS_COUNTER},
};
Expand Down

0 comments on commit 9b26f79

Please sign in to comment.