Skip to content

Commit 5b64f3a

Browse files
committed
Wrap send/receive in USB ifdef
Allows compilation under other USB modes if the XInput USB interface hasn't been defined.
1 parent 42438a4 commit 5b64f3a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/XInput.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,12 +307,15 @@ uint8_t XInputGamepad::getLEDPatternID() const {
307307

308308
//Send an update packet to the PC
309309
void XInputGamepad::send() {
310+
#ifdef USB_XINPUT
310311
if (!newData) return; // TX data hasn't changed
311312
XInputUSB.send(tx, USB_Timeout);
312313
newData = false;
314+
#endif
313315
}
314316

315317
void XInputGamepad::receive() {
318+
#ifdef USB_XINPUT
316319
if (XInputUSB.available() == 0) {
317320
return; // No packet available
318321
}
@@ -330,6 +333,7 @@ void XInputGamepad::receive() {
330333
else if (rx[0] == 0x01) {
331334
parseLED(rx[2]);
332335
}
336+
#endif
333337
}
334338

335339
void XInputGamepad::parseLED(uint8_t leds) {

0 commit comments

Comments
 (0)