mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-27 11:31:13 +00:00
Add active driver callbacks
This commit is contained in:
parent
c9824094c6
commit
6dd03f4288
@ -82,12 +82,25 @@ host_driver_t *host_get_driver(void) {
|
|||||||
#ifdef CONNECTION_ENABLE
|
#ifdef CONNECTION_ENABLE
|
||||||
static connection_host_t active_host = CONNECTION_HOST_NONE;
|
static connection_host_t active_host = CONNECTION_HOST_NONE;
|
||||||
|
|
||||||
static void host_update_active_driver(connection_host_t current, connection_host_t next) {
|
__attribute__((weak)) void host_disconnect_active_driver_user(connection_host_t host) {}
|
||||||
if (current != CONNECTION_HOST_NONE) {
|
__attribute__((weak)) void host_disconnect_active_driver_kb(connection_host_t host) {}
|
||||||
|
|
||||||
|
__attribute__((weak)) void host_connect_active_driver_user(connection_host_t host) {}
|
||||||
|
__attribute__((weak)) void host_connect_active_driver_kb(connection_host_t host) {}
|
||||||
|
|
||||||
// TODO: Additionally have host_driver_t handle swap
|
// TODO: Additionally have host_driver_t handle swap
|
||||||
|
static void host_update_active_driver(connection_host_t current, connection_host_t next) {
|
||||||
|
host_disconnect_active_driver_user(current);
|
||||||
|
host_disconnect_active_driver_kb(current);
|
||||||
|
|
||||||
|
if (current != CONNECTION_HOST_NONE) {
|
||||||
clear_keyboard();
|
clear_keyboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
host_connect_active_driver_user(next);
|
||||||
|
host_connect_active_driver_kb(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void host_init(void) {
|
void host_init(void) {
|
||||||
|
Loading…
Reference in New Issue
Block a user