Store fast adc error for debug
This commit is contained in:
parent
e562f0b540
commit
eab5e16282
|
@ -119,11 +119,18 @@ static void adc_callback_fast(ADCDriver *adcp) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static volatile adcerror_t fastAdcLastError;
|
||||||
|
|
||||||
|
static void fastAdcErrorCB(ADCDriver *, adcerror_t err)
|
||||||
|
{
|
||||||
|
fastAdcLastError = err;
|
||||||
|
}
|
||||||
|
|
||||||
static ADCConversionGroup adcgrpcfgFast = {
|
static ADCConversionGroup adcgrpcfgFast = {
|
||||||
.circular = FALSE,
|
.circular = FALSE,
|
||||||
.num_channels = 0,
|
.num_channels = 0,
|
||||||
.end_cb = adc_callback_fast,
|
.end_cb = adc_callback_fast,
|
||||||
.error_cb = nullptr,
|
.error_cb = fastAdcErrorCB,
|
||||||
/* HW dependent part.*/
|
/* HW dependent part.*/
|
||||||
.cr1 = 0,
|
.cr1 = 0,
|
||||||
.cr2 = ADC_CR2_SWSTART,
|
.cr2 = ADC_CR2_SWSTART,
|
||||||
|
@ -180,13 +187,11 @@ static void fast_adc_callback(GPTDriver*) {
|
||||||
engine->outputChannels.fastAdcErrorsCount++;
|
engine->outputChannels.fastAdcErrorsCount++;
|
||||||
// todo: when? why? criticalError("ADC fast not ready?");
|
// todo: when? why? criticalError("ADC fast not ready?");
|
||||||
// see notes at https://github.com/rusefi/rusefi/issues/6399
|
// see notes at https://github.com/rusefi/rusefi/issues/6399
|
||||||
chSysUnlockFromISR();
|
} else {
|
||||||
return;
|
adcStartConversionI(&ADC_FAST_DEVICE, &adcgrpcfgFast, fastAdc.samples, ADC_BUF_DEPTH_FAST);
|
||||||
|
fastAdc.conversionCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
adcStartConversionI(&ADC_FAST_DEVICE, &adcgrpcfgFast, fastAdc.samples, ADC_BUF_DEPTH_FAST);
|
|
||||||
chSysUnlockFromISR();
|
chSysUnlockFromISR();
|
||||||
fastAdc.conversionCount++;
|
|
||||||
#endif /* EFI_INTERNAL_ADC */
|
#endif /* EFI_INTERNAL_ADC */
|
||||||
}
|
}
|
||||||
#endif // EFI_USE_FAST_ADC
|
#endif // EFI_USE_FAST_ADC
|
||||||
|
|
Loading…
Reference in New Issue