* Unify PlatformIO and ESP-IDF around a shared UI/runtime shell
9.1 KiB
UI Shared / IDF ???????
?????? UI ?????apps/* ??????? ESP-IDF ????????????
???????
- ????????????????????????
- ????
apps/esp_pio?apps/esp_idf?modules/ui_shared????????????? - PlatformIO ? ESP-IDF ??????? shared UI/page/runtime ????
1. ???
??????????????????????????????
- ??????????????????????
modules/ui_shared - ??????
apps/esp_pio?apps/esp_idf??? startup / loop / runtime / adapter ???? - ????????? PIO / IDF ?????
platform/*? app runtime adapter ????????????
2. ????
2.1 ??????
???????????????
- ???????????
modules/ui_shared *_page_shell.cpp???????host ???fallback ??- ???? shell ??????????????
- ????
apps/esp_pio?apps/esp_idf?????????
2.2 apps ?????????
apps/esp_pio ? apps/esp_idf ??????
- ????startup / boot / menu ????
- loop ??????tick???
- runtime access??????????????????
- facade/runtime adapter???????? shared ??? shared ?????
??????
- ????
- ????
- ???????
- ??????
- ???? wrapper ????
2.3 ???? placeholder ??????
?????????????????? shared ???????????????????
placeholder ??????
- ?????????????
- ??????????????????????
- ??????????? runtime/capability ??????
placeholder ???????????????
2.4 PIO / IDF ??????
?????????????????????
apps/esp_pio????apps/esp_idf????- ??????????? shared ??
- ?? runtime adapter ? PIO / IDF ??????????? capability gating
2.5 ????????? profile ??
???????? profile / runtime config ???????????????????????
????
tab5???????tdeck??????????pager- topbar???? icon card???/???????? shared profile ????
3. ???????2026-03-11?
3.1 ??? shared shell ??????
????????????????? shared shell + runtime/components/controller ???
SettingsChatGPS / MapGNSS Sky PlotContactsTeamTrackerPC LinkUSBSSTVEnergy SweepWalkie Talkie
???
- ?????????????? shared ????
- ???????????????????? shared capability-gated fallback ??
3.2 apps ?????
?? apps/esp_pio/src ????????????????
startup_runtime.cpploop_runtime.cppapp_runtime_access.cppapp_registry.cpparduino_entry.cppapp_context.cpp
?? apps/esp_idf/src ?????????????????
startup_runtime.cpploop_runtime.cppapp_runtime_access.cppapp_registry.cppruntime_config.cppapp_facade_runtime.cppidf_entry.cppidf_component_anchor.cpp
?????
- ?? 5 ??? IDF retired stub ?????
modules/ui_shared???ui_common_stub.cpp/ui_status_stub.cpp????? 6 ??apps/esp_pio/src??ui_*.cpp?? wrapper ??
3.3 ????????
- ????? shared ?????
Settings?Chat?Contacts?Team - ??? shared shell / runtime ?????????????? 4 ?????
GPS / Map?GNSS Sky Plot?Tracker?PC Link / USB?SSTV?Energy Sweep?Walkie Talkie - ??? shared shell ??????? capability-gated ??????
ui/screens/common/page_shell_fallback.h
4. ???????
?? 0??????????
??
???????????????????????????? / adapter / stub ???
????
- ????????????
- ???? app ?????
- ??????? shared shell ??????
????
- ???
?? 1?apps ???????
??
? apps/esp_pio ? apps/esp_idf ???????? + runtime ????????? wrapper ??????
???
- ??
app_catalog/menu/startup/loop??? shared ?? - ??
apps/esp_pio???? page wrapper / registry ???? - ??
app_runtime_access??????????????????? - ??
esp_pio/esp_idf? startup / loop / event ????
????
apps/esp_pio/apps/esp_idf???????????app_runtime_access?? lifecycle / runtime access- ????????? shared app catalog / shared shell ????
????
- ????2026-03-11?
apps/esp_pio/src?apps/esp_idf/src??????????apps/esp_pio/src??ui_*.cpp?? wrapper ??- startup / loop / menu / runtime access ??? shared shell ????
?? 2???????????
??
????????????
shell???? / host / fallbackcomponents/controller/runtime????? shared ??
???
- ??????
shell + components/runtime?? - ?? shell ???????????
- ????????? shared app catalog / shared page shell ?? shared ??
- ?? fallback ????????? runtime ???????
????
- ?????????????
shell??????????- ?????????????????????
????
- ????2026-03-11?
Chat / Contacts / Team / Settings? shared shell ??? placeholder fallback ?????????? runtime ??- ?? capability-gated ??????
page_shell_fallback.h?????????? enter / exit placeholder ?? - apps ???????????????
?? 3?????????
??
? shared ????????????? adapter / runtime hook ??
???
- ? shared UI ???? adapter contract??????
- restart
- kv/config persistence
- screen sleep
- tone/audio preview
- GPS runtime control
- tracker recording runtime hook
- hostlink / USB capability hook
- Arduino ???
platform/esp/arduino_common - IDF ???
platform/esp/idf_common?apps/esp_idf/*runtime - shared ????? contract?????? ESP ???
????
modules/ui_shared ????????????????
<Arduino.h><Preferences.h>nvs.hesp_system.h- ?? board ????
????
- ????2026-03-10?
modules/ui_shared????????? ESP ????<Arduino.h>- ???
platform/ui/*contract??? device / screen / settings / gps / tracker / hostlink / walkie / sstv / lora / usb_support - Arduino ???
platform/esp/arduino_common?IDF ???platform/esp/idf_common
?? 4???????????
??
??????? capability fallback ????????????????????? shared ?????
?????
Settings?? adapter ??????ChatGPS / MapGNSS Sky PlotContacts / Team / Node InfoTrackerPC Link / USBSSTV / Energy Sweep / Walkie Talkie
??????
??????????????????
- shared ???????????? placeholder
- PIO / IDF ??????
- ???? shared ?????
- ???? runtime / facade adapter ???
- ?????
tab5?tdeck???? profile ??
????
- ????2026-03-11?
Settings?Chat?Contacts?Team??? shared ???????GPS / Map?GNSS Sky Plot?Tracker?PC Link / USB?SSTV?Energy Sweep?Walkie Talkie???? 4 ??????????- ?? 6 ?????????????????? 4 ?????????
?? 5?IDF ???????
??
? apps/esp_idf ????????? shared ???????????????????
???
- ????? stub????? IDF runtime / facade
- ? IDF runtime facade ? shared ??????
- ??
tab5profile / topbar / menu layout / page layout ?? - ?? capability-based fallback???????????
????
tab5????? startup shell ????- ??????????????
- ???????????? stub ????
- ????? capability / adapter ??????????????
????
- ????2026-03-10?
apps/esp_idf??????? / ?? / ????????????? skeleton ???- IDF ????? capability gating ???
Chat / Contacts / Team / Settings????? shared runtime ???? screen_sleep?ui_common?gps_service_api?gps_tracker_overlay?team_ui_store???? IDF ??tab5???????modules/ui_shared/src/ui/startup_shell.cpp???menu_runtime.cpp/ui_status.cpp?????????
?? 6?????????
??
???????????????????????
???
- ??????? wrapper / shim / duplicate shell logic
- ???? stub ??????
- ?? README / ???? / ????
- ????????
????
- ??????
modules/ui_shared - app ??????? runtime ??
- platform ??????????
- ?????????
????
- ????2026-03-11?
- ???
apps/esp_idf/src/*_stub.cpp?modules/ui_shared/src/ui/*_stub.cpp?? retired ???? idf_component_stub.cpp?????apps/esp_idf/src/idf_component_anchor.cpp??????? stub?????????TeamUiStoreStub????TeamUiMemoryStore?????????????????????Chat / Contacts / Team / Settings? shared page shell ??? placeholder fallback ?????????? runtime ??- ?? capability-gated ???????
ui/screens/common/page_shell_fallback.h apps/esp_pio/src??ui_*.cpp?? wrapper ???apps/esp_idf/src??????????- ?? README?????? build ?????????
5. ??????
????
2026-03-11 ????
platformio run -e tdeckidf.py -B build.tab5 -DTRAIL_MATE_IDF_TARGET=tab5 build
????
2026-03-11 ????
apps/esp_pio/src??ui_*.cpp?? wrapper ??apps/esp_idf/src??????????? retired*_stub.cpp??modules/ui_shared? capability fallback ?????? helper?????? shell ???? placeholder ??- shared ??????????
modules/ui_shared
??????
??????????
tab5?? shell?????????????? 5 ???????????- ???? 6 ??????????helper ???retired ?????????? runtime ??
6. ??????
?? 2026-03-11?
- ?? 0?1?2?3?5?6 ???
- ?? 4 ???????????????????????????????
?????
- ????? UI / app / platform ??????
- ????????????????????????? 4 ???????????
2026-03-11 阶段 4 完成更新
- 阶段 4 现已完成。
pc_link、sstv、energy_sweep、walkie_talkie的 shared page runtime 现已统一支持 Arduino / ESP-IDF(ESP_PLATFORM) 编译,并通过platform::ui::*能力接口决定是否可用。modules/ui_shared/src/ui/app_catalog_builder.cpp不再把Walkie Talkie入口硬编码在 Pager 专属宏后面,菜单入口统一由 shared feature flags 控制。apps/esp_pio/src/app_registry.cpp已切换到与apps/esp_idf/src/app_registry.cpp一致的platform::ui::*能力判定,不再在 apps 层维护独立宏分叉。USB在 IDF 侧当前仍属于 shared shell + capability gate 的特例;真正的 IDF USB / Hostlink / LoRa / Walkie 平台后端对接继续归入阶段 5。- 验证已通过:
idf.py -B build.tab5 -DTRAIL_MATE_IDF_TARGET=tab5 build、platformio run -e tdeck。