From c9ac6aac733c0f96b9d8723157fd740f8d724d98 Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Wed, 5 Jun 2013 10:31:08 +0100 Subject: [PATCH] BMAX_POWER can now be defined --- module_usb_audio/devicedefines.h | 12 ++++++++++-- module_usb_audio/endpoint0/descriptors_2.h | 9 +++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/module_usb_audio/devicedefines.h b/module_usb_audio/devicedefines.h index a88bcdf5..ae54f71e 100644 --- a/module_usb_audio/devicedefines.h +++ b/module_usb_audio/devicedefines.h @@ -186,8 +186,8 @@ /* Device release number in BCD: 0xJJMNi */ #ifndef BCD_DEVICE -#define BCD_DEVICE (0x0610) -#warning BCD_DEVICE not defined. Using 0x0610 +#define BCD_DEVICE (0x0620) +#warning BCD_DEVICE not defined. Using 0x0620 #endif /* Addition interfaces based on defines */ @@ -290,6 +290,14 @@ #define MAX_VOL (0x20000000) +#ifdef SELF_POWERED +#define BMAX_POWER 0 +#else +#ifndef BMAX_POWER +#define BMAX_POWER 250 +#endif +#endif + /* Length of clock unit/clock-selector units */ #if defined(SPDIF_RX) && defined(ADAT_RX) diff --git a/module_usb_audio/endpoint0/descriptors_2.h b/module_usb_audio/endpoint0/descriptors_2.h index b3da7df7..d974a35b 100644 --- a/module_usb_audio/endpoint0/descriptors_2.h +++ b/module_usb_audio/endpoint0/descriptors_2.h @@ -307,11 +307,10 @@ unsigned char cfgDesc_Audio2[] = 0x00, /* 6 iConfiguration */ #ifdef SELF_POWERED 192, /* 7 bmAttributes */ - 0, /* 8 bMaxPower */ #else 128, /* 7 bmAttributes */ - 250, /* 8 bMaxPower */ #endif + BMAX_POWER, /* 8 bMaxPower */ /* Interface Association Descriptor */ 0x08, /* 0 bLength */ @@ -1543,11 +1542,10 @@ unsigned char cfgDesc_Null[] = 0x00, /* 6 iConfiguration */ #ifdef SELF_POWERED 192, /* 7 bmAttributes */ - 0, /* 8 bMaxPower */ #else 128, - 250, /* 8 bMaxPower */ #endif + BMAX_POWER, /* 8 bMaxPower */ 0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */ 0x04, /* 1 bDescriptorType : INTERFACE descriptor. (field size 1 bytes) */ @@ -1608,11 +1606,10 @@ unsigned char cfgDesc_Audio1[] = 0x00, /* Unused */ #ifdef SELF_POWERED 192, /* 7 bmAttributes */ - 0, /* 8 bMaxPower */ #else 128, /* 7 bmAttributes */ - 250, /* 8 bMaxPower */ #endif + BMAX_POWER, /* 8 bMaxPower */ /* Standard AC interface descriptor */ 0x09,