mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Removed double instance of the same code
This commit is contained in:
parent
813c5192d4
commit
39c3039415
1 changed files with 9 additions and 18 deletions
27
PS3USB.cpp
27
PS3USB.cpp
|
@ -205,6 +205,15 @@ uint8_t PS3USB::Init(uint8_t parent, uint8_t port, bool lowspeed) {
|
||||||
writeBuf[0] = 0x02; // Set report ID, this is needed for Move commands to work
|
writeBuf[0] = 0x02; // Set report ID, this is needed for Move commands to work
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
Notify(PSTR("\r\nBluetooth Address was set to: "), 0x80);
|
||||||
|
for (int8_t i = 5; i > 0; i--) {
|
||||||
|
PrintHex<uint8_t > (my_bdaddr[i], 0x80);
|
||||||
|
Serial.print(":");
|
||||||
|
}
|
||||||
|
PrintHex<uint8_t > (my_bdaddr[0], 0x80);
|
||||||
|
#endif
|
||||||
|
|
||||||
bPollEnable = true;
|
bPollEnable = true;
|
||||||
Notify(PSTR("\r\n"), 0x80);
|
Notify(PSTR("\r\n"), 0x80);
|
||||||
timer = millis();
|
timer = millis();
|
||||||
|
@ -462,15 +471,6 @@ void PS3USB::setBdaddr(uint8_t* BDADDR) {
|
||||||
|
|
||||||
//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0xF5), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)
|
//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0xF5), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)
|
||||||
pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0xF5, 0x03, 0x00, 8, 8, buf, NULL);
|
pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0xF5, 0x03, 0x00, 8, 8, buf, NULL);
|
||||||
#ifdef DEBUG
|
|
||||||
Notify(PSTR("\r\nBluetooth Address was set to: "), 0x80);
|
|
||||||
for (int8_t i = 5; i > 0; i--) {
|
|
||||||
PrintHex<uint8_t > (my_bdaddr[i], 0x80);
|
|
||||||
Serial.print(":");
|
|
||||||
}
|
|
||||||
PrintHex<uint8_t > (my_bdaddr[0], 0x80);
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PS3USB::enable_sixaxis() { //Command used to enable the Dualshock 3 and Navigation controller to send data via USB
|
void PS3USB::enable_sixaxis() { //Command used to enable the Dualshock 3 and Navigation controller to send data via USB
|
||||||
|
@ -527,13 +527,4 @@ void PS3USB::setMoveBdaddr(uint8_t* BDADDR) {
|
||||||
|
|
||||||
//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x05), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)
|
//bmRequest = Host to device (0x00) | Class (0x20) | Interface (0x01) = 0x21, bRequest = Set Report (0x09), Report ID (0x05), Report Type (Feature 0x03), interface (0x00), datalength, datalength, data)
|
||||||
pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x05, 0x03, 0x00, 11, 11, buf, NULL);
|
pUsb->ctrlReq(bAddress, epInfo[PS3_CONTROL_PIPE].epAddr, bmREQ_HID_OUT, HID_REQUEST_SET_REPORT, 0x05, 0x03, 0x00, 11, 11, buf, NULL);
|
||||||
#ifdef DEBUG
|
|
||||||
Notify(PSTR("\r\nBluetooth Address was set to: "), 0x80);
|
|
||||||
for (int8_t i = 5; i > 0; i--) {
|
|
||||||
PrintHex<uint8_t > (my_bdaddr[i], 0x80);
|
|
||||||
Serial.print(":");
|
|
||||||
}
|
|
||||||
PrintHex<uint8_t > (my_bdaddr[0], 0x80);
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue