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
1 changed files with 6 additions and 2 deletions

View File

@ -180,8 +180,12 @@ impl Lockin {
// update old timestamps for new ADC batch // update old timestamps for new ADC batch
let sample_period = self.sample_period as i32; let sample_period = self.sample_period as i32;
self.timestamps.iter_mut().for_each(|t| match *t { self.timestamps.iter_mut().for_each(|t| match *t {
Some(i) => { Some(timestamp) => {
*t = Some(i - ADC_SAMPLE_BUFFER_SIZE as i32 * sample_period); // 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 => (), None => (),
}); });