From d374f824cd9ea9df74c69d3bd6f559a982d874d3 Mon Sep 17 00:00:00 2001 From: skiinder Date: Tue, 10 Mar 2026 09:17:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(caf):=20=E9=9B=86=E6=88=90=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E7=AE=A1=E7=90=86=E5=99=A8=E5=B9=B6=E9=85=8D=E7=BD=AE?= =?UTF-8?q?CAF=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在prj.conf中启用CAF、堆内存池和日志配置 - 替换kernel头文件为应用事件管理器相关头文件 - 添加模块状态事件支持用于报告就绪状态 - 初始化应用事件管理器并在初始化失败时记录错误 --- prj.conf | 4 +++- src/main.c | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/prj.conf b/prj.conf index 8b13789..cce25cf 100644 --- a/prj.conf +++ b/prj.conf @@ -1 +1,3 @@ - +CONFIG_CAF=y +CONFIG_HEAP_MEM_POOL_SIZE=2048 +CONFIG_LOG=y \ No newline at end of file diff --git a/src/main.c b/src/main.c index 75a9c07..f162000 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,18 @@ -#include +#include + +#define MODULE main +#include + +#include +LOG_MODULE_REGISTER(MODULE); int main(void) { - return 0; + if (app_event_manager_init()) { + LOG_ERR("Application Event Manager not initialized"); + } else { + module_set_state(MODULE_STATE_READY); + } + + return 0; }