Unified low battery indication of LED/RGB matrix and individual LED; Fixed bluetooth name may not be set correctly after factory reset

This commit is contained in:
lokher
2024-11-09 15:45:12 +08:00
parent b5de40f5c1
commit 27a218a3d1
11 changed files with 98 additions and 147 deletions
+5 -23
View File
@@ -140,12 +140,6 @@ void set_transport(transport_t new_transport) {
p24g_transport_enable(false);
wireless_disconnect();
lpm_timer_stop();
#ifdef NKRO_ENABLE
# if defined(WIRELESS_NKRO_ENABLE)
nkro.bluetooth = keymap_config.nkro;
# endif
keymap_config.nkro = nkro.usb;
#endif
break;
case TRANSPORT_BLUETOOTH:
@@ -154,14 +148,6 @@ void set_transport(transport_t new_transport) {
bt_transport_enable(true);
usb_transport_enable(false);
lpm_timer_reset();
#if defined(NKRO_ENABLE)
nkro.usb = keymap_config.nkro;
# if defined(WIRELESS_NKRO_ENABLE)
keymap_config.nkro = nkro.bluetooth;
# else
keymap_config.nkro = FALSE;
# endif
#endif
break;
case TRANSPORT_P2P4:
@@ -170,14 +156,6 @@ void set_transport(transport_t new_transport) {
p24g_transport_enable(true);
usb_transport_enable(false);
lpm_timer_reset();
#if defined(NKRO_ENABLE)
nkro.usb = keymap_config.nkro;
# if defined(WIRELESS_NKRO_ENABLE)
keymap_config.nkro = nkro.bluetooth;
# else
keymap_config.nkro = FALSE;
# endif
#endif
break;
default:
@@ -244,7 +222,11 @@ void usb_remote_wakeup(void) {
/* Do this in the suspended state */
suspend_power_down(); // on AVR this deep sleeps for 15ms
/* Remote wakeup */
if (suspend_wakeup_condition()) {
if (suspend_wakeup_condition()
#ifdef ENCODER_ENABLE
|| encoder_read()
#endif
) {
usbWakeupHost(&USB_DRIVER);
wait_ms(300);
#ifdef MOUSEKEY_ENABLE