From 785886eadf6e75cf1d01c9c9c775cfcd977b2bb6 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Sun, 24 Jan 2021 14:36:45 +0100 Subject: [PATCH 1/3] The user function was called twice in the PS4BT and XBOXONESBT drivers --- PS4BT.h | 6 ++---- XBOXONESBT.h | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/PS4BT.h b/PS4BT.h index b7eb4b5a..3a23ee0c 100644 --- a/PS4BT.h +++ b/PS4BT.h @@ -65,10 +65,8 @@ protected: virtual void OnInitBTHID() { PS4Parser::Reset(); enable_sixaxis(); // Make the controller send out the entire output report - if (pFuncOnInit) - pFuncOnInit(); // Call the user function - else - setLed(Blue); + if (!pFuncOnInit) + setLed(Blue); // Only call this is a user function has not been set }; /** Used to reset the different buffers to there default values */ diff --git a/XBOXONESBT.h b/XBOXONESBT.h index 58395790..f3e7e4da 100644 --- a/XBOXONESBT.h +++ b/XBOXONESBT.h @@ -64,8 +64,6 @@ protected: */ virtual void OnInitBTHID() { XBOXONESParser::Reset(); - if (pFuncOnInit) - pFuncOnInit(); // Call the user function }; /** Used to reset the different buffers to there default values */ From a3e52f8ee69357df0c65cd973f4cef7cdb52f170 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Sun, 24 Jan 2021 14:40:25 +0100 Subject: [PATCH 2/3] Fixed typo --- PS5Parser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PS5Parser.h b/PS5Parser.h index 0b311f42..49fadd7b 100644 --- a/PS5Parser.h +++ b/PS5Parser.h @@ -218,7 +218,7 @@ public: * @param finger 0 = first finger, 1 = second finger. If omitted, then 0 will be used. * @return Return the value of the counter, note that it is only a 7-bit value. */ - uint8_t getTouchCounter(uint8_t finger = 00) { + uint8_t getTouchCounter(uint8_t finger = 0) { return ps5Data.xy.finger[finger].counter; }; From e82f26db7a1cfc7568bbf7c9d6b029bc0669ee8d Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Sun, 24 Jan 2021 14:41:21 +0100 Subject: [PATCH 3/3] Fix compiler warning --- PS4USB.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PS4USB.h b/PS4USB.h index 9d9dbb40..83cf122f 100644 --- a/PS4USB.h +++ b/PS4USB.h @@ -65,7 +65,7 @@ protected: * @param len The length of the incoming data. * @param buf Pointer to the data buffer. */ - virtual void ParseHIDData(USBHID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) { + virtual void ParseHIDData(USBHID *hid __attribute__((unused)), bool is_rpt_id __attribute__((unused)), uint8_t len, uint8_t *buf) { if (HIDUniversal::VID == PS4_VID && (HIDUniversal::PID == PS4_PID || HIDUniversal::PID == PS4_PID_SLIM)) PS4Parser::Parse(len, buf); };