Always run disconnect inactive profiles after switching
This commit is contained in:
parent
9a8ca231a9
commit
65afd08051
1 changed files with 6 additions and 8 deletions
|
@ -273,15 +273,13 @@ int zmk_ble_prof_select(uint8_t index) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_ZMK_BLE_FAST_SWITCHING)
|
|
||||||
active_profile = index;
|
active_profile = index;
|
||||||
#else
|
|
||||||
bool was_active_profile_open = zmk_ble_active_profile_is_open();
|
#if !IS_ENABLED(CONFIG_ZMK_BLE_FAST_SWITCHING)
|
||||||
active_profile = index;
|
// If the previous profile wasn't paired, then we may be connected to
|
||||||
if (was_active_profile_open) {
|
// multiple hosts during the open advertisement. And if it was, we still
|
||||||
// We may have connected to multiple hosts while the active profile was open.
|
// want to disconnect the previous profile.
|
||||||
zmk_ble_disconnect_inactive_profiles();
|
zmk_ble_disconnect_inactive_profiles();
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ble_save_profile();
|
ble_save_profile();
|
||||||
|
|
Loading…
Add table
Reference in a new issue