Skip to content

Commit

Permalink
Revert "Merge pull request #93 from careyk007/main"
Browse files Browse the repository at this point in the history
This reverts commit 8cd8933, reversing
changes made to 3f1dfba.
  • Loading branch information
petejohanson committed Aug 18, 2020
1 parent f04da71 commit e5ba03f
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions app/src/usb_hid.c
Expand Up @@ -15,26 +15,13 @@ static enum usb_dc_status_code usb_status;

static struct device *hid_dev;

static K_SEM_DEFINE(hid_sem, 1, 1);

static void in_ready_cb(void)
{
k_sem_give(&hid_sem);
}

static const struct hid_ops ops =
{
.int_in_ready = in_ready_cb,
};

int zmk_usb_hid_send_report(const u8_t *report, size_t len)
{
if (usb_status == USB_DC_SUSPEND)
{
return usb_wakeup_request();
}

k_sem_take(&hid_sem, K_FOREVER);
return hid_int_ep_write(hid_dev, report, len, NULL);
}

Expand All @@ -56,7 +43,7 @@ static int zmk_usb_hid_init(struct device *_arg)

usb_hid_register_device(hid_dev,
zmk_hid_report_desc, sizeof(zmk_hid_report_desc),
&ops);
NULL);

usb_hid_init(hid_dev);

Expand Down

0 comments on commit e5ba03f

Please sign in to comment.