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);
}
// 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();
}
}
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();
{
#ifdef KEYBOARD_LOCK_ENABLE
static host_driver_t *host_driver = 0;
+#endif
+#ifdef SLEEP_LED_ENABLE
+ static bool sleep_led_test = false;
#endif
switch (code) {
#ifdef SLEEP_LED_ENABLE
case KC_Z:
// test breathing sleep LED
print("Sleep LED test\n");
- sleep_led_toggle();
- led_set(host_keyboard_leds());
+ if (sleep_led_test) {
+ sleep_led_disable();
+ led_set(host_keyboard_leds());
+ } else {
+ sleep_led_enable();
+ }
+ sleep_led_test = !sleep_led_test;
break;
#endif
#ifdef BOOTMAGIC_ENABLE
#define SLEEP_LED_H
-#ifdef SLEEP_LED_ENABLE
-
void sleep_led_init(void);
void sleep_led_enable(void);
void sleep_led_disable(void);
-void sleep_led_toggle(void);
-
-#else
-
-#define sleep_led_init()
-#define sleep_led_enable()
-#define sleep_led_disable()
-#define sleep_led_toggle()
-
-#endif
+void sleep_led_on(void);
+void sleep_led_off(void);
#endif