From 307a8d09db78b95c858c41bd5549c721da7eb1f8 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Thu, 1 Oct 2020 17:18:01 -0400 Subject: [PATCH] feat(usb): Function to access latest USB status. * To be leveraged by upcoming power management work. --- app/include/zmk/usb_hid.h | 2 ++ app/src/usb_hid.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/include/zmk/usb_hid.h b/app/include/zmk/usb_hid.h index 7ee26298..83a45407 100644 --- a/app/include/zmk/usb_hid.h +++ b/app/include/zmk/usb_hid.h @@ -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); diff --git a/app/src/usb_hid.c b/app/src/usb_hid.c index 530ffea8..64addaea 100644 --- a/app/src/usb_hid.c +++ b/app/src/usb_hid.c @@ -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: