Actually center the ADC samples where we want
Change-Id: I55047f863600f0f46394fd2460a4d71b28453dba
diff --git a/motors/peripheral/adc_dma.h b/motors/peripheral/adc_dma.h
index 8d98dde..6cd0742 100644
--- a/motors/peripheral/adc_dma.h
+++ b/motors/peripheral/adc_dma.h
@@ -28,7 +28,7 @@
// Corresponding samples in adc0_samples and adc1_samples happen
// simultaneously. Second sample happens at the cycle boundary. Elements
// should include the appropriate ADCH and DIFF values.
- AdcDmaSampler();
+ AdcDmaSampler(int counts_per_cycle);
// Must be called before Initialize().
void set_adc0_samples(
@@ -97,6 +97,8 @@
return ENCODER_VALUE_DMA_CHANNEL;
}
+ const int counts_per_cycle_;
+
::std::array<::std::array<volatile uint32_t, kNumberAdcSamples + 2>, 2>
adc_sc1s_{};
::std::array<::std::array<volatile uint16_t, kNumberAdcSamples>, 2>