1
0
Fork 0

Update outputselect to use platform connected state API (#16185)

This commit is contained in:
Joel Challis 2022-02-04 17:55:58 +00:00 committed by GitHub
parent e212c7c2e5
commit 8927d56606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,10 +13,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "outputselect.h" #include "outputselect.h"
#include "usb_util.h"
#if defined(PROTOCOL_LUFA)
# include "lufa.h"
#endif
#ifdef BLUETOOTH_BLUEFRUIT_LE #ifdef BLUETOOTH_BLUEFRUIT_LE
# include "bluefruit_le.h" # include "bluefruit_le.h"
@ -39,18 +36,12 @@ void set_output(uint8_t output) {
*/ */
__attribute__((weak)) void set_output_user(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 /** \brief Auto Detect Output
* *
* FIXME: Needs doc * FIXME: Needs doc
*/ */
uint8_t auto_detect_output(void) { uint8_t auto_detect_output(void) {
if (is_usb_configured()) { if (usb_connected_state()) {
return OUTPUT_USB; return OUTPUT_USB;
} }