diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-12-15 11:02:01 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-12-15 11:02:01 +0000 |
| commit | 99ad61cecf4fe098feeced5524d3e60625137457 (patch) | |
| tree | e2d968579accafd429b1d25a9378252455e30a39 | |
| parent | 1e37cc5498d30404ce0daf59748bce22ac4815cf (diff) | |
| parent | ffbef9316d523724d050f32e800668a56e534657 (diff) | |
Merge pull request #3647 from vinsynth/rp-fix-pio-i2s-clock
Rp fix pio i2s clock
| -rw-r--r-- | embassy-rp/src/pio_programs/i2s.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/embassy-rp/src/pio_programs/i2s.rs b/embassy-rp/src/pio_programs/i2s.rs index e3f1f89d4..87fb2e19f 100644 --- a/embassy-rp/src/pio_programs/i2s.rs +++ b/embassy-rp/src/pio_programs/i2s.rs | |||
| @@ -67,7 +67,7 @@ impl<'a, P: Instance, const S: usize> PioI2sOut<'a, P, S> { | |||
| 67 | cfg.use_program(&program.prg, &[&bit_clock_pin, &left_right_clock_pin]); | 67 | cfg.use_program(&program.prg, &[&bit_clock_pin, &left_right_clock_pin]); |
| 68 | cfg.set_out_pins(&[&data_pin]); | 68 | cfg.set_out_pins(&[&data_pin]); |
| 69 | let clock_frequency = sample_rate * bit_depth * channels; | 69 | let clock_frequency = sample_rate * bit_depth * channels; |
| 70 | cfg.clock_divider = (125_000_000. / clock_frequency as f64 / 2.).to_fixed(); | 70 | cfg.clock_divider = (crate::clocks::clk_sys_freq() as f64 / clock_frequency as f64 / 2.).to_fixed(); |
| 71 | cfg.shift_out = ShiftConfig { | 71 | cfg.shift_out = ShiftConfig { |
| 72 | threshold: 32, | 72 | threshold: 32, |
| 73 | direction: ShiftDirection::Left, | 73 | direction: ShiftDirection::Left, |
