From 345e1b126ca79dca73fd9f176ce85692cd5151b5 Mon Sep 17 00:00:00 2001 From: gitlab-runner Date: Thu, 28 Mar 2024 12:12:58 -0500 Subject: [PATCH] Upload abstraction-rtos [2307] --- RELEASE.md | 4 +- props.json | 2 +- .../cyabs_freertos_helpers.c | 53 +++++++++---------- 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 9dcf8d0..1304888 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -16,6 +16,8 @@ The this release of the RTOS Abstraction API includes support for the following: * ThreadX ### What Changed? +#### v1.7.6 +* FreeRTOS: vApplicationSleep issue fixed where sleep could not be entered in non-deeplseep idle mode. #### v1.7.5 * FreeRTOS: On devices that support DeepSleep, allow the application to specify a separate latency value for DeepSleep and normal Sleep, by defining `CY_CFG_PWR_SLEEP_LATENCY`. #### v1.7.4 @@ -74,7 +76,7 @@ This version of the RTOS Abstraction API was validated for compatibility with th | :--- | :----: | | ModusToolbox™ Software Environment | 2.4.0 | | GCC Compiler | 10.3.1 | -| IAR Compiler | 9.30.1 | +| IAR Compiler | 9.40.2 | | ARM Compiler | 6.16 | Minimum required ModusToolbox™ Software Environment: v2.0 diff --git a/props.json b/props.json index bf46742..3d7120e 100644 --- a/props.json +++ b/props.json @@ -2,6 +2,6 @@ "core": { "id": "83097955-1d6f-526e-97c4-75ce7920222f", "name": "abstraction-rtos", - "version": "1.7.5.36563" + "version": "1.7.6.39828" } } \ No newline at end of file diff --git a/source/COMPONENT_FREERTOS/cyabs_freertos_helpers.c b/source/COMPONENT_FREERTOS/cyabs_freertos_helpers.c index 6c9a07b..2be4a3e 100644 --- a/source/COMPONENT_FREERTOS/cyabs_freertos_helpers.c +++ b/source/COMPONENT_FREERTOS/cyabs_freertos_helpers.c @@ -189,6 +189,12 @@ __WEAK void vApplicationGetTimerTaskMemory(StaticTask_t** ppxTimerTaskTCBBuffer, //-------------------------------------------------------------------------------------------------- __WEAK void vApplicationSleep(TickType_t xExpectedIdleTime) { + #if (defined(CY_CFG_PWR_MODE_DEEPSLEEP) && \ + (CY_CFG_PWR_SYS_IDLE_MODE == CY_CFG_PWR_MODE_DEEPSLEEP)) || \ + (defined(CY_CFG_PWR_MODE_DEEPSLEEP_RAM) && \ + (CY_CFG_PWR_SYS_IDLE_MODE == CY_CFG_PWR_MODE_DEEPSLEEP_RAM)) + #define DEEPSLEEP_ENABLE + #endif static cyhal_lptimer_t timer; uint32_t actual_sleep_ms = 0; cy_rslt_t result = CY_RSLT_SUCCESS; @@ -220,10 +226,8 @@ __WEAK void vApplicationSleep(TickType_t xExpectedIdleTime) // configurator overrides the behaviour to sleep in the System->Power->RTOS->System // Idle Power Mode setting. #if defined (CY_CFG_PWR_SYS_IDLE_MODE) - #if (defined(CY_CFG_PWR_MODE_DEEPSLEEP) && \ - (CY_CFG_PWR_SYS_IDLE_MODE == CY_CFG_PWR_MODE_DEEPSLEEP)) || \ - (defined(CY_CFG_PWR_MODE_DEEPSLEEP_RAM) && \ - (CY_CFG_PWR_SYS_IDLE_MODE == CY_CFG_PWR_MODE_DEEPSLEEP_RAM)) + uint32_t sleep_ms = pdTICKS_TO_MS(xExpectedIdleTime); + #if defined DEEPSLEEP_ENABLE bool deep_sleep = true; // If the system needs to operate in active mode the tickless mode should not be used in // FreeRTOS @@ -233,7 +237,6 @@ __WEAK void vApplicationSleep(TickType_t xExpectedIdleTime) (CY_CFG_PWR_SYS_IDLE_MODE == CY_CFG_PWR_MODE_DEEPSLEEP_RAM) || #endif (CY_CFG_PWR_SYS_IDLE_MODE == CY_CFG_PWR_MODE_DEEPSLEEP); - uint32_t sleep_ms = pdTICKS_TO_MS(xExpectedIdleTime); if (deep_sleep) { // Adjust the deep-sleep time by the sleep/wake latency if set. @@ -268,30 +271,24 @@ __WEAK void vApplicationSleep(TickType_t xExpectedIdleTime) } if (!deep_sleep) { - uint32_t sleep_latency = - #if defined (CY_CFG_PWR_SLEEP_LATENCY) - CY_CFG_PWR_SLEEP_LATENCY + - #endif - 0; - if (sleep_ms > sleep_latency) - { - result = cyhal_syspm_tickless_sleep(_lptimer, (sleep_ms - sleep_latency), - &actual_sleep_ms); - } - else - { - result = CY_RTOS_TIMEOUT; - } + #endif // if defined DEEPSLEEP_ENABLE + uint32_t sleep_latency = + #if defined (CY_CFG_PWR_SLEEP_LATENCY) + CY_CFG_PWR_SLEEP_LATENCY + + #endif + 0; + if (sleep_ms > sleep_latency) + { + result = cyhal_syspm_tickless_sleep(_lptimer, (sleep_ms - sleep_latency), + &actual_sleep_ms); } - #else // if (defined(CY_CFG_PWR_MODE_DEEPSLEEP) && - // (CY_CFG_PWR_SYS_IDLE_MODE == CY_CFG_PWR_MODE_DEEPSLEEP)) || - // (defined(CY_CFG_PWR_MODE_DEEPSLEEP_RAM) && - // (CY_CFG_PWR_SYS_IDLE_MODE == CY_CFG_PWR_MODE_DEEPSLEEP_RAM)) - CY_UNUSED_PARAMETER(xExpectedIdleTime); - #endif //(defined(CY_CFG_PWR_MODE_DEEPSLEEP) && - //(CY_CFG_PWR_SYS_IDLE_MODE == CY_CFG_PWR_MODE_DEEPSLEEP)) || - //(defined(CY_CFG_PWR_MODE_DEEPSLEEP_RAM) && - //(CY_CFG_PWR_SYS_IDLE_MODE == CY_CFG_PWR_MODE_DEEPSLEEP_RAM)) + else + { + result = CY_RTOS_TIMEOUT; + } + #if defined DEEPSLEEP_ENABLE + } + #endif #else // if defined (CY_CFG_PWR_SYS_IDLE_MODE) CY_UNUSED_PARAMETER(xExpectedIdleTime); #endif // if defined (CY_CFG_PWR_SYS_IDLE_MODE)