update firmware v1.2.4 (#16)

This commit is contained in:
Forairaaaaa
2026-04-20 16:27:36 +08:00
committed by GitHub
parent 605b575fcc
commit dd34f9e0ec
94 changed files with 3615 additions and 41513 deletions
@@ -31,11 +31,6 @@ WifiSetupWorker::WifiSetupWorker()
avatar->rightEye().setVisible(false);
avatar->mouth().setVisible(false);
GetStackChan().attachAvatar(std::move(avatar));
_app_config_signal_id =
GetHAL().onAppConfigEvent.connect([this](AppConfigEvent event) { _last_app_config_event = event; });
GetHAL().startAppConfigServer();
}
WifiSetupWorker::~WifiSetupWorker()
@@ -69,30 +64,65 @@ void WifiSetupWorker::update_state()
data.title = std::make_unique<Label>(lv_screen_active());
data.title->setTextFont(&lv_font_montserrat_20);
data.title->setTextColor(lv_color_hex(0x7E7B9C));
data.title->align(LV_ALIGN_TOP_MID, 0, 13);
data.title->align(LV_ALIGN_TOP_MID, 0, 0);
data.title->setText("APP SETUP");
data.info = std::make_unique<Label>(lv_screen_active());
data.info->setTextFont(&lv_font_montserrat_14);
data.info->setTextColor(lv_color_hex(0x26206A));
data.info->align(LV_ALIGN_TOP_MID, 0, 27);
data.info->setTextAlign(LV_TEXT_ALIGN_CENTER);
data.info->setText("Install \"StackChan World\" app\nand login to your M5Stack account");
std::string qrcode_text = "https://apps.apple.com/us/app/stackchan-world/id6756086326";
data.qrcode = std::make_unique<Qrcode>(lv_screen_active());
data.qrcode->setSize(150);
data.qrcode->setDarkColor(lv_color_hex(0x221C5B));
data.qrcode->setLightColor(lv_color_hex(0xEDF4FF));
data.qrcode->update(qrcode_text);
data.qrcode->align(LV_ALIGN_CENTER, -72, 12);
data.qrcode_ios = std::make_unique<Qrcode>(lv_screen_active());
data.qrcode_ios->setSize(80);
data.qrcode_ios->setDarkColor(lv_color_hex(0x221C5B));
data.qrcode_ios->setLightColor(lv_color_hex(0xEDF4FF));
data.qrcode_ios->update(qrcode_text);
data.qrcode_ios->align(LV_ALIGN_CENTER, -65, -12);
qrcode_text = "https://play.google.com/store/apps/details?id=com.m5stack.stackchan";
data.qrcode_android = std::make_unique<Qrcode>(lv_screen_active());
data.qrcode_android->setSize(80);
data.qrcode_android->setDarkColor(lv_color_hex(0x221C5B));
data.qrcode_android->setLightColor(lv_color_hex(0xEDF4FF));
data.qrcode_android->update(qrcode_text);
data.qrcode_android->align(LV_ALIGN_CENTER, 65, -12);
data.label_ios = std::make_unique<Label>(lv_screen_active());
data.label_ios->setTextFont(&lv_font_montserrat_14);
data.label_ios->setTextColor(lv_color_hex(0x26206A));
data.label_ios->align(LV_ALIGN_CENTER, -65, 47);
data.label_ios->setText("App Store\n(iOS)");
data.label_ios->setTextAlign(LV_TEXT_ALIGN_CENTER);
data.label_android = std::make_unique<Label>(lv_screen_active());
data.label_android->setTextFont(&lv_font_montserrat_14);
data.label_android->setTextColor(lv_color_hex(0x26206A));
data.label_android->align(LV_ALIGN_CENTER, 65, 47);
data.label_android->setText("Play Store\n(Android)");
data.label_android->setTextAlign(LV_TEXT_ALIGN_CENTER);
data.btn_next = std::make_unique<Button>(lv_screen_active());
apply_button_common_style(*data.btn_next);
data.btn_next->align(LV_ALIGN_CENTER, 79, 73);
data.btn_next->setSize(112, 48);
data.btn_next->align(LV_ALIGN_CENTER, 72, 91);
data.btn_next->setSize(112, 42);
data.btn_next->label().setText("Next");
data.btn_next->onClick().connect([this]() { _state_app_download_data.next_clicked = true; });
data.info = std::make_unique<Label>(lv_screen_active());
data.info->setTextFont(&lv_font_montserrat_20);
data.info->setTextColor(lv_color_hex(0x26206A));
data.info->align(LV_ALIGN_TOP_LEFT, 183, 56);
data.info->setTextAlign(LV_TEXT_ALIGN_LEFT);
data.info->setText("Download\n\"StackChan\"\napp to start\nthe setup");
data.btn_quit = std::make_unique<Button>(lv_screen_active());
apply_button_common_style(*data.btn_quit);
data.btn_quit->align(LV_ALIGN_CENTER, -72, 91);
data.btn_quit->setSize(112, 42);
data.btn_quit->setBgColor(lv_color_hex(0xD4D9E0));
data.btn_quit->label().setText("Back");
data.btn_quit->label().setTextColor(lv_color_hex(0x525064));
data.btn_quit->onClick().connect([this]() { _state_app_download_data.quit_clicked = true; });
}
if (_state_app_download_data.quit_clicked) {
_is_done = true;
}
if (_state_app_download_data.next_clicked) {
@@ -113,6 +143,12 @@ void WifiSetupWorker::update_state()
if (_is_first_in) {
_is_first_in = false;
// Start app config server
_app_config_signal_id =
GetHAL().onAppConfigEvent.connect([this](AppConfigEvent event) { _last_app_config_event = event; });
GetHAL().startAppConfigServer();
auto& data = _state_wait_app_connection_data;
data.panel = std::make_unique<Container>(lv_screen_active());