From 572f31fef632e82df13a2f7e2d12fbdef4be6118 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Sun, 23 Apr 2017 20:24:44 +0200 Subject: [PATCH] added command to get actual LED values --- firmware/keyboard.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/firmware/keyboard.c b/firmware/keyboard.c index 651eb6d..2098d39 100644 --- a/firmware/keyboard.c +++ b/firmware/keyboard.c @@ -21,6 +21,7 @@ #define CMD_IEEREAD 8 // int. eep. #define CMD_SETBLOCK 9 #define CMD_SETLED 10 +#define CMD_GETLED 11 #define CMD_SETBRIGHTNESS 12 #define CMD_GETBRIGHTNESS 13 @@ -123,6 +124,12 @@ USB_PUBLIC uchar usbFunctionSetup(uchar data[8]) led[rq->wValue.bytes[0]].b = rq->wIndex.bytes[1]; return 0; } + else if (rq->bRequest == CMD_GETLED) { + reportBuffer[0] = led[rq->wValue.bytes[0]].r; + reportBuffer[1] = led[rq->wValue.bytes[0]].g; + reportBuffer[2] = led[rq->wValue.bytes[0]].b; + return 3; + } return 0; }