Files
qmk_firmware/keyboards/keychron
rootiest 0fa528b3dd feat(q5_max): add CMD_BATTERY HID push and query for wireless battery level
Adds a new HID_CMD_BATTERY (0x44) command to the shared qmk-host protocol.
When the keyboard is in wireless transport mode (BT or 2.4G) the firmware
now pushes the current battery percentage to the host:

- Periodic push every 5 minutes via timer_read32()/timer_elapsed32(); fires
  immediately on the first matrix_scan_user() call after boot so qmk-host
  gets a reading as soon as the keyboard connects over USB in wireless mode.
- Redundant sends are suppressed: g_last_sent_bat tracks the last value
  transmitted and the packet is skipped when the level has not changed.
- Query-response path: qmk-host can send CMD_BATTERY with HID_FLAG_QUERY at
  any time; the keyboard replies with the current percentage or
  HID_BATT_UNAVAILABLE (0xFF) when in USB transport mode.
- All battery and transport code is guarded by #ifdef LK_WIRELESS_ENABLE so
  the keymap compiles cleanly on any wired-only build.

Firmware size delta: +160 bytes (well within flash budget).
2026-04-15 03:37:18 -04:00
..
2024-11-15 17:47:02 +08:00
2024-11-27 18:04:06 +08:00
2024-11-18 18:54:24 +08:00
2025-03-25 16:16:19 +08:00
2024-08-19 12:21:40 +08:00
2024-03-07 11:13:53 +08:00
2024-11-15 15:48:52 +08:00
2024-04-12 11:16:25 +08:00
2026-03-16 19:07:27 +08:00
2025-12-08 10:14:28 +08:00
2025-09-09 12:31:34 +08:00
2024-11-29 18:23:30 +08:00
2024-04-12 10:25:22 +08:00
2024-02-17 10:13:05 +08:00
2025-01-17 15:08:58 +08:00