]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
core: Fix for ATtiny85
authortmk <hasu@tmk-kbd.com>
Thu, 14 Sep 2017 03:56:35 +0000 (12:56 +0900)
committertmk <hasu@tmk-kbd.com>
Thu, 14 Sep 2017 03:56:35 +0000 (12:56 +0900)
tmk_core/common/avr/suspend.c
tmk_core/common/avr/timer.c

index 02d7e4c9426eea2921a4322d3959fe8952c7154d..0e13eb69c0aaa33511c59d507958d15f6e9503ec 100644 (file)
@@ -72,11 +72,13 @@ static void power_down(uint8_t wdto)
 
 static void standby(void)
 {
+#ifdef SLEEP_MODE_STANDBY
     set_sleep_mode(SLEEP_MODE_STANDBY);
     sleep_enable();
     sei();
     sleep_cpu();
     sleep_disable();
+#endif
 }
 
 static void idle(void)
index 292b41c3a6c29fca9e4319114a0759473ea3e7e3..1aa4a6a80cee68d39ed748083acfc7d620514b3c 100644 (file)
@@ -46,7 +46,11 @@ void timer_init(void)
 #endif
 
     OCR0A = TIMER_RAW_TOP;
+#ifdef TIMSK0
     TIMSK0 = (1<<OCIE0A);
+#else
+    TIMSK = (1<<OCIE0A);
+#endif
 }
 
 inline