summaryrefslogtreecommitdiff
path: root/demos/device
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-10-29 15:09:16 +0700
committerhathach <[email protected]>2013-10-29 15:09:16 +0700
commit5ab195a73d58bcf8d104a7b49d2674368c292792 (patch)
tree70c2b92e69489d869daf55a31082074a7a3f10e8 /demos/device
parentdb986b3107c5e7c0c91cb808c0676313ba598cab (diff)
temporarily implementation of dcd_pipe_is_busy
Diffstat (limited to 'demos/device')
-rw-r--r--demos/device/keyboard/main.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/demos/device/keyboard/main.c b/demos/device/keyboard/main.c
index 5f1ee8608..733aab3d9 100644
--- a/demos/device/keyboard/main.c
+++ b/demos/device/keyboard/main.c
@@ -85,17 +85,18 @@ void led_blinking_task(void * p_para)
hid_keyboard_report_t keyboard_report TUSB_CFG_ATTR_USBRAM;
void keyboard_device_app_task(void * p_para)
{
-// if (tusbd_is_configured(0))
-// {
-// static uint32_t count =0;
-// if (count < 10)
-// {
-// count++;
-//
-// keyboard_report.keycode[0] = 0x04;
-// tusbd_hid_keyboard_send(0, &keyboard_report );
-// }
-// }
+ if (tusbd_is_configured(0))
+ {
+ static uint32_t count =0;
+ if (count++ < 10)
+ {
+ keyboard_report.keycode[0] = (count%2) ? 0x04 : 0x00;
+ if (!tusbd_hid_keyboard_is_busy(0))
+ {
+ tusbd_hid_keyboard_send(0, &keyboard_report );
+ }
+ }
+ }
}
#endif