-
Notifications
You must be signed in to change notification settings - Fork 0
/
mk3.diff
23 lines (20 loc) · 837 Bytes
/
mk3.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff --git a/libusb/blink1.go b/libusb/blink1.go
index 8caba67..9d4fbd2 100644
--- a/libusb/blink1.go
+++ b/libusb/blink1.go
@@ -16,15 +16,15 @@ func SendBlink1Command(device *Device, fadeTime int, red, blue, green, led uint8
dms := fadeTime / 10
data := []byte{
- '0', 'c', byte(red), byte(green), byte(blue), byte(dms >> 8), byte(dms % 127), byte(led),
+ 1, 'c', byte(red), byte(green), byte(blue), byte(dms >> 8), byte(dms % 127), byte(led),
}
- //reportID := data[1]
+ reportID := data[0]
return int(C.usb_control_msg(device.handle,
C.int(USB_TYPE_CLASS|C.USB_RECIP_INTERFACE|C.USB_ENDPOINT_OUT),
C.int(USBRQ_HID_SET_REPORT),
- C.int(USB_HID_REPORT_TYPE_FEATURE<<8|('c'&0xff)),
+ C.int(USB_HID_REPORT_TYPE_FEATURE<<8 | int(reportID)),
C.int(0),
(*C.char)(unsafe.Pointer(&data[0])),
C.int(len(data)),