diff --git a/examples/lighting-app/silabs/SiWx917/src/LightingManager.cpp b/examples/lighting-app/silabs/SiWx917/src/LightingManager.cpp index fd07e80e68401f..2c5807f4ea693e 100644 --- a/examples/lighting-app/silabs/SiWx917/src/LightingManager.cpp +++ b/examples/lighting-app/silabs/SiWx917/src/LightingManager.cpp @@ -52,7 +52,7 @@ CHIP_ERROR LightingManager::Init() { // Create FreeRTOS sw timer for light timer. sLightTimer = xTimerCreate("lightTmr", // Just a text name, not used by the RTOS kernel - 1, // == default timer period (mS) + pdMS_TO_TICKS(1), // == default timer period false, // no timer reload (==one-shot) (void *) this, // init timer id = light obj context TimerEventHandler // timer callback handler @@ -164,9 +164,9 @@ void LightingManager::StartTimer(uint32_t aTimeoutMs) } // timer is not active, change its period to required value (== restart). - // FreeRTOS- Block for a maximum of 100 ticks if the change period command + // FreeRTOS- Block for a maximum of 100 ms if the change period command // cannot immediately be sent to the timer command queue. - if (xTimerChangePeriod(sLightTimer, (aTimeoutMs / portTICK_PERIOD_MS), 100) != pdPASS) + if (xTimerChangePeriod(sLightTimer, pdMS_TO_TICKS(aTimeoutMs), pdMS_TO_TICKS(100)) != pdPASS) { SILABS_LOG("sLightTimer timer start() failed"); appError(APP_ERROR_START_TIMER_FAILED); @@ -175,7 +175,7 @@ void LightingManager::StartTimer(uint32_t aTimeoutMs) void LightingManager::CancelTimer(void) { - if (xTimerStop(sLightTimer, 0) == pdFAIL) + if (xTimerStop(sLightTimer, pdMS_TO_TICKS(0)) == pdFAIL) { SILABS_LOG("sLightTimer stop() failed"); appError(APP_ERROR_STOP_TIMER_FAILED); diff --git a/examples/lighting-app/silabs/efr32/src/LightingManager.cpp b/examples/lighting-app/silabs/efr32/src/LightingManager.cpp index fd07e80e68401f..2c5807f4ea693e 100644 --- a/examples/lighting-app/silabs/efr32/src/LightingManager.cpp +++ b/examples/lighting-app/silabs/efr32/src/LightingManager.cpp @@ -52,7 +52,7 @@ CHIP_ERROR LightingManager::Init() { // Create FreeRTOS sw timer for light timer. sLightTimer = xTimerCreate("lightTmr", // Just a text name, not used by the RTOS kernel - 1, // == default timer period (mS) + pdMS_TO_TICKS(1), // == default timer period false, // no timer reload (==one-shot) (void *) this, // init timer id = light obj context TimerEventHandler // timer callback handler @@ -164,9 +164,9 @@ void LightingManager::StartTimer(uint32_t aTimeoutMs) } // timer is not active, change its period to required value (== restart). - // FreeRTOS- Block for a maximum of 100 ticks if the change period command + // FreeRTOS- Block for a maximum of 100 ms if the change period command // cannot immediately be sent to the timer command queue. - if (xTimerChangePeriod(sLightTimer, (aTimeoutMs / portTICK_PERIOD_MS), 100) != pdPASS) + if (xTimerChangePeriod(sLightTimer, pdMS_TO_TICKS(aTimeoutMs), pdMS_TO_TICKS(100)) != pdPASS) { SILABS_LOG("sLightTimer timer start() failed"); appError(APP_ERROR_START_TIMER_FAILED); @@ -175,7 +175,7 @@ void LightingManager::StartTimer(uint32_t aTimeoutMs) void LightingManager::CancelTimer(void) { - if (xTimerStop(sLightTimer, 0) == pdFAIL) + if (xTimerStop(sLightTimer, pdMS_TO_TICKS(0)) == pdFAIL) { SILABS_LOG("sLightTimer stop() failed"); appError(APP_ERROR_STOP_TIMER_FAILED); diff --git a/examples/lock-app/silabs/SiWx917/src/LockManager.cpp b/examples/lock-app/silabs/SiWx917/src/LockManager.cpp index 1d227128f72258..ae25a4d1119382 100644 --- a/examples/lock-app/silabs/SiWx917/src/LockManager.cpp +++ b/examples/lock-app/silabs/SiWx917/src/LockManager.cpp @@ -79,7 +79,7 @@ CHIP_ERROR LockManager::Init(chip::app::DataModel::Nullable