From c622d52f6b2b84e98dbc9ced6a3ee5f6c1e48c76 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 14 Mar 2022 07:49:08 +0000 Subject: [PATCH] Fixed bug #1221. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15500 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/nil/include/ch.h | 2 +- os/rt/include/chtime.h | 2 +- readme.txt | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/os/nil/include/ch.h b/os/nil/include/ch.h index 13d0462a4..686b77849 100644 --- a/os/nil/include/ch.h +++ b/os/nil/include/ch.h @@ -965,7 +965,7 @@ struct nil_os_instance { * @api */ #define TIME_I2US(interval) \ - (time_msecs_t)((((time_conv_t)(interval) * (time_conv_t)1000000) + \ + (time_usecs_t)((((time_conv_t)(interval) * (time_conv_t)1000000) + \ (time_conv_t)CH_CFG_ST_FREQUENCY - (time_conv_t)1) / \ (time_conv_t)CH_CFG_ST_FREQUENCY) /** @} */ diff --git a/os/rt/include/chtime.h b/os/rt/include/chtime.h index ba393f90a..4756276ae 100644 --- a/os/rt/include/chtime.h +++ b/os/rt/include/chtime.h @@ -271,7 +271,7 @@ typedef uint32_t time_conv_t; * @api */ #define TIME_I2US(interval) \ - (time_msecs_t)((((time_conv_t)(interval) * (time_conv_t)1000000) + \ + (time_usecs_t)((((time_conv_t)(interval) * (time_conv_t)1000000) + \ (time_conv_t)CH_CFG_ST_FREQUENCY - (time_conv_t)1) / \ (time_conv_t)CH_CFG_ST_FREQUENCY) /** @} */ diff --git a/readme.txt b/readme.txt index c47440e67..0c7b052dd 100644 --- a/readme.txt +++ b/readme.txt @@ -121,6 +121,8 @@ ARMv7-M and ARMv8-M-ML. - NEW: On STM32WBxx added a check on STM32_LSI_ENABLE required by IWDG. - NEW: Added SPIv2 support also to STM32WB and STM32WL. +- FIX: Fixed incorrect type cast in TIME_I2US() (bug #1221) + (backported to 20.3.5)(backported to 21.11.2). - FIX: Reverted bug #1100 (backported to 20.3.5)(backported to 21.11.2). - FIX: Fixed missing clock disable for STM32 OCTOSPI2 (bug #1220) (backported to 20.3.5)(backported to 21.11.2).