From 4a36fb944b854eb91e74ce18a7b2cb0cedf7d0d1 Mon Sep 17 00:00:00 2001 From: Nicolas Reinecke Date: Sun, 15 May 2016 20:11:18 +0200 Subject: qei driver: fix potential overflow in qeiUpdateI when quiUpdate isn't called for while an cnt(uint16_t) is above 32767 delta(int16_t) can overflow. --- os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'os/hal/ports/STM32/LLD') diff --git a/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.h b/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.h index 05f0ea7..d0cb683 100644 --- a/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.h +++ b/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.h @@ -238,7 +238,7 @@ typedef uint16_t qeicnt_t; /** * @brief QEI delta type. */ -typedef int16_t qeidelta_t; +typedef int32_t qeidelta_t; /** * @brief Driver configuration structure. -- cgit v1.2.3