>For instance, if the motor speed is sufficiently high that two consecutive capture events occur
> within the 10ms overflow period, your current coding would suggest that the overflow counter
> value would be either 1or 2, depending on whether an overflow condition occurred between
> the two events, or not. For the purpose of the period calculation, the number of intervening
> overflow periods should be zero in this case.
The way the current code is structured (and intended to work), if two motor edges come during 10ms, the overflow count would be 0. This is because the ISR will record tmr on first edge, increment hall_switch, and reset tpm_overflow counter. On the next edge, the ISR will record new timer value, store the tpm_overflow counter (which in this case should be 0), and disable the ISR for the channel.
At the next 10ms overflow, the main loop will see that the hall switch had been triggered and calculate the period. I am not understanding what I am missing.
-paul