Skip to content
Open
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
6 changes: 5 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ file dist/M5CardputerZero-APPLaunch # expect ARM aarch64
sh projects/APPLaunch/tests/run_tests.sh # 42 C++ + 17 Python contracts
sh ext_components/cp0_lvgl/tests/run_tests.sh # 81 C++

# 2b. Building ON the device itself (no dev headers, no apt): cross profile + native gcc
scripts/device_launcher.sh build # then: try [secs] | install | rollback | status

# 4. Build the .deb (**does not compile anything** — packages the existing dist/)
python3 scripts/debian_packager.py

Expand Down Expand Up @@ -253,6 +256,7 @@ Screen geometry: **320×170**, a 20px top bar plus a 320×150 content area.
| ESC long-press to return home | `main/ui/esc_hold_hint_controller.cpp` | `handle`, `poll` |
| Hang watchdog | `main/ui/esc_ui_watchdog.{h,cpp}` | `ESC_UI_RECOVERY_DELAY_MS` (exit code 75) |
| Global keyboard shortcuts | `main/ui/model/global_hint_policy.cpp` + `ui_global_hint.cpp` | `action_for` |
| Alt+Tab app switcher (keep apps running) | `main/ui/launch.cpp` (`RunningApp`, `key_filter_cb`) + `ui_app_switcher.cpp` + `model/app_switcher_model.cpp`; external apps are SIGSTOPped by `ext_components/cp0_lvgl/src/cp0/cp0_external_app_runner.cpp` | `ExecSwitchable` / `ResumeSuspended` / `KillSuspended` |
| Volume/brightness stepping and persistence | `main/ui/launcher_media_controls.cpp` + `model/setup_value_policy.hpp` | — |
| Volume/brightness OSD | `main/ui/launcher_media_osd.cpp` | `model/launcher_media_model.hpp` |
| Toast styling | `main/ui/launcher_toast.cpp` | `kShowDurationMs` |
Expand All @@ -275,7 +279,7 @@ Screen geometry: **320×170**, a 20px top bar plus a 320×150 content area.

| Type | Entry point | Behavior |
| --- | --- | --- |
| **External executable** (`.desktop`, `Exec`) | `Launch::launch_Exec()` | `cp0_signal_process_api({"ExecBlocking", ...})` — **blocking**; meanwhile `lv_timer_enable(false)` and the child process owns the framebuffer. **Do not** create timers / toasts / threads inside that window |
| **External executable** (`.desktop`, `Exec`) | `Launch::launch_Exec()` | `Launch::run_external()` → `cp0_signal_process_api({"ExecSwitchable", ...})` — **blocking** until the app exits or Alt+Tab suspends it; meanwhile `lv_timer_enable(false)` and the child process owns the framebuffer. **Do not** create timers / toasts / threads inside that window |
| **Terminal-style** (CLI, Python, `Terminal=true`) | `Launch::launch_Exec_in_terminal()` + `UISTPage` | goes through `cp0_signal_pty_api`, 30ms polling, ESC long-press to exit |

