aboutsummaryrefslogtreecommitdiff
path: root/common/action_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/action_util.c')
-rw-r--r--common/action_util.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/common/action_util.c b/common/action_util.c
index 5f44b3812..dbee630d1 100644
--- a/common/action_util.c
+++ b/common/action_util.c
@@ -31,8 +31,8 @@ static uint8_t real_mods = 0;
31static uint8_t weak_mods = 0; 31static uint8_t weak_mods = 0;
32 32
33#ifdef USB_6KRO_ENABLE 33#ifdef USB_6KRO_ENABLE
34#define RO_ADD(a, b) ((a + b) % REPORT_KEYS) 34#define RO_ADD(a, b) ((a + b) % KEYBOARD_REPORT_KEYS)
35#define RO_SUB(a, b) ((a - b + REPORT_KEYS) % REPORT_KEYS) 35#define RO_SUB(a, b) ((a - b + KEYBOARD_REPORT_KEYS) % KEYBOARD_REPORT_KEYS)
36#define RO_INC(a) RO_ADD(a, 1) 36#define RO_INC(a) RO_ADD(a, 1)
37#define RO_DEC(a) RO_SUB(a, 1) 37#define RO_DEC(a) RO_SUB(a, 1)
38static int8_t cb_head = 0; 38static int8_t cb_head = 0;
@@ -98,7 +98,7 @@ void del_key(uint8_t key)
98void clear_keys(void) 98void clear_keys(void)
99{ 99{
100 // not clear mods 100 // not clear mods
101 for (int8_t i = 1; i < REPORT_SIZE; i++) { 101 for (int8_t i = 1; i < KEYBOARD_REPORT_SIZE; i++) {
102 keyboard_report->raw[i] = 0; 102 keyboard_report->raw[i] = 0;
103 } 103 }
104} 104}
@@ -145,7 +145,7 @@ void clear_oneshot_mods(void)
145uint8_t has_anykey(void) 145uint8_t has_anykey(void)
146{ 146{
147 uint8_t cnt = 0; 147 uint8_t cnt = 0;
148 for (uint8_t i = 1; i < REPORT_SIZE; i++) { 148 for (uint8_t i = 1; i < KEYBOARD_REPORT_SIZE; i++) {
149 if (keyboard_report->raw[i]) 149 if (keyboard_report->raw[i])
150 cnt++; 150 cnt++;
151 } 151 }
@@ -162,7 +162,7 @@ uint8_t get_first_key(void)
162#ifdef NKRO_ENABLE 162#ifdef NKRO_ENABLE
163 if (keyboard_nkro) { 163 if (keyboard_nkro) {
164 uint8_t i = 0; 164 uint8_t i = 0;
165 for (; i < REPORT_BITS && !keyboard_report->nkro.bits[i]; i++) 165 for (; i < KEYBOARD_REPORT_BITS && !keyboard_report->nkro.bits[i]; i++)
166 ; 166 ;
167 return i<<3 | biton(keyboard_report->nkro.bits[i]); 167 return i<<3 | biton(keyboard_report->nkro.bits[i]);
168 } 168 }
@@ -234,7 +234,7 @@ static inline void add_key_byte(uint8_t code)
234#else 234#else
235 int8_t i = 0; 235 int8_t i = 0;
236 int8_t empty = -1; 236 int8_t empty = -1;
237 for (; i < REPORT_KEYS; i++) { 237 for (; i < KEYBOARD_REPORT_KEYS; i++) {
238 if (keyboard_report->keys[i] == code) { 238 if (keyboard_report->keys[i] == code) {
239 break; 239 break;
240 } 240 }
@@ -242,7 +242,7 @@ static inline void add_key_byte(uint8_t code)
242 empty = i; 242 empty = i;
243 } 243 }
244 } 244 }
245 if (i == REPORT_KEYS) { 245 if (i == KEYBOARD_REPORT_KEYS) {
246 if (empty != -1) { 246 if (empty != -1) {
247 keyboard_report->keys[empty] = code; 247 keyboard_report->keys[empty] = code;
248 } 248 }
@@ -278,7 +278,7 @@ static inline void del_key_byte(uint8_t code)
278 } while (i != cb_tail); 278 } while (i != cb_tail);
279 } 279 }
280#else 280#else
281 for (uint8_t i = 0; i < REPORT_KEYS; i++) { 281 for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
282 if (keyboard_report->keys[i] == code) { 282 if (keyboard_report->keys[i] == code) {
283 keyboard_report->keys[i] = 0; 283 keyboard_report->keys[i] = 0;
284 } 284 }
@@ -289,7 +289,7 @@ static inline void del_key_byte(uint8_t code)
289#ifdef NKRO_ENABLE 289#ifdef NKRO_ENABLE
290static inline void add_key_bit(uint8_t code) 290static inline void add_key_bit(uint8_t code)
291{ 291{
292 if ((code>>3) < REPORT_BITS) { 292 if ((code>>3) < KEYBOARD_REPORT_BITS) {
293 keyboard_report->nkro.bits[code>>3] |= 1<<(code&7); 293 keyboard_report->nkro.bits[code>>3] |= 1<<(code&7);
294 } else { 294 } else {
295 dprintf("add_key_bit: can't add: %02X\n", code); 295 dprintf("add_key_bit: can't add: %02X\n", code);
@@ -298,7 +298,7 @@ static inline void add_key_bit(uint8_t code)
298 298
299static inline void del_key_bit(uint8_t code) 299static inline void del_key_bit(uint8_t code)
300{ 300{
301 if ((code>>3) < REPORT_BITS) { 301 if ((code>>3) < KEYBOARD_REPORT_BITS) {
302 keyboard_report->nkro.bits[code>>3] &= ~(1<<(code&7)); 302 keyboard_report->nkro.bits[code>>3] &= ~(1<<(code&7));
303 } else { 303 } else {
304 dprintf("del_key_bit: can't del: %02X\n", code); 304 dprintf("del_key_bit: can't del: %02X\n", code);