From 0d95c64b47fd66bfd6ef4a9e618b30711c12182f Mon Sep 17 00:00:00 2001 From: Christian Starkjohann Date: Sat, 22 Aug 2009 10:27:24 +0000 Subject: - fixed bmAttributes in configuration descriptor --- usbdrv/Changelog.txt | 2 ++ usbdrv/usbdrv.c | 4 ++-- usbdrv/usbdrv.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/usbdrv/Changelog.txt b/usbdrv/Changelog.txt index 6e2397d..496a1c0 100644 --- a/usbdrv/Changelog.txt +++ b/usbdrv/Changelog.txt @@ -290,3 +290,5 @@ Scroll down to the bottom to see the most recent changes. receiver was out of sync. - Included option for faster CRC routine. Thanks to Slawomir Fras (BoskiDialer) for this code! + - Updated bits in Configuration Descriptor's bmAttributes according to + USB 1.1 (in particular bit 7, it is a must-be-set bit now). diff --git a/usbdrv/usbdrv.c b/usbdrv/usbdrv.c index cd2ce62..6eb7f22 100644 --- a/usbdrv/usbdrv.c +++ b/usbdrv/usbdrv.c @@ -149,9 +149,9 @@ PROGMEM char usbDescriptorConfiguration[] = { /* USB configuration descriptor 1, /* index of this configuration */ 0, /* configuration name string index */ #if USB_CFG_IS_SELF_POWERED - USBATTR_SELFPOWER, /* attributes */ + (1 << 7) | USBATTR_SELFPOWER, /* attributes */ #else - (char)USBATTR_BUSPOWER, /* attributes */ + (1 << 7), /* attributes */ #endif USB_CFG_MAX_BUS_POWER/2, /* max USB current in 2mA units */ /* interface descriptor follows inline: */ diff --git a/usbdrv/usbdrv.h b/usbdrv/usbdrv.h index ba1ad4b..5c520c8 100644 --- a/usbdrv/usbdrv.h +++ b/usbdrv/usbdrv.h @@ -718,7 +718,7 @@ typedef struct usbRequest{ #define USBDESCR_HID_REPORT 0x22 #define USBDESCR_HID_PHYS 0x23 -#define USBATTR_BUSPOWER 0x80 +//#define USBATTR_BUSPOWER 0x80 // USB 1.1 does not define this value any more #define USBATTR_SELFPOWER 0x40 #define USBATTR_REMOTEWAKE 0x20 -- cgit v1.2.3