Skip to content

Commit

Permalink
firmware: app: tasks: Fix milliseconds to ticks macro #349
Browse files Browse the repository at this point in the history
  • Loading branch information
c-porto committed May 17, 2024
1 parent c180b69 commit d6f0c4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions firmware/app/tasks/system_reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <[email protected]>
*
* \version 0.10.7
* \version 0.10.16
*
* \date 2020/01/12
*
Expand All @@ -44,7 +44,7 @@ void vTaskSystemReset(void)
{
while(1)
{
vTaskDelay(pdMS_TO_TICKS_64(TASK_SYSTEM_RESET_PERIOD_MS));
vTaskDelay(pdMS_TO_TICKS_64(TASK_SYSTEM_RESET_PERIOD_MS)); // cppcheck-suppress misra-c2012-10.8

sys_log_print_event_from_module(SYS_LOG_INFO, TASK_SYSTEM_RESET_NAME, "Restarting the system...");
sys_log_new_line();
Expand Down
4 changes: 2 additions & 2 deletions firmware/app/tasks/system_reset.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <[email protected]>
*
* \version 0.10.7
* \version 0.10.16
*
* \date 2020/01/12
*
Expand All @@ -45,7 +45,7 @@
#define TASK_SYSTEM_RESET_PRIORITY 2 /**< Task priority. */
#define TASK_SYSTEM_RESET_PERIOD_MS (1000UL*60U*60U*10U) /**< Task period in milliseconds. */

#define pdMS_TO_TICKS_64( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) )
#define pdMS_TO_TICKS_64( xTimeInMs ) ( ( TickType_t ) ( ( ( uint64_t ) ( xTimeInMs ) * ( uint64_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) )

/**
* \brief Periodic system reset handle.
Expand Down

0 comments on commit d6f0c4f

Please sign in to comment.