mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Exclude specific enum defines and cast
The unscoped Enum for the Controller LEDs is colliding with changes in the recent RedBearLab nRF51288 SDK, specifically the PinName enum in the mbed.h header file. As a simple RBL/mBed specific work-around we are now casting the LED enums into the USBH LEDEnum enum. This will potentially break support for controllers on RBL, but restore the ability to compile the project.
This commit is contained in:
parent
f90ba2c16d
commit
51cb078fa0
5 changed files with 9 additions and 8 deletions
|
@ -629,6 +629,6 @@ void PS3BT::onInit() {
|
|||
if(PS3MoveConnected)
|
||||
moveSetBulb(Red);
|
||||
else // Dualshock 3 or Navigation controller
|
||||
setLedOn(LED1);
|
||||
setLedOn(static_cast<LEDEnum>(LED1));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -566,6 +566,6 @@ void PS3USB::onInit() {
|
|||
if(PS3MoveConnected)
|
||||
moveSetBulb(Red);
|
||||
else // Dualshock 3 or Navigation controller
|
||||
setLedOn(LED1);
|
||||
setLedOn(static_cast<LEDEnum>(LED1));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -572,13 +572,13 @@ void XBOXRECV::onInit(uint8_t controller) {
|
|||
else {
|
||||
LEDEnum led;
|
||||
if(controller == 0)
|
||||
led = LED1;
|
||||
led = static_cast<LEDEnum>(LED1);
|
||||
else if(controller == 1)
|
||||
led = LED2;
|
||||
led = static_cast<LEDEnum>(LED2);
|
||||
else if(controller == 2)
|
||||
led = LED3;
|
||||
led = static_cast<LEDEnum>(LED3);
|
||||
else
|
||||
led = LED4;
|
||||
led = static_cast<LEDEnum>(LED4);
|
||||
setLedOn(led, controller);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -358,5 +358,5 @@ void XBOXUSB::onInit() {
|
|||
if(pFuncOnInit)
|
||||
pFuncOnInit(); // Call the user function
|
||||
else
|
||||
setLedOn(LED1);
|
||||
setLedOn(static_cast<LEDEnum>(LED1));
|
||||
}
|
||||
|
|
|
@ -26,11 +26,12 @@
|
|||
/** Enum used to turn on the LEDs on the different controllers. */
|
||||
enum LEDEnum {
|
||||
OFF = 0,
|
||||
#ifndef RBL_NRF51822
|
||||
LED1 = 1,
|
||||
LED2 = 2,
|
||||
LED3 = 3,
|
||||
LED4 = 4,
|
||||
|
||||
#endif
|
||||
LED5 = 5,
|
||||
LED6 = 6,
|
||||
LED7 = 7,
|
||||
|
|
Loading…
Reference in a new issue