From 1e5ea44875d25dca11f3cf27618f3cdfc652a68c Mon Sep 17 00:00:00 2001 From: Phillip Stevens Date: Wed, 19 Feb 2020 11:34:02 +1100 Subject: [PATCH] Update projdefs.h Where `TickType_t` is `uint16_t` the calculation overflows. This proposal was used to resolve [`feilipu/Arduino_FreeRTOS_Library` #61](https://github.com/feilipu/Arduino_FreeRTOS_Library/issues/61) --- include/projdefs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/projdefs.h b/include/projdefs.h index 19a6b8f3e..7a88e6f21 100644 --- a/include/projdefs.h +++ b/include/projdefs.h @@ -38,7 +38,7 @@ typedef void (*TaskFunction_t)( void * ); overridden by a macro of the same name defined in FreeRTOSConfig.h in case the definition here is not suitable for your application. */ #ifndef pdMS_TO_TICKS - #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) ) + #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( xTimeInMs ) * (uint32_t) configTICK_RATE_HZ ) / 1000 ) ) #endif #define pdFALSE ( ( BaseType_t ) 0 )