mirror of
https://github.com/vicliu624/trail-mate.git
synced 2026-08-28 13:34:07 +00:00
Feature/cardputer zero (#27)
* fix(tdeck): improve display startup and brightness handling * fix(energy-sweep): use instant RSSI and only lock LoRa while scanning * feat(cardputer-zero): add linux shells and M5 SDK baseline * feat(cardputer-zero): add linux runtime baseline and shell ui simulator * feat(cardputer-zero): unify linux shell boot and polish simulator * docs(cardputer-zero): define final-shape adaptation spec * feat(cardputer-zero): integrate shared linux runtimes and pages * fix(linux-sim): mount repo root in dev container * Fix GPS runtime semantics and transport init Add a GPS specification and align platform runtimes around explicit GPS enable, power, receiver configuration, and external NMEA export semantics. Keep internal NMEA parsing independent from external export settings, stop treating gps_mode as an enable flag, and update phone/UI config paths to use gps_enabled. Decouple board-level GPS transport readiness from UBX receiver probing on T-Deck, T-Deck Pro, and T-LoRa Pager, and let boards own UART teardown. Verified with pio run -e tdeck, pio run -e tlora_pager_sx1262, pio run -e gat562_mesh_evb_pro, and pio run -e tdeck_pro_a7682e. * Add Russian localization pack Add an installable European Cyrillic Extended locale bundle with Russian translations, Cyrillic font metadata, and package catalog entry. Credit polarikus for the Russian translations based on the polarikus/trail-mate localization PR. * Prepare 0.1.23-alpha release * Fix T-Watch Morse release build * Format CI-checked sources * Fix Cardputer Linux CI dependencies * Fix WSL validation smoke target build * Prepare 0.1.24-alpha release * fix: unblock Cardputer Zero Linux CI
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
#include "ui/startup_ui_shell.h"
|
||||
|
||||
#include <ctime>
|
||||
|
||||
#include "lvgl.h"
|
||||
#include "platform/ui/time_runtime.h"
|
||||
#include "ui/app_runtime.h"
|
||||
#include "ui/localization.h"
|
||||
#include "ui/menu/menu_layout.h"
|
||||
#include "ui/menu/menu_runtime.h"
|
||||
#include "ui/ui_boot.h"
|
||||
#include "ui/widgets/system_notification.h"
|
||||
|
||||
namespace ui::startup_ui_shell
|
||||
{
|
||||
@@ -19,6 +24,61 @@ void present_boot_overlay_now()
|
||||
lv_refr_now(nullptr);
|
||||
}
|
||||
|
||||
bool resolve_display_time(struct tm* out_tm)
|
||||
{
|
||||
if (!out_tm)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (::platform::ui::time::localtime_now(out_tm))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const std::time_t now = std::time(nullptr);
|
||||
if (now <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const std::time_t local = ::platform::ui::time::apply_timezone_offset(now);
|
||||
const std::tm* tmp = std::gmtime(&local);
|
||||
if (!tmp)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
*out_tm = *tmp;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool format_menu_time(char* out, size_t out_len)
|
||||
{
|
||||
if (!out || out_len < 6)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
struct tm info
|
||||
{
|
||||
};
|
||||
if (!resolve_display_time(&info))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::strftime(out, out_len, "%H:%M", &info);
|
||||
return true;
|
||||
}
|
||||
|
||||
ui::menu_runtime::Hooks build_menu_runtime_hooks()
|
||||
{
|
||||
ui::menu_runtime::Hooks hooks{};
|
||||
hooks.format_time = format_menu_time;
|
||||
return hooks;
|
||||
}
|
||||
|
||||
bool lock_ui(const Hooks& hooks)
|
||||
{
|
||||
return hooks.lock_ui ? hooks.lock_ui(hooks.lock_timeout_ms) : true;
|
||||
@@ -50,6 +110,7 @@ bool prepareBootUi(const Hooks& hooks, bool waking_from_sleep)
|
||||
present_boot_overlay_now();
|
||||
unlock_ui(hooks);
|
||||
::ui::i18n::reload_language();
|
||||
ui::SystemNotification::init();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -71,6 +132,8 @@ bool initializeMenuSkeleton(const Hooks& hooks)
|
||||
ui::menu_layout::InitOptions options{};
|
||||
options.apps = hooks.apps;
|
||||
ui::menu_layout::init(options);
|
||||
ui::menu_runtime::init(
|
||||
lv_screen_active(), main_screen, ui::menu_layout::menuPanel(), build_menu_runtime_hooks());
|
||||
|
||||
s_shell_initialized = true;
|
||||
unlock_ui(hooks);
|
||||
|
||||
Reference in New Issue
Block a user