mirror of
https://github.com/vicliu624/trail-mate.git
synced 2026-06-25 06:31:42 +00:00
e5c11d6473
* feat(ui): add runtime English and Chinese localization * fix(meshtastic): harden t-deck send and ack recovery Align the T-Deck SX1262 setup with the reference firmware, switch critical radio SPI paths to blocking access, and share RX restart state between direct send paths and the radio task so TX-to-RX handoff cannot silently get stuck. Also unify Meshtastic wire transmission through a single helper, keep wire packets for ACK-tracked sends, retry ACK timeouts up to three times, and document the issue #21 repair checklist. Validation: local builds passed for tdeck, tlora_pager_sx1262, lilygo_twatch_s3, and gat562_mesh_evb_pro; clang-format check passed. Testing status: not fully tested on hardware yet. * Refactor LXMF runtime toward full Reticulum alignment Split adapter runtime state into transport, link, and propagation domains. Add pending path request tracking, stronger link teardown semantics, outbound link establishment, deferred link payload flushing, link keepalive/stale handling, and inbound split-resource assembly. Document the authoritative Reticulum/LXMF runtime alignment plan and mark the older device-mode plan as historical context. * feat(web): add pages site and web flasher release flow
81 lines
2.1 KiB
C++
81 lines
2.1 KiB
C++
#pragma once
|
|
|
|
#include "ui/app_screen.h"
|
|
#include "ui/localization.h"
|
|
|
|
namespace ui
|
|
{
|
|
|
|
class CallbackAppScreen : public AppScreen
|
|
{
|
|
public:
|
|
using SimpleCallback = void (*)(lv_obj_t* parent);
|
|
using Callback = void (*)(void* user_data, lv_obj_t* parent);
|
|
|
|
CallbackAppScreen(const char* stable_id,
|
|
const char* name,
|
|
const lv_image_dsc_t* icon,
|
|
SimpleCallback enter,
|
|
SimpleCallback exit)
|
|
: stable_id_(stable_id), name_(name), icon_(icon), simple_enter_(enter), simple_exit_(exit)
|
|
{
|
|
}
|
|
|
|
CallbackAppScreen(const char* stable_id,
|
|
const char* name,
|
|
const lv_image_dsc_t* icon,
|
|
Callback enter,
|
|
Callback exit,
|
|
void* user_data = nullptr)
|
|
: stable_id_(stable_id),
|
|
name_(name),
|
|
icon_(icon),
|
|
callback_enter_(enter),
|
|
callback_exit_(exit),
|
|
user_data_(user_data)
|
|
{
|
|
}
|
|
|
|
const char* stable_id() const override { return stable_id_; }
|
|
const char* name() const override { return ::ui::i18n::tr(name_); }
|
|
const lv_image_dsc_t* icon() const override { return icon_; }
|
|
|
|
void enter(lv_obj_t* parent) override
|
|
{
|
|
if (callback_enter_)
|
|
{
|
|
callback_enter_(user_data_, parent);
|
|
return;
|
|
}
|
|
if (simple_enter_)
|
|
{
|
|
simple_enter_(parent);
|
|
}
|
|
}
|
|
|
|
void exit(lv_obj_t* parent) override
|
|
{
|
|
if (callback_exit_)
|
|
{
|
|
callback_exit_(user_data_, parent);
|
|
return;
|
|
}
|
|
if (simple_exit_)
|
|
{
|
|
simple_exit_(parent);
|
|
}
|
|
}
|
|
|
|
private:
|
|
const char* stable_id_ = nullptr;
|
|
const char* name_ = nullptr;
|
|
const lv_image_dsc_t* icon_ = nullptr;
|
|
SimpleCallback simple_enter_ = nullptr;
|
|
SimpleCallback simple_exit_ = nullptr;
|
|
Callback callback_enter_ = nullptr;
|
|
Callback callback_exit_ = nullptr;
|
|
void* user_data_ = nullptr;
|
|
};
|
|
|
|
} // namespace ui
|