1d369ffa73
Added some utility functions and an event for tracking the state of the USB connection. Updated endpoints.c to select a single endpoint to send HID reports to based on the status of the USB and BLE connections. Partially fixes #206. Future commits will add a user setting to control which endpoint is used if both USB and BLE are ready.
20 lines
No EOL
356 B
C
20 lines
No EOL
356 B
C
/*
|
|
* Copyright (c) 2020 The ZMK Contributors
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <zephyr.h>
|
|
#include <usb/usb_device.h>
|
|
|
|
#include <zmk/event-manager.h>
|
|
#include <zmk/usb.h>
|
|
|
|
struct usb_conn_state_changed {
|
|
struct zmk_event_header header;
|
|
enum zmk_usb_conn_state conn_state;
|
|
};
|
|
|
|
ZMK_EVENT_DECLARE(usb_conn_state_changed); |