Code formatted

This commit is contained in:
Kai Lauterbach 2024-02-09 21:31:21 +01:00
parent c099bb3a53
commit 7633963ea7

View file

@ -32,9 +32,11 @@ void ADC_Sampling(uint16_t *i2s_buff){
}
*/
void ADC_Sampling(uint16_t *i2s_buff){
size_t bytes_read; for (int i = 0; i < B_MULT; i++) {
size_t bytes_read;
for (int i = 0; i < B_MULT; i++) {
i2s_read(I2S_NUM_0, (void*)&i2s_buff[i * NUM_SAMPLES], NUM_SAMPLES * sizeof(uint16_t), &bytes_read, portMAX_DELAY);
for(size_t ix = 0; ix < bytes_read/2; ix++) i2s_buff[(i * NUM_SAMPLES) + ix] &= 0x0FFF; // 16bit to 12bit conversion 
for(size_t ix = 0; ix < bytes_read/2; ix++)
i2s_buff[(i * NUM_SAMPLES) + ix] &= 0x0FFF; // 16bit to 12bit conversion 
}
}