src/C/sleep.c
void sleep_check_is_awoke(void)
{
    uint64_t t = core_systick_get_ticks();

    for (uint8_t id = 0; id <= ID_APPMAX; ++id) {
        if ((task_get_task_state(id, TASK_MODE_MAINTHREAD) == TASK_STATE_SLEEPING ||
             task_get_task_state(id, TASK_MODE_MAINTHREAD) == TASK_STATE_SLEEPING_DEEP)
            && t > sleep_tab[id].sleep_until)
        {
            task_set_task_state(id, TASK_MODE_MAINTHREAD, TASK_STATE_RUNNABLE);
        }
    }
}
/*
 * This function is called at each sched time of the systick handler, to
 * decrement the sleeptime of each task of 1.
 * If the speeptime reaches 0, the task mainthread is awoken.
 *
 * WARNING: there is case where the task is awoken *before* the end of
 * its sleep period:
 * - when an ISR arise
 * - when an IPC targeting the task is pushed
 *
 * In theses two cases, the sleep_cancel() function must be called in order
 * to cancel the current sleep round. The task is awoken by the corresponding
 * kernel module instead.
 */
This function is called at each sched time of the systick handler, to
decrement the sleeptime of each task of 1.
If the speeptime reaches 0, the task mainthread is awoken.

there is case where the task is awoken *before* the end of
its sleep period:
- when an ISR arise
- when an IPC targeting the task is pushed

In theses two cases, the sleep_cancel() function must be called in order
to cancel the current sleep round. The task is awoken by the corresponding
kernel module instead.
This function is called at each sched time of the systick handler to decrement the sleeptime of each task of 1 . If the speeptime reaches 0 the task mainthread is awoken . there is case where the task is awoken * before * the end of its sleep period : - when an ISR arise - when an IPC targeting the task is pushed In theses two cases the sleep_cancel () function must be called in order to cancel the current sleep round . The task is awoken by the corresponding kernel module instead .
void sleep_check_is_awoke(void)
{
    uint64_t t = core_systick_get_ticks();
    for (uint8_t id = 0; id <= ID_APPMAX; ++id) {
        if ((task_get_task_state(id, TASK_MODE_MAINTHREAD) == TASK_STATE_SLEEPING ||
             task_get_task_state(id, TASK_MODE_MAINTHREAD) == TASK_STATE_SLEEPING_DEEP)
            && t > sleep_tab[id].sleep_until)
        {
            task_set_task_state(id, TASK_MODE_MAINTHREAD, TASK_STATE_RUNNABLE);
        }
    }
}
void sleep_check_is_awoke ( void ) { uint64_t t = core_systick_get_ticks ( ) ; for ( uint8_t id = 0 ; id <= ID_APPMAX ; ++ id ) { if ( ( task_get_task_state ( id , TASK_MODE_MAINTHREAD ) == TASK_STATE_SLEEPING || task_get_task_state ( id , TASK_MODE_MAINTHREAD ) == TASK_STATE_SLEEPING_DEEP ) && t > sleep_tab [ id ] . sleep_until ) { task_set_task_state ( id , TASK_MODE_MAINTHREAD , TASK_STATE_RUNNABLE ) ; } } }
This function is called at each sched time of the systick handler, to
 decrement the sleeptime of each task of 1.
This function is called at each sched time of the systick handler to decrement the sleeptime of each task of 1 .