mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Cleanup
No new code
This commit is contained in:
parent
2b69cfe15e
commit
a21d1e7258
3 changed files with 12 additions and 8 deletions
10
PS4BT.h
10
PS4BT.h
|
@ -86,7 +86,6 @@ protected:
|
||||||
};
|
};
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
private:
|
|
||||||
/** @name PS4Parser implementation */
|
/** @name PS4Parser implementation */
|
||||||
virtual void sendOutputReport(PS4Output *output) { // Source: https://github.com/chrippa/ds4drv
|
virtual void sendOutputReport(PS4Output *output) { // Source: https://github.com/chrippa/ds4drv
|
||||||
uint8_t buf[79];
|
uint8_t buf[79];
|
||||||
|
@ -115,10 +114,7 @@ private:
|
||||||
};
|
};
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
void HID_Command(uint8_t *data, uint8_t nbytes) {
|
private:
|
||||||
pBtd->L2CAP_Command(hci_handle, data, nbytes, control_scid[0], control_scid[1]);
|
|
||||||
};
|
|
||||||
|
|
||||||
void enable_sixaxis() { // Command used to make the PS4 controller send out the entire output report
|
void enable_sixaxis() { // Command used to make the PS4 controller send out the entire output report
|
||||||
uint8_t buf[2];
|
uint8_t buf[2];
|
||||||
buf[0] = 0x43; // HID BT Get_report (0x40) | Report Type (Feature 0x03)
|
buf[0] = 0x43; // HID BT Get_report (0x40) | Report Type (Feature 0x03)
|
||||||
|
@ -127,6 +123,10 @@ private:
|
||||||
HID_Command(buf, 2);
|
HID_Command(buf, 2);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void HID_Command(uint8_t *data, uint8_t nbytes) {
|
||||||
|
pBtd->L2CAP_Command(hci_handle, data, nbytes, control_scid[0], control_scid[1]);
|
||||||
|
};
|
||||||
|
|
||||||
void (*pFuncOnInit)(void); // Pointer to function called in onInit()
|
void (*pFuncOnInit)(void); // Pointer to function called in onInit()
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
|
@ -215,7 +215,7 @@ public:
|
||||||
* @return Return the angle in the range of 0-360.
|
* @return Return the angle in the range of 0-360.
|
||||||
*/
|
*/
|
||||||
double getAngle(AngleEnum a) {
|
double getAngle(AngleEnum a) {
|
||||||
if(a == Pitch)
|
if (a == Pitch)
|
||||||
return (atan2(ps4Data.accY, ps4Data.accZ) + PI) * RAD_TO_DEG;
|
return (atan2(ps4Data.accY, ps4Data.accZ) + PI) * RAD_TO_DEG;
|
||||||
else
|
else
|
||||||
return (atan2(ps4Data.accX, ps4Data.accZ) + PI) * RAD_TO_DEG;
|
return (atan2(ps4Data.accX, ps4Data.accZ) + PI) * RAD_TO_DEG;
|
||||||
|
@ -349,7 +349,11 @@ protected:
|
||||||
ps4Output.reportChanged = false;
|
ps4Output.reportChanged = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void sendOutputReport(PS4Output *output) = 0; // This is overridden in PS4BT and PS4USB
|
/**
|
||||||
|
* Send the output to the PS4 controller. This is implemented in PS4BT.h and PS4USB.h.
|
||||||
|
* @param output Pointer to PS4Output buffer;
|
||||||
|
*/
|
||||||
|
virtual void sendOutputReport(PS4Output *output) = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool checkDpad(ButtonEnum b); // Used to check PS4 DPAD buttons
|
bool checkDpad(ButtonEnum b); // Used to check PS4 DPAD buttons
|
||||||
|
|
2
PS4USB.h
2
PS4USB.h
|
@ -86,7 +86,6 @@ protected:
|
||||||
};
|
};
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
private:
|
|
||||||
/** @name PS4Parser implementation */
|
/** @name PS4Parser implementation */
|
||||||
virtual void sendOutputReport(PS4Output *output) { // Source: https://github.com/chrippa/ds4drv
|
virtual void sendOutputReport(PS4Output *output) { // Source: https://github.com/chrippa/ds4drv
|
||||||
uint8_t buf[32];
|
uint8_t buf[32];
|
||||||
|
@ -113,6 +112,7 @@ private:
|
||||||
};
|
};
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
|
private:
|
||||||
void (*pFuncOnInit)(void); // Pointer to function called in onInit()
|
void (*pFuncOnInit)(void); // Pointer to function called in onInit()
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
Loading…
Reference in a new issue