Note there was one place where a non-strict prototype was actually being used with an argument, in `zmk_hog_init`. In this case, the actual argument type was added instead.
29 lines
637 B
C
29 lines
637 B
C
/*
|
|
* Copyright (c) 2020 The ZMK Contributors
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <zephyr/usb/usb_device.h>
|
|
#include <zephyr/usb/class/usb_hid.h>
|
|
|
|
#include <zmk/keys.h>
|
|
#include <zmk/hid.h>
|
|
|
|
enum zmk_usb_conn_state {
|
|
ZMK_USB_CONN_NONE,
|
|
ZMK_USB_CONN_POWERED,
|
|
ZMK_USB_CONN_HID,
|
|
};
|
|
|
|
enum usb_dc_status_code zmk_usb_get_status(void);
|
|
enum zmk_usb_conn_state zmk_usb_get_conn_state(void);
|
|
|
|
static inline bool zmk_usb_is_powered(void) {
|
|
return zmk_usb_get_conn_state() != ZMK_USB_CONN_NONE;
|
|
}
|
|
static inline bool zmk_usb_is_hid_ready(void) {
|
|
return zmk_usb_get_conn_state() == ZMK_USB_CONN_HID;
|
|
}
|