From 2bb5ef90b54e5137bef70da2970f48babc5b062d Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Wed, 22 Sep 2021 10:20:13 -0700 Subject: [PATCH 1/5] Fix USB_6KRO_ENABLE compilation errors --- quantum/action_util.c | 10 ---------- tmk_core/common/report.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/quantum/action_util.c b/quantum/action_util.c index 2b3c00cba005..9a85bd504069 100644 --- a/quantum/action_util.c +++ b/quantum/action_util.c @@ -32,16 +32,6 @@ static uint8_t weak_override_mods = 0; static uint8_t suppressed_mods = 0; #endif -#ifdef USB_6KRO_ENABLE -# define RO_ADD(a, b) ((a + b) % KEYBOARD_REPORT_KEYS) -# define RO_SUB(a, b) ((a - b + KEYBOARD_REPORT_KEYS) % KEYBOARD_REPORT_KEYS) -# define RO_INC(a) RO_ADD(a, 1) -# define RO_DEC(a) RO_SUB(a, 1) -static int8_t cb_head = 0; -static int8_t cb_tail = 0; -static int8_t cb_count = 0; -#endif - // TODO: pointer variable is not needed // report_keyboard_t keyboard_report = {}; report_keyboard_t *keyboard_report = &(report_keyboard_t){}; diff --git a/tmk_core/common/report.c b/tmk_core/common/report.c index 1bcb6f2adb94..a2af3ac74bf0 100644 --- a/tmk_core/common/report.c +++ b/tmk_core/common/report.c @@ -21,6 +21,16 @@ #include "util.h" #include +#ifdef USB_6KRO_ENABLE +# define RO_ADD(a, b) ((a + b) % KEYBOARD_REPORT_KEYS) +# define RO_SUB(a, b) ((a - b + KEYBOARD_REPORT_KEYS) % KEYBOARD_REPORT_KEYS) +# define RO_INC(a) RO_ADD(a, 1) +# define RO_DEC(a) RO_SUB(a, 1) +static int8_t cb_head = 0; +static int8_t cb_tail = 0; +static int8_t cb_count = 0; +#endif + /** \brief has_anykey * * FIXME: Needs doc From 6793f5570c17a5111fb2ac10a6b09f311146093a Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Wed, 22 Sep 2021 10:23:16 -0700 Subject: [PATCH 2/5] Add info to docs --- docs/config_options.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/config_options.md b/docs/config_options.md index 7584d3584eb9..10ba3508acef 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -418,6 +418,8 @@ Use these to enable or disable building certain features. The more you have enab * Key combo feature * `NKRO_ENABLE` * USB N-Key Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +* `USB_6KRO_ENABLE` + * USB 6-Key Rollover - Instead of stopping any new input once 6 keys are pressed, the oldest key is released and the new key is pressed. * `AUDIO_ENABLE` * Enable the audio subsystem. * `KEY_OVERRIDE_ENABLE` From 438de9113f9ff48834ccf85ed5a6e808e3eb3895 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Wed, 22 Sep 2021 11:02:23 -0700 Subject: [PATCH 3/5] Rename define to be more accurate --- show_options.mk | 2 +- tests/test_common/keyboard_report_util.cpp | 2 +- tmk_core/common.mk | 4 ++-- tmk_core/common/report.c | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/show_options.mk b/show_options.mk index ce2f9c06360a..b17d8c7d9dde 100644 --- a/show_options.mk +++ b/show_options.mk @@ -72,7 +72,7 @@ OTHER_OPTION_NAMES = \ PS2_MOUSE_ENABLE \ RAW_ENABLE \ SWAP_HANDS_ENABLE \ - USB_6KRO_ENABLE \ + RING_BUFFERED_6KRO_REPORT_ENABLE \ WATCHDOG_ENABLE \ XT_ENABLE \ ERGOINU \ diff --git a/tests/test_common/keyboard_report_util.cpp b/tests/test_common/keyboard_report_util.cpp index cb044c92b390..f73cf239e050 100644 --- a/tests/test_common/keyboard_report_util.cpp +++ b/tests/test_common/keyboard_report_util.cpp @@ -24,7 +24,7 @@ std::vector get_keys(const report_keyboard_t& report) { std::vector result; #if defined(NKRO_ENABLE) # error NKRO support not implemented yet -#elif defined(USB_6KRO_ENABLE) +#elif defined(RING_BUFFERED_6KRO_REPORT_ENABLE) # error 6KRO support not implemented yet #else for (size_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 7f7420059072..e44ff2f0ab5e 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -63,8 +63,8 @@ ifeq ($(strip $(NKRO_ENABLE)), yes) endif endif -ifeq ($(strip $(USB_6KRO_ENABLE)), yes) - TMK_COMMON_DEFS += -DUSB_6KRO_ENABLE +ifeq ($(strip $(RING_BUFFERED_6KRO_REPORT_ENABLE)), yes) + TMK_COMMON_DEFS += -DRING_BUFFERED_6KRO_REPORT_ENABLE endif ifeq ($(strip $(SLEEP_LED_ENABLE)), yes) diff --git a/tmk_core/common/report.c b/tmk_core/common/report.c index a2af3ac74bf0..2a7fc006c436 100644 --- a/tmk_core/common/report.c +++ b/tmk_core/common/report.c @@ -21,7 +21,7 @@ #include "util.h" #include -#ifdef USB_6KRO_ENABLE +#ifdef RING_BUFFERED_6KRO_REPORT_ENABLE # define RO_ADD(a, b) ((a + b) % KEYBOARD_REPORT_KEYS) # define RO_SUB(a, b) ((a - b + KEYBOARD_REPORT_KEYS) % KEYBOARD_REPORT_KEYS) # define RO_INC(a) RO_ADD(a, 1) @@ -64,7 +64,7 @@ uint8_t get_first_key(report_keyboard_t* keyboard_report) { return i << 3 | biton(keyboard_report->nkro.bits[i]); } #endif -#ifdef USB_6KRO_ENABLE +#ifdef RING_BUFFERED_6KRO_REPORT_ENABLE uint8_t i = cb_head; do { if (keyboard_report->keys[i] != 0) { @@ -109,7 +109,7 @@ bool is_key_pressed(report_keyboard_t* keyboard_report, uint8_t key) { * FIXME: Needs doc */ void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code) { -#ifdef USB_6KRO_ENABLE +#ifdef RING_BUFFERED_6KRO_REPORT_ENABLE int8_t i = cb_head; int8_t empty = -1; if (cb_count) { @@ -176,7 +176,7 @@ void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code) { * FIXME: Needs doc */ void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code) { -#ifdef USB_6KRO_ENABLE +#ifdef RING_BUFFERED_6KRO_REPORT_ENABLE uint8_t i = cb_head; if (cb_count) { do { From af206ce7eee8c23692c98e565ce9d8a06222b12d Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Wed, 22 Sep 2021 11:02:38 -0700 Subject: [PATCH 4/5] Remove unused rule --- keyboards/hotdox/rules.mk | 1 - keyboards/ktec/ergodone/rules.mk | 1 - keyboards/planck/keymaps/not-quite-neo/rules.mk | 4 +--- keyboards/planck/keymaps/zach/rules.mk | 6 ++---- keyboards/preonic/keymaps/zach/rules.mk | 6 ++---- 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/keyboards/hotdox/rules.mk b/keyboards/hotdox/rules.mk index 3802dbe9957d..6caa17fab639 100644 --- a/keyboards/hotdox/rules.mk +++ b/keyboards/hotdox/rules.mk @@ -16,7 +16,6 @@ CONSOLE_ENABLE = yes # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA -USB_6KRO_ENABLE = no # USB 6key Rollover BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality SWAP_HANDS_ENABLE = no # Disable Onehand RGBLIGHT_ENABLE = no diff --git a/keyboards/ktec/ergodone/rules.mk b/keyboards/ktec/ergodone/rules.mk index 3c1723a3c432..f0478eb3a46c 100644 --- a/keyboards/ktec/ergodone/rules.mk +++ b/keyboards/ktec/ergodone/rules.mk @@ -16,7 +16,6 @@ CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA -USB_6KRO_ENABLE = no # USB 6key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality SWAP_HANDS_ENABLE = no # Disable Onehand RGBLIGHT_ENABLE = no diff --git a/keyboards/planck/keymaps/not-quite-neo/rules.mk b/keyboards/planck/keymaps/not-quite-neo/rules.mk index b30c3a21e09d..b4e2e5c8156d 100644 --- a/keyboards/planck/keymaps/not-quite-neo/rules.mk +++ b/keyboards/planck/keymaps/not-quite-neo/rules.mk @@ -12,7 +12,6 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -USB_6KRO_ENABLE = no # 6key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 @@ -20,7 +19,6 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode (can't be used with unicodemap) UNICODEMAP_ENABLE = no # Enable extended unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - diff --git a/keyboards/planck/keymaps/zach/rules.mk b/keyboards/planck/keymaps/zach/rules.mk index 3247aece2c48..544e10a456f0 100644 --- a/keyboards/planck/keymaps/zach/rules.mk +++ b/keyboards/planck/keymaps/zach/rules.mk @@ -2,7 +2,7 @@ # Max .hex size is about 28636 bytes # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # TAP_DANCE_ENABLE = yes # Enable TapDance functionality @@ -12,7 +12,6 @@ EXTRAKEY_ENABLE = no # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -USB_6KRO_ENABLE = no # 6key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 @@ -20,7 +19,6 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode (can't be used with unicodemap) UNICODEMAP_ENABLE = yes # Enable extended unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - diff --git a/keyboards/preonic/keymaps/zach/rules.mk b/keyboards/preonic/keymaps/zach/rules.mk index 8d2f75eea39e..8cd4f98eeb2c 100644 --- a/keyboards/preonic/keymaps/zach/rules.mk +++ b/keyboards/preonic/keymaps/zach/rules.mk @@ -2,7 +2,7 @@ # Max .hex size is about 28636 bytes # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # TAP_DANCE_ENABLE = yes # Enable TapDance functionality @@ -12,7 +12,6 @@ EXTRAKEY_ENABLE = no # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -USB_6KRO_ENABLE = no # 6key Rollover BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 @@ -20,7 +19,6 @@ AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode UNICODEMAP_ENABLE = yes # Enable extended unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - From 148b9fc2f26adfdfcad323829d28617b9207380c Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Wed, 22 Sep 2021 11:03:48 -0700 Subject: [PATCH 5/5] Refixe docs --- docs/config_options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config_options.md b/docs/config_options.md index 10ba3508acef..dbf3d3da2eb0 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -418,7 +418,7 @@ Use these to enable or disable building certain features. The more you have enab * Key combo feature * `NKRO_ENABLE` * USB N-Key Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -* `USB_6KRO_ENABLE` +* `RING_BUFFERED_6KRO_REPORT_ENABLE` * USB 6-Key Rollover - Instead of stopping any new input once 6 keys are pressed, the oldest key is released and the new key is pressed. * `AUDIO_ENABLE` * Enable the audio subsystem.