Merge pull request #231 from petejohanson/core/usb-status-api

Add API to access current USB status
This commit is contained in:
Pete Johanson 2020-10-01 17:29:16 -04:00 committed by GitHub
commit e2ce9c34b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -14,4 +14,6 @@
int zmk_usb_hid_init();
enum usb_dc_status_code zmk_usb_hid_get_status();
int zmk_usb_hid_send_report(u8_t *report, size_t len);

View file

@ -28,6 +28,8 @@ static const struct hid_ops ops = {
.int_in_ready = in_ready_cb,
};
enum usb_dc_status_code zmk_usb_hid_get_status() { return usb_status; }
int zmk_usb_hid_send_report(const u8_t *report, size_t len) {
switch (usb_status) {
case USB_DC_SUSPEND: