Skip to content

Commit 3395533

Browse files
author
Iain Buchanan
committed
use uint64_t for intermediate calculate of pdMS_TO_TICKS so stop integer overflow for long ms values
1 parent 562fc79 commit 3395533

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/nRF5/freertos/Source/include/projdefs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ typedef void (*TaskFunction_t)( void * );
3838
overridden by a macro of the same name defined in FreeRTOSConfig.h in case the
3939
definition here is not suitable for your application. */
4040
#ifndef pdMS_TO_TICKS
41-
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) )
41+
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( uint64_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) )
4242
#endif
4343

4444
#define pdFALSE ( ( BaseType_t ) 0 )

0 commit comments

Comments
 (0)