Code cleanup

This commit is contained in:
Christoffer Martinsson 2025-09-17 23:00:23 +02:00
parent aa6ac7a0c4
commit 527d34840e
5 changed files with 14 additions and 20 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ rp2040_42/Cargo.lock
rp2040_51/Cargo.lock rp2040_51/Cargo.lock
*.FCBak *.FCBak
rp2040/target rp2040/target
rp2040/firmware.uf2

View File

@ -35,14 +35,14 @@
- 42 keys "Split" keyboard layout. 36 finger buttons and 6 thumb buttons. - 42 keys "Split" keyboard layout. 36 finger buttons and 6 thumb buttons.
- Extreme low profile (only one pcb). - Extreme low profile (only one pcb).
- Cost efficient solution with one pcb and one 3D printed cover. - Cost efficient solution with one pcb and one 3D printed cover.
- Function keys with total of three layer support (Primary + 2fn layers). - Function layers provide three active maps (primary + two Fn layers) with sticky-lock support.
- Status indication - - High-speed key scanning: 250µs cadence with 2-scan press / 3-scan release debounce for sub-millisecond latency and immediate USB reporting.
- LED green = Normal mode - Status indication driven by the joystick-style heartbeat model:
- LED green flashing = waiting for USB enumeration - Heartbeat green while waiting for USB enumeration.
- LED blue on = sticky lock initiated - Solid green during normal operation; automatic heartbeat idle animation after 5s inactivity.
- LED blue flashing = sticky lock activated - Blue solid / flashing when sticky lock is armed / latched.
- LED red = error - Red solid on firmware error, red flashing for Caps Lock.
- LED red flashing = Caps Lock activated
## Build environment rp2040 Zero ## Build environment rp2040 Zero
@ -101,17 +101,11 @@ Rust embedded, rp2040 HAL
## Features ## Features
- 51 keys "Split" keyboard layout. 36 finger buttons and 9 thumb buttons and 6 function buttons. - 51 keys "Split" keyboard layout. 36 finger buttons, 9 thumb buttons and 6 function buttons.
- Extreme low profile (only one pcb). - Extreme low profile (only one pcb).
- Cost efficient solution with one pcb and one 3D printed cover. - Cost efficient solution with one pcb and one 3D printed cover.
- Function keys with total of three layer support (Primary + 2fn layers). - Function layers with the same immediate-report, low-latency scanning pipeline as the 42-key variant (primary + two Fn layers with sticky lock).
- Status indication - - Status LED behaviour mirrors the joystick/42-key firmware: heartbeat during boot, idle animation after 5s inactivity, blue indicators for sticky lock, and red for caps/error conditions.
- LED green = Normal mode
- LED green flashing = waiting for USB enumeration
- LED blue on = sticky lock initiated
- LED blue flashing = sticky lock activated
- LED red = error
- LED red flashing = Caps Lock activated
## Build environment rp2040 Zero ## Build environment rp2040 Zero
@ -135,4 +129,3 @@ Rust embedded, rp2040 HAL
- 1x PCB [Gerber files](eCAD/cmdr_mainboard_51_gerber_v1.zip) - 1x PCB [Gerber files](eCAD/cmdr_mainboard_51_gerber_v1.zip)
- 1x MCU cover (TBD) - 1x MCU cover (TBD)
- 1x 6x3 Cherry MX mounting jig (optional) [STL file](mCAD/cmdr_mounting_jig-MountingJig.stl) - 1x 6x3 Cherry MX mounting jig (optional) [STL file](mCAD/cmdr_mounting_jig-MountingJig.stl)

Binary file not shown.

View File

@ -28,7 +28,7 @@ pub mod usb {
pub mod timers { pub mod timers {
pub const USB_REPORT_INTERVAL_MS: u32 = 10; pub const USB_REPORT_INTERVAL_MS: u32 = 10;
pub const USB_TICK_INTERVAL_US: u32 = 250; pub const USB_TICK_INTERVAL_US: u32 = 250;
pub const STATUS_LED_INTERVAL_MS: u32 = 4; pub const STATUS_LED_INTERVAL_MS: u32 = 10;
pub const IDLE_TIMEOUT_MS: u32 = 5_000; pub const IDLE_TIMEOUT_MS: u32 = 5_000;
} }

View File

@ -109,7 +109,7 @@ impl LedEffect {
match self { match self {
LedEffect::Solid => 0, LedEffect::Solid => 0,
LedEffect::Blink { period_ms } => period_ms / 2, LedEffect::Blink { period_ms } => period_ms / 2,
LedEffect::Heartbeat { .. } => 4, LedEffect::Heartbeat { .. } => 10,
} }
} }