hmm
Some checks failed
Rust/va416xx-rs/pipeline/pr-main There was a failure building this commit

This commit is contained in:
Robin Müller 2024-09-17 18:50:40 +02:00
parent 911fe8771e
commit d231905aca
Signed by: muellerr
GPG Key ID: A649FB78196E3849
3 changed files with 7 additions and 4 deletions

View File

@ -13,7 +13,7 @@ panic-rtt-target = { version = "0.1" }
critical-section = "1"
embassy-sync = { version = "0.6.0" }
embassy-time = { version = "0.3.2", features = ["tick-hz-1"] }
embassy-time = { version = "0.3.2", features = ["tick-hz-1_000"] }
embassy-time-driver = { version = "0.1" }
[dependencies.once_cell]

View File

@ -135,7 +135,7 @@ impl TimerDriverEmbassy {
// Should be called inside the IRQ of the alarm timer.
fn on_interrupt_alarm(&self, idx: usize) {
critical_section::with(|cs| {
if self.alarms.borrow(cs)[idx].timestamp.get() < self.now() {
if self.alarms.borrow(cs)[idx].timestamp.get() <= self.now() {
self.trigger_alarm(idx, cs)
}
})
@ -171,7 +171,10 @@ impl TimerDriverEmbassy {
}
fn trigger_alarm(&self, n: usize, cs: CriticalSection) {
alarm_tim(n).ctrl().modify(|_, w| w.irq_enb().clear_bit());
alarm_tim(n).ctrl().modify(|_, w| {
w.irq_enb().clear_bit();
w.enable().clear_bit()
});
let alarm = &self.alarms.borrow(cs)[n];
// Setting the maximum value disables the alarm.

View File

@ -38,7 +38,7 @@ async fn main(_spawner: Spawner) {
let portg = PinsG::new(&mut dp.sysconfig, dp.portg);
let mut led = portg.pg5.into_readable_push_pull_output();
loop {
Timer::after_millis(500).await;
Timer::after_secs(1).await;
led.toggle().ok();
}
}