diff options
| author | 1-rafael-1 <[email protected]> | 2025-04-26 21:55:16 +0200 |
|---|---|---|
| committer | 1-rafael-1 <[email protected]> | 2025-04-26 21:55:16 +0200 |
| commit | 45b7127d614ddc65181249e70d94422500865ecd (patch) | |
| tree | 9ebe9317efa91e5e13655594916325b0ff05bd05 /embassy-rp | |
| parent | 713d6291d569cf44ce3a53bc93ddd7d569fb93ed (diff) | |
fmt
Diffstat (limited to 'embassy-rp')
| -rw-r--r-- | embassy-rp/src/pio_programs/rotary_encoder.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-rp/src/pio_programs/rotary_encoder.rs b/embassy-rp/src/pio_programs/rotary_encoder.rs index 7bd463bb8..71567a602 100644 --- a/embassy-rp/src/pio_programs/rotary_encoder.rs +++ b/embassy-rp/src/pio_programs/rotary_encoder.rs | |||
| @@ -49,12 +49,12 @@ impl<'d, T: Instance, const SM: usize> PioEncoder<'d, T, SM> { | |||
| 49 | cfg.set_in_pins(&[&pin_a, &pin_b]); | 49 | cfg.set_in_pins(&[&pin_a, &pin_b]); |
| 50 | cfg.fifo_join = FifoJoin::RxOnly; | 50 | cfg.fifo_join = FifoJoin::RxOnly; |
| 51 | cfg.shift_in.direction = ShiftDirection::Left; | 51 | cfg.shift_in.direction = ShiftDirection::Left; |
| 52 | 52 | ||
| 53 | // Original: 10_000 at 125 MHz (12.5 KHz PIO clock) | 53 | // Original: 10_000 at 125 MHz (12.5 KHz PIO clock) |
| 54 | // Scale divider to maintain same PIO clock frequency at different system clocks | 54 | // Scale divider to maintain same PIO clock frequency at different system clocks |
| 55 | let divider = (clk_sys_freq() as f32 / 12_500.0).to_fixed(); | 55 | let divider = (clk_sys_freq() as f32 / 12_500.0).to_fixed(); |
| 56 | cfg.clock_divider = divider; | 56 | cfg.clock_divider = divider; |
| 57 | 57 | ||
| 58 | cfg.use_program(&program.prg, &[]); | 58 | cfg.use_program(&program.prg, &[]); |
| 59 | sm.set_config(&cfg); | 59 | sm.set_config(&cfg); |
| 60 | sm.set_enable(true); | 60 | sm.set_enable(true); |
