Update pjrc lib to compile with modern avr-gcc
This commit is contained in:
parent
d831eb699b
commit
11db1e1a9f
22
pjrc/usb.c
22
pjrc/usb.c
|
@ -124,7 +124,7 @@ static const uint8_t PROGMEM endpoint_config_table[] = {
|
||||||
// spec and relevant portions of any USB class specifications!
|
// spec and relevant portions of any USB class specifications!
|
||||||
|
|
||||||
|
|
||||||
static uint8_t PROGMEM device_descriptor[] = {
|
const static uint8_t PROGMEM device_descriptor[] = {
|
||||||
18, // bLength
|
18, // bLength
|
||||||
1, // bDescriptorType
|
1, // bDescriptorType
|
||||||
0x00, 0x02, // bcdUSB
|
0x00, 0x02, // bcdUSB
|
||||||
|
@ -142,7 +142,7 @@ static uint8_t PROGMEM device_descriptor[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Keyboard Protocol 1, HID 1.11 spec, Appendix B, page 59-60
|
// Keyboard Protocol 1, HID 1.11 spec, Appendix B, page 59-60
|
||||||
static uint8_t PROGMEM keyboard_hid_report_desc[] = {
|
const static uint8_t PROGMEM keyboard_hid_report_desc[] = {
|
||||||
0x05, 0x01, // Usage Page (Generic Desktop),
|
0x05, 0x01, // Usage Page (Generic Desktop),
|
||||||
0x09, 0x06, // Usage (Keyboard),
|
0x09, 0x06, // Usage (Keyboard),
|
||||||
0xA1, 0x01, // Collection (Application),
|
0xA1, 0x01, // Collection (Application),
|
||||||
|
@ -177,7 +177,7 @@ static uint8_t PROGMEM keyboard_hid_report_desc[] = {
|
||||||
0xc0 // End Collection
|
0xc0 // End Collection
|
||||||
};
|
};
|
||||||
#ifdef USB_NKRO_ENABLE
|
#ifdef USB_NKRO_ENABLE
|
||||||
static uint8_t PROGMEM keyboard2_hid_report_desc[] = {
|
const static uint8_t PROGMEM keyboard2_hid_report_desc[] = {
|
||||||
0x05, 0x01, // Usage Page (Generic Desktop),
|
0x05, 0x01, // Usage Page (Generic Desktop),
|
||||||
0x09, 0x06, // Usage (Keyboard),
|
0x09, 0x06, // Usage (Keyboard),
|
||||||
0xA1, 0x01, // Collection (Application),
|
0xA1, 0x01, // Collection (Application),
|
||||||
|
@ -218,7 +218,7 @@ static uint8_t PROGMEM keyboard2_hid_report_desc[] = {
|
||||||
// http://www.microchip.com/forums/tm.aspx?high=&m=391435&mpage=1#391521
|
// http://www.microchip.com/forums/tm.aspx?high=&m=391435&mpage=1#391521
|
||||||
// http://www.keil.com/forum/15671/
|
// http://www.keil.com/forum/15671/
|
||||||
// http://www.microsoft.com/whdc/device/input/wheel.mspx
|
// http://www.microsoft.com/whdc/device/input/wheel.mspx
|
||||||
static uint8_t PROGMEM mouse_hid_report_desc[] = {
|
const static uint8_t PROGMEM mouse_hid_report_desc[] = {
|
||||||
/* mouse */
|
/* mouse */
|
||||||
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
|
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
|
||||||
0x09, 0x02, // USAGE (Mouse)
|
0x09, 0x02, // USAGE (Mouse)
|
||||||
|
@ -269,7 +269,7 @@ static uint8_t PROGMEM mouse_hid_report_desc[] = {
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static uint8_t PROGMEM debug_hid_report_desc[] = {
|
const static uint8_t PROGMEM debug_hid_report_desc[] = {
|
||||||
0x06, 0x31, 0xFF, // Usage Page 0xFF31 (vendor defined)
|
0x06, 0x31, 0xFF, // Usage Page 0xFF31 (vendor defined)
|
||||||
0x09, 0x74, // Usage 0x74
|
0x09, 0x74, // Usage 0x74
|
||||||
0xA1, 0x53, // Collection 0x53
|
0xA1, 0x53, // Collection 0x53
|
||||||
|
@ -285,7 +285,7 @@ static uint8_t PROGMEM debug_hid_report_desc[] = {
|
||||||
#ifdef USB_EXTRA_ENABLE
|
#ifdef USB_EXTRA_ENABLE
|
||||||
// audio controls & system controls
|
// audio controls & system controls
|
||||||
// http://www.microsoft.com/whdc/archive/w2kbd.mspx
|
// http://www.microsoft.com/whdc/archive/w2kbd.mspx
|
||||||
static uint8_t PROGMEM extra_hid_report_desc[] = {
|
const static uint8_t PROGMEM extra_hid_report_desc[] = {
|
||||||
/* system control */
|
/* system control */
|
||||||
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
|
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
|
||||||
0x09, 0x80, // USAGE (System Control)
|
0x09, 0x80, // USAGE (System Control)
|
||||||
|
@ -344,7 +344,7 @@ static uint8_t PROGMEM extra_hid_report_desc[] = {
|
||||||
|
|
||||||
#define NUM_INTERFACES (KBD2_HID_DESC_NUM + 1)
|
#define NUM_INTERFACES (KBD2_HID_DESC_NUM + 1)
|
||||||
#define CONFIG1_DESC_SIZE (9+(9+9+7)*NUM_INTERFACES)
|
#define CONFIG1_DESC_SIZE (9+(9+9+7)*NUM_INTERFACES)
|
||||||
static uint8_t PROGMEM config1_descriptor[CONFIG1_DESC_SIZE] = {
|
const static uint8_t PROGMEM config1_descriptor[CONFIG1_DESC_SIZE] = {
|
||||||
// configuration descriptor, USB spec 9.6.3, page 264-266, Table 9-10
|
// configuration descriptor, USB spec 9.6.3, page 264-266, Table 9-10
|
||||||
9, // bLength;
|
9, // bLength;
|
||||||
2, // bDescriptorType;
|
2, // bDescriptorType;
|
||||||
|
@ -511,17 +511,17 @@ struct usb_string_descriptor_struct {
|
||||||
uint8_t bDescriptorType;
|
uint8_t bDescriptorType;
|
||||||
int16_t wString[];
|
int16_t wString[];
|
||||||
};
|
};
|
||||||
static struct usb_string_descriptor_struct PROGMEM string0 = {
|
const static struct usb_string_descriptor_struct PROGMEM string0 = {
|
||||||
4,
|
4,
|
||||||
3,
|
3,
|
||||||
{0x0409}
|
{0x0409}
|
||||||
};
|
};
|
||||||
static struct usb_string_descriptor_struct PROGMEM string1 = {
|
const static struct usb_string_descriptor_struct PROGMEM string1 = {
|
||||||
sizeof(STR_MANUFACTURER),
|
sizeof(STR_MANUFACTURER),
|
||||||
3,
|
3,
|
||||||
STR_MANUFACTURER
|
STR_MANUFACTURER
|
||||||
};
|
};
|
||||||
static struct usb_string_descriptor_struct PROGMEM string2 = {
|
const static struct usb_string_descriptor_struct PROGMEM string2 = {
|
||||||
sizeof(STR_PRODUCT),
|
sizeof(STR_PRODUCT),
|
||||||
3,
|
3,
|
||||||
STR_PRODUCT
|
STR_PRODUCT
|
||||||
|
@ -534,7 +534,7 @@ static struct descriptor_list_struct {
|
||||||
uint16_t wIndex;
|
uint16_t wIndex;
|
||||||
const uint8_t *addr;
|
const uint8_t *addr;
|
||||||
uint8_t length;
|
uint8_t length;
|
||||||
} PROGMEM descriptor_list[] = {
|
} const PROGMEM descriptor_list[] = {
|
||||||
// DEVICE descriptor
|
// DEVICE descriptor
|
||||||
{0x0100, 0x0000, device_descriptor, sizeof(device_descriptor)},
|
{0x0100, 0x0000, device_descriptor, sizeof(device_descriptor)},
|
||||||
// CONFIGURATION descriptor
|
// CONFIGURATION descriptor
|
||||||
|
|
Loading…
Reference in New Issue