diff options
| author | hathach <[email protected]> | 2013-05-25 17:19:18 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-05-25 17:19:18 +0700 |
| commit | ed217948b8a25a7c4b7929775079ea8b9086305b (patch) | |
| tree | f615c3755c7e2c681f8f2669bb3c1458911626c6 /demos/device/keyboard | |
| parent | ae02263d817a7b2f37c7e9c5026fd067b9d75fcc (diff) | |
rename descriptor type, hid descriptor type
Diffstat (limited to 'demos/device/keyboard')
| -rw-r--r-- | demos/device/keyboard/descriptors.c | 38 | ||||
| -rw-r--r-- | demos/device/keyboard/main.c | 6 |
2 files changed, 23 insertions, 21 deletions
diff --git a/demos/device/keyboard/descriptors.c b/demos/device/keyboard/descriptors.c index 91b2a900e..e17527f63 100644 --- a/demos/device/keyboard/descriptors.c +++ b/demos/device/keyboard/descriptors.c @@ -123,7 +123,7 @@ TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4) tusb_descriptor_device_t const desc_device = { .bLength = sizeof(tusb_descriptor_device_t), - .bDescriptorType = TUSB_DESC_DEVICE, + .bDescriptorType = TUSB_DESC_TYPE_DEVICE, .bcdUSB = 0x0200, .bDeviceClass = 0x00, .bDeviceSubClass = 0x00, @@ -149,7 +149,7 @@ const app_configuration_desc_t desc_configuration = .configuration = { .bLength = sizeof(tusb_descriptor_configuration_t), - .bDescriptorType = TUSB_DESC_CONFIGURATION, + .bDescriptorType = TUSB_DESC_TYPE_CONFIGURATION, .wTotalLength = sizeof(app_configuration_desc_t) - 1, // exclude termination .bNumInterfaces = TOTAL_INTEFACES, @@ -165,7 +165,7 @@ const app_configuration_desc_t desc_configuration = .CDC_IAD = { .bLength = sizeof(tusb_descriptor_interface_association_t), - .bDescriptorType = TUSB_DESC_INTERFACE_ASSOCIATION, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE_ASSOCIATION, .bFirstInterface = 0, .bInterfaceCount = 2, @@ -184,7 +184,7 @@ const app_configuration_desc_t desc_configuration = .CDC_CCI_Interface = { .bLength = sizeof(tusb_descriptor_interface_t), - .bDescriptorType = TUSB_DESC_INTERFACE, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE, .bInterfaceNumber = INTERFACE_INDEX_CDC, .bAlternateSetting = 0, .bNumEndpoints = 1, @@ -225,7 +225,7 @@ const app_configuration_desc_t desc_configuration = .CDC_NotificationEndpoint = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = CDC_NOTIFICATION_EP, .bmAttributes = USB_ENDPOINT_TYPE_INTERRUPT, .wMaxPacketSize = CDC_NOTIFICATION_EP_MAXPACKETSIZE, @@ -236,7 +236,7 @@ const app_configuration_desc_t desc_configuration = .CDC_DCI_Interface = { .bLength = sizeof(tusb_descriptor_interface_t), - .bDescriptorType = TUSB_DESC_INTERFACE, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE, .bInterfaceNumber = INTERFACE_INDEX_CDC+1, .bAlternateSetting = 0x00, .bNumEndpoints = 2, @@ -249,7 +249,7 @@ const app_configuration_desc_t desc_configuration = .CDC_DataOutEndpoint = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = CDC_DATA_EP_OUT, .bmAttributes = USB_ENDPOINT_TYPE_BULK, .wMaxPacketSize = CDC_DATA_EP_MAXPACKET_SIZE, @@ -259,7 +259,7 @@ const app_configuration_desc_t desc_configuration = .CDC_DataInEndpoint = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = CDC_DATA_EP_IN, .bmAttributes = USB_ENDPOINT_TYPE_BULK, .wMaxPacketSize = CDC_DATA_EP_MAXPACKET_SIZE, @@ -272,7 +272,7 @@ const app_configuration_desc_t desc_configuration = .keyboard_interface = { .bLength = sizeof(tusb_descriptor_interface_t), - .bDescriptorType = TUSB_DESC_INTERFACE, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE, .bInterfaceNumber = 1, .bAlternateSetting = 0x00, .bNumEndpoints = 1, @@ -285,18 +285,18 @@ const app_configuration_desc_t desc_configuration = .keyboard_hid = { .bLength = sizeof(tusb_hid_descriptor_hid_t), - .bDescriptorType = HID_DESC_HID, + .bDescriptorType = HID_DESC_TYPE_HID, .bcdHID = 0x0111, .bCountryCode = HID_Local_NotSupported, .bNumDescriptors = 1, - .bReportType = HID_DESC_REPORT, + .bReportType = HID_DESC_TYPE_REPORT, .wReportLength = sizeof(keyboard_report_descriptor) }, .keyboard_endpoint = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x81, .bmAttributes = { .xfer = TUSB_XFER_INTERRUPT }, .wMaxPacketSize = { .size = 0x08 }, @@ -309,7 +309,7 @@ const app_configuration_desc_t desc_configuration = .HID_MouseInterface = { .bLength = sizeof(tusb_descriptor_interface_t), - .bDescriptorType = TUSB_DESC_INTERFACE, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE, .bInterfaceNumber = INTERFACE_INDEX_HID_MOUSE, .bAlternateSetting = 0x00, .bNumEndpoints = 1, @@ -322,18 +322,18 @@ const app_configuration_desc_t desc_configuration = .mouse_hid = { .bLength = sizeof(tusb_hid_descriptor_hid_t), - .bDescriptorType = HID_DESC_HID, + .bDescriptorType = HID_DESC_TYPE_HID, .bcdHID = 0x0111, .bCountryCode = HID_Local_NotSupported, .bNumDescriptors = 1, - .bReportType = HID_DESC_REPORT, + .bReportType = HID_DESC_TYPE_REPORT, .wReportLength = sizeof(mouse_report_descriptor) }, .mouse_endpoint = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x82, .bmAttributes = { .xfer = TUSB_XFER_INTERRUPT }, .wMaxPacketSize = 0x08, @@ -346,7 +346,7 @@ const app_configuration_desc_t desc_configuration = .msc_interface = { .bLength = sizeof(tusb_descriptor_interface_t), - .bDescriptorType = TUSB_DESC_INTERFACE, + .bDescriptorType = TUSB_DESC_TYPE_INTERFACE, .bInterfaceNumber = 3, .bAlternateSetting = 0x00, .bNumEndpoints = 2, @@ -359,7 +359,7 @@ const app_configuration_desc_t desc_configuration = .msc_endpoint_in = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x83, .bmAttributes = { .xfer = TUSB_XFER_BULK }, .wMaxPacketSize = 512, @@ -369,7 +369,7 @@ const app_configuration_desc_t desc_configuration = .msc_endpoint_out = { .bLength = sizeof(tusb_descriptor_endpoint_t), - .bDescriptorType = TUSB_DESC_ENDPOINT, + .bDescriptorType = TUSB_DESC_TYPE_ENDPOINT, .bEndpointAddress = 0x03, .bmAttributes = { .xfer = TUSB_XFER_BULK }, .wMaxPacketSize = 512, diff --git a/demos/device/keyboard/main.c b/demos/device/keyboard/main.c index 324c6a51c..0648b1e1d 100644 --- a/demos/device/keyboard/main.c +++ b/demos/device/keyboard/main.c @@ -25,10 +25,12 @@ int main(void) { if (current_tick + 1000 < system_ticks) { + static uint32_t led_on_mask = 0; + current_tick += 1000; - board_leds(0x01, (current_tick/1000)%2); /* Toggle LED once per second */ - printf("tinyusb: " __DATE__ "\t" __TIME__ "\n"); + board_leds(led_on_mask, 1 - led_on_mask); + led_on_mask = 1 - led_on_mask; // toggle #if !(defined TUSB_CFG_DEVICE_CDC) && 0 if (usb_isConfigured()) |
