diff options
| author | zvecr <git@zvecr.com> | 2022-02-25 23:45:40 +0000 |
|---|---|---|
| committer | zvecr <git@zvecr.com> | 2022-02-25 23:45:40 +0000 |
| commit | e7931289918221081cbe2a7ea5df27a5d86324db (patch) | |
| tree | 0b06145520f8aaf5ff5cb928aa5176fc2dd23619 /drivers/bluetooth/outputselect.c | |
| parent | c0ee3d2c79388187883b1b1b1d1a0b6842acf741 (diff) | |
| parent | cf31355f08dca311a013168eb3eb995e2fc6a3d1 (diff) | |
Merge remote-tracking branch 'origin/develop'
Diffstat (limited to 'drivers/bluetooth/outputselect.c')
| -rw-r--r-- | drivers/bluetooth/outputselect.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/bluetooth/outputselect.c b/drivers/bluetooth/outputselect.c index f758c65280..b986ba274e 100644 --- a/drivers/bluetooth/outputselect.c +++ b/drivers/bluetooth/outputselect.c @@ -13,13 +13,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "outputselect.h" +#include "usb_util.h" -#if defined(PROTOCOL_LUFA) -# include "lufa.h" -#endif - -#ifdef MODULE_ADAFRUIT_BLE -# include "adafruit_ble.h" +#ifdef BLUETOOTH_BLUEFRUIT_LE +# include "bluefruit_le.h" #endif uint8_t desired_output = OUTPUT_DEFAULT; @@ -39,29 +36,23 @@ 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; } -#ifdef MODULE_ADAFRUIT_BLE - if (adafruit_ble_is_connected()) { +#ifdef BLUETOOTH_BLUEFRUIT_LE + if (bluefruit_le_is_connected()) { return OUTPUT_BLUETOOTH; } #endif #ifdef BLUETOOTH_ENABLE - return OUTPUT_BLUETOOTH; // should check if BT is connected here + return OUTPUT_BLUETOOTH; // should check if BT is connected here #endif return OUTPUT_NONE; |
