# Why don't we correct the kernel tick count in tickless idle when eSleepStatus == eNoTasksWaitingTimeout

**URL:** <https://forums.freertos.org/t/why-dont-we-correct-the-kernel-tick-count-in-tickless-idle-when-esleepstatus-enotaskswaitingtimeout/21136>\
**Category:** Kernel\
**Created:** [August 7, 2024, 4:44pm UTC](https://forums.freertos.org/t/why-dont-we-correct-the-kernel-tick-count-in-tickless-idle-when-esleepstatus-enotaskswaitingtimeout/21136 "2024-08-07T16:44:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![geekie\_techie](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@geekie\_techie](https://forums.freertos.org/u/geekie_techie)\
**Post date:** [August 7, 2024, 4:44pm UTC](https://forums.freertos.org/t/why-dont-we-correct-the-kernel-tick-count-in-tickless-idle-when-esleepstatus-enotaskswaitingtimeout/21136/1 "2024-08-07T16:44:00Z")

</div>

Hello,

I am looking at the tickless idle functionality that FreeRTOS provides: [Low Power Support - FreeRTOS™](https://www.freertos.org/low-power-tickless-rtos.html).

I wonder why we don’t call `vTaskStepTick()` in the snippet below after we come out of sleep. We do it in the “else” case though.

```auto
if( eSleepStatus == eNoTasksWaitingTimeout )
        {
            /* It is not necessary to configure an interrupt to bring the
            microcontroller out of its low power state at a fixed time in the
            future. */
            prvSleep();
        }

```

---

<div class="post-metadata">

**Author:** ![jefftenney](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/jefftenney/32/1314_2.png) [@jefftenney](https://forums.freertos.org/u/jefftenney)\
**Post date:** [August 7, 2024, 6:42pm UTC](https://forums.freertos.org/t/why-dont-we-correct-the-kernel-tick-count-in-tickless-idle-when-esleepstatus-enotaskswaitingtimeout/21136/2 "2024-08-07T18:42:14Z")

</div>

In the example on that page, the code doesn’t set up any timer to track the time spent in sleep nor to limit that time for the `eNoTasksWaitingTimeout` case. Thus it wouldn’t know what value to pass vTaskStepTick(). And the end result is the system tick count is allowed to stall for as long as that sleep lasts.

Typically if the application allows unlimited sleep with no timeout, then it also doesn’t care if the system tick count loses that sleep time.

---

<div class="post-metadata">

**Author:** ![Shub](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@Shub](https://forums.freertos.org/u/Shub)\
**Post date:** [August 8, 2024, 10:00am UTC](https://forums.freertos.org/t/why-dont-we-correct-the-kernel-tick-count-in-tickless-idle-when-esleepstatus-enotaskswaitingtimeout/21136/3 "2024-08-08T10:00:16Z")

</div>

The eSleepStatus value of eNoTasksWaitingTimeout indicates that no task is present in the ready queue to be scheduled, hence this being an RTOS it makes more sense for the system to sleep till a task is moved from “Blocked” to “Ready” state.
