From 339553343de08cfa4506cebfbbf6d3eab9b099a5 Mon Sep 17 00:00:00 2001 From: Iain Buchanan Date: Wed, 8 Dec 2021 17:00:40 +0930 Subject: [PATCH] use uint64_t for intermediate calculate of pdMS_TO_TICKS so stop integer overflow for long ms values --- cores/nRF5/freertos/Source/include/projdefs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/nRF5/freertos/Source/include/projdefs.h b/cores/nRF5/freertos/Source/include/projdefs.h index d4aa198a..b203416a 100644 --- a/cores/nRF5/freertos/Source/include/projdefs.h +++ b/cores/nRF5/freertos/Source/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 ) ( ( ( TickType_t ) ( xTimeInMs ) * ( uint64_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) ) #endif #define pdFALSE ( ( BaseType_t ) 0 )