Skip to content

Commit

Permalink
Stop reading samples during readfifo for better speed & timing
Browse files Browse the repository at this point in the history
  • Loading branch information
mcells authored Mar 29, 2024
1 parent 3f3aba8 commit ffcd967
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ unsigned long IRAM_ATTR fifotime = 0;
// The ADC counts get saved in uint32_t i2s_adc_buffer[].
void IRAM_ATTR readFiFo()
{
CLEAR_PERI_REG_MASK(I2S_CONF_REG(0), I2S_RX_START); // Stop aquisition to buffer

// uint32_t readings[ADC1_CHANNEL_MAX][ADC1_CHANNEL_MAX*BUF_LEN];
uint32_t avgreadings[ADC1_CHANNEL_MAX] = {0};
uint32_t counts[ADC1_CHANNEL_MAX] = {0};
Expand Down Expand Up @@ -173,6 +175,8 @@ void IRAM_ATTR readFiFo()
// Serial.printf(">Channel%d:%d\n", j, i2s_adc_buffer[j]);
}
}*/

SET_PERI_REG_MASK(I2S_CONF_REG(0), I2S_RX_START); // Restart aquisition to buffer
}

#if I2S_USE_INTERRUPT == true
Expand Down

0 comments on commit ffcd967

Please sign in to comment.