Unverified Commit a8e66347 authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Avoid swapping L/R channels on I2S input (#2124)

Fixes #2123
parent bd8eb9bc
...@@ -295,8 +295,8 @@ static inline void pio_i2s_in_program_init(PIO pio, uint sm, uint offset, uint d ...@@ -295,8 +295,8 @@ static inline void pio_i2s_in_program_init(PIO pio, uint sm, uint offset, uint d
pio_sm_exec(pio, sm, pio_encode_set(pio_y, bits - 2)); pio_sm_exec(pio, sm, pio_encode_set(pio_y, bits - 2));
// Offset the data by 1 bit pio_sm_exec(pio, sm, pio_encode_in(pio_pins, bits)); // Shift in 1st L data
pio_sm_exec(pio, sm, pio_encode_in(pio_pins, bits - 1)); pio_sm_exec(pio, sm, pio_encode_in(pio_pins, bits - 1)); // Shift in 1st R data modulo one bit, avoiding bit shift from #2037
} }
%} %}
...@@ -378,8 +378,8 @@ static inline void pio_i2s_in_program_init(PIO pio, uint sm, uint offset, uint d ...@@ -378,8 +378,8 @@ static inline void pio_i2s_in_program_init(PIO pio, uint sm, uint offset, uint d
pio_sm_set_pindirs_with_mask(pio, sm, pin_mask, pin_mask); pio_sm_set_pindirs_with_mask(pio, sm, pin_mask, pin_mask);
pio_sm_set_pins(pio, sm, 0); // clear pins pio_sm_set_pins(pio, sm, 0); // clear pins
pio_sm_exec(pio, sm, pio_encode_set(pio_y, bits - 2)); pio_sm_exec(pio, sm, pio_encode_set(pio_y, bits - 2));
// Offset the data by 1 bit pio_sm_exec(pio, sm, pio_encode_in(pio_pins, bits)); // Shift in 1st L data
pio_sm_exec(pio, sm, pio_encode_in(pio_pins, bits - 1)); pio_sm_exec(pio, sm, pio_encode_in(pio_pins, bits - 1)); // Shift in 1st R data modulo one bit, avoiding bit shift from #2037
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment