diff options
Diffstat (limited to 'tmk_core/protocol/lufa/outputselect.c')
| -rw-r--r-- | tmk_core/protocol/lufa/outputselect.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tmk_core/protocol/lufa/outputselect.c b/tmk_core/protocol/lufa/outputselect.c index b115ea969..f758c6528 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 | |||
| 12 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 12 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include "lufa.h" | ||
| 16 | #include "outputselect.h" | 15 | #include "outputselect.h" |
| 16 | |||
| 17 | #if defined(PROTOCOL_LUFA) | ||
| 18 | # include "lufa.h" | ||
| 19 | #endif | ||
| 20 | |||
| 17 | #ifdef MODULE_ADAFRUIT_BLE | 21 | #ifdef MODULE_ADAFRUIT_BLE |
| 18 | # include "adafruit_ble.h" | 22 | # include "adafruit_ble.h" |
| 19 | #endif | 23 | #endif |
| @@ -35,12 +39,18 @@ void set_output(uint8_t output) { | |||
| 35 | */ | 39 | */ |
| 36 | __attribute__((weak)) void set_output_user(uint8_t output) {} | 40 | __attribute__((weak)) void set_output_user(uint8_t output) {} |
| 37 | 41 | ||
| 42 | static bool is_usb_configured(void) { | ||
| 43 | #if defined(PROTOCOL_LUFA) | ||
| 44 | return USB_DeviceState == DEVICE_STATE_Configured; | ||
| 45 | #endif | ||
| 46 | } | ||
| 47 | |||
| 38 | /** \brief Auto Detect Output | 48 | /** \brief Auto Detect Output |
| 39 | * | 49 | * |
| 40 | * FIXME: Needs doc | 50 | * FIXME: Needs doc |
| 41 | */ | 51 | */ |
| 42 | uint8_t auto_detect_output(void) { | 52 | uint8_t auto_detect_output(void) { |
| 43 | if (USB_DeviceState == DEVICE_STATE_Configured) { | 53 | if (is_usb_configured()) { |
| 44 | return OUTPUT_USB; | 54 | return OUTPUT_USB; |
| 45 | } | 55 | } |
| 46 | 56 | ||
