aboutsummaryrefslogtreecommitdiff
path: root/src/clocks/periph_helpers.rs
diff options
context:
space:
mode:
authorFelipe Balbi <[email protected]>2025-11-21 14:56:00 -0800
committerFelipe Balbi <[email protected]>2025-11-21 15:03:23 -0800
commitc21a402ebcf26fd40a2809fc771b71a3e9b31962 (patch)
tree2b59cec3cc2b0e369c22d49d13bdbf8233308b66 /src/clocks/periph_helpers.rs
parentafbf72fb7842c926a9ac9b62f794ed010d4f7b27 (diff)
Fix clkdiv configuration
DIV should be modified while the clock is halted, not after it's already running.
Diffstat (limited to 'src/clocks/periph_helpers.rs')
-rw-r--r--src/clocks/periph_helpers.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/clocks/periph_helpers.rs b/src/clocks/periph_helpers.rs
index e5b234c5b..8914f6833 100644
--- a/src/clocks/periph_helpers.rs
+++ b/src/clocks/periph_helpers.rs
@@ -240,12 +240,12 @@ impl SPConfHelper for LpuartConfig {
240 clkdiv.modify(|_r, w| { 240 clkdiv.modify(|_r, w| {
241 w.halt().on(); 241 w.halt().on();
242 w.reset().on(); 242 w.reset().on();
243 unsafe { w.div().bits(self.div.into_bits()) };
243 w 244 w
244 }); 245 });
245 clkdiv.modify(|_r, w| { 246 clkdiv.modify(|_r, w| {
246 w.halt().off(); 247 w.halt().off();
247 w.reset().off(); 248 w.reset().off();
248 unsafe { w.div().bits(self.div.into_bits()) };
249 w 249 w
250 }); 250 });
251 251
@@ -377,12 +377,12 @@ impl SPConfHelper for AdcConfig {
377 mrcc0.mrcc_adc_clkdiv().modify(|_r, w| { 377 mrcc0.mrcc_adc_clkdiv().modify(|_r, w| {
378 w.halt().on(); 378 w.halt().on();
379 w.reset().on(); 379 w.reset().on();
380 unsafe { w.div().bits(self.div.into_bits()) };
380 w 381 w
381 }); 382 });
382 mrcc0.mrcc_adc_clkdiv().modify(|_r, w| { 383 mrcc0.mrcc_adc_clkdiv().modify(|_r, w| {
383 w.halt().off(); 384 w.halt().off();
384 w.reset().off(); 385 w.reset().off();
385 unsafe { w.div().bits(self.div.into_bits()) };
386 w 386 w
387 }); 387 });
388 388