aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Brassel <[email protected]>2024-09-24 21:53:55 +1000
committerGitHub <[email protected]>2024-09-24 12:53:55 +0100
commit9a8f5a80e47815aefef1420f37078b7ff204e1c0 (patch)
tree6e72f1df52e3916719471d3b8a887d23e20d8e84
parenta7486a8d87e6b982033d9328f6474fb7d7d5371a (diff)
downloadqmk_firmware-9a8f5a80e47815aefef1420f37078b7ff204e1c0.tar.gz
qmk_firmware-9a8f5a80e47815aefef1420f37078b7ff204e1c0.zip
Remove `RING_BUFFERED_6KRO_REPORT_ENABLE` due to disuse. (#24433)
-rw-r--r--builddefs/show_options.mk1
-rw-r--r--docs/config_options.md2
-rw-r--r--tests/test_common/keyboard_report_util.cpp2
-rw-r--r--tmk_core/protocol.mk4
-rw-r--r--tmk_core/protocol/report.c93
5 files changed, 0 insertions, 102 deletions
diff --git a/builddefs/show_options.mk b/builddefs/show_options.mk
index 81d8400a80..1c1a3ebf8e 100644
--- a/builddefs/show_options.mk
+++ b/builddefs/show_options.mk
@@ -67,7 +67,6 @@ OTHER_OPTION_NAMES = \
PS2_DRIVER \
RAW_ENABLE \
SWAP_HANDS_ENABLE \
- RING_BUFFERED_6KRO_REPORT_ENABLE \
WATCHDOG_ENABLE \
ERGOINU \
NO_USB_STARTUP_CHECK \
diff --git a/docs/config_options.md b/docs/config_options.md
index fec6b22b13..90a708dd99 100644
--- a/docs/config_options.md
+++ b/docs/config_options.md
@@ -426,8 +426,6 @@ 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
-* `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.
* `KEY_OVERRIDE_ENABLE`
diff --git a/tests/test_common/keyboard_report_util.cpp b/tests/test_common/keyboard_report_util.cpp
index 5676483539..18e0574277 100644
--- a/tests/test_common/keyboard_report_util.cpp
+++ b/tests/test_common/keyboard_report_util.cpp
@@ -29,8 +29,6 @@ std::vector<uint8_t> get_keys(const report_keyboard_t& report) {
std::vector<uint8_t> result;
#if defined(NKRO_ENABLE)
# error NKRO support not implemented yet
-#elif defined(RING_BUFFERED_6KRO_REPORT_ENABLE)
-# error 6KRO support not implemented yet
#else
for (size_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
if (report.keys[i]) {
diff --git a/tmk_core/protocol.mk b/tmk_core/protocol.mk
index 796b4e8787..8f01976548 100644
--- a/tmk_core/protocol.mk
+++ b/tmk_core/protocol.mk
@@ -54,10 +54,6 @@ ifeq ($(strip $(NKRO_ENABLE)), yes)
endif
endif
-ifeq ($(strip $(RING_BUFFERED_6KRO_REPORT_ENABLE)), yes)
- OPT_DEFS += -DRING_BUFFERED_6KRO_REPORT_ENABLE
-endif
-
ifeq ($(strip $(NO_SUSPEND_POWER_DOWN)), yes)
OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
endif
diff --git a/tmk_core/protocol/report.c b/tmk_core/protocol/report.c
index 0166bf654f..056921d6a0 100644
--- a/tmk_core/protocol/report.c
+++ b/tmk_core/protocol/report.c
@@ -22,16 +22,6 @@
#include "util.h"
#include <string.h>
-#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)
-# 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
@@ -65,18 +55,7 @@ uint8_t get_first_key(void) {
return i << 3 | biton(nkro_report->bits[i]);
}
#endif
-#ifdef RING_BUFFERED_6KRO_REPORT_ENABLE
- uint8_t i = cb_head;
- do {
- if (keyboard_report->keys[i] != 0) {
- break;
- }
- i = RO_INC(i);
- } while (i != cb_tail);
- return keyboard_report->keys[i];
-#else
return keyboard_report->keys[0];
-#endif
}
/** \brief Checks if a key is pressed in the report
@@ -110,50 +89,6 @@ bool is_key_pressed(uint8_t key) {
* FIXME: Needs doc
*/
void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code) {
-#ifdef RING_BUFFERED_6KRO_REPORT_ENABLE
- int8_t i = cb_head;
- int8_t empty = -1;
- if (cb_count) {
- do {
- if (keyboard_report->keys[i] == code) {
- return;
- }
- if (empty == -1 && keyboard_report->keys[i] == 0) {
- empty = i;
- }
- i = RO_INC(i);
- } while (i != cb_tail);
- if (i == cb_tail) {
- if (cb_tail == cb_head) {
- // buffer is full
- if (empty == -1) {
- // pop head when has no empty space
- cb_head = RO_INC(cb_head);
- cb_count--;
- } else {
- // left shift when has empty space
- uint8_t offset = 1;
- i = RO_INC(empty);
- do {
- if (keyboard_report->keys[i] != 0) {
- keyboard_report->keys[empty] = keyboard_report->keys[i];
- keyboard_report->keys[i] = 0;
- empty = RO_INC(empty);
- } else {
- offset++;
- }
- i = RO_INC(i);
- } while (i != cb_tail);
- cb_tail = RO_SUB(cb_tail, offset);
- }
- }
- }
- }
- // add to tail
- keyboard_report->keys[cb_tail] = code;
- cb_tail = RO_INC(cb_tail);
- cb_count++;
-#else
int8_t i = 0;
int8_t empty = -1;
for (; i < KEYBOARD_REPORT_KEYS; i++) {
@@ -169,7 +104,6 @@ void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code) {
keyboard_report->keys[empty] = code;
}
}
-#endif
}
/** \brief del key byte
@@ -177,38 +111,11 @@ 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 RING_BUFFERED_6KRO_REPORT_ENABLE
- uint8_t i = cb_head;
- if (cb_count) {
- do {
- if (keyboard_report->keys[i] == code) {
- keyboard_report->keys[i] = 0;
- cb_count--;
- if (cb_count == 0) {
- // reset head and tail
- cb_tail = cb_head = 0;
- }
- if (i == RO_DEC(cb_tail)) {
- // left shift when next to tail
- do {
- cb_tail = RO_DEC(cb_tail);
- if (keyboard_report->keys[RO_DEC(cb_tail)] != 0) {
- break;
- }
- } while (cb_tail != cb_head);
- }
- break;
- }
- i = RO_INC(i);
- } while (i != cb_tail);
- }
-#else
for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
if (keyboard_report->keys[i] == code) {
keyboard_report->keys[i] = 0;
}
}
-#endif
}
#ifdef NKRO_ENABLE