forked from forks/qmk_firmware
Merge pull request #109 from petereichinger/master
Fix flickering when sleeping
This commit is contained in:
commit
3ea6927b70
|
@ -8,6 +8,7 @@
|
||||||
#include "suspend_avr.h"
|
#include "suspend_avr.h"
|
||||||
#include "suspend.h"
|
#include "suspend.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
#include "led.h"
|
||||||
#ifdef PROTOCOL_LUFA
|
#ifdef PROTOCOL_LUFA
|
||||||
#include "lufa.h"
|
#include "lufa.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -64,6 +65,10 @@ static void power_down(uint8_t wdto)
|
||||||
// Watchdog Interrupt Mode
|
// Watchdog Interrupt Mode
|
||||||
wdt_intr_enable(wdto);
|
wdt_intr_enable(wdto);
|
||||||
|
|
||||||
|
#ifdef BACKLIGHT_ENABLE
|
||||||
|
backlight_set(0);
|
||||||
|
#endif
|
||||||
|
|
||||||
// TODO: more power saving
|
// TODO: more power saving
|
||||||
// See PicoPower application note
|
// See PicoPower application note
|
||||||
// - I/O port input with pullup
|
// - I/O port input with pullup
|
||||||
|
@ -89,6 +94,9 @@ __attribute__ ((weak)) void matrix_power_up(void) {}
|
||||||
__attribute__ ((weak)) void matrix_power_down(void) {}
|
__attribute__ ((weak)) void matrix_power_down(void) {}
|
||||||
bool suspend_wakeup_condition(void)
|
bool suspend_wakeup_condition(void)
|
||||||
{
|
{
|
||||||
|
#ifdef BACKLIGHT_ENABLE
|
||||||
|
backlight_set(0);
|
||||||
|
#endif
|
||||||
matrix_power_up();
|
matrix_power_up();
|
||||||
matrix_scan();
|
matrix_scan();
|
||||||
matrix_power_down();
|
matrix_power_down();
|
||||||
|
@ -104,8 +112,10 @@ void suspend_wakeup_init(void)
|
||||||
// clear keyboard state
|
// clear keyboard state
|
||||||
clear_keyboard();
|
clear_keyboard();
|
||||||
#ifdef BACKLIGHT_ENABLE
|
#ifdef BACKLIGHT_ENABLE
|
||||||
|
backlight_set(0);
|
||||||
backlight_init();
|
backlight_init();
|
||||||
#endif
|
#endif
|
||||||
|
led_set(host_keyboard_leds());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_SUSPEND_POWER_DOWN
|
#ifndef NO_SUSPEND_POWER_DOWN
|
||||||
|
@ -122,3 +132,4 @@ ISR(WDT_vect)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue