Skip to content

Why does default_idle_hook() lock deep sleep? #6199

@amq

Description

@amq

Description

Question

According to the documentation, sleep is managed automatically, including deep sleep. However from what I see, deep sleep is locked by default_idle_hook() for non-tickless targets

static void default_idle_hook(void)
{
// critical section to complete sleep with locked deepsleep
core_util_critical_section_enter();
sleep_manager_lock_deep_sleep();
sleep();
sleep_manager_unlock_deep_sleep();
core_util_critical_section_exit();
}

What is the reason for this? What is the expected way of entering deep sleep?

I know that it is possible to use a custom default_idle_hook(), but before I do, I would like to understand it more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions