Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/apps/app_startup_anim/app_startup_anim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ using namespace mooncake;
using namespace smooth_ui_toolkit;
using namespace smooth_ui_toolkit::lvgl_cpp;

#define FIRMWARE_VERSION "V0.2"

AppStartupAnim::AppStartupAnim()
{
// 配置 App 信息
Expand Down Expand Up @@ -43,6 +45,12 @@ void AppStartupAnim::onOpen()
_logo_5->setSrc(&logo_5);
_logo_5->setPos(700, 308);

_label_version = std::make_unique<Label>(lv_screen_active());
_label_version->setTextColor(lv_color_hex(0xCCCCCC));
_label_version->setTextFont(&lv_font_montserrat_24);
_label_version->align(LV_ALIGN_CENTER, 580, 320);
_label_version->setText(FIRMWARE_VERSION);

_anim_logo_tab_y.pause();
_anim_logo_tab_y.teleport(785);
_anim_logo_tab_y.springOptions().visualDuration = 0.6;
Expand Down Expand Up @@ -90,6 +98,7 @@ void AppStartupAnim::onRunning()
}
if (!_is_sfx_played) {
if (_anim_logo_5_x.directValue() < 90) {
GetHAL()->setSpeakerVolume(80);
GetHAL()->playStartupSfx();
_is_sfx_played = true;
}
Expand Down Expand Up @@ -118,4 +127,7 @@ void AppStartupAnim::onClose()

_logo_tab.reset();
_logo_5.reset();
_label_version.reset();

GetHAL()->setSpeakerVolume(60);
}
2 changes: 2 additions & 0 deletions app/apps/app_startup_anim/app_startup_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#pragma once
#include <mooncake.h>
#include <memory>
#include "lvgl_cpp/label.h"
#include <smooth_ui_toolkit.h>
#include <smooth_lvgl.h>
#include <stdint.h>
Expand Down Expand Up @@ -35,6 +36,7 @@ class AppStartupAnim : public mooncake::AppAbility {
AnimState_t _anime_state = AnimState_StartupDelay;
std::unique_ptr<smooth_ui_toolkit::lvgl_cpp::Image> _logo_tab;
std::unique_ptr<smooth_ui_toolkit::lvgl_cpp::Image> _logo_5;
std::unique_ptr<smooth_ui_toolkit::lvgl_cpp::Label> _label_version;
smooth_ui_toolkit::AnimateValue _anim_logo_tab_y;
smooth_ui_toolkit::AnimateValue _anim_logo_tab_opa;
smooth_ui_toolkit::AnimateValue _anim_logo_5_x;
Expand Down
3 changes: 2 additions & 1 deletion platforms/tab5/components/m5stack_tab5/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

idf_component_register(
SRCS "m5stack_tab5.c"
SRCS "m5stack_tab5.c" "esp_lcd_st7123.c"
INCLUDE_DIRS "include"
INCLUDE_DIRS "include/bsp"
PRIV_INCLUDE_DIRS "priv_include"
Expand All @@ -10,5 +10,6 @@ idf_component_register(
esp_codec_dev
esp_lvgl_port
esp_lcd_ili9881c
esp_lcd_touch_st7123
PRIV_REQUIRES usb spiffs fatfs
)
Loading