summaryrefslogtreecommitdiff
path: root/keyboard/hhkb_rn42/hhkb_avr.h
diff options
context:
space:
mode:
authortmk <hasu@tmk-kbd.com>2014-12-03 15:50:02 +0900
committertmk <hasu@tmk-kbd.com>2015-01-15 17:08:49 +0900
commitebe437325872045e0b99469f83cb9e877e98112c (patch)
tree36d7fc6928b7a3c75c63a6d5e52e03db5734b7d9 /keyboard/hhkb_rn42/hhkb_avr.h
parent86f82dd02db577cd658ca4284cae15e9664db0f2 (diff)
Fix power saving while USB suspended
- doesn't pwoer save while Bluetooth turns on
Diffstat (limited to 'keyboard/hhkb_rn42/hhkb_avr.h')
-rw-r--r--keyboard/hhkb_rn42/hhkb_avr.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/keyboard/hhkb_rn42/hhkb_avr.h b/keyboard/hhkb_rn42/hhkb_avr.h
index f007d7667a..0321977d11 100644
--- a/keyboard/hhkb_rn42/hhkb_avr.h
+++ b/keyboard/hhkb_rn42/hhkb_avr.h
@@ -53,9 +53,11 @@ static inline void KEY_POWER_OFF(void) {
DDRB = 0x00; PORTB = 0xFF; // change pins input with pull-up
DDRD |= (1<<4); PORTD &= ~(1<<4); // MOS FET switch off
}
+static inline bool KEY_POWER_STATE(void) { return PORTD & (1<<4); }
#else
static inline void KEY_POWER_ON(void) {}
static inline void KEY_POWER_OFF(void) {}
+static inline bool KEY_POWER_STATE(void) { return true; }
#endif
static inline void KEY_INIT(void)
{
@@ -73,7 +75,7 @@ static inline void KEY_INIT(void)
KEY_UNABLE();
KEY_PREV_OFF();
- KEY_POWER_ON();
+ KEY_POWER_OFF();
}
static inline void KEY_SELECT(uint8_t ROW, uint8_t COL)
{