From 009d525f93319017ac0c7791f6231a3b1b2dcb70 Mon Sep 17 00:00:00 2001 From: lokher Date: Thu, 6 Jul 2023 10:16:21 +0800 Subject: [PATCH] fix system sleep not working --- keyboards/keychron/bluetooth/ckbt51.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); }