Skip to content

Commit 55d7d04

Browse files
committed
wip
1 parent e55d747 commit 55d7d04

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

embassy-stm32/src/timer/low_level.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ impl<'d, T: CoreInstance> Timer<'d, T> {
303303
pub fn bits(&self) -> TimerBits {
304304
match T::Word::bits() {
305305
16 => TimerBits::Bits16,
306+
#[cfg(not(stm32l0))]
306307
32 => TimerBits::Bits32,
307308
_ => unreachable!(),
308309
}
@@ -332,6 +333,9 @@ impl<'d, T: CoreInstance> Timer<'d, T> {
332333

333334
let regs = self.regs_gp32_unchecked();
334335
regs.psc().write_value(psc);
336+
#[cfg(stm32l0)]
337+
regs.arr().write(|r| r.set_arr(unwrap!(arr.try_into())));
338+
#[cfg(not(stm32l0))]
335339
regs.arr().write_value(arr.into());
336340
}
337341

@@ -382,7 +386,10 @@ impl<'d, T: CoreInstance> Timer<'d, T> {
382386
let timer_f = T::frequency();
383387

384388
let regs = self.regs_gp32_unchecked();
389+
#[cfg(not(stm32l0))]
385390
let arr = regs.arr().read();
391+
#[cfg(stm32l0)]
392+
let arr = regs.arr().read().arr();
386393
let psc = regs.psc().read();
387394

388395
timer_f / arr / (psc + 1)
@@ -457,7 +464,10 @@ impl<'d, T: GeneralInstance1Channel> Timer<'d, T> {
457464
let arr = ticks;
458465

459466
let regs = self.regs_gp32_unchecked();
467+
#[cfg(not(stm32l0))]
460468
regs.arr().write_value(arr.into());
469+
#[cfg(stm32l0)]
470+
regs.arr().write(|r| r.set_arr(unwrap!(arr.try_into())));
461471

462472
regs.cr1().modify(|r| r.set_urs(vals::Urs::COUNTER_ONLY));
463473
regs.egr().write(|r| r.set_ug(true));

0 commit comments

Comments
 (0)