Fast ADC readings ok, to verify timing and settling time

This commit is contained in:
2026-04-05 17:05:10 +02:00
parent a2d0afa0c9
commit 5c9ef7e93b
8 changed files with 66 additions and 82 deletions

View File

@@ -254,6 +254,7 @@ void rtIgnitionTask(void *pvParameters)
// read adc channels: pickup12, out12 [ pos + neg ]
if (adc) // read only if adc initialized
{
uint32_t start_adc_read = esp_timer_get_time();
// from peak detector circuits
ign_box_sts.coils12.peak_p_in = adcReadChannel(adc, ADC_CH_PEAK_12P_IN);
ign_box_sts.coils12.peak_n_in = adcReadChannel(adc, ADC_CH_PEAK_12N_IN);
@@ -263,6 +264,7 @@ void rtIgnitionTask(void *pvParameters)
ign_box_sts.coils12.peak_n_out = adcReadChannel(adc, ADC_CH_PEAK_12N_OUT);
ign_box_sts.coils34.peak_p_out = adcReadChannel(adc, ADC_CH_PEAK_34P_OUT);
ign_box_sts.coils34.peak_n_out = adcReadChannel(adc, ADC_CH_PEAK_34N_OUT);
ign_box_sts.adc_read_time = (uint32_t)(esp_timer_get_time() - start_adc_read);
}
else // simulate adc read timig
vTaskDelay(pdMS_TO_TICKS(1));