This commit is contained in:
JuliDi 2023-06-28 15:21:24 +02:00
parent 91c31d5e43
commit 27a89019ad
No known key found for this signature in database
GPG Key ID: E1E90AE563D09D63

View File

@ -52,6 +52,8 @@ async fn dac_task1(dac: &'static mut Dac1Type<'static>) {
info!("TIM6 frequency is {}", TIM6::frequency()); info!("TIM6 frequency is {}", TIM6::frequency());
const FREQUENCY: Hertz = Hertz::hz(200); const FREQUENCY: Hertz = Hertz::hz(200);
// Compute the reload value such that we obtain the FREQUENCY for the sine
let reload: u32 = (TIM6::frequency().0 / FREQUENCY.0) / data.len() as u32; let reload: u32 = (TIM6::frequency().0 / FREQUENCY.0) / data.len() as u32;
// Depends on your clock and on the specific chip used, you may need higher or lower values here // Depends on your clock and on the specific chip used, you may need higher or lower values here