usb_usb: Prohibit MAX3421 suspend at startup #770
MAX3421 suspend/resume at startup can: - prevent LUFA startup - prevent Poker X from being enumerated
This commit is contained in:
parent
d825356dd5
commit
86157dc41d
1 changed files with 12 additions and 0 deletions
|
|
@ -226,8 +226,16 @@ void led_set(uint8_t usb_led)
|
||||||
if (kbd4.isReady()) kbd4.SetLed(&usb_led);
|
if (kbd4.isReady()) kbd4.SetLed(&usb_led);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool init_done = false;
|
||||||
|
void hook_late_init()
|
||||||
|
{
|
||||||
|
dprintf("[i]");
|
||||||
|
init_done = true;
|
||||||
|
}
|
||||||
|
|
||||||
void hook_usb_suspend_loop(void)
|
void hook_usb_suspend_loop(void)
|
||||||
{
|
{
|
||||||
|
dprintf("[s]");
|
||||||
#ifndef TMK_LUFA_DEBUG_UART
|
#ifndef TMK_LUFA_DEBUG_UART
|
||||||
// This corrupts debug print when suspend
|
// This corrupts debug print when suspend
|
||||||
suspend_power_down();
|
suspend_power_down();
|
||||||
|
|
@ -243,6 +251,8 @@ static uint8_t _led_stats = 0;
|
||||||
void hook_usb_suspend_entry(void)
|
void hook_usb_suspend_entry(void)
|
||||||
{
|
{
|
||||||
dprintf("[S]");
|
dprintf("[S]");
|
||||||
|
if (!init_done) return;
|
||||||
|
|
||||||
matrix_clear();
|
matrix_clear();
|
||||||
clear_keyboard();
|
clear_keyboard();
|
||||||
|
|
||||||
|
|
@ -260,6 +270,8 @@ void hook_usb_suspend_entry(void)
|
||||||
void hook_usb_wakeup(void)
|
void hook_usb_wakeup(void)
|
||||||
{
|
{
|
||||||
dprintf("[W]");
|
dprintf("[W]");
|
||||||
|
if (!init_done) return;
|
||||||
|
|
||||||
suspend_wakeup_init();
|
suspend_wakeup_init();
|
||||||
|
|
||||||
#ifdef UHS2_POWER_SAVING
|
#ifdef UHS2_POWER_SAVING
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue