9a8f5a80e47815aefef1420f37078b7ff204e1c0

Author
Nick Brassel <nick@tzarc.org>
Committer
GitHub <noreply@github.com>
Date

Message

Remove `RING_BUFFERED_6KRO_REPORT_ENABLE` due to disuse. (#24433)

Diff

This diff is truncated to protect this page.

  1diff --git a/builddefs/show_options.mk b/builddefs/show_options.mk
  2index 81d8400a8064cd7e3f918549d3dbf5dddbb5043d..1c1a3ebf8e0a55a4de80e3888a4098af4a5356db 100644
  3--- a/builddefs/show_options.mk
  4+++ b/builddefs/show_options.mk
  5@@ -67,7 +67,6 @@ OTHER_OPTION_NAMES = \
  6   PS2_DRIVER \
  7   RAW_ENABLE \
  8   SWAP_HANDS_ENABLE \
  9-  RING_BUFFERED_6KRO_REPORT_ENABLE \
 10   WATCHDOG_ENABLE \
 11   ERGOINU \
 12   NO_USB_STARTUP_CHECK \
 13diff --git a/docs/config_options.md b/docs/config_options.md
 14index fec6b22b133cd4e8158347ef063df9452f9524dd..90a708dd99c273b79eb44f0db7f7ff968de5305d 100644
 15--- a/docs/config_options.md
 16+++ b/docs/config_options.md
 17@@ -426,8 +426,6 @@ Use these to enable or disable building certain features. The more you have enab
 18   * Key combo feature
 19 * `NKRO_ENABLE`
 20   * USB N-Key Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
 21-* `RING_BUFFERED_6KRO_REPORT_ENABLE`
 22-  * 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.
 23 * `AUDIO_ENABLE`
 24   * Enable the audio subsystem.
 25 * `KEY_OVERRIDE_ENABLE`
 26diff --git a/tests/test_common/keyboard_report_util.cpp b/tests/test_common/keyboard_report_util.cpp
 27index 567648353916fa9dc4ee0d9ff4f88d51079ec18d..18e0574277d43fb0cfcadfec41f6d9afcb1ecc43 100644
 28--- a/tests/test_common/keyboard_report_util.cpp
 29+++ b/tests/test_common/keyboard_report_util.cpp
 30@@ -29,8 +29,6 @@ std::vector<uint8_t> get_keys(const report_keyboard_t& report) {
 31     std::vector<uint8_t> result;
 32 #if defined(NKRO_ENABLE)
 33 #    error NKRO support not implemented yet
 34-#elif defined(RING_BUFFERED_6KRO_REPORT_ENABLE)
 35-#    error 6KRO support not implemented yet
 36 #else
 37     for (size_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
 38         if (report.keys[i]) {
 39diff --git a/tmk_core/protocol.mk b/tmk_core/protocol.mk
 40index 796b4e878713855218eb2ffed0b558a8ba6799fc..8f019765484a20259a652ba6a03be8069c426c35 100644
 41--- a/tmk_core/protocol.mk
 42+++ b/tmk_core/protocol.mk
 43@@ -54,10 +54,6 @@ ifeq ($(strip $(NKRO_ENABLE)), yes)
 44     endif
 45 endif
 46 
 47-ifeq ($(strip $(RING_BUFFERED_6KRO_REPORT_ENABLE)), yes)
 48-    OPT_DEFS += -DRING_BUFFERED_6KRO_REPORT_ENABLE
 49-endif
 50-
 51 ifeq ($(strip $(NO_SUSPEND_POWER_DOWN)), yes)
 52     OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
 53 endif
 54diff --git a/tmk_core/protocol/report.c b/tmk_core/protocol/report.c
 55index 0166bf654f27b0c4904d05a73558f3ef3c6f108a..056921d6a09e10c27909f0ad01022e19be3a4c28 100644
 56--- a/tmk_core/protocol/report.c
 57+++ b/tmk_core/protocol/report.c
 58@@ -22,16 +22,6 @@
 59 #include "util.h"
 60 #include <string.h>
 61 
 62-#ifdef RING_BUFFERED_6KRO_REPORT_ENABLE
 63-#    define RO_ADD(a, b) ((a + b) % KEYBOARD_REPORT_KEYS)
 64-#    define RO_SUB(a, b) ((a - b + KEYBOARD_REPORT_KEYS) % KEYBOARD_REPORT_KEYS)
 65-#    define RO_INC(a) RO_ADD(a, 1)
 66-#    define RO_DEC(a) RO_SUB(a, 1)
 67-static int8_t cb_head  = 0;
 68-static int8_t cb_tail  = 0;
 69-static int8_t cb_count = 0;
 70-#endif
 71-
 72 /** \brief has_anykey
 73  *
 74  * FIXME: Needs doc
 75@@ -65,18 +55,7 @@ uint8_t get_first_key(void) {
 76         return i << 3 | biton(nkro_report->bits[i]);
 77     }
 78 #endif
 79-#ifdef RING_BUFFERED_6KRO_REPORT_ENABLE
 80-    uint8_t i = cb_head;
 81-    do {
 82-        if (keyboard_report->keys[i] != 0) {
 83-            break;
 84-        }
 85-        i = RO_INC(i);
 86-    } while (i != cb_tail);
 87-    return keyboard_report->keys[i];
 88-#else
 89     return keyboard_report->keys[0];
 90-#endif
 91 }
 92 
 93 /** \brief Checks if a key is pressed in the report
 94@@ -110,50 +89,6 @@ bool is_key_pressed(uint8_t key) {
 95  * FIXME: Needs doc
 96  */
 97 void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code) {
 98-#ifdef RING_BUFFERED_6KRO_REPORT_ENABLE
 99-    int8_t i     = cb_head;
100-    int8_t empty = -1;
101-    if (cb_count) {
102-        do {
103-            if (keyboard_report->keys[i] == code) {
104-                return;
105-            }
106-            if (empty == -1 && keyboard_report->keys[i] == 0) {
107-                empty = i;
108-            }
109-            i = RO_INC(i);
110-        } while (i != cb_tail);
111-        if (i == cb_tail) {
112-            if (cb_tail == cb_head) {
113-                // buffer is full
114-                if (empty == -1) {
115-                    // pop head when has no empty space
116-                    cb_head = RO_INC(cb_head);
117-                    cb_count--;
118-                } else {
119-                    // left shift when has empty space
120-                    uint8_t offset = 1;
121-                    i              = RO_INC(empty);
122-                    do {
123-                        if (keyboard_report->keys[i] != 0) {
124-                            keyboard_report->keys[empty] = keyboard_report->keys[i];
125-                            keyboard_report->keys[i]     = 0;
126-                            empty                        = RO_INC(empty);
127-                        } else {
128-                            offset++;
129-                        }
130-                        i = RO_INC(i);
131-                    } while (i != cb_tail);
132-                    cb_tail = RO_SUB(cb_tail, offset);
133-                }
134-            }
135-        }
136-    }
137-    // add to tail
138-    keyboard_report->keys[cb_tail] = code;
139-    cb_tail                        = RO_INC(cb_tail);
140-    cb_count++;
141-#else
142     int8_t i     = 0;
143     int8_t empty = -1;
144     for (; i < KEYBOARD_REPORT_KEYS; i++) {
145@@ -169,7 +104,6 @@ void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code) {
146             keyboard_report->keys[empty] = code;
147         }
148     }
149-#endif
150 }
151 
152 /** \brief del key byte
153@@ -177,38 +111,11 @@ void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code) {
154  * FIXME: Needs doc
155  */
156 void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code) {
157-#ifdef RING_BUFFERED_6KRO_REPORT_ENABLE