mirror of https://github.com/FOME-Tech/fome-fw.git
fast adc skip
This commit is contained in:
parent
175e51dfd1
commit
2e7425d037
|
@ -151,12 +151,6 @@ static FastAdcToken triggerSampleIndex;
|
|||
|
||||
extern AdcDevice fastAdc;
|
||||
|
||||
#ifdef FAST_ADC_SKIP
|
||||
// No reason to enable if N = 1
|
||||
static_assert(FAST_ADC_SKIP > 1);
|
||||
static size_t fastAdcSkipCount = 0;
|
||||
#endif // FAST_ADC_SKIP
|
||||
|
||||
/**
|
||||
* This method is not in the adc* lower-level file because it is more business logic then hardware.
|
||||
*/
|
||||
|
@ -168,16 +162,6 @@ void onFastAdcComplete(adcsample_t*) {
|
|||
triggerAdcCallback(getFastAdc(triggerSampleIndex));
|
||||
#endif /* HAL_TRIGGER_USE_ADC */
|
||||
|
||||
#ifdef FAST_ADC_SKIP
|
||||
// If we run the fast ADC _very_ fast for triggerAdcCallback's benefit, we may want to
|
||||
// skip most of the samples for the rest of the callback.
|
||||
if (fastAdcSkipCount++ == FAST_ADC_SKIP) {
|
||||
fastAdcSkipCount = 0;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* this callback is executed 10 000 times a second, it needs to be as fast as possible
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue