Skip to content

Commit

Permalink
Update outputselect to use platform connected state API (#16185)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored Feb 4, 2022
1 parent e212c7c commit 8927d56
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions drivers/bluetooth/outputselect.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "outputselect.h"

#if defined(PROTOCOL_LUFA)
# include "lufa.h"
#endif
#include "usb_util.h"

#ifdef BLUETOOTH_BLUEFRUIT_LE
# include "bluefruit_le.h"
Expand All @@ -39,18 +36,12 @@ void set_output(uint8_t output) {
*/
__attribute__((weak)) void set_output_user(uint8_t output) {}

static bool is_usb_configured(void) {
#if defined(PROTOCOL_LUFA)
return USB_DeviceState == DEVICE_STATE_Configured;
#endif
}

/** \brief Auto Detect Output
*
* FIXME: Needs doc
*/
uint8_t auto_detect_output(void) {
if (is_usb_configured()) {
if (usb_connected_state()) {
return OUTPUT_USB;
}

Expand Down

0 comments on commit 8927d56

Please sign in to comment.