Files
stc32g128k/App/appmgr.h

33 lines
1.0 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __APPMGR_H__
#define __APPMGR_H__
#include "config.h"
/* =========================================================================
* 应用管理器接口声明
* ========================================================================= */
// 初始化应用管理器,注册所有应用
void AppManager_Init(void);
// 启动指定应用(切换前台)
// 参数app_id - 目标应用ID
void AppManager_StartApp(AppID app_id);
// 关闭当前前台应用,回退到默认应用(时钟)
void AppManager_CloseApp(void);
// 获取当前活跃的前台应用ID
AppID AppManager_GetActiveAppID(void);
// 事件分发函数:将事件分发给前台/后台应用
// 分发逻辑:前台应用优先处理 -> 后台应用兜底处理 -> 未处理则丢弃
void AppManager_DispatchEvent(SystemEvent evt);
// 运行当前活跃应用的onRun回调带CPU占用控制
void AppManager_RunActiveApp(void);
// 广播事件给所有后台应用(用于系统级事件)
void AppManager_BroadcastToBackground(SystemEvent evt);
#endif