summaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-02-07 19:12:29 +0100
committerGitHub <noreply@github.com>2017-02-07 19:12:29 +0100
commit0c2b6951a6ad80649798c0eca36a9999ebae0b13 (patch)
treefb8c24479e7978848a1c2a7ff39f117cb3383464 /quantum
parentde659486f52db6492be6ca03ce5450690f5d891d (diff)
parente7c4f621f14b60bde68c01ae076cac49cac9927e (diff)
downloadqmk_firmware-0c2b6951a6ad80649798c0eca36a9999ebae0b13.tar.gz
qmk_firmware-0c2b6951a6ad80649798c0eca36a9999ebae0b13.tar.xz
Merge pull request #1057 from priyadi/selectable_output
Implement runtime selectable output (USB or BT)
Diffstat (limited to 'quantum')
-rw-r--r--quantum/quantum.c33
-rw-r--r--quantum/quantum.h1
-rw-r--r--quantum/quantum_keycodes.h10
3 files changed, 43 insertions, 1 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 @@
#include "quantum.h"
+#ifdef PROTOCOL_LUFA
+#include "outputselect.h"
+#endif
#ifndef TAPPING_TERM
#define TAPPING_TERM 200
@@ -243,6 +246,36 @@ bool process_record_quantum(keyrecord_t *record) {
return false;
break;
#endif
+ #ifdef PROTOCOL_LUFA
+ case OUT_AUTO:
+ if (record->event.pressed) {
+ set_output(OUTPUT_AUTO);
+ }
+ return false;
+ break;
+ case OUT_USB:
+ if (record->event.pressed) {
+ set_output(OUTPUT_USB);
+ }
+ return false;
+ break;
+ #ifdef BLUETOOTH_ENABLE
+ case OUT_BT:
+ if (record->event.pressed) {
+ set_output(OUTPUT_BLUETOOTH);
+ }
+ return false;
+ break;
+ #endif
+ #ifdef ADAFRUIT_BLE_ENABLE
+ case OUT_BLE:
+ if (record->event.pressed) {
+ set_output(OUTPUT_ADAFRUIT_BLE);
+ }
+ return false;
+ break;
+ #endif
+ #endif
case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO:
if (record->event.pressed) {
// MAGIC actions (BOOTMAGIC without the boot)
diff --git a/quantum/quantum.h b/quantum/quantum.h
index 8614c053a..18f072189 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -15,7 +15,6 @@
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
-
#include "action_layer.h"
#include "eeconfig.h"
#include <stddef.h>
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index 91324be35..a786bd322 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -141,6 +141,16 @@ enum quantum_keycodes {
PRINT_ON,
PRINT_OFF,
+ // output selection
+ OUT_AUTO,
+ OUT_USB,
+#ifdef BLUETOOTH_ENABLE
+ OUT_BT,
+#endif
+#ifdef ADAFRUIT_BLE_ENABLE
+ OUT_BLE,
+#endif
+
// always leave at the end
SAFE_RANGE
};