Merge #939
939: time: add more tick rates, use 1mhz as default. r=Dirbaio a=Dirbaio Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
This commit is contained in:
@ -10,7 +10,7 @@ src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-stm32
|
||||
# TODO: sdmmc
|
||||
# TODO: net
|
||||
# TODO: subghz
|
||||
features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "exti", "time-driver-any", "embassy-time/tick-32768hz"]
|
||||
features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "exti", "time-driver-any"]
|
||||
flavors = [
|
||||
{ regex_feature = "stm32f0.*", target = "thumbv6m-none-eabi" },
|
||||
{ regex_feature = "stm32f1.*", target = "thumbv7m-none-eabi" },
|
||||
|
@ -7,7 +7,7 @@ use atomic_polyfill::{AtomicU32, AtomicU8};
|
||||
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
use embassy_sync::blocking_mutex::Mutex;
|
||||
use embassy_time::driver::{AlarmHandle, Driver};
|
||||
use embassy_time::TICKS_PER_SECOND;
|
||||
use embassy_time::TICK_HZ;
|
||||
use stm32_metapac::timer::regs;
|
||||
|
||||
use crate::interrupt::{CriticalSection, InterruptExt};
|
||||
@ -153,7 +153,7 @@ impl RtcDriver {
|
||||
r.cr1().modify(|w| w.set_cen(false));
|
||||
r.cnt().write(|w| w.set_cnt(0));
|
||||
|
||||
let psc = timer_freq.0 / TICKS_PER_SECOND as u32 - 1;
|
||||
let psc = timer_freq.0 / TICK_HZ as u32 - 1;
|
||||
let psc: u16 = match psc.try_into() {
|
||||
Err(_) => panic!("psc division overflow: {}", psc),
|
||||
Ok(n) => n,
|
||||
|
Reference in New Issue
Block a user