projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix warning about possible string truncation in the TempDataLogger project.
[pub/USBasp.git]
/
Demos
/
Device
/
LowLevel
/
KeyboardMouse
/
Descriptors.c
diff --git
a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c
b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c
index
92fc063
..
f577276
100644
(file)
--- a/
Demos/Device/LowLevel/KeyboardMouse/Descriptors.c
+++ b/
Demos/Device/LowLevel/KeyboardMouse/Descriptors.c
@@
-1,13
+1,13
@@
/*
LUFA Library
/*
LUFA Library
- Copyright (C) Dean Camera, 201
3
.
+ Copyright (C) Dean Camera, 201
8
.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
- Copyright 201
3
Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 201
8
Dean Camera (dean [at] fourwalledcubicle [dot] com)
Copyright 2010 Denver Gingerich (denver [at] ossguy [dot] com)
Permission to use, copy, modify, distribute, and sell this
Copyright 2010 Denver Gingerich (denver [at] ossguy [dot] com)
Permission to use, copy, modify, distribute, and sell this
@@
-124,7
+124,7
@@
const USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
{
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
- .USBSpecification = VERSION_BCD(
01.1
0),
+ .USBSpecification = VERSION_BCD(
1,1,
0),
.Class = USB_CSCP_NoDeviceClass,
.SubClass = USB_CSCP_NoDeviceSubclass,
.Protocol = USB_CSCP_NoDeviceProtocol,
.Class = USB_CSCP_NoDeviceClass,
.SubClass = USB_CSCP_NoDeviceSubclass,
.Protocol = USB_CSCP_NoDeviceProtocol,
@@
-133,7
+133,7
@@
const USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
.VendorID = 0x03EB,
.ProductID = 0x204D,
.VendorID = 0x03EB,
.ProductID = 0x204D,
- .ReleaseNumber = VERSION_BCD(0
0.0
1),
+ .ReleaseNumber = VERSION_BCD(0
,0,
1),
.ManufacturerStrIndex = STRING_ID_Manufacturer,
.ProductStrIndex = STRING_ID_Product,
.ManufacturerStrIndex = STRING_ID_Manufacturer,
.ProductStrIndex = STRING_ID_Product,
@@
-184,7
+184,7
@@
const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
{
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
- .HIDSpec = VERSION_BCD(
01.1
1),
+ .HIDSpec = VERSION_BCD(
1,1,
1),
.CountryCode = 0x00,
.TotalReportDescriptors = 1,
.HIDReportType = HID_DTYPE_Report,
.CountryCode = 0x00,
.TotalReportDescriptors = 1,
.HIDReportType = HID_DTYPE_Report,
@@
-231,7
+231,7
@@
const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
{
.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
- .HIDSpec = VERSION_BCD(
01.1
1),
+ .HIDSpec = VERSION_BCD(
1,1,
1),
.CountryCode = 0x00,
.TotalReportDescriptors = 1,
.HIDReportType = HID_DTYPE_Report,
.CountryCode = 0x00,
.TotalReportDescriptors = 1,
.HIDReportType = HID_DTYPE_Report,
@@
-253,34
+253,19
@@
const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
-const USB_Descriptor_String_t PROGMEM LanguageString =
-{
- .Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
-
- .UnicodeString = {LANGUAGE_ID_ENG}
-};
+const USB_Descriptor_String_t PROGMEM LanguageString = USB_STRING_DESCRIPTOR_ARRAY(LANGUAGE_ID_ENG);
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
/** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable
* form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
-const USB_Descriptor_String_t PROGMEM ManufacturerString =
-{
- .Header = {.Size = USB_STRING_LEN(11), .Type = DTYPE_String},
-
- .UnicodeString = L"Dean Camera"
-};
+const USB_Descriptor_String_t PROGMEM ManufacturerString = USB_STRING_DESCRIPTOR(L"LUFA Library");
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
* and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
* and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
-const USB_Descriptor_String_t PROGMEM ProductString =
-{
- .Header = {.Size = USB_STRING_LEN(28), .Type = DTYPE_String},
-
- .UnicodeString = L"LUFA Mouse and Keyboard Demo"
-};
+const USB_Descriptor_String_t PROGMEM ProductString = USB_STRING_DESCRIPTOR(L"LUFA Mouse and Keyboard Demo");
/** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors"
* documentation) by the application code so that the address and size of a requested descriptor can be given
/** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors"
* documentation) by the application code so that the address and size of a requested descriptor can be given
@@
-289,7
+274,7
@@
const USB_Descriptor_String_t PROGMEM ProductString =
* USB host.
*/
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
* USB host.
*/
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
- const uint
8
_t wIndex,
+ const uint
16
_t wIndex,
const void** const DescriptorAddress)
{
const uint8_t DescriptorType = (wValue >> 8);
const void** const DescriptorAddress)
{
const uint8_t DescriptorType = (wValue >> 8);