[stm32f0xx] Fix type of overflow counter.

stm32_timer_calc_value was using uint32_t for the overflow counter,
ultimately causing timestamps to wrap as uint32_t.
This commit is contained in:
Onath Claridge
2021-08-12 13:22:03 -07:00
parent 77fa084cd0
commit 3c4a0b96c1

View File

@@ -222,7 +222,7 @@ static uint32_t stm32_timer_median_val(stm32_timer_capture_t *tc) {
// Assumes interrupts are disabled.
static uint64_t stm32_timer_calc_value(stm32_timer_capture_t *tc, uint32_t sr, uint32_t val) {
uint32_t overflow = tc->overflow;
uint64_t overflow = tc->overflow;
// Since we could be processing an overflow and capture interrupts at the
// same time, we don't know the ordering of the two. Here we assume
// that if the capture event occurred in the lower half of the counter