9 if(!
usbrecv(kb, data_pkt, in_pkt))
21 { 0x0e, 0x15, 0x01, 0 },
22 { 0x0e, 0x16, 0x01, 0 }
26 for(
int i = 0; i <= modes; i++){
28 if(!
usbrecv(kb, data_pkt[0], in_pkt)){
32 memcpy(hw->
id + i, in_pkt + 4,
sizeof(
usbid));
35 if(!
usbrecv(kb, data_pkt[1], in_pkt)){
41 for(
int i = 0; i < modes; i++){
66 { 0x07, 0x16, 0x01, 0 },
67 { 0x07, 0x15, 0x01, 0 },
70 for(
int i = 0; i <= modes; i++){
73 if(!
usbsend(kb, data_pkt[0], 1))
77 for(
int i = 0; i <= modes; i++){
79 memcpy(data_pkt[1] + 4, hw->
id + i,
sizeof(
usbid));
80 if(!
usbsend(kb, data_pkt[1], 1))
84 for(
int i = 0; i < modes; i++){
#define DELAY_LONG(kb)
The longest delay takes place where something went wrong (eg when resetting the device) ...
int cmd_hwsave_kb(usbdevice *kb, usbmode *dummy1, int dummy2, int dummy3, const char *dummy4)
int loadrgb_kb(usbdevice *kb, lighting *light, int mode)
void hwtonative(usbprofile *profile, hwprofile *hw, int modecount)
static int hwloadmode(usbdevice *kb, hwprofile *hw, int mode)
void nativetohw(usbprofile *profile, hwprofile *hw, int modecount)
#define usbrecv(kb, out_msg, in_msg)
usbrecv macro is used to wrap _usbrecv() with debugging information (file and lineno) ...
Definitions for using USB interface.
int cmd_hwload_kb(usbdevice *kb, usbmode *dummy1, int dummy2, int apply, const char *dummy3)
int savergb_kb(usbdevice *kb, lighting *light, int mode)
#define usbsend(kb, messages, count)
usbsend macro is used to wrap _usbsend() with debugging information (file and lineno) ...