aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32
diff options
context:
space:
mode:
authorNicolas Reinecke <nr@das-labor.org>2016-05-15 20:11:18 +0200
committerNicolas Reinecke <nr@das-labor.org>2016-05-15 20:21:20 +0200
commit4a36fb944b854eb91e74ce18a7b2cb0cedf7d0d1 (patch)
tree216ab41dc7a48990d09b4bedec95e5a54f99ec90 /os/hal/ports/STM32
parentec6cada170e3640bb42a1e7a5fb3f052b4b6ea47 (diff)
downloadChibiOS-Contrib-4a36fb944b854eb91e74ce18a7b2cb0cedf7d0d1.tar.gz
ChibiOS-Contrib-4a36fb944b854eb91e74ce18a7b2cb0cedf7d0d1.tar.bz2
ChibiOS-Contrib-4a36fb944b854eb91e74ce18a7b2cb0cedf7d0d1.zip
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.
Diffstat (limited to 'os/hal/ports/STM32')
-rw-r--r--os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.h2
1 files changed, 1 insertions, 1 deletions
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.