core: Fix sleep_led
This commit is contained in:
parent
e7b8da47ce
commit
5969d6267f
4 changed files with 29 additions and 20 deletions
|
|
@ -45,10 +45,17 @@ void sleep_led_disable(void)
|
|||
TIMSK1 &= ~_BV(OCIE1A);
|
||||
}
|
||||
|
||||
void sleep_led_toggle(void)
|
||||
|
||||
__attribute__ ((weak))
|
||||
void sleep_led_on(void)
|
||||
{
|
||||
/* Disable Compare Match Interrupt */
|
||||
TIMSK1 ^= _BV(OCIE1A);
|
||||
led_set(1<<USB_LED_CAPS_LOCK);
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void sleep_led_off(void)
|
||||
{
|
||||
led_set(0);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -86,10 +93,10 @@ ISR(TIMER1_COMPA_vect)
|
|||
|
||||
// LED on
|
||||
if (timer.pwm.count == 0) {
|
||||
led_set(1<<USB_LED_CAPS_LOCK);
|
||||
sleep_led_on();
|
||||
}
|
||||
// LED off
|
||||
if (timer.pwm.count == pgm_read_byte(&breathing_table[timer.pwm.index])) {
|
||||
led_set(0);
|
||||
sleep_led_off();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,11 @@ void suspend_idle(uint8_t time)
|
|||
|
||||
void suspend_power_down(void)
|
||||
{
|
||||
#ifdef SUSPEND_MODE_STANDBY
|
||||
#ifdef NO_SUSPEND_POWER_DOWN
|
||||
;
|
||||
#elif defined(SUSPEND_MODE_NOPOWERSAVE)
|
||||
;
|
||||
#elif defined(SUSPEND_MODE_STANDBY)
|
||||
standby();
|
||||
#elif defined(SUSPEND_MODE_IDLE)
|
||||
idle();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue