$ account UltimateHackingKeyboard
This repository contains the production firmware for the Ultimate Hacking Keyboard (UHK) family, including the UHK60, UHK80, and companion modules (trackball, trackpoint, keycluster) plus a USB dongle. It implements the complete embedded software stack for a highly configurable split ergonomic keyboard: USB HID and Bluetooth LE HID transport, a rich macro engine with layers, chording, autoshift, sticky modifiers, and secondary roles, per-key RGB backlighting, OLED display with LVGL-based UI, battery management, and inter-device communication (UART, I2C, SPI). The firmware supports two hardware generations via conditional compilation (legacy NXP MCUXpresso SDK on the right half, Zephyr RTOS on the device half and dongle). Architecturally, the codebase is organized into distinct compilation targets: the right-hand keyboard half (right/), the left-hand half and dongle (device/), shared libraries (shared/), and peripheral modules (trackball/, trackpoint/, keycluster/). Central design patterns include an event-driven main loop with an event scheduler, a postponer system for delayed key actions, a versioned binary configuration parser, a lock-free messenger queue for inter-device messaging, and a double-buffered HID report pipeline. The firmware exposes a large USB vendor command set for reconfiguration, debugging, and firmware updates, and includes an embedded test suite that simulates key inputs and validates USB reports. The code demonstrates strong engineering craftsmanship with clean abstractions, extensive use of state machines, and careful resource management in a constrained embedded environment. While the dual-platform support introduces some conditional compilation complexity, the core modules are well-isolated and many patterns (event scheduler, postponer, UART parser, config parser, double buffer) are directly reusable in other embedded projects. The repository is actively maintained with a comprehensive test suite and CI pipeline, though the Zephyr migration is ongoing and some legacy code paths remain.