stm32duino / STM32Examples

Arduino library to provide several examples for the Arduino core for STM32 MCUs.
140 stars 54 forks source link

Computed frequency = 0, with input signal present #15

Closed ABOSTM closed 4 years ago

ABOSTM commented 4 years ago

Fix issue introduced by 'Fix frequency computation when there is no more signal'

It happens that frequency was measured at 0 whereas signal was present. It is due to the fact that rollover is not abnormal: timer is never reset to avoid missing some cpu cycles in the computation. Loss of signal is detected by 2 consecutive rollover without rising edge.