Skip to content

Commit

Permalink
Upload abstraction-rtos [2307]
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlab-runner committed Mar 28, 2024
1 parent b679710 commit 345e1b1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 30 deletions.
4 changes: 3 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion props.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"core": {
"id": "83097955-1d6f-526e-97c4-75ce7920222f",
"name": "abstraction-rtos",
"version": "1.7.5.36563"
"version": "1.7.6.39828"
}
}
53 changes: 25 additions & 28 deletions source/COMPONENT_FREERTOS/cyabs_freertos_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 345e1b1

Please sign in to comment.