mirror of
https://github.com/OpenAMP/libmetal.git
synced 2026-09-24 03:03:47 +08:00
FreeRTOS: Allow tick rates greater than 1000 for metal_sleep_usec().
metal_sleep_usec() used portTICK_PERIOD_MS to determine how long to sleep. If the FreeRTOS tick rate is set to greater than 1000, this will be 0, resulting in a divide by zero error at run time. This changes it to use pdMS_TO_TICKS(), which can accomodate higher tick rates. Signed-off-by: Ed Mooring <ed.mooring@linaro.org>
This commit is contained in:
committed by
Arnaud Pouliquen
parent
f52728d078
commit
f252f0e007
@@ -25,7 +25,7 @@ extern "C" {
|
||||
|
||||
static inline int __metal_sleep_usec(unsigned int usec)
|
||||
{
|
||||
const TickType_t xDelay = ((usec/1000) / portTICK_PERIOD_MS);
|
||||
const TickType_t xDelay = pdMS_TO_TICKS(usec/1000);
|
||||
|
||||
vTaskDelay(xDelay ? xDelay : 1);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user