Commit graph

24 commits

Author SHA1 Message Date
eb18386512 Fix dict embedding: scope source property to app target directory 2026-06-24 15:43:00 +08:00
32f1812709 Fix: Plover + Lapwing are additive, not exclusive
Both CONFIG_ZMK_JAVELIN_STENO_DICT_PLOVER and DICT_LAPWING can be y.
All enabled dicts downloaded + compiled into one binary. Javelin stacks
them in StenoDictionaryList — user toggles at runtime.

Dict priority at runtime (highest first):
1. User dict (add_translation, on-keyboard)
2. All built-in dicts (Plover, Lapwing, etc. from embedded binary)

Upload dict (USB) not yet implemented — future enhancement.
2026-06-23 00:58:17 +08:00
0f0861ffd4 Add Lapwing dictionary option via Kconfig
CONFIG_ZMK_JAVELIN_STENO_DICT choices:
- PLOVER (default) — downloads openstenoproject/plover main.json
- LAPWING — downloads lapwing-base + lapwing-commands + lapwing-numbers
- NONE — no auto-download, upload via USB or provide custom binary

Set in corne.conf: CONFIG_ZMK_JAVELIN_STENO_DICT_LAPWING=y
2026-06-23 00:51:59 +08:00
6eef6d7006 Auto-download + compile Plover dict during build
CMake configure:
1. Check for pre-compiled dicts/steno_dict.bin (or JAVELIN_DICT_BIN)
2. If missing, download Plover main.json from openstenoproject/plover
3. Run compile_dict.py to produce JSC4 binary
4. Embed via dict_embed.S

Downloaded JSON cached in dicts_src/ — persists across builds via
GH Actions west module cache. Only re-downloads if cache evicted.
2026-06-23 00:47:15 +08:00
4e7b4e062f Fix: sed-patch orthography.h to disable cache (LockCache/UnlockCache undef) 2026-06-23 00:13:36 +08:00
d40dc7f537 Fix linker: disable ortho cache, stub CancelAllStenoKeys, stub flash, fix C linkage for raise_zmk_keycode_state_changed 2026-06-23 00:06:57 +08:00
8a8b5cdc67 Fix: add ZMK app include dir to library (APPLICATION_SOURCE_DIR) 2026-06-22 23:49:28 +08:00
358cba1704 Fix: compile all C++ (including bridge) in javelin_steno library for C++23 2026-06-22 23:43:59 +08:00
95e73ee2b8 Fix: split build - Javelin lib (C++23) + bridge sources in app target (ZMK headers) 2026-06-22 23:39:11 +08:00
bbb17c58d9 Fix: exclude fake_processor.cc (test-only, uses RUN_TESTS members) 2026-06-22 23:30:04 +08:00
f70037b728 Fix: strip TEST_BEGIN..TEST_END blocks from Javelin .cc files entirely 2026-06-22 23:26:43 +08:00
3470bfb18e Fix: use Python to patch unit_test.h with if constexpr(false) for test bodies 2026-06-22 23:23:20 +08:00
9cfaca3aca Fix: use sed instead of git patches for javelin source modifications 2026-06-22 23:16:55 +08:00
547aadcebe Fix: override unit_test.h via include path to suppress test compilation 2026-06-22 23:05:57 +08:00
4f1a402240 Fix: suppress Javelin test compilation via template dead-code elimination 2026-06-22 23:02:16 +08:00
13e873414b Fix constexpr reinterpret_cast: patch user_dictionary.h at build time 2026-06-22 22:52:40 +08:00
efbebfd1d2 Fix: add -fpermissive for constexpr reinterpret_cast in user_dictionary.h 2026-06-22 22:48:14 +08:00
181082ef91 Fix: define M_PI directly (picolibc ignores _USE_MATH_DEFINES) 2026-06-22 22:43:04 +08:00
66a71cf0ed Fix: define _USE_MATH_DEFINES for M_PI in picolibc 2026-06-22 22:38:48 +08:00
000f86e255 Fix: define JAVELIN_BOARD_CONFIG=<stddef.h> for board config include 2026-06-22 22:34:49 +08:00
7fdf6823f5 Fix C++ standard: use zephyr_library to override Zephyr's -std=c++11 with gnu++23 2026-06-22 22:30:31 +08:00
1751171667 Phase 3: dictionary loading pipeline + binary embedding
- engine_init.cc: loads StenoDictionaryCollection from embedded binary,
  validates JSC4 magic + timestamp, constructs dict list + full processor
  pipeline (Repeat → AllUp → JeffModifiers → Engine)
- dict_embed.S: embeds compiled dict binary via .incbin directive.
  Falls back to null placeholder if no dict available
- CMakeLists.txt: dict binary discovery (dicts/steno_dict.bin or
  JAVELIN_DICT_BIN cmake var), assembly embedding
- tools/dict_compiler/compile_dict.py: stroke parser + skeleton compiler.
  Full JSC4 binary format not yet implemented — for now, use Javelin
  web tool (lim.au) to generate dict binary
- dicts/: directory for compiled dictionary binaries

Dict compiler is the remaining gap — JSC4 format requires exact XIP
pointer layout matching Javelin's C++ struct casting.
2026-06-22 21:26:23 +08:00
d4dc836b52 Implement Phase 2: real platform shims + behavior driver + steno key defines
- zmk_key_shim: Key::Press/Release → raise_zmk_keycode_state_changed()
  Maps Javelin KeyCode to ZMK HID events (keyboard + consumer pages)
- zmk_clock_shim: Clock:: → Zephyr k_uptime_get/k_cyc_to_us/k_msleep
- zmk_flash_shim: Flash::EraseBlock/WriteBlock → Zephyr flash API
- behavior_javelin_steno.c: proper DT_DRV_COMPAT, DT_INST_FOREACH_STATUS_OKAY
- engine_init.cc: processor pipeline wiring (AllUp → JeffModifiers → Engine)
- javelin_steno.dtsi: default &javsteno behavior instance
- dt-bindings/zmk/javelin_steno.h: STENO_S1..STENO_ZR key defines for keymaps
- Exclude thread.cc (pthreads), key.cc, clock.cc (replaced by shims)
- Fix CMake: combine COMPILE_FLAGS + COMPILE_DEFINITIONS in single call

Engine init deferred until dictionary loaded (Phase 3).
2026-06-22 21:02:14 +08:00
206e5231e1 Initial skeleton: ZMK module structure + Javelin submodule + stub shims
Phase 1 scaffold for porting Javelin steno engine as a ZMK module.
All platform shims are stubs — compiles but no steno processing yet.
2026-06-22 20:49:01 +08:00