17 return !memcmp(light->
r +
LED_MOUSE, black,
sizeof(black)) && !memcmp(light->
g +
LED_MOUSE, black,
sizeof(black)) && !memcmp(light->
b +
LED_MOUSE, black,
sizeof(black));
27 && !
rgbcmp(lastlight, newlight))
35 { 0x07, 0x22, num_zones, 0x01, 0 },
36 { 0x07, 0x05, 0x02, 0 }
38 uchar* rgb_data = &data_pkt[0][4];
40 if (
IS_GLAIVE(kb) && i != 0 && i != 1 && i != 5)
48 if(!
usbsend(kb, data_pkt[0], 1))
50 int was_black =
isblack(kb, lastlight), is_black =
isblack(kb, newlight);
53 if(!
usbsend(kb, data_pkt[1], 1))
55 }
else if(was_black || force){
58 if(!
usbsend(kb, data_pkt[1], 1))
62 memcpy(lastlight, newlight,
sizeof(
lighting));
72 for(
int i = 0; i < zonecount; i++){
76 data_pkt[4] = light->
r[led];
77 data_pkt[5] = light->
g[led];
78 data_pkt[6] = light->
b[led];
94 for(
int i = 0; i < zonecount; i++){
95 if(!
usbrecv(kb, data_pkt, in_pkt))
97 if(memcmp(in_pkt, data_pkt, 4)){
105 light->
r[led] = in_pkt[4];
106 light->
g[led] = in_pkt[5];
107 light->
b[led] = in_pkt[6];
static int isblack(const usbdevice *kb, const lighting *light)
int savergb_mouse(usbdevice *kb, lighting *light, int mode)
int loadrgb_mouse(usbdevice *kb, lighting *light, int mode)
#define ckb_err(fmt, args...)
int updatergb_mouse(usbdevice *kb, int force)
static int rgbcmp(const lighting *lhs, const lighting *rhs)
#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.
#define usbsend(kb, messages, count)
usbsend macro is used to wrap _usbsend() with debugging information (file and lineno) ...