diff --git a/keyboards/nuphy/air75_v2/ansi/customizations.md b/keyboards/nuphy/air75_v2/ansi/customizations.md index 4294ef7309d0..c0a82c5a07d3 100644 --- a/keyboards/nuphy/air75_v2/ansi/customizations.md +++ b/keyboards/nuphy/air75_v2/ansi/customizations.md @@ -24,6 +24,7 @@ BT mode key. No indicator for RF as the sidelight is a different colour. - Light Sleep (NRF off, LED off) - no real reason to use this, but might wake up quicker. Right indicator blinks yellow. - No Sleep - for those that want their board to always be on... Right indicator blinks red. - Keyboard will never go to deep sleep in USB mode. This seems to cause issues on wake and I don't have a solution. I'm expecting that the device is powered and if it's not the keyboard would reset anyway. +- Keyboard won't go to deep sleep if charging on wireless mode as charging interrupts the MCU causing it to sleep and wake repeatedly. To restore the proper sleep mode you must wake the board while it's off the charger. ## Fixes diff --git a/keyboards/nuphy/air75_v2/ansi/sleep.c b/keyboards/nuphy/air75_v2/ansi/sleep.c index a1598e34667d..c17693b82062 100644 --- a/keyboards/nuphy/air75_v2/ansi/sleep.c +++ b/keyboards/nuphy/air75_v2/ansi/sleep.c @@ -50,7 +50,7 @@ void deep_sleep_handle(void) { enter_deep_sleep(); // puts the board in WFI mode and pauses the MCU exit_deep_sleep(); // This gets called when there is an interrupt (wake) event. - no_act_time = 0; // required to not cause an immediate sleep on first wake + no_act_time = 0; // required to not cause an immediate sleep on first wake } /** @@ -73,9 +73,12 @@ void sleep_handle(void) { rf_linking_time = 0; usb_suspend_debounce = 0; - // Don't deep sleep if in USB mode. Board may have issues waking as reported by others. I assume it's being - // powered if USB port is on, or otherwise it's disconnected at the hardware level if USB port is off.. - if (kb_config.sleep_mode != SLEEP_MODE_OFF && dev_info.link_mode == LINK_USB) { + // don't deep sleep if charging on wireless, charging interrupts and wakes the MCU + if (kb_config.sleep_mode != SLEEP_MODE_OFF && dev_info.link_mode < LINK_USB && dev_info.rf_charge & 0x01) { + enter_light_sleep(); + // Don't deep sleep if in USB mode. Board may have issues waking as reported by others. I assume it's being + // powered if USB port is on, or otherwise it's disconnected at the hardware level if USB port is off.. + } else if (kb_config.sleep_mode != SLEEP_MODE_OFF && dev_info.link_mode == LINK_USB) { enter_light_sleep(); } else if (kb_config.sleep_mode == SLEEP_MODE_DEEP) { deep_sleep_handle();