|
From: polly <li...@bi...> - 2007-01-03 17:08:29
|
Hello,
This just doesn't seem right, the first two byte fields seem
to me to be wrongly swapped as is the two bytes are part of a
little endian word .. could anyone help me understand please ? Tks
snip.........
typedef unsigned char byte;
typedef unsigned int word;
typedef struct _USB_DEV_DSC
{
byte bLength; byte bDscType; word bcdUSB;
byte bDevCls; byte bDevSubCls; byte bDevProtocol;
byte bMaxPktSize0; word idVendor; word idProduct;
word bcdDevice; byte iMFR; byte iProduct;
byte iSerialNum; byte bNumCfg;
} USB_DEV_DSC;
#define ROMADVDSC 0x02000
#define DSC_DEV 0x98
#define CDC_DEVICE 0x76
#define EP0_BUFF_SIZE 0x54
const USB_DEV_DSC at ROMADVDSC device_dsc =
/* Device Descriptor */
{
sizeof(USB_DEV_DSC), // Size of this descriptor in bytes
DSC_DEV, // DEVICE descriptor type
0x0200, // USB Spec Release Number in BCD format
CDC_DEVICE, // Class Code
0x00, // Subclass code
0x00, // Protocol code
EP0_BUFF_SIZE, // Max packet size for EP0, see usbcfg.h
0x04D8, // Vendor ID
0x000A, // Product ID: CDC RS-232 Emulation Demo
0x0000, // Device release number in BCD format
0x01, // Manufacturer string index
0x02, // Product string index
0x00, // Device serial number string index
0x01 // Number of possible configurations
};
void main() {
while(1) {};
}
....
results in:
...
00028 ; ; Starting pCode block for absolute Ival
00029 S_ddscaddx__device_dsc code 0X002000
2000 00030 _device_dsc:
2000 9812 0200 00031 DB 0x12, 0x98, 0x00, 0x02, 0x76, 0x00,
0x00, 0x54, 0xd8, 0x04, 0x0a, 0x00
2004 0076 5400
2008 04D8 000A
200C 0000 0201 00032 DB 0x00, 0x00, 0x01, 0x02, 0x00, 0x01
2010 0100
...
--
<=>
|