From 7633963ea7cdff42a0357ffd33ad321616290f44 Mon Sep 17 00:00:00 2001 From: Kai Lauterbach Date: Fri, 9 Feb 2024 21:31:21 +0100 Subject: [PATCH] Code formatted --- ESP32_Oscilloscope/i2s.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ESP32_Oscilloscope/i2s.ino b/ESP32_Oscilloscope/i2s.ino index a4c319a..6f17c62 100644 --- a/ESP32_Oscilloscope/i2s.ino +++ b/ESP32_Oscilloscope/i2s.ino @@ -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Ā  } }