summaryrefslogtreecommitdiffstats
path: root/keyboards
diff options
context:
space:
mode:
authorlokher <lokher@gmail.com>2023-03-29 17:18:27 +0800
committerlokher <lokher@gmail.com>2023-03-29 17:18:27 +0800
commitb2f55d3142b5c2fbdff83b0cd7b59f1eae0fe5f4 (patch)
tree5698cb75681034ae1221dd4f75f7540d3fffb32d /keyboards
parent3928ffcaa22105cb23c5292116f8d69a17dfb393 (diff)
fix setting REPORT_BUFFER_QUEUE_SIZE doesn't work correctly when it's greater than 256
Diffstat (limited to 'keyboards')
-rwxr-xr-xkeyboards/keychron/bluetooth/report_buffer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/keyboards/keychron/bluetooth/report_buffer.c b/keyboards/keychron/bluetooth/report_buffer.c
index 51225888c9..5056b33b35 100755
--- a/keyboards/keychron/bluetooth/report_buffer.c
+++ b/keyboards/keychron/bluetooth/report_buffer.c
@@ -29,7 +29,7 @@
* sizeof(report_buffer_t) * 256 = 34* 256 = 8704 bytes
*/
#ifndef REPORT_BUFFER_QUEUE_SIZE
-# define REPORT_BUFFER_QUEUE_SIZE 256
+# define REPORT_BUFFER_QUEUE_SIZE 512
#endif
extern bluetooth_transport_t bluetooth_transport;
@@ -45,8 +45,8 @@ uint8_t report_interval = DEFAULT_REPORT_INVERVAL_MS;
static uint32_t report_timer_buffer = 0;
uint32_t retry_time_buffer = 0;
report_buffer_t report_buffer_queue[REPORT_BUFFER_QUEUE_SIZE];
-uint8_t report_buffer_queue_head;
-uint8_t report_buffer_queue_tail;
+uint16_t report_buffer_queue_head;
+uint16_t report_buffer_queue_tail;
report_buffer_t kb_rpt;
uint8_t retry = 0;
@@ -60,7 +60,7 @@ void report_buffer_init(void) {
}
bool report_buffer_enqueue(report_buffer_t *report) {
- uint8_t next = (report_buffer_queue_head + 1) % REPORT_BUFFER_QUEUE_SIZE;
+ uint16_t next = (report_buffer_queue_head + 1) % REPORT_BUFFER_QUEUE_SIZE;
if (next == report_buffer_queue_tail) {
return false;
}