Skip to content

Commit

Permalink
Merge pull request zmkfirmware#231 from petejohanson/core/usb-status-api
Browse files Browse the repository at this point in the history
Add API to access current USB status
  • Loading branch information
petejohanson authored Oct 1, 2020
2 parents e5fb921 + bb1ea65 commit c89e0e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/include/zmk/usb_hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 2 additions & 0 deletions app/src/usb_hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c89e0e3

Please sign in to comment.