aboutsummaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/protocol.mk8
-rw-r--r--tmk_core/protocol/host.c18
-rw-r--r--tmk_core/protocol/host.h1
3 files changed, 21 insertions, 6 deletions
diff --git a/tmk_core/protocol.mk b/tmk_core/protocol.mk
index 8f01976548..2930efc283 100644
--- a/tmk_core/protocol.mk
+++ b/tmk_core/protocol.mk
@@ -46,12 +46,8 @@ else
endif
ifeq ($(strip $(NKRO_ENABLE)), yes)
- ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
- $(info NKRO is not currently supported with Bluetooth, and has been disabled.)
- else
- OPT_DEFS += -DNKRO_ENABLE
- SHARED_EP_ENABLE = yes
- endif
+ OPT_DEFS += -DNKRO_ENABLE
+ SHARED_EP_ENABLE = yes
endif
ifeq ($(strip $(NO_SUSPEND_POWER_DOWN)), yes)
diff --git a/tmk_core/protocol/host.c b/tmk_core/protocol/host.c
index 4f3867df08..e785cb24cc 100644
--- a/tmk_core/protocol/host.c
+++ b/tmk_core/protocol/host.c
@@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "host.h"
#include "util.h"
#include "debug.h"
+#include "usb_device_state.h"
#ifdef DIGITIZER_ENABLE
# include "digitizer.h"
@@ -90,6 +91,23 @@ static host_driver_t *host_get_active_driver(void) {
return driver;
}
+bool host_can_send_nkro(void) {
+#ifdef CONNECTION_ENABLE
+ switch (connection_get_host()) {
+# ifdef BLUETOOTH_ENABLE
+ case CONNECTION_HOST_BLUETOOTH:
+ return bluetooth_can_send_nkro();
+# endif
+ case CONNECTION_HOST_NONE:
+ return false;
+ default:
+ break;
+ }
+#endif
+
+ return usb_device_state_get_protocol() == USB_PROTOCOL_REPORT;
+}
+
#ifdef SPLIT_KEYBOARD
uint8_t split_led_state = 0;
void set_split_host_keyboard_leds(uint8_t led_state) {
diff --git a/tmk_core/protocol/host.h b/tmk_core/protocol/host.h
index d824fca077..8e8a18e2ed 100644
--- a/tmk_core/protocol/host.h
+++ b/tmk_core/protocol/host.h
@@ -32,6 +32,7 @@ void host_set_driver(host_driver_t *driver);
host_driver_t *host_get_driver(void);
/* host driver interface */
+bool host_can_send_nkro(void);
uint8_t host_keyboard_leds(void);
led_t host_keyboard_led_state(void);
void host_keyboard_send(report_keyboard_t *report);