diff options
author | QMK Bot <hello@qmk.fm> | 2020-03-13 18:44:56 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2020-03-13 18:44:56 +0000 |
commit | 5e98eaaaff8fde1ce25b9bad6c00a982718cb467 (patch) | |
tree | 6af5516366a2a35b29ee7710c33eb47c2ead5718 /tmk_core | |
parent | 9e8767917d628afd3dc43759d1d50151c61944a1 (diff) | |
download | qmk_firmware-5e98eaaaff8fde1ce25b9bad6c00a982718cb467.tar.gz qmk_firmware-5e98eaaaff8fde1ce25b9bad6c00a982718cb467.zip |
format code according to conventions [skip ci]
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/common/action.c | 4 | ||||
-rw-r--r-- | tmk_core/common/report.c | 30 | ||||
-rw-r--r-- | tmk_core/common/report.h | 2 |
3 files changed, 18 insertions, 18 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 2deafd465..555a71ebc 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c | |||
@@ -758,8 +758,8 @@ void register_code(uint8_t code) { | |||
758 | // without this, keys with the same keycode, but different | 758 | // without this, keys with the same keycode, but different |
759 | // modifiers will be reported incorrectly, see issue #1708 | 759 | // modifiers will be reported incorrectly, see issue #1708 |
760 | if (is_key_pressed(keyboard_report, code)) { | 760 | if (is_key_pressed(keyboard_report, code)) { |
761 | del_key(code); | 761 | del_key(code); |
762 | send_keyboard_report(); | 762 | send_keyboard_report(); |
763 | } | 763 | } |
764 | add_key(code); | 764 | add_key(code); |
765 | send_keyboard_report(); | 765 | send_keyboard_report(); |
diff --git a/tmk_core/common/report.c b/tmk_core/common/report.c index f4cdca728..1bcb6f2ad 100644 --- a/tmk_core/common/report.c +++ b/tmk_core/common/report.c | |||
@@ -74,24 +74,24 @@ uint8_t get_first_key(report_keyboard_t* keyboard_report) { | |||
74 | * Note: The function doesn't support modifers currently, and it returns false for KC_NO | 74 | * Note: The function doesn't support modifers currently, and it returns false for KC_NO |
75 | */ | 75 | */ |
76 | bool is_key_pressed(report_keyboard_t* keyboard_report, uint8_t key) { | 76 | bool is_key_pressed(report_keyboard_t* keyboard_report, uint8_t key) { |
77 | if (key == KC_NO) { | 77 | if (key == KC_NO) { |
78 | return false; | 78 | return false; |
79 | } | 79 | } |
80 | #ifdef NKRO_ENABLE | 80 | #ifdef NKRO_ENABLE |
81 | if (keyboard_protocol && keymap_config.nkro) { | 81 | if (keyboard_protocol && keymap_config.nkro) { |
82 | if ((key>>3) < KEYBOARD_REPORT_BITS) { | 82 | if ((key >> 3) < KEYBOARD_REPORT_BITS) { |
83 | return keyboard_report->nkro.bits[key>>3] & 1<<(key&7); | 83 | return keyboard_report->nkro.bits[key >> 3] & 1 << (key & 7); |
84 | } else { | 84 | } else { |
85 | return false; | 85 | return false; |
86 | } | ||
86 | } | 87 | } |
87 | } | ||
88 | #endif | 88 | #endif |
89 | for (int i=0; i < KEYBOARD_REPORT_KEYS; i++) { | 89 | for (int i = 0; i < KEYBOARD_REPORT_KEYS; i++) { |
90 | if (keyboard_report->keys[i] == key) { | 90 | if (keyboard_report->keys[i] == key) { |
91 | return true; | 91 | return true; |
92 | } | 92 | } |
93 | } | 93 | } |
94 | return false; | 94 | return false; |
95 | } | 95 | } |
96 | 96 | ||
97 | /** \brief add key byte | 97 | /** \brief add key byte |
diff --git a/tmk_core/common/report.h b/tmk_core/common/report.h index 645e01612..b7d104a45 100644 --- a/tmk_core/common/report.h +++ b/tmk_core/common/report.h | |||
@@ -237,7 +237,7 @@ static inline uint16_t KEYCODE2CONSUMER(uint8_t key) { | |||
237 | 237 | ||
238 | uint8_t has_anykey(report_keyboard_t* keyboard_report); | 238 | uint8_t has_anykey(report_keyboard_t* keyboard_report); |
239 | uint8_t get_first_key(report_keyboard_t* keyboard_report); | 239 | uint8_t get_first_key(report_keyboard_t* keyboard_report); |
240 | bool is_key_pressed(report_keyboard_t* keyboard_report, uint8_t key); | 240 | bool is_key_pressed(report_keyboard_t* keyboard_report, uint8_t key); |
241 | 241 | ||
242 | void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code); | 242 | void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code); |
243 | void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code); | 243 | void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code); |