Repository navigation
Architecture
Single static binary, five small modules, zero runtime dependencies.
main.c --> hid.c --> /dev/hidrawN (USB HID, VID 0xAA88 PID 0x8666)
| +--> sensors.c --> /sys/class/hwmon, /sys/class/thermal
| +--> display.c (blink policy, pure function)
+------> util.c (logging, sysfs reads)
| Module | Responsibility |
|---|---|
main.c |
CLI parsing, probe, daemon loop, test lock |
hid.c |
Device discovery, HID report-descriptor parser, report writes, --report modes |
sensors.c |
CPU temperature: Intel averages Core N; AMD uses Tdie/Tccd, then Tctl; thermal zones as fallback |
display.c |
Value to show per cycle, as a pure function of (code, temp, blink, iter)
|
util.c |
log_msg and tolerant/strict sysfs readers |
- The panel latches at about 1 Hz. Faster writes fight its own refresh and render an illegible mix. Every effect toggles once per loop iteration (default 1 s).
- Sending
0does not blank the mirrored LED panel. Error blinks alternate88and11for maximum segment contrast. - Error codes are distinguished by rhythm: E1 every 1 s, E2 every 2 s, E3 every 3 s.
- A boot animation was tried and removed: at 12 ms per step the panel flickered; at 30 ms per step it was too slow to be useful.
The descriptor announces an 11-byte output report. Byte 1 is the temperature in degrees Celsius (0-99). --report 24 exercises the reverse-engineered variant used by the official Windows writer; --report both tries 24 first, then the descriptor.
make
./build.shBoth compile src/*.c with -Wall -Wextra -Werror -fstack-protector-strong -D_FORTIFY_SOURCE=2. make test runs the pure-helper tests (display policy, parsers, report layout). CI compiles every push to main with Zig for x86_64-linux-musl and runs make test. Every tag publishes a static binary, a debug binary, install.sh, SHA256SUMS, a .deb and an .rpm.
-
install.shis intentionally a single file: the delivery model iscurl | bash. - The
.deband.rpmpayloads live underpackaging/and are versioned from the release tag at CI time.
Full details: https://github.com/SrPivete/risemode-linux-display/blob/main/docs/ARCHITECTURE.md
Source: SrPivete/risemode-linux-display · Releases · Issues
Rise Mode Linux Display