Merge pull request #118 from larry-xmos/feature/dfu_detach_time_out

Expose DFU detach timeout value
This commit is contained in:
oscarbailey-xmos
2020-01-30 16:53:16 +00:00
committed by GitHub
2 changed files with 11 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2011-2019, XMOS Ltd, All rights reserved
// Copyright (c) 2011-2020, XMOS Ltd, All rights reserved
/*
* @brief Defines relating to device configuration and customisation of lib_xua
* @author Ross Owen, XMOS Limited
@@ -1445,6 +1445,12 @@ enum USBEndpointNumber_Out
#error Bad DEFAULT_MCLK_FREQ
#endif
/* DFU functional descriptor wDetachTimeOut field (milliseconds)
* Time for device to wait for bus reset after DETACH request before reverting to idle state */
#ifndef DFU_DETACH_TIME_OUT
#define DFU_DETACH_TIME_OUT 250
#endif
#if ((MCLK_441 % MIN_FREQ) == 0)
#define MIN_FREQ_44 MIN_FREQ
#define MIN_FREQ_48 ((48000 * 512)/((44100 * 512)/MIN_FREQ))
@@ -1466,4 +1472,3 @@ enum USBEndpointNumber_Out
#if (CODEC_MASTER == 1) && (DSD_CHANS_DAC != 0)
#error CODEC_MASTER with DSD is currently unsupported
#endif

View File

@@ -2068,8 +2068,8 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
0x09, /* 0 Size */
0x21, /* 1 bDescriptorType : DFU FUNCTIONAL */
0x07, /* 2 bmAttributes */
0xFA, /* 3 wDetachTimeOut */
0x00, /* 4 wDetachTimeOut */
DFU_DETACH_TIME_OUT & 0xFF, /* 3 wDetachTimeOut */
(DFU_DETACH_TIME_OUT >> 8) & 0xFF, /* 4 wDetachTimeOut */
0x40, /* 5 wTransferSize */
0x00, /* 6 wTransferSize */
0x10, /* 7 bcdDFUVersion */
@@ -2849,8 +2849,8 @@ unsigned char cfgDesc_Audio1[] =
0x09, /* 0 Size */
0x21, /* 1 bDescriptorType : DFU FUNCTIONAL */
0x07, /* 2 bmAttributes */
0xFA, /* 3 wDetachTimeOut */
0x00, /* 4 wDetachTimeOut */
DFU_DETACH_TIME_OUT & 0xFF, /* 3 wDetachTimeOut */
(DFU_DETACH_TIME_OUT >> 8) & 0xFF, /* 4 wDetachTimeOut */
0x40, /* 5 wTransferSize */
0x00, /* 6 wTransferSize */
0x10, /* 7 bcdDFUVersion */