mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Merge pull request #215 from sieren/fix-new-rbl-sdk
Make USBH work with new RedBear SDK for nRF51288
This commit is contained in:
commit
405c126921
7 changed files with 18 additions and 10 deletions
|
@ -632,6 +632,6 @@ void PS3BT::onInit() {
|
||||||
if(PS3MoveConnected)
|
if(PS3MoveConnected)
|
||||||
moveSetBulb(Red);
|
moveSetBulb(Red);
|
||||||
else // Dualshock 3 or Navigation controller
|
else // Dualshock 3 or Navigation controller
|
||||||
setLedOn(LED1);
|
setLedOn(static_cast<LEDEnum>(LED1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -569,6 +569,6 @@ void PS3USB::onInit() {
|
||||||
if(PS3MoveConnected)
|
if(PS3MoveConnected)
|
||||||
moveSetBulb(Red);
|
moveSetBulb(Red);
|
||||||
else // Dualshock 3 or Navigation controller
|
else // Dualshock 3 or Navigation controller
|
||||||
setLedOn(LED1);
|
setLedOn(static_cast<LEDEnum>(LED1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
SPP.h
2
SPP.h
|
@ -120,7 +120,9 @@ public:
|
||||||
*/
|
*/
|
||||||
size_t write(const uint8_t* data, size_t size);
|
size_t write(const uint8_t* data, size_t size);
|
||||||
/** Pull in write(const char *str) from Print */
|
/** Pull in write(const char *str) from Print */
|
||||||
|
#if !defined(RBL_NRF51822)
|
||||||
using Print::write;
|
using Print::write;
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
/**
|
/**
|
||||||
* Writes the byte to send to a buffer. The message is send when either send() or after Usb.Task() is called.
|
* Writes the byte to send to a buffer. The message is send when either send() or after Usb.Task() is called.
|
||||||
|
|
|
@ -572,13 +572,13 @@ void XBOXRECV::onInit(uint8_t controller) {
|
||||||
else {
|
else {
|
||||||
LEDEnum led;
|
LEDEnum led;
|
||||||
if(controller == 0)
|
if(controller == 0)
|
||||||
led = LED1;
|
led = static_cast<LEDEnum>(LED1);
|
||||||
else if(controller == 1)
|
else if(controller == 1)
|
||||||
led = LED2;
|
led = static_cast<LEDEnum>(LED2);
|
||||||
else if(controller == 2)
|
else if(controller == 2)
|
||||||
led = LED3;
|
led = static_cast<LEDEnum>(LED3);
|
||||||
else
|
else
|
||||||
led = LED4;
|
led = static_cast<LEDEnum>(LED4);
|
||||||
setLedOn(led, controller);
|
setLedOn(led, controller);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -358,5 +358,5 @@ void XBOXUSB::onInit() {
|
||||||
if(pFuncOnInit)
|
if(pFuncOnInit)
|
||||||
pFuncOnInit(); // Call the user function
|
pFuncOnInit(); // Call the user function
|
||||||
else
|
else
|
||||||
setLedOn(LED1);
|
setLedOn(static_cast<LEDEnum>(LED1));
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,11 +26,12 @@
|
||||||
/** Enum used to turn on the LEDs on the different controllers. */
|
/** Enum used to turn on the LEDs on the different controllers. */
|
||||||
enum LEDEnum {
|
enum LEDEnum {
|
||||||
OFF = 0,
|
OFF = 0,
|
||||||
|
#ifndef RBL_NRF51822
|
||||||
LED1 = 1,
|
LED1 = 1,
|
||||||
LED2 = 2,
|
LED2 = 2,
|
||||||
LED3 = 3,
|
LED3 = 3,
|
||||||
LED4 = 4,
|
LED4 = 4,
|
||||||
|
#endif
|
||||||
LED5 = 5,
|
LED5 = 5,
|
||||||
LED6 = 6,
|
LED6 = 6,
|
||||||
LED7 = 7,
|
LED7 = 7,
|
||||||
|
|
|
@ -135,8 +135,13 @@ e-mail : support@circuitsathome.com
|
||||||
#define USING_SPI4TEENSY3 0
|
#define USING_SPI4TEENSY3 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ((defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)) || defined(RBL_NRF51822) || defined(__ARDUINO_X86__) || ARDUINO >= 10600) && !USING_SPI4TEENSY3
|
#if ((defined(ARDUINO_SAM_DUE) && defined(__SAM3X8E__)) || defined(__ARDUINO_X86__) || ARDUINO >= 10600) && !USING_SPI4TEENSY3
|
||||||
#include <SPI.h> // Use the Arduino SPI library for the Arduino Due, RedBearLab nRF51822, Intel Galileo 1 & 2, Intel Edison or if the SPI library with transaction is available
|
#include <SPI.h> // Use the Arduino SPI library for the Arduino Due, Intel Galileo 1 & 2, Intel Edison or if the SPI library with transaction is available
|
||||||
|
#endif
|
||||||
|
#ifdef RBL_NRF51822
|
||||||
|
#include <nrf_gpio.h>
|
||||||
|
#include <SPI_Master.h>
|
||||||
|
#define SPI SPI_Master
|
||||||
#endif
|
#endif
|
||||||
#if defined(__PIC32MX__) || defined(__PIC32MZ__)
|
#if defined(__PIC32MX__) || defined(__PIC32MZ__)
|
||||||
#include <../../../../hardware/pic32/libraries/SPI/SPI.h> // Hack to use the SPI library
|
#include <../../../../hardware/pic32/libraries/SPI/SPI.h> // Hack to use the SPI library
|
||||||
|
|
Loading…
Reference in a new issue