Currently i'am measuring a 4khz signal from a signal generator with the I2S adc via dma.
The data goes into a buffer on a task and i read that buffer from an other task.
The problem is that i think some data get lost because the other task reads the data from the buffer even when the reader does not finished.
My code right now:
Code: Select all
static void loop0(void * pvParameters){
for( ;; ){
Sampling(); // RETRIVE DATA FROM DMA BUFFER
}
}
static const inline void To_the_Stars(){
if(millis() - Start_Millis >= 1000){
Start_Millis = millis();
for(int i = 0;i<NUM_SAMPLES;i++){
Send_Data_to_Plot(i2s_read_buff[i]); // RETRIVE DATA FROM i2s_read_buff FOR CALCULATION AND VISUALIZATION
}
}
}