summaryrefslogtreecommitdiffstats
path: root/common/action_util.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2014-11-24 13:50:33 +0900
committertmk <nobody@nowhere>2014-11-24 13:50:33 +0900
commit363950982a291c3bfa03ac6362061b1d37dc06b0 (patch)
treec46fc53fe00137ced3c8edd3d0766ee844f77516 /common/action_util.c
parenteb90ed6238426db9367e294abfaefb5de07564f5 (diff)
parent60096e11c77980ca6b54674c5b68248e8aa15d8d (diff)
Merge branch 'rn42' into merge_rn42
Conflicts: .gitignore common.mk common/debug_config.h common/print.h
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 5f44b3812c..dbee630d18 100644
--- a/common/action_util.c
+++ b/common/action_util.c
@@ -31,8 +31,8 @@ static uint8_t real_mods = 0;
static uint8_t weak_mods = 0;
#ifdef USB_6KRO_ENABLE
-#define RO_ADD(a, b) ((a + b) % REPORT_KEYS)
-#define RO_SUB(a, b) ((a - b + REPORT_KEYS) % REPORT_KEYS)
+#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;
@@ -98,7 +98,7 @@ void del_key(uint8_t key)
void clear_keys(void)
{
// not clear mods
- for (int8_t i = 1; i < REPORT_SIZE; i++) {
+ for (int8_t i = 1; i < KEYBOARD_REPORT_SIZE; i++) {
keyboard_report->raw[i] = 0;
}
}
@@ -145,7 +145,7 @@ void clear_oneshot_mods(void)
uint8_t has_anykey(void)
{
uint8_t cnt = 0;
- for (uint8_t i = 1; i < REPORT_SIZE; i++) {
+ for (uint8_t i = 1; i < KEYBOARD_REPORT_SIZE; i++) {
if (keyboard_report->raw[i])
cnt++;
}
@@ -162,7 +162,7 @@ uint8_t get_first_key(void)
#ifdef NKRO_ENABLE
if (keyboard_nkro) {
uint8_t i = 0;
- for (; i < REPORT_BITS && !keyboard_report->nkro.bits[i]; i++)
+ for (; i < KEYBOARD_REPORT_BITS && !keyboard_report->nkro.bits[i]; i++)
;
return i<<3 | biton(keyboard_report->nkro.bits[i]);
}
@@ -234,7 +234,7 @@ static inline void add_key_byte(uint8_t code)
#else
int8_t i = 0;
int8_t empty = -1;
- for (; i < REPORT_KEYS; i++) {
+ for (; i < KEYBOARD_REPORT_KEYS; i++) {
if (keyboard_report->keys[i] == code) {
break;
}
@@ -242,7 +242,7 @@ static inline void add_key_byte(uint8_t code)
empty = i;
}
}
- if (i == REPORT_KEYS) {
+ if (i == KEYBOARD_REPORT_KEYS) {
if (empty != -1) {
keyboard_report->keys[empty] = code;
}
@@ -278,7 +278,7 @@ static inline void del_key_byte(uint8_t code)
} while (i != cb_tail);
}
#else
- for (uint8_t i = 0; i < REPORT_KEYS; i++) {
+ for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
if (keyboard_report->keys[i] == code) {
keyboard_report->keys[i] = 0;
}
@@ -289,7 +289,7 @@ static inline void del_key_byte(uint8_t code)
#ifdef NKRO_ENABLE
static inline void add_key_bit(uint8_t code)
{
- if ((code>>3) < REPORT_BITS) {
+ if ((code>>3) < KEYBOARD_REPORT_BITS) {
keyboard_report->nkro.bits[code>>3] |= 1<<(code&7);
} else {
dprintf("add_key_bit: can't add: %02X\n", code);
@@ -298,7 +298,7 @@ static inline void add_key_bit(uint8_t code)
static inline void del_key_bit(uint8_t code)
{
- if ((code>>3) < REPORT_BITS) {
+ if ((code>>3) < KEYBOARD_REPORT_BITS) {
keyboard_report->nkro.bits[code>>3] &= ~(1<<(code&7));
} else {
dprintf("del_key_bit: can't del: %02X\n", code);