From b04518168eb1fb7c1a777edcf3fc23ad1f362dea Mon Sep 17 00:00:00 2001 From: Aaron Mueller Date: Tue, 13 May 2014 22:20:30 +0200 Subject: [PATCH] Update the usbdrv lib --- firmware/usbdrv/Changelog.txt | 21 ++++++++ firmware/usbdrv/CommercialLicense.txt | 10 ++-- firmware/usbdrv/USB-ID-FAQ.txt | 6 +-- firmware/usbdrv/USB-IDs-for-free.txt | 16 ++++-- firmware/usbdrv/asmcommon.inc | 1 - firmware/usbdrv/oddebug.c | 1 - firmware/usbdrv/oddebug.h | 1 - firmware/usbdrv/usbconfig-prototype.h | 10 +++- firmware/usbdrv/usbdrv.c | 75 ++++++++++++++++---------- firmware/usbdrv/usbdrv.h | 77 ++++++++++----------------- firmware/usbdrv/usbdrvasm.S | 5 -- firmware/usbdrv/usbdrvasm.asm | 1 - firmware/usbdrv/usbdrvasm12.inc | 1 - firmware/usbdrv/usbdrvasm128.inc | 1 - firmware/usbdrv/usbdrvasm15.inc | 1 - firmware/usbdrv/usbdrvasm16.inc | 1 - firmware/usbdrv/usbdrvasm165.inc | 1 - firmware/usbdrv/usbdrvasm18-crc.inc | 1 - firmware/usbdrv/usbdrvasm20.inc | 1 - firmware/usbdrv/usbportability.h | 1 - 20 files changed, 126 insertions(+), 106 deletions(-) diff --git a/firmware/usbdrv/Changelog.txt b/firmware/usbdrv/Changelog.txt index 5c6354a..79b5215 100644 --- a/firmware/usbdrv/Changelog.txt +++ b/firmware/usbdrv/Changelog.txt @@ -306,3 +306,24 @@ Scroll down to the bottom to see the most recent changes. endpoint now. * Release 2010-07-15 + + - Fixed bug in usbDriverSetup() which prevented descriptor sizes above 255 + bytes. + - Avoid a compiler warning for unused parameter in usbHandleResetHook() when + compiler option -Wextra is enabled. + - Fixed wrong hex value for some IDs in USB-IDs-for-free.txt. + - Keep a define for USBATTR_BUSPOWER, although the flag does not exist + in USB 1.1 any more. Set it to 0. This is for backward compatibility. + +* Release 2012-01-09 + + - Define a separate (defined) type for usbMsgPtr so that projects using a + tiny memory model can define it to an 8 bit type in usbconfig.h. This + change also saves a couple of bytes when using a scalar 16 bit type. + - Inserted "const" keyword for all PROGMEM declarations because new GCC + requires it. + - Fixed problem with dependence of usbportability.h on usbconfig.h. This + problem occurred with IAR CC only. + - Prepared repository for github.com. + +* Release 2012-12-06 \ No newline at end of file diff --git a/firmware/usbdrv/CommercialLicense.txt b/firmware/usbdrv/CommercialLicense.txt index 11d07d9..de1a2b0 100644 --- a/firmware/usbdrv/CommercialLicense.txt +++ b/firmware/usbdrv/CommercialLicense.txt @@ -1,5 +1,5 @@ V-USB Driver Software License Agreement -Version 2009-08-03 +Version 2012-07-09 THIS LICENSE AGREEMENT GRANTS YOU CERTAIN RIGHTS IN A SOFTWARE. YOU CAN ENTER INTO THIS AGREEMENT AND ACQUIRE THE RIGHTS OUTLINED BELOW BY PAYING @@ -37,10 +37,10 @@ Product ID(s), sent to you in e-mail. These Product IDs are reserved exclusively for you. OBJECTIVE DEVELOPMENT has obtained USB Product ID ranges under the Vendor ID 5824 from Wouter van Ooijen (Van Ooijen Technische Informatica, www.voti.nl) and under the Vendor ID 8352 from -Jason Kotzin (Clay Logic, www.claylogic.com). Both owners of the Vendor IDs -have obtained these IDs from the USB Implementers Forum, Inc. -(www.usb.org). OBJECTIVE DEVELOPMENT disclaims all liability which might -arise from the assignment of USB IDs. +Jason Kotzin (now flirc.tv, Inc.). Both owners of the Vendor IDs have +obtained these IDs from the USB Implementers Forum, Inc. (www.usb.org). +OBJECTIVE DEVELOPMENT disclaims all liability which might arise from the +assignment of USB IDs. 2.5 USB Certification. Although not part of this agreement, we want to make it clear that you cannot become USB certified when you use V-USB or a USB diff --git a/firmware/usbdrv/USB-ID-FAQ.txt b/firmware/usbdrv/USB-ID-FAQ.txt index d1de8fb..a4a6bd6 100644 --- a/firmware/usbdrv/USB-ID-FAQ.txt +++ b/firmware/usbdrv/USB-ID-FAQ.txt @@ -1,4 +1,4 @@ -Version 2009-08-22 +Version 2012-07-09 ========================== WHY DO WE NEED THESE IDs? @@ -107,8 +107,8 @@ WHO IS THE OWNER OF THE VENDOR-ID? Objective Development has obtained ranges of USB Product-IDs under two Vendor-IDs: Under Vendor-ID 5824 from Wouter van Ooijen (Van Ooijen Technische Informatica, www.voti.nl) and under Vendor-ID 8352 from Jason -Kotzin (Clay Logic, www.claylogic.com). Both VID owners have received their -Vendor-ID directly from usb.org. +Kotzin (now flirc.tv, Inc.). Both VID owners have received their Vendor-ID +directly from usb.org. ========================================================================= diff --git a/firmware/usbdrv/USB-IDs-for-free.txt b/firmware/usbdrv/USB-IDs-for-free.txt index 2f4d59a..d46517d 100644 --- a/firmware/usbdrv/USB-IDs-for-free.txt +++ b/firmware/usbdrv/USB-IDs-for-free.txt @@ -86,8 +86,9 @@ If you use one of the IDs listed below, your device and host-side software must conform to these rules: (1) The USB device MUST provide a textual representation of the serial -number. The serial number string MUST be available at least in USB language -0x0409 (English/US). +number, unless ONLY the operating system's default class driver is used. +The serial number string MUST be available at least in USB language 0x0409 +(English/US). (2) The serial number MUST start with either an Internet domain name (e.g. "mycompany.com") registered and owned by you, or an e-mail address under your @@ -108,6 +109,11 @@ driver for Vendor Class devices is needed, this driver must be libusb or libusb-win32 (see http://libusb.org/ and http://libusb-win32.sourceforge.net/). +(7) If ONLY the operating system's default class driver is used, e.g. for +mice, keyboards, joysticks, CDC or MIDI devices and no discrimination by an +application is needed, the serial number may be omitted. + + Table if IDs for discrimination by serial number string: PID dec (hex) | VID dec (hex) | Description of use @@ -121,11 +127,11 @@ PID dec (hex) | VID dec (hex) | Description of use ---------------+---------------+------------------------------------------- 10203 (0x27db) | 5824 (0x16c0) | For USB Keyboards ---------------+---------------+------------------------------------------- -10204 (0x27db) | 5824 (0x16c0) | For USB Joysticks +10204 (0x27dc) | 5824 (0x16c0) | For USB Joysticks ---------------+---------------+------------------------------------------- -10205 (0x27dc) | 5824 (0x16c0) | For CDC-ACM class devices (modems) +10205 (0x27dd) | 5824 (0x16c0) | For CDC-ACM class devices (modems) ---------------+---------------+------------------------------------------- -10206 (0x27dd) | 5824 (0x16c0) | For MIDI class devices +10206 (0x27de) | 5824 (0x16c0) | For MIDI class devices ---------------+---------------+------------------------------------------- diff --git a/firmware/usbdrv/asmcommon.inc b/firmware/usbdrv/asmcommon.inc index 07d692b..d2a4f7c 100644 --- a/firmware/usbdrv/asmcommon.inc +++ b/firmware/usbdrv/asmcommon.inc @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id$ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/oddebug.c b/firmware/usbdrv/oddebug.c index 945457c..19bf142 100644 --- a/firmware/usbdrv/oddebug.c +++ b/firmware/usbdrv/oddebug.c @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: oddebug.c 692 2008-11-07 15:07:40Z cs $ */ #include "oddebug.h" diff --git a/firmware/usbdrv/oddebug.h b/firmware/usbdrv/oddebug.h index d61309d..851f84d 100644 --- a/firmware/usbdrv/oddebug.h +++ b/firmware/usbdrv/oddebug.h @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: oddebug.h 692 2008-11-07 15:07:40Z cs $ */ #ifndef __oddebug_h_included__ diff --git a/firmware/usbdrv/usbconfig-prototype.h b/firmware/usbdrv/usbconfig-prototype.h index 847710e..93721c2 100644 --- a/firmware/usbdrv/usbconfig-prototype.h +++ b/firmware/usbdrv/usbconfig-prototype.h @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ */ #ifndef __usbconfig_h_included__ @@ -356,6 +355,15 @@ section at the end of this file). #define USB_CFG_DESCR_PROPS_HID_REPORT 0 #define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + /* ----------------------- Optional MCU Description ------------------------ */ /* The following configurations have working defaults in usbdrv.h. You diff --git a/firmware/usbdrv/usbdrv.c b/firmware/usbdrv/usbdrv.c index f109a12..d838935 100644 --- a/firmware/usbdrv/usbdrv.c +++ b/firmware/usbdrv/usbdrv.c @@ -5,10 +5,8 @@ * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrv.c 791 2010-07-15 15:56:13Z cs $ */ -#include "usbportability.h" #include "usbdrv.h" #include "oddebug.h" @@ -45,14 +43,9 @@ uchar usbCurrentDataToken;/* when we check data toggling to ignore duplica #endif /* USB status registers / not shared with asm code */ -uchar *usbMsgPtr; /* data to transmit next -- ROM or RAM address */ - +usbMsgPtr_t usbMsgPtr; /* data to transmit next -- ROM or RAM address */ static usbMsgLen_t usbMsgLen = USB_NO_MSG; /* remaining number of bytes */ -#ifdef USB_CFG_USE_GPIOR -# define usbMsgFlags (*((uchar*)&GPIOR0)) -#else static uchar usbMsgFlags; /* flag values see below */ -#endif #define USB_FLG_MSGPTR_IS_ROM (1<<6) #define USB_FLG_USE_USER_RW (1<<7) @@ -72,7 +65,7 @@ optimizing hints: #if USB_CFG_DESCR_PROPS_STRING_0 == 0 #undef USB_CFG_DESCR_PROPS_STRING_0 #define USB_CFG_DESCR_PROPS_STRING_0 sizeof(usbDescriptorString0) -PROGMEM char usbDescriptorString0[] = { /* language descriptor */ +PROGMEM const char usbDescriptorString0[] = { /* language descriptor */ 4, /* sizeof(usbDescriptorString0): length of descriptor in bytes */ 3, /* descriptor type */ 0x09, 0x04, /* language index (0x0409 = US-English) */ @@ -82,7 +75,7 @@ PROGMEM char usbDescriptorString0[] = { /* language descriptor */ #if USB_CFG_DESCR_PROPS_STRING_VENDOR == 0 && USB_CFG_VENDOR_NAME_LEN #undef USB_CFG_DESCR_PROPS_STRING_VENDOR #define USB_CFG_DESCR_PROPS_STRING_VENDOR sizeof(usbDescriptorStringVendor) -PROGMEM int usbDescriptorStringVendor[] = { +PROGMEM const int usbDescriptorStringVendor[] = { USB_STRING_DESCRIPTOR_HEADER(USB_CFG_VENDOR_NAME_LEN), USB_CFG_VENDOR_NAME }; @@ -91,7 +84,7 @@ PROGMEM int usbDescriptorStringVendor[] = { #if USB_CFG_DESCR_PROPS_STRING_PRODUCT == 0 && USB_CFG_DEVICE_NAME_LEN #undef USB_CFG_DESCR_PROPS_STRING_PRODUCT #define USB_CFG_DESCR_PROPS_STRING_PRODUCT sizeof(usbDescriptorStringDevice) -PROGMEM int usbDescriptorStringDevice[] = { +PROGMEM const int usbDescriptorStringDevice[] = { USB_STRING_DESCRIPTOR_HEADER(USB_CFG_DEVICE_NAME_LEN), USB_CFG_DEVICE_NAME }; @@ -100,7 +93,7 @@ PROGMEM int usbDescriptorStringDevice[] = { #if USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER == 0 && USB_CFG_SERIAL_NUMBER_LEN #undef USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER #define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER sizeof(usbDescriptorStringSerialNumber) -PROGMEM int usbDescriptorStringSerialNumber[] = { +PROGMEM const int usbDescriptorStringSerialNumber[] = { USB_STRING_DESCRIPTOR_HEADER(USB_CFG_SERIAL_NUMBER_LEN), USB_CFG_SERIAL_NUMBER }; @@ -113,7 +106,7 @@ PROGMEM int usbDescriptorStringSerialNumber[] = { #if USB_CFG_DESCR_PROPS_DEVICE == 0 #undef USB_CFG_DESCR_PROPS_DEVICE #define USB_CFG_DESCR_PROPS_DEVICE sizeof(usbDescriptorDevice) -PROGMEM char usbDescriptorDevice[] = { /* USB device descriptor */ +PROGMEM const char usbDescriptorDevice[] = { /* USB device descriptor */ 18, /* sizeof(usbDescriptorDevice): length of descriptor in bytes */ USBDESCR_DEVICE, /* descriptor type */ 0x10, 0x01, /* USB version supported */ @@ -144,7 +137,7 @@ PROGMEM char usbDescriptorDevice[] = { /* USB device descriptor */ #if USB_CFG_DESCR_PROPS_CONFIGURATION == 0 #undef USB_CFG_DESCR_PROPS_CONFIGURATION #define USB_CFG_DESCR_PROPS_CONFIGURATION sizeof(usbDescriptorConfiguration) -PROGMEM char usbDescriptorConfiguration[] = { /* USB configuration descriptor */ +PROGMEM const char usbDescriptorConfiguration[] = { /* USB configuration descriptor */ 9, /* sizeof(usbDescriptorConfiguration): length of descriptor in bytes */ USBDESCR_CONFIG, /* descriptor type */ 18 + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT3 + @@ -199,6 +192,16 @@ PROGMEM char usbDescriptorConfiguration[] = { /* USB configuration descriptor /* ------------------------------------------------------------------------- */ +static inline void usbResetDataToggling(void) +{ +#if USB_CFG_HAVE_INTRIN_ENDPOINT && !USB_CFG_SUPPRESS_INTR_CODE + USB_SET_DATATOKEN1(USB_INITIAL_DATATOKEN); /* reset data toggling for interrupt endpoint */ +# if USB_CFG_HAVE_INTRIN_ENDPOINT3 + USB_SET_DATATOKEN3(USB_INITIAL_DATATOKEN); /* reset data toggling for interrupt endpoint */ +# endif +#endif +} + static inline void usbResetStall(void) { #if USB_CFG_IMPLEMENT_HALT && USB_CFG_HAVE_INTRIN_ENDPOINT @@ -296,7 +299,7 @@ USB_PUBLIC void usbSetInterrupt3(uchar *data, uchar len) len = usbFunctionDescriptor(rq); \ }else{ \ len = USB_PROP_LENGTH(cfgProp); \ - usbMsgPtr = (uchar *)(staticName); \ + usbMsgPtr = (usbMsgPtr_t)(staticName); \ } \ } @@ -356,7 +359,8 @@ uchar flags = USB_FLG_MSGPTR_IS_ROM; */ static inline usbMsgLen_t usbDriverSetup(usbRequest_t *rq) { -uchar len = 0, *dataPtr = usbTxBuf + 9; /* there are 2 bytes free space at the end of the buffer */ +usbMsgLen_t len = 0; +uchar *dataPtr = usbTxBuf + 9; /* there are 2 bytes free space at the end of the buffer */ uchar value = rq->wValue.bytes[0]; #if USB_CFG_IMPLEMENT_HALT uchar index = rq->wIndex.bytes[0]; @@ -403,7 +407,7 @@ uchar index = rq->wIndex.bytes[0]; SWITCH_DEFAULT /* 7=SET_DESCRIPTOR, 12=SYNC_FRAME */ /* Should we add an optional hook here? */ SWITCH_END - usbMsgPtr = dataPtr; + usbMsgPtr = (usbMsgPtr_t)dataPtr; skipMsgPtrAssignment: return len; } @@ -493,7 +497,8 @@ static uchar usbDeviceRead(uchar *data, uchar len) }else #endif { - uchar i = len, *r = usbMsgPtr; + uchar i = len; + usbMsgPtr_t r = usbMsgPtr; if(usbMsgFlags & USB_FLG_MSGPTR_IS_ROM){ /* ROM data */ do{ uchar c = USB_READ_FLASH(r); /* assign to char size variable to enforce byte ops */ @@ -502,7 +507,8 @@ static uchar usbDeviceRead(uchar *data, uchar len) }while(--i); }else{ /* RAM data */ do{ - *data++ = *r++; + *data++ = *((uchar *)r); + r++; }while(--i); } usbMsgPtr = r; @@ -542,9 +548,9 @@ uchar len; /* ------------------------------------------------------------------------- */ -#ifdef USB_RESET_HOOK static inline void usbHandleResetHook(uchar notResetState) { +#ifdef USB_RESET_HOOK static uchar wasReset; uchar isReset = !notResetState; @@ -552,8 +558,10 @@ uchar isReset = !notResetState; USB_RESET_HOOK(isReset); wasReset = isReset; } -} +#else + notResetState = notResetState; // avoid compiler warning #endif +} /* ------------------------------------------------------------------------- */ @@ -586,22 +594,35 @@ uchar i; for(i = 20; i > 0; i--){ uchar usbLineStatus = USBIN & USBMASK; if(usbLineStatus != 0) /* SE0 has ended */ -#ifdef USB_RESET_HOOK goto isNotReset; -#else - return; -#endif } /* RESET condition, called multiple times during reset */ usbNewDeviceAddr = 0; usbDeviceAddr = 0; usbResetStall(); DBG1(0xff, 0, 0); -#ifdef USB_RESET_HOOK isNotReset: usbHandleResetHook(i); -#endif } /* ------------------------------------------------------------------------- */ +USB_PUBLIC void usbInit(void) +{ +#if USB_INTR_CFG_SET != 0 + USB_INTR_CFG |= USB_INTR_CFG_SET; +#endif +#if USB_INTR_CFG_CLR != 0 + USB_INTR_CFG &= ~(USB_INTR_CFG_CLR); +#endif + USB_INTR_ENABLE |= (1 << USB_INTR_ENABLE_BIT); + usbResetDataToggling(); +#if USB_CFG_HAVE_INTRIN_ENDPOINT && !USB_CFG_SUPPRESS_INTR_CODE + usbTxLen1 = USBPID_NAK; +#if USB_CFG_HAVE_INTRIN_ENDPOINT3 + usbTxLen3 = USBPID_NAK; +#endif +#endif +} + +/* ------------------------------------------------------------------------- */ diff --git a/firmware/usbdrv/usbdrv.h b/firmware/usbdrv/usbdrv.h index 79318b4..3fe84d5 100644 --- a/firmware/usbdrv/usbdrv.h +++ b/firmware/usbdrv/usbdrv.h @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrv.h 793 2010-07-15 15:58:11Z cs $ */ #ifndef __usbdrv_h_included__ @@ -122,7 +121,7 @@ USB messages, even if they address another (low-speed) device on the same bus. /* --------------------------- Module Interface ---------------------------- */ /* ------------------------------------------------------------------------- */ -#define USBDRV_VERSION 20100715 +#define USBDRV_VERSION 20121206 /* This define uniquely identifies a driver version. It is a decimal number * constructed from the driver's release date in the form YYYYMMDD. If the * driver's behavior or interface changes, you can use this constant to @@ -163,8 +162,25 @@ USB messages, even if they address another (low-speed) device on the same bus. */ #define USB_NO_MSG ((usbMsgLen_t)-1) /* constant meaning "no message" */ +#ifndef usbMsgPtr_t +#define usbMsgPtr_t uchar * +#endif +/* Making usbMsgPtr_t a define allows the user of this library to define it to + * an 8 bit type on tiny devices. This reduces code size, especially if the + * compiler supports a tiny memory model. + * The type can be a pointer or scalar type, casts are made where necessary. + * Although it's paradoxical, Gcc 4 generates slightly better code for scalar + * types than for pointers. + */ + struct usbRequest; /* forward declaration */ +USB_PUBLIC void usbInit(void); +/* This function must be called before interrupts are enabled and the main + * loop is entered. We exepct that the PORT and DDR bits for D+ and D- have + * not been changed from their default status (which is 0). If you have changed + * them, set both back to 0 (configure them as input with no internal pull-up). + */ USB_PUBLIC void usbPoll(void); /* This function must be called at regular intervals from the main loop. * Maximum delay between calls is somewhat less than 50ms (USB timeout for @@ -172,7 +188,7 @@ USB_PUBLIC void usbPoll(void); * Please note that debug outputs through the UART take ~ 0.5ms per byte * at 19200 bps. */ -extern uchar *usbMsgPtr; +extern usbMsgPtr_t usbMsgPtr; /* This variable may be used to pass transmit data to the driver from the * implementation of usbFunctionWrite(). It is also used internally by the * driver for standard control requests. @@ -384,13 +400,13 @@ extern volatile schar usbRxLen; * about the various methods to define USB descriptors. If you do nothing, * the default descriptors will be used. */ -#define USB_PROP_IS_DYNAMIC (1 << 14) +#define USB_PROP_IS_DYNAMIC (1u << 14) /* If this property is set for a descriptor, usbFunctionDescriptor() will be * used to obtain the particular descriptor. Data directly returned via * usbMsgPtr are FLASH data by default, combine (OR) with USB_PROP_IS_RAM to * return RAM data. */ -#define USB_PROP_IS_RAM (1 << 15) +#define USB_PROP_IS_RAM (1u << 15) /* If this property is set for a descriptor, the data is read from RAM * memory instead of Flash. The property is used for all methods to provide * external descriptors. @@ -444,43 +460,43 @@ extern volatile schar usbRxLen; #ifndef __ASSEMBLER__ extern #if !(USB_CFG_DESCR_PROPS_DEVICE & USB_PROP_IS_RAM) -PROGMEM +PROGMEM const #endif char usbDescriptorDevice[]; extern #if !(USB_CFG_DESCR_PROPS_CONFIGURATION & USB_PROP_IS_RAM) -PROGMEM +PROGMEM const #endif char usbDescriptorConfiguration[]; extern #if !(USB_CFG_DESCR_PROPS_HID_REPORT & USB_PROP_IS_RAM) -PROGMEM +PROGMEM const #endif char usbDescriptorHidReport[]; extern #if !(USB_CFG_DESCR_PROPS_STRING_0 & USB_PROP_IS_RAM) -PROGMEM +PROGMEM const #endif char usbDescriptorString0[]; extern #if !(USB_CFG_DESCR_PROPS_STRING_VENDOR & USB_PROP_IS_RAM) -PROGMEM +PROGMEM const #endif int usbDescriptorStringVendor[]; extern #if !(USB_CFG_DESCR_PROPS_STRING_PRODUCT & USB_PROP_IS_RAM) -PROGMEM +PROGMEM const #endif int usbDescriptorStringDevice[]; extern #if !(USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER & USB_PROP_IS_RAM) -PROGMEM +PROGMEM const #endif int usbDescriptorStringSerialNumber[]; @@ -713,6 +729,7 @@ typedef struct usbRequest{ #define USBDESCR_HID_PHYS 0x23 //#define USBATTR_BUSPOWER 0x80 // USB 1.1 does not define this value any more +#define USBATTR_BUSPOWER 0 #define USBATTR_SELFPOWER 0x40 #define USBATTR_REMOTEWAKE 0x20 @@ -726,40 +743,4 @@ typedef struct usbRequest{ /* ------------------------------------------------------------------------- */ -#ifndef __ASSEMBLER__ - -static inline void usbResetDataToggling(void) -{ -#if USB_CFG_HAVE_INTRIN_ENDPOINT && !USB_CFG_SUPPRESS_INTR_CODE - USB_SET_DATATOKEN1(USB_INITIAL_DATATOKEN); /* reset data toggling for interrupt endpoint */ -# if USB_CFG_HAVE_INTRIN_ENDPOINT3 - USB_SET_DATATOKEN3(USB_INITIAL_DATATOKEN); /* reset data toggling for interrupt endpoint */ -# endif -#endif -} - -static inline void usbInit(void) -{ -#if USB_INTR_CFG_SET != 0 - USB_INTR_CFG |= USB_INTR_CFG_SET; -#endif -#if USB_INTR_CFG_CLR != 0 - USB_INTR_CFG &= ~(USB_INTR_CFG_CLR); -#endif - USB_INTR_ENABLE |= (1 << USB_INTR_ENABLE_BIT); - usbResetDataToggling(); -#if USB_CFG_HAVE_INTRIN_ENDPOINT && !USB_CFG_SUPPRESS_INTR_CODE - usbTxLen1 = USBPID_NAK; -#if USB_CFG_HAVE_INTRIN_ENDPOINT3 - usbTxLen3 = USBPID_NAK; -#endif -#endif -} -/* This function must be called before interrupts are enabled and the main - * loop is entered. We exepct that the PORT and DDR bits for D+ and D- have - * not been changed from their default status (which is 0). If you have changed - * them, set both back to 0 (configure them as input with no internal pull-up). - */ -#endif /* __ASSEMBLER */ - #endif /* __usbdrv_h_included__ */ diff --git a/firmware/usbdrv/usbdrvasm.S b/firmware/usbdrv/usbdrvasm.S index 57d7334..32ce8ef 100644 --- a/firmware/usbdrv/usbdrvasm.S +++ b/firmware/usbdrv/usbdrvasm.S @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm.S 785 2010-05-30 17:57:07Z cs $ */ /* @@ -368,10 +367,6 @@ usbMFTimeout: # endif #endif -/* place the interrupt routine in .vectors, after the jump to __init. - Warning: This depends on correct linking order. Link crt0 before usbdrasm! */ -.section .vectors - #if USB_CFG_CHECK_CRC /* separate dispatcher for CRC type modules */ # if USB_CFG_CLOCK_KHZ == 18000 # include "usbdrvasm18-crc.inc" diff --git a/firmware/usbdrv/usbdrvasm.asm b/firmware/usbdrv/usbdrvasm.asm index 9cc4e4d..fb66934 100644 --- a/firmware/usbdrv/usbdrvasm.asm +++ b/firmware/usbdrv/usbdrvasm.asm @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id$ */ /* diff --git a/firmware/usbdrv/usbdrvasm12.inc b/firmware/usbdrv/usbdrvasm12.inc index c116758..d3bd056 100644 --- a/firmware/usbdrv/usbdrvasm12.inc +++ b/firmware/usbdrv/usbdrvasm12.inc @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrvasm12.inc 740 2009-04-13 18:23:31Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm128.inc b/firmware/usbdrv/usbdrvasm128.inc index bcd6621..8f67bcc 100644 --- a/firmware/usbdrv/usbdrvasm128.inc +++ b/firmware/usbdrv/usbdrvasm128.inc @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbdrvasm128.inc 758 2009-08-06 10:12:54Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm15.inc b/firmware/usbdrv/usbdrvasm15.inc index 401b7f8..33bcf0e 100644 --- a/firmware/usbdrv/usbdrvasm15.inc +++ b/firmware/usbdrv/usbdrvasm15.inc @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm15.inc 740 2009-04-13 18:23:31Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm16.inc b/firmware/usbdrv/usbdrvasm16.inc index 207b6e4..25b84e6 100644 --- a/firmware/usbdrv/usbdrvasm16.inc +++ b/firmware/usbdrv/usbdrvasm16.inc @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm16.inc 760 2009-08-09 18:59:43Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm165.inc b/firmware/usbdrv/usbdrvasm165.inc index 79b3c61..ae91588 100644 --- a/firmware/usbdrv/usbdrvasm165.inc +++ b/firmware/usbdrv/usbdrvasm165.inc @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2007 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm165.inc 740 2009-04-13 18:23:31Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm18-crc.inc b/firmware/usbdrv/usbdrvasm18-crc.inc index f83347d..0ff2f42 100644 --- a/firmware/usbdrv/usbdrvasm18-crc.inc +++ b/firmware/usbdrv/usbdrvasm18-crc.inc @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2008 by Lukas Schrittwieser and OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm18-crc.inc 740 2009-04-13 18:23:31Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbdrvasm20.inc b/firmware/usbdrv/usbdrvasm20.inc index 303abaf..5027edd 100644 --- a/firmware/usbdrv/usbdrvasm20.inc +++ b/firmware/usbdrv/usbdrvasm20.inc @@ -6,7 +6,6 @@ * Tabsize: 4 * Copyright: (c) 2008 by Jeroen Benschop and OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * Revision: $Id: usbdrvasm20.inc 740 2009-04-13 18:23:31Z cs $ */ /* Do not link this file! Link usbdrvasm.S instead, which includes the diff --git a/firmware/usbdrv/usbportability.h b/firmware/usbdrv/usbportability.h index 476184d..0a861d0 100644 --- a/firmware/usbdrv/usbportability.h +++ b/firmware/usbdrv/usbportability.h @@ -5,7 +5,6 @@ * Tabsize: 4 * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbportability.h 785 2010-05-30 17:57:07Z cs $ */ /*