Repository navigation
HHKB Classic Nightly — 2026.11.15
Pre-release
Pre-release
Pre-release nightly build for HHKB Professional Classic (PD-KB401*, AHHX01) and Classic Type-S (PD-KB401*SC, AHHS01) running on the stock STM32L072 microcontroller. No hardware modifications or controller replacements are required.
Headline: Full 1000 Hz Matrix Scan Rate Achieved
The matrix scanning engine has been comprehensively optimized to achieve a sustained, monolithic 1000 Hz (1 ms) scan rate without altering analog discharge times, row strobe delays, or Rapid Trigger precision.
- Scan Time Reduction: Raw scan execution time dropped from 1094 µs to 835 µs (-24%, saving ~259 µs per pass).
- Guaranteed Timing Headroom: Full work cycle completes in ~841–875 µs, leaving a solid 125–159 µs (>12%) margin under the 1000 µs deadline.
- Zero Missed Deadlines: Sustained 1000 Hz polling with miss = 0 during continuous operation.
- USB Task Starvation Protection: Restored non-blocking overdue timer notification drop mechanism (
ulTaskNotifyTake(pdTRUE, 0)) to ensure the lower-priority FreeRTOS USB task is never starved of CPU time.
What's Changed
Topre Matrix & Hot-Path Optimizations
- Cumulative 260 µs Latency Reduction:
- Raw scan time reduced from 1094 µs to 835 µs (-24%), unlocking a true 1000 Hz polling rate with ~125–159 µs of idle headroom per millisecond.
- Outer Loop Array Caching:
- Eliminated 120 getter calls (
hhkb_get_cal_peak()andhhkb_get_rt_key()) per scan pass by caching column pointers at the column loop level. - Hoisted
hhkb_get_debug_flag(DEBUG_FLAG_TOPRE)evaluation completely out of the 60-key loop (evaluated once per pass instead of 60 times).
- Eliminated 120 getter calls (
- Native PRIMASK Critical Sections:
- Replaced FreeRTOS
taskENTER_CRITICAL()andtaskEXIT_CRITICAL()inside the RAM-resident scan loop (.RamFunc) with atomic__get_PRIMASK()/__disable_irq()/__set_PRIMASK(). - Completely eliminated 120 Flash-veneer jumps (
__vPortEnterCritical_veneer/__vPortExitCritical_veneer) between RAM and Flash per pass, executing in 1–2 CPU cycles directly in RAM.
- Replaced FreeRTOS
USB & HID Console Diagnostics
- Debug Console Formatting & Buffer Expansion:
- Expanded
debug_console_printfbuffer from 96 to 128 bytes and the console ring buffer from 192 to 256 bytes. - Resolved diagnostic line truncation that previously stripped trailing carriage return / line feed sequences (
\r\n), restoring clean line breaks in HID Console.
- Expanded
- Production Purity & Zero Debug Overhead:
- All debug monitoring streams (Topre matrix stream, VIA telemetry, Polling rate monitor, Calibration monitor) remain strictly disabled by default.
- Internal scan diagnostics profiler (
HHKB_SCAN_DIAGNOSTICS) disabled by default in release configuration for maximum efficiency.
Included Assets
dmk-hhkb-classic-classic-via.hfb: Firmware for HHKB Professional Classic (Model AHHX01, HFB version A4.50).dmk-hhkb-classic-type-s-via.hfb: Firmware for HHKB Professional Classic Type-S (Model AHHS01, HFB version A8.50).via.json: Complete VIA v3 draft definition containing layout definitions, custom Topre settings, calibration controls, and debug toggles.
Installation & Documentation
- Installation Guide: https://github.com/aroum/dmk/blob/dev/keyboards/hhkb_classic/docs/en/install.md
- VIA Configuration: https://github.com/aroum/dmk/blob/dev/keyboards/hhkb_classic/docs/en/via.md
- Debugging & HID Console: https://github.com/aroum/dmk/blob/dev/keyboards/hhkb_classic/docs/en/debug.md
- Flashing can be performed using
tools/hhkb/hhkb_flasher.pyor the official PFU HHKB Keymap Tool.