add firmware source code (#4)

* add firmware source code
This commit is contained in:
Forairaaaaa
2026-01-08 09:18:20 +08:00
committed by GitHub
parent 4f1373e449
commit 5001b7081b
164 changed files with 81663 additions and 1 deletions
@@ -0,0 +1,52 @@
/*
* SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD
*
* SPDX-License-Identifier: MIT
*/
#include "app_ai_agent.h"
#include <hal/hal.h>
#include <mooncake.h>
#include <mooncake_log.h>
#include <assets/assets.h>
#include <smooth_lvgl.hpp>
using namespace mooncake;
using namespace smooth_ui_toolkit::lvgl_cpp;
AppAiAgent::AppAiAgent()
{
// Configure App name
setAppInfo().name = "AI.AGENT";
// Configure App icon
setAppInfo().icon = (void*)&icon_ai_agent;
// Configure App theme color
static uint32_t theme_color = 0x33CC99;
setAppInfo().userData = (void*)&theme_color;
}
// Called when the App is installed
void AppAiAgent::onCreate()
{
mclog::tagInfo(getAppInfo().name, "on create");
}
// Called when the App is opened
// You can construct UI, initialize operations, etc. here
void AppAiAgent::onOpen()
{
mclog::tagInfo(getAppInfo().name, "on open");
GetHAL().startXiaozhi();
}
// Called repeatedly while the App is running
void AppAiAgent::onRunning()
{
}
// Called when the App is closed
// You can destroy UI, release resources, etc. here
void AppAiAgent::onClose()
{
mclog::tagInfo(getAppInfo().name, "on close");
}