diff options
Diffstat (limited to 'tmk_core/common')
| -rw-r--r-- | tmk_core/common/avr/suspend.c | 2 | ||||
| -rw-r--r-- | tmk_core/common/keyboard.c | 6 | ||||
| -rw-r--r-- | tmk_core/common/keyboard.h | 8 | ||||
| -rw-r--r-- | tmk_core/common/matrix.h | 4 |
4 files changed, 16 insertions, 4 deletions
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index 80243f02b..af99f52b5 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c | |||
| @@ -85,6 +85,8 @@ void suspend_power_down(void) | |||
| 85 | power_down(WDTO_15MS); | 85 | power_down(WDTO_15MS); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | __attribute__ ((weak)) void matrix_power_up(void) {} | ||
| 89 | __attribute__ ((weak)) void matrix_power_down(void) {} | ||
| 88 | bool suspend_wakeup_condition(void) | 90 | bool suspend_wakeup_condition(void) |
| 89 | { | 91 | { |
| 90 | matrix_power_up(); | 92 | matrix_power_up(); |
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index b03b124d7..eb7b096be 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c | |||
| @@ -62,6 +62,12 @@ static bool has_ghost_in_row(uint8_t row) | |||
| 62 | #endif | 62 | #endif |
| 63 | 63 | ||
| 64 | 64 | ||
| 65 | __attribute__ ((weak)) void matrix_setup(void) {} | ||
| 66 | void keyboard_setup(void) | ||
| 67 | { | ||
| 68 | matrix_setup(); | ||
| 69 | } | ||
| 70 | |||
| 65 | void keyboard_init(void) | 71 | void keyboard_init(void) |
| 66 | { | 72 | { |
| 67 | timer_init(); | 73 | timer_init(); |
diff --git a/tmk_core/common/keyboard.h b/tmk_core/common/keyboard.h index 6442716fc..7738251b6 100644 --- a/tmk_core/common/keyboard.h +++ b/tmk_core/common/keyboard.h | |||
| @@ -58,13 +58,15 @@ static inline bool IS_RELEASED(keyevent_t event) { return (!IS_NOEVENT(event) && | |||
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | 60 | ||
| 61 | /* it runs once at early stage of startup before keyboard_init. */ | ||
| 62 | void keyboard_setup(void); | ||
| 63 | /* it runs once after initializing host side protocol, debug and MCU peripherals. */ | ||
| 61 | void keyboard_init(void); | 64 | void keyboard_init(void); |
| 65 | /* it runs repeatedly in main loop */ | ||
| 62 | void keyboard_task(void); | 66 | void keyboard_task(void); |
| 67 | /* it runs when host LED status is updated */ | ||
| 63 | void keyboard_set_leds(uint8_t leds); | 68 | void keyboard_set_leds(uint8_t leds); |
| 64 | 69 | ||
| 65 | __attribute__ ((weak)) void matrix_power_up(void) {} | ||
| 66 | __attribute__ ((weak)) void matrix_power_down(void) {} | ||
| 67 | |||
| 68 | #ifdef __cplusplus | 70 | #ifdef __cplusplus |
| 69 | } | 71 | } |
| 70 | #endif | 72 | #endif |
diff --git a/tmk_core/common/matrix.h b/tmk_core/common/matrix.h index 107ee7265..ec6f8cd43 100644 --- a/tmk_core/common/matrix.h +++ b/tmk_core/common/matrix.h | |||
| @@ -43,7 +43,9 @@ extern "C" { | |||
| 43 | uint8_t matrix_rows(void); | 43 | uint8_t matrix_rows(void); |
| 44 | /* number of matrix columns */ | 44 | /* number of matrix columns */ |
| 45 | uint8_t matrix_cols(void); | 45 | uint8_t matrix_cols(void); |
| 46 | /* intialize matrix for scaning. should be called once. */ | 46 | /* should be called at early stage of startup before matrix_init.(optional) */ |
| 47 | void matrix_setup(void); | ||
| 48 | /* intialize matrix for scaning. */ | ||
| 47 | void matrix_init(void); | 49 | void matrix_init(void); |
| 48 | /* scan all key states on matrix */ | 50 | /* scan all key states on matrix */ |
| 49 | uint8_t matrix_scan(void); | 51 | uint8_t matrix_scan(void); |
