aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common')
-rw-r--r--tmk_core/common/avr/suspend.c2
-rw-r--r--tmk_core/common/keyboard.c6
-rw-r--r--tmk_core/common/keyboard.h8
-rw-r--r--tmk_core/common/matrix.h4
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) {}
88bool suspend_wakeup_condition(void) 90bool 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) {}
66void keyboard_setup(void)
67{
68 matrix_setup();
69}
70
65void keyboard_init(void) 71void 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. */
62void keyboard_setup(void);
63/* it runs once after initializing host side protocol, debug and MCU peripherals. */
61void keyboard_init(void); 64void keyboard_init(void);
65/* it runs repeatedly in main loop */
62void keyboard_task(void); 66void keyboard_task(void);
67/* it runs when host LED status is updated */
63void keyboard_set_leds(uint8_t leds); 68void 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" {
43uint8_t matrix_rows(void); 43uint8_t matrix_rows(void);
44/* number of matrix columns */ 44/* number of matrix columns */
45uint8_t matrix_cols(void); 45uint8_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) */
47void matrix_setup(void);
48/* intialize matrix for scaning. */
47void matrix_init(void); 49void matrix_init(void);
48/* scan all key states on matrix */ 50/* scan all key states on matrix */
49uint8_t matrix_scan(void); 51uint8_t matrix_scan(void);