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

Fixes #2123
This commit is contained in:
Earle F. Philhower, III 2024-04-25 11:22:07 -07:00 committed by GitHub
parent bd8eb9bca2
commit a8e6634776
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -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));
// Offset the data by 1 bit
pio_sm_exec(pio, sm, pio_encode_in(pio_pins, bits - 1));
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)); // Shift in 1st R data modulo one bit, avoiding bit shift from #2037
}
%}

View file

@ -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_pins(pio, sm, 0); // clear pins
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 - 1));
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)); // Shift in 1st R data modulo one bit, avoiding bit shift from #2037
}
#endif