Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .claude/skills/watch-app/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Ask, don't guess. A package can mix them (`app-guide.md` section 3, "Widget" and
- **Widget card** (`WIDGET`): two lines of text on a stock card left of the face. Good for "next thing / count /
last value". `api.widget(title, value)`: title ≤ 23 B, value ≤ 39 B with one `\n`. Writes NAND: call it when the
value changes and at start, never per frame. The card shows the new text the next time the face is shown.
From stub 10 it can instead be up to four columns of caption, own icon and value (`api.widget_columns`,
`widget-icons/NN-name.svg`; `app-guide.md`, "Columns card"): always keep the text card as the `-22` fallback.
- **Page** (`PAGE`): a full screen next to the face ("full-screen widget"). Branch on `api.on_page()` for a compact
view. No `BUTTON` there, so the loop never returns on its own; `PAUSE` on swipe away, `RESUME` on return: draw
nothing and run no motor in between, redraw time-dependent parts on `RESUME`.
Expand Down
14 changes: 10 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ One package can offer several of these; ask which the owner wants before buildin
|---|---|---|
| Menu app | the default: a row in Apps, `main` runs until `BUTTON` | any |
| Widget card | `app_features!(WIDGET)`; `api.widget(title, value)` stores text (23 B / 39 B, `\n` = 2nd line) the stub draws on a 344×166 card left of the face. A NAND write: on change, never per frame. A tap opens the app | 2026-11-15 |
| Columns card | the same tile in the layout of the stock weather-by-hour card: `api.widget_columns(&[Column])`, 1-4 columns of caption, icon, value (text ≤ 9 B). Icons: `widget-icons/NN-name.svg` (40×40, ≤ 16, index = file name order), packed by `make build`. `-22` = this watch can't: write `api.widget` instead and don't retry per tick. `app-guide.md`, "Columns card" | stub 10 and its loader (merged, not yet released) |
| Page | `app_features!(PAGE)`: the app is a whole screen next to the face. `api.on_page()` is `true` there; no `BUTTON` (the app never exits itself), swipe away = `PAUSE`, back = `RESUME` | 2026-11-15 |
| Phone or Mac link | `send`/`recv`, `MESSAGE`: section "Apps that talk to a phone" below | 2026-11-13 for K |
| Phone services | calendar, reminders, location, weather, HTTP, notifications, media, a notification on the phone, storage, background jobs, from FMC Companion over `R1` messages (`crates/companion-rpc`): "FMC Companion" below | 2026-11-13 for K |
Expand All @@ -55,7 +56,7 @@ make build APP=my-app # target/my-app.wp2app
make check # store.toml / store.md
```

- **The simulator has no LVGL** (`lv_submit` returns `-95`), no widget card and no page (`on_page()` is `false`). An
- **The simulator has no LVGL** (`lv_submit` returns `-95`), no widget card of either kind and no page (`on_page()` is `false`). An
LVGL app is tested by host tests of its batch builder (each batch validates against the loader's checker) and in
the emulator. Pick canvas (`cmf-wp2-ui`) when the simulator matters more than stock widgets: `app-guide.md`,
"LVGL or `cmf-wp2-ui`?".
Expand Down Expand Up @@ -177,6 +178,11 @@ How it works and what it can't do:

**What needs a newer watch.** Patched firmware **stub 8** (published 2026-11-19 as `1.0.0.73-wp2.11`, by OTA) with the
loader of 2026-11-19 brings 16 app slots instead of 8 and `PUSH`, which `job.set` needs to refresh a widget or start
blob in the background; on an older stub the phone runs the job and drops the result. The SDK pin here predates
both (`git -C .sdk/wp2-apps log HEAD..origin/main`). The order of apps in the Apps menu is the user's, set in FMC
Companion; an app can't change it.
blob in the background; on an older stub the phone runs the job and drops the result. The order of apps in the Apps
menu is the user's, set in FMC Companion; an app can't change it.

**Stub 10** with its loader (cmf-watch-sdk #23, merged, no loader release yet) draws v2 widget records (the columns card), takes
them by `PUSH` too, and accepts a package with a widget icon trailer (`docs/app-icons.md` in the SDK). Stub 9, the one
watches run now, is the watch face bootloop guard and has none of it: it refuses a package with the trailer at `END`
and v2 records. A host installing on a stub below 10 must cut the trailer off; anything that checks a package for its
exact header length (a store, an installer) refuses one with a trailer until it learns it.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# The SDK and its tooling. To move to a newer one: change the commit here, `make sdk`, build and test every app,
# open a PR. Packages built against it change, but a store update still needs each app's version raised.
WP2_APPS_REV := 884e9a693070c3dc587f814def3806889a3c4e49
WP2_APPS_REV := cccaf794a372f98ec223ffa6f25db0960cb1c1c6
WP2_APPS_GIT := https://github.com/cmf-tech-community/cmf-watch-sdk
SDK := .sdk/wp2-apps

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ channel, budgets. The apps here are worked examples of it.
change later.
- `icon.svg` (96×96 viewBox) is the watch menu's icon and, rendered at 288 px, the store's. Images it references are
resolved next to it. Style: [docs/app-icons.md](https://github.com/cmf-tech-community/cmf-watch-sdk/blob/main/docs/app-icons.md).
- `widget-icons/NN-name.svg` (40×40 viewBox, optional, at most 16) are the icons of a columns widget card (patched
firmware stub 10); the build packs them behind the app, and their order in the file name is the index the app uses.
- Use the system font and the stock look, not LVGL's defaults.

### In the emulator or on a watch
Expand Down
8 changes: 8 additions & 0 deletions apps/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions scripts/store
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ which fetches the pinned SDK first and puts llvm-objcopy on PATH.
missed goes out with the next one
scripts/store check [NAME...] validate the listings (all without NAME)
scripts/store build NAME... check, then build target/<name>.wp2app with the pinned wp2-apps tooling;
icon.svg -> target/<name>-icon.png, the store's icon
icon.svg -> target/<name>-icon.png, the store's icon; widget-icons/*.svg ->
the package's widget icons (40x40, index = file name order)
scripts/store publish NAME... send target/<name>.wp2app, -icon.png + the listing to the store
(STORE_URL, STORE_PUBLISH_TOKEN; --dry-run: the store
validates and answers what would change, saves nothing)
Expand All @@ -19,6 +20,7 @@ import json
import os
from pathlib import Path
import re
import shutil
import subprocess
import sys
import tomllib
Expand Down Expand Up @@ -178,8 +180,16 @@ def build(name):
subprocess.run(["llvm-objcopy", "-O", "binary", "--set-section-flags", ".data=alloc,load,contents",
elf, TARGET / f"{name}.bin"], check=True)
(TARGET / f"{name}.wp2app").unlink(missing_ok=True)
pack_icons = []
if widget_svgs := sorted((APPS / name / "widget-icons").glob("*.svg")):
out = TARGET / "widget-icons" / name
shutil.rmtree(out, ignore_errors=True) # pack takes every PNG there: none of an icon since removed
out.mkdir(parents=True)
for one in widget_svgs:
subprocess.run(["resvg", "-w", "40", "-h", "40", one, out / f"{one.stem}.png"], check=True)
pack_icons = ["--widget-icons", out]
wp2apps("pack", TARGET / f"{name}.bin", "--elf", elf, "--name", name, "--version", build_number(meta["version"]),
"--output", TARGET / f"{name}.wp2app")
"--output", TARGET / f"{name}.wp2app", *pack_icons)
wp2apps("info", TARGET / f"{name}.wp2app")
if svg.exists(): # the store's icon; an icon.svg may pull in images by relative path
subprocess.run(["resvg", "-w", "288", "-h", "288", svg, TARGET / f"{name}-icon.png"], check=True)
Expand Down
Loading