Closed manuelferreira65 closed 4 years ago
I don't think it was expected that TickType_t
would be a 16 bit type, hence top line, before divide, overflows.
Try removing the casts from the top line. Richard may already have fixed this. I'll check.
Resolved finally with this code.
#if configUSE_16_BIT_TICKS == 1
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( uint32_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) )
#else
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) )
#endif
define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) )
If TickType_t defined as uint16_t xTimeInMs * configTICK_RATE_HZ overflows with xTimeInMs = 1058.