From 785886eadf6e75cf1d01c9c9c775cfcd977b2bb6 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Sun, 24 Jan 2021 14:36:45 +0100 Subject: [PATCH] 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 */