lockin: add documentation explaining timestamp decrement

This commit is contained in:
Matt Huszagh 2020-11-24 23:43:21 -08:00
parent 3c4e83bf0f
commit da4430e912

View File

@ -180,8 +180,12 @@ impl Lockin {
// update old timestamps for new ADC batch
let sample_period = self.sample_period as i32;
self.timestamps.iter_mut().for_each(|t| match *t {
Some(i) => {
*t = Some(i - ADC_SAMPLE_BUFFER_SIZE as i32 * sample_period);
Some(timestamp) => {
// Existing timestamps have aged by one ADC batch
// period since the last ADC batch.
*t = Some(
timestamp - ADC_SAMPLE_BUFFER_SIZE as i32 * sample_period,
);
}
None => (),
});