aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@110e8d01-0319-4d1e-a829-52ad28d1bb01>2018-07-07 09:50:34 +0000
committergdisirio <gdisirio@110e8d01-0319-4d1e-a829-52ad28d1bb01>2018-07-07 09:50:34 +0000
commit3d7b366fd0fa5cb43743b58661c1027cd2623350 (patch)
treea10c5fc6208d0c2306597039e45906f4b2c06791 /os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.h
parentd8c1554717a8162fe2741533a50631f7ae99d067 (diff)
downloadChibiOS-3d7b366fd0fa5cb43743b58661c1027cd2623350.tar.gz
ChibiOS-3d7b366fd0fa5cb43743b58661c1027cd2623350.tar.bz2
ChibiOS-3d7b366fd0fa5cb43743b58661c1027cd2623350.zip
Fixed bug #957.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12138 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.h')
-rw-r--r--os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.h b/os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.h
index f453243cb..df6645c12 100644
--- a/os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.h
+++ b/os/hal/ports/STM32/LLD/TIMv1/hal_gpt_lld.h
@@ -542,7 +542,7 @@ struct GPTDriver {
* @notapi
*/
#define gpt_lld_change_interval(gptp, interval) \
- ((gptp)->tim->ARR = (uint32_t)(interval))
+ ((gptp)->tim->ARR = (uint32_t)((interval) - 1U))
/**
* @brief Returns the interval of GPT peripheral.
@@ -553,7 +553,7 @@ struct GPTDriver {
*
* @notapi
*/
-#define gpt_lld_get_interval(gptp) ((gptcnt_t)(gptp)->tim->ARR)
+#define gpt_lld_get_interval(gptp) ((gptcnt_t)((gptp)->tim->ARR + 1U))
/**
* @brief Returns the counter value of GPT peripheral.