forked from PAWPAW-Mirror/lib_xua
@@ -412,10 +412,10 @@
|
||||
*
|
||||
* Default: 1 (Enabled)
|
||||
*/
|
||||
#if !defined(DFU)
|
||||
#define DFU (1)
|
||||
#elif defined(DFU) && (DFU == 0)
|
||||
#undef DFU
|
||||
#if !defined(XUA_DFU_EN)
|
||||
#define XUA_DFU_EN (1)
|
||||
#elif defined(XUA_DFU_EN) && (XUA_DFU_EN == 0)
|
||||
#undef XUA_DFU_EN
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -1379,7 +1379,7 @@ chanend c_dig_rx,
|
||||
curSamRes_DAC = inuint(c_mix_out);
|
||||
}
|
||||
|
||||
#if (XUA_DFU == 1)
|
||||
#if (XUA_DFU_EN == 1)
|
||||
/* Currently no more audio will happen after this point */
|
||||
if ((curSamFreq / AUD_TO_USB_RATIO) == AUDIO_STOP_FOR_DFU)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ enum USBInterfaceNumber
|
||||
#if defined(USB_CONTROL_DESCS) && (USB_CONTROL_DESCS != 0)
|
||||
INTERFACE_NUMBER_MISC_CONTROL,
|
||||
#endif
|
||||
#if defined(DFU) && (DFU != 0)
|
||||
#if defined(XUA_DFU_EN) && (XUA_DFU_EN != 0)
|
||||
INTERFACE_NUMBER_DFU,
|
||||
#endif
|
||||
#if defined(IAP) && (IAP != 0)
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#ifndef NO_USB
|
||||
#include "xud_device.h" /* Standard descriptor requests */
|
||||
#include "dfu_types.h"
|
||||
#include "usbaudio20.h" /* Defines from USB Audio 2.0 spec */
|
||||
#include "xua_ep0_descriptors.h" /* This devices descriptors */
|
||||
#include "commands.h"
|
||||
@@ -52,8 +53,8 @@
|
||||
#warning DFU_PID not defined, Using PID_AUDIO_2. This is probably fine!
|
||||
#endif
|
||||
|
||||
#if (XUA_DFU == 1)
|
||||
#include "dfu.h"
|
||||
#if (XUA_DFU_EN == 1)
|
||||
#include "xua_dfu.h"
|
||||
#define DFU_IF_NUM INPUT_INTERFACES + OUTPUT_INTERFACES + MIDI_INTERFACES + 1
|
||||
extern void device_reboot(chanend);
|
||||
#endif
|
||||
@@ -281,7 +282,7 @@ void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl,
|
||||
VendorAudioRequestsInit(c_audioControl, c_mix_ctl, c_clk_ctl);
|
||||
#endif
|
||||
|
||||
#if (XUA_DFU == 1)
|
||||
#if (XUA_DFU_EN == 1)
|
||||
/* Check if device has started in DFU mode */
|
||||
if (DFUReportResetState(null))
|
||||
{
|
||||
@@ -547,7 +548,7 @@ void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl,
|
||||
//unsigned request = (sp.bmRequestType.Recipient ) | (sp.bmRequestType.Type << 5);
|
||||
|
||||
/* TODO Check on return value retval = */
|
||||
#if (XUA_DFU == 1)
|
||||
#if (XUA_DFU_EN == 1)
|
||||
unsigned DFU_IF = INTERFACE_NUMBER_DFU;
|
||||
|
||||
/* DFU interface number changes based on which mode we are currently running in */
|
||||
@@ -587,7 +588,7 @@ void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl,
|
||||
* - Audio endpoint request (Audio 1.0 Sampling freq requests are sent to the endpoint)
|
||||
*/
|
||||
if(((interfaceNum == 0) || (interfaceNum == 1) || (interfaceNum == 2))
|
||||
#if (XUA_DFU == 1)
|
||||
#if (XUA_DFU_EN == 1)
|
||||
&& !DFU_mode_active
|
||||
#endif
|
||||
)
|
||||
@@ -639,7 +640,7 @@ void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl,
|
||||
|
||||
if(result == XUD_RES_ERR)
|
||||
{
|
||||
#ifdef DFU
|
||||
#if (XUA_DFU_EN == 1)
|
||||
if (!DFU_mode_active)
|
||||
{
|
||||
#endif
|
||||
@@ -750,8 +751,9 @@ void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl,
|
||||
cfgDesc_Null, sizeof(cfgDesc_Null),
|
||||
(char**)&g_strTable, sizeof(g_strTable)/sizeof(char *), &sp, g_curUsbSpeed);
|
||||
#endif
|
||||
#if (XUA_DFU_EN == 1)
|
||||
}
|
||||
#if (XUA_DFU == 1)
|
||||
|
||||
else
|
||||
{
|
||||
/* Running in DFU mode - always return same descs for DFU whether HS or FS */
|
||||
@@ -776,7 +778,7 @@ void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl,
|
||||
g_curStreamAlt_Out = 0;
|
||||
g_curStreamAlt_In = 0;
|
||||
|
||||
#if (XUA_DFU == 1)
|
||||
#if (XUA_DFU_EN == 1)
|
||||
if (DFUReportResetState(null))
|
||||
{
|
||||
if (!DFU_mode_active)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "xua.h"
|
||||
#if (XUD_DFU == 1)
|
||||
#if (XUA_DFU_EN == 1)
|
||||
#include "uac_hwresources.h"
|
||||
#include <xs1.h>
|
||||
#include <xclib.h>
|
||||
|
||||
@@ -558,7 +558,7 @@ int main()
|
||||
#define c_clk_ctl null
|
||||
#endif
|
||||
|
||||
#ifdef DFU
|
||||
#if (XUA_DFU_EN == 1)
|
||||
interface i_dfu dfuInterface;
|
||||
#else
|
||||
#define dfuInterface null
|
||||
@@ -583,7 +583,7 @@ int main()
|
||||
{
|
||||
#if (XUD_TILE == 0)
|
||||
/* Check if USB is on the flash tile (tile 0) */
|
||||
#ifdef DFU
|
||||
#if (XUA_DFU_EN == 1)
|
||||
[[distribute]]
|
||||
DFUHandler(dfuInterface, null);
|
||||
#endif
|
||||
|
||||
@@ -60,7 +60,7 @@ typedef struct
|
||||
STR_TABLE_ENTRY(adatClockSourceStr); /* iClockSource for external S/PDIF clock */
|
||||
#endif
|
||||
#endif
|
||||
#ifdef DFU
|
||||
#if (XUA_DFU_EN == 1)
|
||||
STR_TABLE_ENTRY(dfuStr); /* iInterface for DFU interface */
|
||||
#endif
|
||||
#ifdef USB_CONTROL_DESCS
|
||||
@@ -333,7 +333,7 @@ StringDescTable_t g_strTable =
|
||||
.adatClockSourceStr = APPEND_VENDOR_STR(ADAT Clock),
|
||||
#endif
|
||||
#endif
|
||||
#ifdef DFU
|
||||
#if (XUA_DFU_EN == 1)
|
||||
.dfuStr = APPEND_VENDOR_STR(DFU),
|
||||
#endif
|
||||
#ifdef USB_CONTROL_DESCS
|
||||
@@ -517,7 +517,7 @@ unsigned char devQualDesc_Null[] =
|
||||
#define MIDI_LENGTH (0)
|
||||
#endif
|
||||
|
||||
#ifdef DFU
|
||||
#if (XUA_DFU_EN == 1)
|
||||
#define DFU_LENGTH (18)
|
||||
#else
|
||||
#define DFU_LENGTH (0)
|
||||
@@ -739,7 +739,7 @@ typedef struct
|
||||
unsigned char configDesc_Midi[MIDI_LENGTH];
|
||||
#endif
|
||||
|
||||
#ifdef DFU
|
||||
#if (XUA_DFU_EN == 1)
|
||||
/* DFU descriptors currently handled as a single block */
|
||||
unsigned char configDesc_DFU[DFU_LENGTH];
|
||||
#endif
|
||||
@@ -1978,7 +1978,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2=
|
||||
},
|
||||
#endif
|
||||
|
||||
#ifdef DFU
|
||||
#if (XUA_DFU_EN == 1)
|
||||
/* Standard DFU class Interface descriptor */
|
||||
{0x09, /* 0 bLength : Size of this descriptor, in bytes. (field size 1 bytes) */
|
||||
0x04, /* 1 bDescriptorType : INTERFACE descriptor. (field size 1 bytes) */
|
||||
@@ -2268,7 +2268,7 @@ const unsigned num_freqs_a1 = MAX(3, (0
|
||||
#define NUM_CONTROL_USB_INTERFACES 0
|
||||
#endif
|
||||
|
||||
#if (DFU == 1) && (FORCE_UAC1_DFU == 1)
|
||||
#if (XUA_DFU_EN == 1) && (FORCE_UAC1_DFU == 1)
|
||||
#define DFU_INTERFACE_BYTES 18
|
||||
#define DFU_INTERFACES_A1 1
|
||||
#else
|
||||
@@ -2741,7 +2741,7 @@ unsigned char cfgDesc_Audio1[] =
|
||||
0x00, 0x00, /* Unused */
|
||||
#endif
|
||||
|
||||
#if (DFU == 1) && (FORCE_UAC1_DFU == 1)
|
||||
#if (XUA_DFU_EN == 1) && (FORCE_UAC1_DFU == 1)
|
||||
|
||||
/* NOTE: By default we turn off DFU in UAC1.0 mode for a better user experiance in Windows */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user