diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2017-02-07 13:12:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-07 13:12:29 -0500 |
| commit | 0c2b6951a6ad80649798c0eca36a9999ebae0b13 (patch) | |
| tree | fb8c24479e7978848a1c2a7ff39f117cb3383464 /quantum/quantum.c | |
| parent | de659486f52db6492be6ca03ce5450690f5d891d (diff) | |
| parent | e7c4f621f14b60bde68c01ae076cac49cac9927e (diff) | |
| download | qmk_firmware-0c2b6951a6ad80649798c0eca36a9999ebae0b13.tar.gz qmk_firmware-0c2b6951a6ad80649798c0eca36a9999ebae0b13.zip | |
Merge pull request #1057 from priyadi/selectable_output
Implement runtime selectable output (USB or BT)
Diffstat (limited to 'quantum/quantum.c')
| -rw-r--r-- | quantum/quantum.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index b83ae433e..d3905decf 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -1,4 +1,7 @@ | |||
| 1 | #include "quantum.h" | 1 | #include "quantum.h" |
| 2 | #ifdef PROTOCOL_LUFA | ||
| 3 | #include "outputselect.h" | ||
| 4 | #endif | ||
| 2 | 5 | ||
| 3 | #ifndef TAPPING_TERM | 6 | #ifndef TAPPING_TERM |
| 4 | #define TAPPING_TERM 200 | 7 | #define TAPPING_TERM 200 |
| @@ -243,6 +246,36 @@ bool process_record_quantum(keyrecord_t *record) { | |||
| 243 | return false; | 246 | return false; |
| 244 | break; | 247 | break; |
| 245 | #endif | 248 | #endif |
| 249 | #ifdef PROTOCOL_LUFA | ||
| 250 | case OUT_AUTO: | ||
| 251 | if (record->event.pressed) { | ||
| 252 | set_output(OUTPUT_AUTO); | ||
| 253 | } | ||
| 254 | return false; | ||
| 255 | break; | ||
| 256 | case OUT_USB: | ||
| 257 | if (record->event.pressed) { | ||
| 258 | set_output(OUTPUT_USB); | ||
| 259 | } | ||
| 260 | return false; | ||
| 261 | break; | ||
| 262 | #ifdef BLUETOOTH_ENABLE | ||
| 263 | case OUT_BT: | ||
| 264 | if (record->event.pressed) { | ||
| 265 | set_output(OUTPUT_BLUETOOTH); | ||
| 266 | } | ||
| 267 | return false; | ||
| 268 | break; | ||
| 269 | #endif | ||
| 270 | #ifdef ADAFRUIT_BLE_ENABLE | ||
| 271 | case OUT_BLE: | ||
| 272 | if (record->event.pressed) { | ||
| 273 | set_output(OUTPUT_ADAFRUIT_BLE); | ||
| 274 | } | ||
| 275 | return false; | ||
| 276 | break; | ||
| 277 | #endif | ||
| 278 | #endif | ||
| 246 | case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO: | 279 | case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO: |
| 247 | if (record->event.pressed) { | 280 | if (record->event.pressed) { |
| 248 | // MAGIC actions (BOOTMAGIC without the boot) | 281 | // MAGIC actions (BOOTMAGIC without the boot) |
