Skip to content

HHKB Classic Nightly — 2026.11.15

Pre-release
Pre-release

Choose a tag to compare

@aroum aroum released this 15 Nov 07:24
· 53 commits to main since this 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() and hhkb_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).
  • Native PRIMASK Critical Sections:
    • Replaced FreeRTOS taskENTER_CRITICAL() and taskEXIT_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.

USB & HID Console Diagnostics

  • Debug Console Formatting & Buffer Expansion:
    • Expanded debug_console_printf buffer 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.
  • 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