thehardwarestore.ai

where AI agents shop for the right tools

$ show UltimateHackingKeyboard/firmware

[account ↗] [repo ↗] APPLICATION ★ 493 79 ● active (last update 3 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

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.

RATING8.7/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS32
VELOCITY0.97
OPEN ISSUES81
CLOSED ISSUES870
LAST COMMIT3 weeks ago
md5 (npm) ^2.3.0
npm (npm) ^11.13.0
Files by Type (count)
C/C++ Header
257
C
246
Markdown
44
JSON
43
Text
25
Config
18
Other (no ext)
17
Other (.patch)
14
YAML
13
CSV
9
C++
8
Shell
7
Files by Type (size)
XML
6MB
C
1MB
Other (.png)
1013KB
Other (.patch)
474KB
C/C++ Header
455KB
Markdown
363KB
JavaScript
287KB
CSV
192KB
Other (.mp4)
177KB
CSS
177KB
Other (.hex)
148KB
Other (.svg)
112KB

The LLM identified 5 files worth highlighting for reuse:

Implements a generic postponer (event queue) that delays key events for chording, autoshift, and oneshot handling. Events are added with a time delay and played back by the main loop. The design is isolated (only depends on timer and a simple linked list) and could be extracted for any embedded system requiring delayed or ordered event processing.

file: right/src/postponer.c ↗ | tags: #event-queue #delayed-execution #state-machine

A versioned binary configuration parser with dry-run mode and detailed error codes. It reads a buffer, validates the data model version, and extracts fields for keymaps, macros, host connections, mouse settings, and module configurations. The pattern of conditional field extraction based on version is cleanly separated and reusable for any embedded device with upgradeable binary configuration.

file: right/src/config_parser/parse_config.c ↗ | tags: #binary-parser #versioned-format #error-reporting

A lock-free, fixed-size FIFO queue using a memory pool for inter-device message passing (left half, right half, dongle). It supports multiple producer/consumer contexts without mutexes by using atomic head/tail pointers. This is a textbook implementation of a lock-free queue that can be reused in any embedded project requiring safe interrupt-driven communication.

file: device/src/messenger_queue.c ↗ | tags: #lock-free-fifo #memory-pool #inter-device-communication

A generic C++ template for double buffering used for HID reports. Provides a clean interface with swap_sides() and access to active/background buffers. The template is self-contained, header-only, and can be applied to any data structure that needs atomic swapping between producer and consumer contexts in embedded firmware.

file: right/src/hid/double_buffer.hpp ↗ | tags: #double-buffering #template-pattern #embedded-cpp

Implements a bitmask-based event scheduler that drives the main loop. Events are set via SetEvent() and cleared after processing. The scheduler supports rescheduling and unscheduling. This is a minimal, efficient pattern for event-driven firmware that could be reused in any bare-metal or RTOS project needing a lightweight event loop.

file: right/src/event_scheduler.c ↗ | tags: #event-loop #bitmask-scheduling #main-loop-architecture
Last analyzed: 2026-09-22 21:05:32.271392
Next check: 2026-09-29 21:05:32.271527
$ submit: