From ae2f19224e667c56c33b47a4d7d9520808fb34be Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Tue, 21 Jan 2020 16:12:38 +0000 Subject: [PATCH 1/2] Expose DFU detach timeout value --- lib_xua/api/xua_conf_default.h | 7 ++++++- lib_xua/src/core/endpoint0/xua_ep0_descriptors.h | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib_xua/api/xua_conf_default.h b/lib_xua/api/xua_conf_default.h index 9bfa7bbd..490647cc 100644 --- a/lib_xua/api/xua_conf_default.h +++ b/lib_xua/api/xua_conf_default.h @@ -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 - diff --git a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h index 1461fc16..76245fac 100644 --- a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h +++ b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h @@ -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 */ From 86667227980740d82f135def26f2f24509c33a2f Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Tue, 21 Jan 2020 16:45:54 +0000 Subject: [PATCH 2/2] Library checks --- LICENSE.txt | 2 +- lib_xua/LICENSE.txt | 2 +- lib_xua/api/xua_conf_default.h | 2 +- lib_xua/src/core/endpoint0/xua_ep0_descriptors.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 19f8e7cc..d4acef94 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ Software Release License Agreement -Copyright (c) 2011-2019, XMOS, All rights reserved. +Copyright (c) 2011-2020, XMOS, All rights reserved. BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software. diff --git a/lib_xua/LICENSE.txt b/lib_xua/LICENSE.txt index 3932a9ae..7f5e44ce 100644 --- a/lib_xua/LICENSE.txt +++ b/lib_xua/LICENSE.txt @@ -1,6 +1,6 @@ Software Release License Agreement -Copyright (c) 2017-2019, XMOS, All rights reserved. +Copyright (c) 2017-2020, XMOS, All rights reserved. BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software. diff --git a/lib_xua/api/xua_conf_default.h b/lib_xua/api/xua_conf_default.h index 490647cc..79aa061b 100644 --- a/lib_xua/api/xua_conf_default.h +++ b/lib_xua/api/xua_conf_default.h @@ -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 diff --git a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h index 76245fac..eb71309e 100644 --- a/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h +++ b/lib_xua/src/core/endpoint0/xua_ep0_descriptors.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2019, XMOS Ltd, All rights reserved +// Copyright (c) 2011-2020, XMOS Ltd, All rights reserved /** * @file xua_ep0_descriptors.h * @brief Device Descriptors