From 84cba6bb97764b87bfd4acfa5216daadfaea25e0 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 24 Apr 2014 11:31:40 +0000 Subject: [PATCH] Fixed bug #487. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6880 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/include/pwm.h | 4 ++-- readme.txt | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/os/hal/include/pwm.h b/os/hal/include/pwm.h index e943df382..cdd1f43ca 100644 --- a/os/hal/include/pwm.h +++ b/os/hal/include/pwm.h @@ -118,8 +118,8 @@ typedef void (*pwmcallback_t)(PWMDriver *pwmp); * @api */ #define PWM_FRACTION_TO_WIDTH(pwmp, denominator, numerator) \ - ((uint16_t)((((uint32_t)(pwmp)->period) * \ - (uint32_t)(numerator)) / (uint32_t)(denominator))) + ((pwmcnt_t)((((pwmcnt_t)(pwmp)->period) * \ + (pwmcnt_t)(numerator)) / (pwmcnt_t)(denominator))) /** * @brief Converts from degrees to pulse width. diff --git a/readme.txt b/readme.txt index e7afb49cb..8901f4aa7 100644 --- a/readme.txt +++ b/readme.txt @@ -89,6 +89,8 @@ ***************************************************************************** *** 2.7.0 *** +- FIX: Fixed invalid cast in PWM_FRACTION_TO_WIDTH() macro (bug #487) + (backported to 2.4.6 and 2.6.4). - FIX: Fixed wrong STM32 TIM9 clock source in PWM and ICU drivers (bug #486) (backported to 2.6.4). - FIX: Fixed MMC_SPI driver block_addresses is not initialized after