feat(keymap): extract pure HID decode into host-testable crate
The Key type, US-QWERTY translate, and the edge-detecting boot-report parser lived in usb_kbd.rs, unreachable by cargo test (the firmware crate is pinned to the xtensa target). Move them to a dependency-free #![no_std] + #![forbid(unsafe_code)] crate so the one path that parses untrusted device bytes can be exercised on the host. 14 tests, including an ASCII-invariant sweep over all 256 usage IDs (pins the guarantee the editor's byte==char indexing relies on) and a never-panics fuzz over arbitrary-length/content reports.
This commit is contained in:
10
keymap/Cargo.toml
Normal file
10
keymap/Cargo.toml
Normal file
@@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "keymap"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
description = "Pure HID boot-keyboard decode: the Key event type, a US-QWERTY translate, and an edge-detecting Decoder. No esp/std deps, so it is host-testable and fuzzable off-device (see MEMORY_AUDIT.md)."
|
||||
|
||||
# Deliberately dependency-free and #![no_std] (except under test) so the decode
|
||||
# path — the one place untrusted device bytes are parsed — can be exercised on
|
||||
# the host without the ESP toolchain. The firmware crate depends on this by path.
|
||||
[dependencies]
|
||||
Reference in New Issue
Block a user