fix system sleep not working

This commit is contained in:
lokher 2023-07-06 10:16:21 +08:00
parent 9902d781e6
commit 009d525f93

View file

@ -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);
}