diff options
| author | stein3 <stein3@gmail.com> | 2020-10-06 07:15:41 -0700 |
|---|---|---|
| committer | stein3 <stein3@gmail.com> | 2020-10-06 07:15:41 -0700 |
| commit | 2e402741a89c5eec8cf30c966ce6f36d6ec9249b (patch) | |
| tree | 3592e8c5e6bd19943ae55db7fc02a5f755afbb51 /tmk_core/protocol/lufa/outputselect.c | |
| parent | 3e5e4f74272c610bb9fa737f674f8e65ed6100ca (diff) | |
| parent | 2013f6313430b977e557e482d30daa279a46e75d (diff) | |
| download | qmk_firmware-2e402741a89c5eec8cf30c966ce6f36d6ec9249b.tar.gz qmk_firmware-2e402741a89c5eec8cf30c966ce6f36d6ec9249b.zip | |
Merge branch 'master' into meteor
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 | ||
