Merge pull request #3647 from vinsynth/rp-fix-pio-i2s-clock
Rp fix pio i2s clock
This commit is contained in:
commit
99ad61cecf
@ -67,7 +67,7 @@ impl<'a, P: Instance, const S: usize> PioI2sOut<'a, P, S> {
|
|||||||
cfg.use_program(&program.prg, &[&bit_clock_pin, &left_right_clock_pin]);
|
cfg.use_program(&program.prg, &[&bit_clock_pin, &left_right_clock_pin]);
|
||||||
cfg.set_out_pins(&[&data_pin]);
|
cfg.set_out_pins(&[&data_pin]);
|
||||||
let clock_frequency = sample_rate * bit_depth * channels;
|
let clock_frequency = sample_rate * bit_depth * channels;
|
||||||
cfg.clock_divider = (125_000_000. / clock_frequency as f64 / 2.).to_fixed();
|
cfg.clock_divider = (crate::clocks::clk_sys_freq() as f64 / clock_frequency as f64 / 2.).to_fixed();
|
||||||
cfg.shift_out = ShiftConfig {
|
cfg.shift_out = ShiftConfig {
|
||||||
threshold: 32,
|
threshold: 32,
|
||||||
direction: ShiftDirection::Left,
|
direction: ShiftDirection::Left,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user