src/C/sleep.c
bool sleep_is_sleeping_task(e_task_id 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)
    {
        if (sleep_tab[id].sleep_until > core_systick_get_ticks()) {
            return true;
        } else {
            task_set_task_state(id, TASK_MODE_MAINTHREAD, TASK_STATE_RUNNABLE);
            return false;
        }
    } else {
        return false;
    }
}
/**
 * \brief check if a task is currently sleeping
 *
 * \param id the task id to check
 *
 * return true if a task is sleeping, or false
 */
\brief check if a task is currently sleeping
\param id the task id to check

return true if a task is sleeping, or false
\ brief check if a task is currently sleeping \ param id the task id to check return true if a task is sleeping or false
bool sleep_is_sleeping_task(e_task_id 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)
    {
        if (sleep_tab[id].sleep_until > core_systick_get_ticks()) {
            return true;
        } else {
            task_set_task_state(id, TASK_MODE_MAINTHREAD, TASK_STATE_RUNNABLE);
            return false;
        }
    } else {
        return false;
    }
}
bool sleep_is_sleeping_task ( e_task_id 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 ) { if ( sleep_tab [ id ] . sleep_until > core_systick_get_ticks ( ) ) { return true ; } else { task_set_task_state ( id , TASK_MODE_MAINTHREAD , TASK_STATE_RUNNABLE ) ; return false ; } } else { return false ; } }
\brief check if a task is currently sleeping
 \param id the task id to check
\ brief check if a task is currently sleeping \ param id the task id to check