Skip to content

Commit a21d1e7

Browse files
committed
Cleanup
No new code
1 parent 2b69cfe commit a21d1e7

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

PS4BT.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ class PS4BT : public BTHID, public PS4Parser {
8686
};
8787
/**@}*/
8888

89-
private:
9089
/** @name PS4Parser implementation */
9190
virtual void sendOutputReport(PS4Output *output) { // Source: https://github.com/chrippa/ds4drv
9291
uint8_t buf[79];
@@ -115,10 +114,7 @@ class PS4BT : public BTHID, public PS4Parser {
115114
};
116115
/**@}*/
117116

118-
void HID_Command(uint8_t *data, uint8_t nbytes) {
119-
pBtd->L2CAP_Command(hci_handle, data, nbytes, control_scid[0], control_scid[1]);
120-
};
121-
117+
private:
122118
void enable_sixaxis() { // Command used to make the PS4 controller send out the entire output report
123119
uint8_t buf[2];
124120
buf[0] = 0x43; // HID BT Get_report (0x40) | Report Type (Feature 0x03)
@@ -127,6 +123,10 @@ class PS4BT : public BTHID, public PS4Parser {
127123
HID_Command(buf, 2);
128124
};
129125

126+
void HID_Command(uint8_t *data, uint8_t nbytes) {
127+
pBtd->L2CAP_Command(hci_handle, data, nbytes, control_scid[0], control_scid[1]);
128+
};
129+
130130
void (*pFuncOnInit)(void); // Pointer to function called in onInit()
131131
};
132132
#endif

PS4Parser.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class PS4Parser {
215215
* @return Return the angle in the range of 0-360.
216216
*/
217217
double getAngle(AngleEnum a) {
218-
if(a == Pitch)
218+
if (a == Pitch)
219219
return (atan2(ps4Data.accY, ps4Data.accZ) + PI) * RAD_TO_DEG;
220220
else
221221
return (atan2(ps4Data.accX, ps4Data.accZ) + PI) * RAD_TO_DEG;
@@ -349,7 +349,11 @@ class PS4Parser {
349349
ps4Output.reportChanged = false;
350350
};
351351

352-
virtual void sendOutputReport(PS4Output *output) = 0; // This is overridden in PS4BT and PS4USB
352+
/**
353+
* Send the output to the PS4 controller. This is implemented in PS4BT.h and PS4USB.h.
354+
* @param output Pointer to PS4Output buffer;
355+
*/
356+
virtual void sendOutputReport(PS4Output *output) = 0;
353357

354358
private:
355359
bool checkDpad(ButtonEnum b); // Used to check PS4 DPAD buttons

PS4USB.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ class PS4USB : public HIDUniversal, public PS4Parser {
8686
};
8787
/**@}*/
8888

89-
private:
9089
/** @name PS4Parser implementation */
9190
virtual void sendOutputReport(PS4Output *output) { // Source: https://github.com/chrippa/ds4drv
9291
uint8_t buf[32];
@@ -113,6 +112,7 @@ class PS4USB : public HIDUniversal, public PS4Parser {
113112
};
114113
/**@}*/
115114

115+
private:
116116
void (*pFuncOnInit)(void); // Pointer to function called in onInit()
117117
};
118118
#endif

0 commit comments

Comments
 (0)