Unify PlatformIO and ESP-IDF around a shared UI/runtime shellRefactor/repo structure (#11)

* Unify PlatformIO and ESP-IDF around a shared UI/runtime shell
This commit is contained in:
vicliu
2026-03-12 01:17:46 +08:00
committed by GitHub
parent 76d83ef7bf
commit d320b6511d
989 changed files with 98068 additions and 15808 deletions
+48
View File
@@ -0,0 +1,48 @@
#include "ui/loop_shell.h"
namespace ui::loop_shell
{
void tick(const Hooks& hooks)
{
const uint32_t now_ms = hooks.now_ms ? hooks.now_ms() : 0;
if (hooks.is_overlay_active && hooks.is_overlay_active())
{
if (hooks.display_tick_if_due)
{
hooks.display_tick_if_due(now_ms);
}
if (hooks.yield_now)
{
hooks.yield_now();
}
if (hooks.sleep_ms)
{
hooks.sleep_ms(hooks.overlay_sleep_ms);
}
return;
}
if (hooks.handle_power_button)
{
hooks.handle_power_button();
}
if (hooks.update_runtime)
{
hooks.update_runtime();
}
if (hooks.display_tick_if_due)
{
hooks.display_tick_if_due(now_ms);
}
if (hooks.sleep_ms)
{
hooks.sleep_ms(hooks.idle_sleep_ms);
}
}
} // namespace ui::loop_shell