The framebuffer hand-off order for external apps is **asserted point by point** by `tests/test_external_framebuffer_ownership.py` — read that test before refactoring the code.
Expand Down
2 changes: 1 addition & 1 deletion docs/cp0_lvgl.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Session commands are `BtSessionInit` (returns an id), `BtSessionDeinit id`, `BtS

### Process, OS information, and time

`cp0_signal_process_api` commands are `ExecBlocking executable keep_root`, `Spawn executable keep_root`, `Stop pid`, `CheckLock path`, `Kill pid grace_ms`, `RunArgv background argv...`, `RunSudo password argv...` (legacy only), `CaptureArgv argv...`, `AdbStatus`, `DesktopExecIsSafe executable`, `Shutdown`, `Reboot`, and `DelayMs milliseconds`. `Spawn` returns a PID; `CaptureArgv` returns stdout; `AdbStatus` returns two status lines.
`cp0_signal_process_api` commands are `ExecBlocking executable keep_root`, `ExecSwitchable executable keep_root`, `ResumeSuspended pgid`, `KillSuspended pgid`, `Spawn executable keep_root`, `Stop pid`, `CheckLock path`, `Kill pid grace_ms`, `RunArgv background argv...`, `RunSudo password argv...` (legacy only), `CaptureArgv argv...`, `AdbStatus`, `DesktopExecIsSafe executable`, `Shutdown`, `Reboot`, and `DelayMs milliseconds`. `ExecSwitchable` behaves like `ExecBlocking`, but Alt+Tab (pressed, then released) stops the app's process group and saves the framebuffer; its data is `exited` or `suspended <pgid>`. `ResumeSuspended` restores the framebuffer, drops input queued for the stopped app, continues it and answers in the same format; `KillSuspended` terminates a suspended group. `Spawn` returns a PID; `CaptureArgv` returns stdout; `AdbStatus` returns two status lines.

`cp0_signal_osinfo_api` and `cp0_signal_timedate_api` share one service. Commands are `NetworkDefaultInfoRead`, `EthInfoRead` (three lines: IPv4, gateway, MAC), `NetworkList` (tab-separated interface records), `AccountInfoRead` (user and hostname), `TimeSet timestamp`, `LocalTime` (`year,month,day,hour,minute,second`), `RandomU32`, `NtpGet`, `NtpSet 0|1`, `AptUpdateBackground`, and `UpdateLauncherBackground`.

Expand Down
2 changes: 1 addition & 1 deletion docs/cp0_lvgl.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Wi-Fi のコマンドは `Status`、`Scan [0..32]`、`Connect ssid [password]`

Settings のコマンドは `BacklightRead`、`BacklightMax`、`BacklightWrite value`、`Log topic message`、`TimeStr`、`GpioSet name 0|1`、`GpioGet name`。GPIO 名は `GROVE5V`/`extport_usb`、`EXT5V`/`extport_5vout`、`BACKLIGHT` です。

Process のコマンドは `ExecBlocking executable keep_root`、`Spawn executable keep_root`、`Stop pid`、`CheckLock path`、`Kill pid grace_ms`、`RunArgv background argv...`、legacy の `RunSudo`、`CaptureArgv argv...`、`AdbStatus`、`DesktopExecIsSafe executable`、`Shutdown`、`Reboot`、`DelayMs milliseconds`。OS 情報と timedate は同じ service で、network/account 情報、`TimeSet`、`LocalTime`、`RandomU32`、`NtpGet`、`NtpSet`、背景更新を処理します。
Process のコマンドは `ExecBlocking executable keep_root`、`ExecSwitchable executable keep_root`、`ResumeSuspended pgid`、`KillSuspended pgid`、`Spawn executable keep_root`、`Stop pid`、`CheckLock path`、`Kill pid grace_ms`、`RunArgv background argv...`、legacy の `RunSudo`、`CaptureArgv argv...`、`AdbStatus`、`DesktopExecIsSafe executable`、`Shutdown`、`Reboot`、`DelayMs milliseconds`。`ExecSwitchable` は `ExecBlocking` と同じですが、Alt+Tab(押して離す)でアプリのプロセスグループを停止(SIGSTOP)し framebuffer を保存します。data は `exited` または `suspended <pgid>`。`ResumeSuspended` は framebuffer を復元し、停止中に溜まった入力を破棄して再開し、同じ形式で応答します。`KillSuspended` は停止中のグループを終了します。OS 情報と timedate は同じ service で、network/account 情報、`TimeSet`、`LocalTime`、`RandomU32`、`NtpGet`、`NtpSet`、背景更新を処理します。

### Battery、screenshot、camera、soundcard

Expand Down
2 changes: 1 addition & 1 deletion docs/cp0_lvgl.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ int cp0_time_ntp_set(int enable);

### 进程:`cp0_signal_process_api(args, cb)`

命令和参数:`ExecBlocking executable keep_root`、`Spawn executable keep_root`、`Stop pid`、`CheckLock path`、`Kill pid grace_ms`、`RunArgv background argv...`、`RunSudo password argv...`(旧接口,禁止新增使用)、`CaptureArgv argv...`、`AdbStatus`、`DesktopExecIsSafe executable`、`Shutdown`、`Reboot`、`DelayMs milliseconds`。`Spawn` data 为 PID;`CaptureArgv` data 为 stdout;`AdbStatus` data 为 `adbd=active|inactive` 和 `enabled=enabled|disabled` 两行。
命令和参数:`ExecBlocking executable keep_root`、`ExecSwitchable executable keep_root`、`ResumeSuspended pgid`、`KillSuspended pgid`、`Spawn executable keep_root`、`Stop pid`、`CheckLock path`、`Kill pid grace_ms`、`RunArgv background argv...`、`RunSudo password argv...`(旧接口,禁止新增使用)、`CaptureArgv argv...`、`AdbStatus`、`DesktopExecIsSafe executable`、`Shutdown`、`Reboot`、`DelayMs milliseconds`。`ExecSwitchable` 与 `ExecBlocking` 相同,但 Alt+Tab(按下并松开)会暂停(SIGSTOP)应用进程组并保存 framebuffer,data 为 `exited` 或 `suspended <pgid>`;`ResumeSuspended` 恢复 framebuffer、丢弃暂停期间积压的输入并继续运行,返回格式相同;`KillSuspended` 结束已暂停的进程组。`Spawn` data 为 PID;`CaptureArgv` data 为 stdout;`AdbStatus` data 为 `adbd=active|inactive` 和 `enabled=enabled|disabled` 两行。

### OS 信息和时间:`cp0_signal_osinfo_api` / `cp0_signal_timedate_api`

Expand Down
Loading