added command to get actual LED values

This commit is contained in:
Markus Koch 2017-04-23 20:24:44 +02:00
parent 116d402b94
commit 572f31fef6
1 changed files with 7 additions and 0 deletions

View File

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