diff options
Diffstat (limited to 'common/keyboard.h')
| -rw-r--r-- | common/keyboard.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/common/keyboard.h b/common/keyboard.h index d1a922420..6442716fc 100644 --- a/common/keyboard.h +++ b/common/keyboard.h | |||
| @@ -30,16 +30,16 @@ extern "C" { | |||
| 30 | typedef struct { | 30 | typedef struct { |
| 31 | uint8_t col; | 31 | uint8_t col; |
| 32 | uint8_t row; | 32 | uint8_t row; |
| 33 | } key_t; | 33 | } keypos_t; |
| 34 | 34 | ||
| 35 | /* key event */ | 35 | /* key event */ |
| 36 | typedef struct { | 36 | typedef struct { |
| 37 | key_t key; | 37 | keypos_t key; |
| 38 | bool pressed; | 38 | bool pressed; |
| 39 | uint16_t time; | 39 | uint16_t time; |
| 40 | } keyevent_t; | 40 | } keyevent_t; |
| 41 | 41 | ||
| 42 | /* equivalent test of key_t */ | 42 | /* equivalent test of keypos_t */ |
| 43 | #define KEYEQ(keya, keyb) ((keya).row == (keyb).row && (keya).col == (keyb).col) | 43 | #define KEYEQ(keya, keyb) ((keya).row == (keyb).row && (keya).col == (keyb).col) |
| 44 | 44 | ||
| 45 | /* Rules for No Event: | 45 | /* Rules for No Event: |
| @@ -52,7 +52,7 @@ static inline bool IS_RELEASED(keyevent_t event) { return (!IS_NOEVENT(event) && | |||
| 52 | 52 | ||
| 53 | /* Tick event */ | 53 | /* Tick event */ |
| 54 | #define TICK (keyevent_t){ \ | 54 | #define TICK (keyevent_t){ \ |
| 55 | .key = (key_t){ .row = 255, .col = 255 }, \ | 55 | .key = (keypos_t){ .row = 255, .col = 255 }, \ |
| 56 | .pressed = false, \ | 56 | .pressed = false, \ |
| 57 | .time = (timer_read() | 1) \ | 57 | .time = (timer_read() | 1) \ |
| 58 | } | 58 | } |
| @@ -62,6 +62,9 @@ void keyboard_init(void); | |||
| 62 | void keyboard_task(void); | 62 | void keyboard_task(void); |
| 63 | void keyboard_set_leds(uint8_t leds); | 63 | void keyboard_set_leds(uint8_t leds); |
| 64 | 64 | ||
| 65 | __attribute__ ((weak)) void matrix_power_up(void) {} | ||
| 66 | __attribute__ ((weak)) void matrix_power_down(void) {} | ||
| 67 | |||
| 65 | #ifdef __cplusplus | 68 | #ifdef __cplusplus |
| 66 | } | 69 | } |
| 67 | #endif | 70 | #endif |
