summaryrefslogtreecommitdiffstats
path: root/keyboards
diff options
context:
space:
mode:
authorlokher <lokher@gmail.com>2023-07-06 10:16:21 +0800
committerlokher <lokher@gmail.com>2023-07-06 10:16:21 +0800
commit009d525f93319017ac0c7791f6231a3b1b2dcb70 (patch)
treeeb4b21c8a7bc99435fd6cef078b2d7d506130753 /keyboards
parent9902d781e69432a3edb1e3014706c80c7e202e6b (diff)
fix system sleep not working
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/keychron/bluetooth/ckbt51.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/keyboards/keychron/bluetooth/ckbt51.c b/keyboards/keychron/bluetooth/ckbt51.c
index 4653825839..13833ad196 100644
--- a/keyboards/keychron/bluetooth/ckbt51.c
+++ b/keyboards/keychron/bluetooth/ckbt51.c
@@ -212,11 +212,14 @@ void ckbt51_send_consumer(uint16_t report) {
}
void ckbt51_send_system(uint16_t report) {
+ /* CKBT51 supports only System Sleep */
+ if ((report & 0xFF) != 0x82) return;
+
uint8_t i = 0;
memset(payload, 0, PACKET_MAX_LEN);
payload[i++] = CKBT51_CMD_SEND_SYSTEM;
- payload[i++] = report & 0xFF;
+ payload[i++] = 0x01 << ((report & 0xFF) - 0x82);
ckbt51_send_cmd(payload, i, true, false);
}