summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/lufa/outputselect.c
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2020-08-19 22:46:15 +1000
committerDrashna Jael're <drashna@live.com>2020-09-30 03:29:43 -0700
commit2d4e228d0a12ee6e14683792b4e8886e07f52763 (patch)
tree4e8e22704929fb126ff5bdf69fd07ff6fb4391c4 /tmk_core/protocol/lufa/outputselect.c
parent44e16ef407ba21b4a9453004c2078610e3d2c568 (diff)
More Bluetooth refactoring (#9905)
Diffstat (limited to 'tmk_core/protocol/lufa/outputselect.c')
-rw-r--r--tmk_core/protocol/lufa/outputselect.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/tmk_core/protocol/lufa/outputselect.c b/tmk_core/protocol/lufa/outputselect.c
index b115ea9691..f758c65280 100644
--- a/tmk_core/protocol/lufa/outputselect.c
+++ b/tmk_core/protocol/lufa/outputselect.c
@@ -12,8 +12,12 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "lufa.h"
#include "outputselect.h"
+
+#if defined(PROTOCOL_LUFA)
+# include "lufa.h"
+#endif
+
#ifdef MODULE_ADAFRUIT_BLE
# include "adafruit_ble.h"
#endif
@@ -35,12 +39,18 @@ 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 (USB_DeviceState == DEVICE_STATE_Configured) {
+ if (is_usb_configured()) {
return OUTPUT_USB;
}