aboutsummaryrefslogtreecommitdiff
path: root/tmk_core
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 /tmk_core
parenta7486a8d87e6b982033d9328f6474fb7d7d5371a (diff)
downloadqmk_firmware-9a8f5a80e47815aefef1420f37078b7ff204e1c0.tar.gz
qmk_firmware-9a8f5a80e47815aefef1420f37078b7ff204e1c0.zip
Remove `RING_BUFFERED_6KRO_REPORT_ENABLE` due to disuse. (#24433)
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/protocol.mk4
-rw-r--r--tmk_core/protocol/report.c93
2 files changed, 0 insertions, 97 deletions
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