Skip to content

Commit dbcb7a8

Browse files
Looks like JSAUX controller needs extra report ID only on Windows, breaks on Linux, so add conditional compilation hack
1 parent b8ad896 commit dbcb7a8

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

Controllers/WushiController/WushiL50USBController.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,27 @@ void WushiL50USBController::setMode(WushiL50State * in_mode)
3232
/*-----------------------------------------------------*\
3333
| Set up custom lighting packet |
3434
\*-----------------------------------------------------*/
35-
usb_buf[0x00] = 0xCC;
36-
usb_buf[0x01] = 0x16;
37-
usb_buf[0x02] = in_mode->effect;
38-
usb_buf[0x03] = in_mode->speed;
39-
usb_buf[0x04] = in_mode->brightness;
35+
#ifdef _WIN32
36+
#define OFFSET 1
37+
usb_buf[0x00] = 0xCC;
38+
#else
39+
#define OFFSET 0
40+
#endif
41+
usb_buf[0x00 + OFFSET] = 0x16;
42+
usb_buf[0x01 + OFFSET] = in_mode->effect;
43+
usb_buf[0x02 + OFFSET] = in_mode->speed;
44+
usb_buf[0x03 + OFFSET] = in_mode->brightness;
4045

4146
/*-----------------------------------------------------*\
4247
| Copy in color data |
4348
\*-----------------------------------------------------*/
44-
memcpy(&usb_buf[0x05], in_mode->zone0_rgb, 3);
45-
memcpy(&usb_buf[0x08], in_mode->zone0_rgb, 3);
46-
memcpy(&usb_buf[0x0B], in_mode->zone0_rgb, 3);
47-
memcpy(&usb_buf[0x0E], in_mode->zone0_rgb, 3);
49+
memcpy(&usb_buf[0x04 + OFFSET], in_mode->zone0_rgb, 3);
50+
memcpy(&usb_buf[0x07 + OFFSET], in_mode->zone0_rgb, 3);
51+
memcpy(&usb_buf[0x0A + OFFSET], in_mode->zone0_rgb, 3);
52+
memcpy(&usb_buf[0x0D + OFFSET], in_mode->zone0_rgb, 3);
4853

49-
usb_buf[0x12] = in_mode->wave_ltr;
50-
usb_buf[0x13] = in_mode->wave_rtl;
54+
usb_buf[0x11 + OFFSET] = in_mode->wave_ltr;
55+
usb_buf[0x12 + OFFSET] = in_mode->wave_rtl;
5156

5257
/*-----------------------------------------------------*\
5358
| Send packet |

0 commit comments

Comments
 (0)