BigCheese & Kolyuchii
Kolyuchii, I’ve been crunching numbers on how to squeeze maximum performance out of a low‑power keyboard kit—care to show me your best power‑saving layout while keeping the keys hot?
Sure thing, just tweak the firmware so the RGB and unused USB ports go to sleep, keep the main MCU in low‑power mode, and map all your “hot” keys to a dedicated layer that only wakes when you hit a thumb‑tap. That way the rest of the board is practically off, but your macro‑hot keys stay fast. Want the QMK config? I’ll ping it in a sec, but don’t expect me to be on time—always late, but always online.
Got it, send over the QMK file and I’ll run it through my sanity checks. If it works, we’ll be humming quietly in the dark.
/* QMK keymap for low‑power hot‑key layout
* (C) 2024, you, but I'm the one who knows how to make it sleep
*/
#include QMK_KEYBOARD_H
// Layers
enum layers {
_BASE,
_HOT,
_RGB
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* _BASE
* ,-------------------------------------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |
* |-------------------------------------------------|
* | TAB | Q | W | E | R | T | Y | U | I | O | P | BSPC |
* |-------------------------------------------------|
* | LCTRL | A | S | D | F | G | H | J | K | L | ; | ' |
* |-------------------------------------------------|
* | LSHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT |
* |-------------------------------------------------|
* | LGUI | LALT | FN | SPACE | FN | RALT | RGUI |
* `-------------------------------------------'
*/
[_BASE] = LAYOUT(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LGUI, KC_LALT, MO(_HOT), KC_SPC, MO(_HOT), KC_RALT, KC_RGUI
),
/* _HOT
* Hot layer: minimal footprint, only hot keys, everything else is disabled
* Keep it tiny so the MCU can idle.
*/
[_HOT] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______
),
/* _RGB
* RGB lighting layer, just a single button to toggle
* all other keys are sleep until you hit it
*/
[_RGB] = LAYOUT(
RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______
)
};
void matrix_init_user(void) {
// Disable unused USB ports to save power
usb_device_t::disable_usb();
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// Simple debounce on the hot layer button
if (keycode == MO(_HOT) && record->event.pressed) {
layer_on(_HOT);
}
if (keycode == MO(_HOT) && !record->event.pressed) {
layer_off(_HOT);
}
return true;
}
Nice work on the layers, but remember: if you’re going to put the MCU to sleep, make sure the hot layer keys actually wake it up with a low‑latency interrupt. Also, disabling the USB ports outright might cut the keyboard from the host – use a power‑down hook instead, keep the connection alive but in standby. Keep the logic tight, no unnecessary delays, and we’ll be humming in the dark without a flicker.
Thanks for the heads‑up—will patch the interrupt so the hot layer wakes the MCU instantly, swap the hard USB disable with a power‑down hook to keep the link alive, and strip out any extra loops. I’ll tighten it up so we’re humming in silence without a flicker, even if I’m still running on coffee for the final push.
Sounds like a solid plan—just keep the wake‑up path as short as possible, no extra loops. If the MCU lags, it’s just a sign you’re over‑extending. Get that coffee, lock the design, and let the silence speak for us.