aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common/keyboard.h
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/keyboard.h')
-rw-r--r--tmk_core/common/keyboard.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/tmk_core/common/keyboard.h b/tmk_core/common/keyboard.h
index 19f98c74e..98ceca49b 100644
--- a/tmk_core/common/keyboard.h
+++ b/tmk_core/common/keyboard.h
@@ -21,7 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21#include <stdbool.h> 21#include <stdbool.h>
22#include <stdint.h> 22#include <stdint.h>
23 23
24
25#ifdef __cplusplus 24#ifdef __cplusplus
26extern "C" { 25extern "C" {
27#endif 26#endif
@@ -40,7 +39,7 @@ typedef struct {
40} keyevent_t; 39} keyevent_t;
41 40
42/* equivalent test of keypos_t */ 41/* equivalent test of keypos_t */
43#define KEYEQ(keya, keyb) ((keya).row == (keyb).row && (keya).col == (keyb).col) 42#define KEYEQ(keya, keyb) ((keya).row == (keyb).row && (keya).col == (keyb).col)
44 43
45/* Rules for No Event: 44/* Rules for No Event:
46 * 1) (time == 0) to handle (keyevent_t){} as empty event 45 * 1) (time == 0) to handle (keyevent_t){} as empty event
@@ -51,11 +50,8 @@ static inline bool IS_PRESSED(keyevent_t event) { return (!IS_NOEVENT(event) &&
51static inline bool IS_RELEASED(keyevent_t event) { return (!IS_NOEVENT(event) && !event.pressed); } 50static inline bool IS_RELEASED(keyevent_t event) { return (!IS_NOEVENT(event) && !event.pressed); }
52 51
53/* Tick event */ 52/* Tick event */
54#define TICK (keyevent_t){ \ 53#define TICK \
55 .key = (keypos_t){ .row = 255, .col = 255 }, \ 54 (keyevent_t) { .key = (keypos_t){.row = 255, .col = 255}, .pressed = false, .time = (timer_read() | 1) }
56 .pressed = false, \
57 .time = (timer_read() | 1) \
58}
59 55
60/* it runs once at early stage of startup before keyboard_init. */ 56/* it runs once at early stage of startup before keyboard_init. */
61void keyboard_setup(void); 57void keyboard_setup(void);