Commit graph

30 commits

Author SHA1 Message Date
3e4b5a56b0 Cleanup: remove dead files from rapid iteration
- Delete suppress_tests.h (unused, replaced by javelin_overrides/unit_test.h)
- Delete patches/ dir (orphaned, sed/python used instead)
- Delete empty .gitmodules (submodule removed, javelin fetched via west)
- Simplify Kconfig: remove unused flags (HEAP_SIZE, USER_DICT_SIZE,
  ORTHOGRAPHY_CACHE, CONSOLE, TRIGGER — not wired to code yet)
- Add .gitignore for __pycache__
2026-06-23 00:29:06 +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
21f1804527 Fix: List::Insert → List::InsertAt 2026-06-23 00:01:14 +08:00
ff2230735e Fix: remove extern C wrappers around Zephyr headers (cbprintf_cxx linkage conflict) 2026-06-22 23:55:33 +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
ab8cad5439 Fix patch: use minimal context for unit_test.h template change 2026-06-22 23:13:13 +08:00
d024087715 Fix patch: correct line numbers for unit_test.h TEST_BEGIN override 2026-06-22 23:12:51 +08:00
752d9e2c7b Fix: patch unit_test.h to use dead template for test bodies 2026-06-22 23:08:50 +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
d1b91ba144 Remove git submodule — javelin-steno fetched via west.yml instead 2026-06-22 22:23:55 +08:00
7a96cf1b6b Fix Kconfig: remove select NEWLIB_LIBC (choice symbol, can't be selected) 2026-06-22 22:13:10 +08:00
1d450a5dd1 Phase 4: user dict, console commands, undo wiring
- engine_init.cc: user dict (16KB RAM-backed) added to dict stack as
  highest priority. Console commands registered (list/enable/disable/
  toggle dicts, lookup, add/remove translations, template values).
  Undo stroke (*) already handled by StenoEngine::Process().
- zmk_console_shim.cc: route Javelin console output to ZMK logging
  (line-buffered, LOG_INF per line). Enables debug visibility.

All Phase 4 features (undo, user dict, add_translation mode, console
mode, orthography engine, all processor types) are already compiled
from Javelin source — this commit wires them into the init path.

Orthography rules: empty for now (suffix folding disabled).
Full orthography requires separate data in the binary — planned for
dict compiler enhancement.
2026-06-22 21:55:53 +08:00
580d2ed5b8 Phase 3b: working dict compiler + dict download script
- compile_dict.py: full JSC4 binary compiler for compact map dicts.
  Parses Plover JSON → builds hash maps with CRC32 probing →
  produces binary with correct header, pointers, text block, timestamps.
  Tested with small dict — magic + timestamp validation passes.
- download_dicts.sh: fetches Plover main.json from openstenoproject/plover
  and Lapwing dicts from aerickt/plover-lapwing-aio.

Usage: python compile_dict.py main.json -o dicts/steno_dict.bin
2026-06-22 21:52:57 +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