sdcandy wrote on Friday, December 14, 2018:
This may be a bit of a dumb question but is there an opposite function / macro to pdMS_TO_TICKS() that converts a number of ticks to millseconds or seconds?
-Andy.
sdcandy wrote on Friday, December 14, 2018:
This may be a bit of a dumb question but is there an opposite function / macro to pdMS_TO_TICKS() that converts a number of ticks to millseconds or seconds?
-Andy.
heinbali01 wrote on Friday, December 14, 2018:
If pdMS_TO_TICKS()
is defined as:
#define pdMS_TO_TICKS( xTimeInMs ) ( ( xTimeInMs * configTICK_RATE_HZ ) / 1000 )
the oppositve would be like:
#define pdTICKS_TO_MS( xTicks ) ( ( xTicks * 1000 ) / configTICK_RATE_HZ )
Or with some proper casts:
#define pdTICKS_TO_MS( xTicks ) ( ( ( TickType_t ) ( xTicks ) * 1000u ) / configTICK_RATE_HZ )