diff options
author | tmk <nobody@nowhere> | 2014-11-23 13:08:05 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2014-11-23 13:08:05 +0900 |
commit | 608ebe2686bdb3fdbd0426731cabdf6082c57b53 (patch) | |
tree | 15d306082db9d53bb9c890f62aeeaf4cdab49712 /keyboard/hhkb_rn42/hhkb_avr.h | |
parent | c2d830c07c823c48a17c214b093ec1bab989fb6a (diff) |
Matrix power saving
Diffstat (limited to 'keyboard/hhkb_rn42/hhkb_avr.h')
-rw-r--r-- | keyboard/hhkb_rn42/hhkb_avr.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/keyboard/hhkb_rn42/hhkb_avr.h b/keyboard/hhkb_rn42/hhkb_avr.h index 313effedfe..f007d7667a 100644 --- a/keyboard/hhkb_rn42/hhkb_avr.h +++ b/keyboard/hhkb_rn42/hhkb_avr.h @@ -43,11 +43,10 @@ static inline void KEY_PREV_ON(void) { (PORTB |= (1<<7)); } static inline void KEY_PREV_OFF(void) { (PORTB &= ~(1<<7)); } #ifdef HHKB_POWER_SAVING static inline void KEY_POWER_ON(void) { - _delay_ms(10); // TODO: sleep to save power DDRB = 0xFF; PORTB = 0x40; // change pins output DDRD |= (1<<4); PORTD |= (1<<4); // MOS FET switch on /* Without this wait you will miss or get false key events. */ - _delay_ms(1); // wait for powering up + _delay_ms(5); // wait for powering up } static inline void KEY_POWER_OFF(void) { /* input with pull-up consumes less than without it when pin is open. */ @@ -74,7 +73,7 @@ static inline void KEY_INIT(void) KEY_UNABLE(); KEY_PREV_OFF(); - KEY_POWER_OFF(); + KEY_POWER_ON(); } static inline void KEY_SELECT(uint8_t ROW, uint8_t COL) { |