aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter <tixiv@gmx.net>2016-09-10 15:13:23 +0200
committerNicolas Reinecke <nr@das-labor.org>2016-12-05 11:37:44 +0100
commitc7d33767e06000f9da3befd6a7954b82c42d080d (patch)
tree5edc1cd2bae71422a61f6e3b3dcedf9a21e59ac4
parent580af16b82c465835801102fe1879f7fffa3296a (diff)
downloadChibiOS-Contrib-c7d33767e06000f9da3befd6a7954b82c42d080d.tar.gz
ChibiOS-Contrib-c7d33767e06000f9da3befd6a7954b82c42d080d.tar.bz2
ChibiOS-Contrib-c7d33767e06000f9da3befd6a7954b82c42d080d.zip
change qei types to int16_t
-rw-r--r--os/hal/ports/NRF5/LLD/hal_qei_lld.h2
-rw-r--r--os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.h2
-rw-r--r--os/hal/src/hal_qei.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/os/hal/ports/NRF5/LLD/hal_qei_lld.h b/os/hal/ports/NRF5/LLD/hal_qei_lld.h
index 6328bab..85c96a5 100644
--- a/os/hal/ports/NRF5/LLD/hal_qei_lld.h
+++ b/os/hal/ports/NRF5/LLD/hal_qei_lld.h
@@ -166,7 +166,7 @@ typedef enum {
/**
* @brief QEI counter type.
*/
-typedef int32_t qeicnt_t;
+typedef int16_t qeicnt_t;
/**
* @brief QEI delta type.
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 c708b5e..ba33a29 100644
--- a/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.h
+++ b/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.h
@@ -251,7 +251,7 @@ typedef enum {
/**
* @brief QEI counter type.
*/
-typedef uint16_t qeicnt_t;
+typedef int16_t qeicnt_t;
/**
* @brief QEI delta type.
diff --git a/os/hal/src/hal_qei.c b/os/hal/src/hal_qei.c
index eb6223e..9b084f7 100644
--- a/os/hal/src/hal_qei.c
+++ b/os/hal/src/hal_qei.c
@@ -364,7 +364,7 @@ qeidelta_t qeiUpdateI(QEIDriver *qeip) {
"invalid state");
cnt = qei_lld_get_count(qeip);
- delta = cnt - qeip->last;
+ delta = (qeicnt_t)(cnt - qeip->last);
qeip->last = cnt;
return delta;