lock-in: use same method for batch_index branching in both instances

This commit is contained in:
Matt Huszagh 2021-01-09 12:57:13 -08:00
parent bae295140d
commit 31d23a3e0c

View File

@ -165,8 +165,9 @@ impl Lockin {
frequency = self.last_frequency.unwrap();
}
None => {
self.batch_index += 1;
if self.batch_index == ADC_BATCHES as u32 {
if self.batch_index < ADC_BATCHES as u32 - 1 {
self.batch_index += 1;
} else {
self.batch_index = 0;
}
return Err("insufficient timestamps");