forked from PAWPAW-Mirror/lib_xua
Merge branch 'master' into pdm_replay
This commit is contained in:
@@ -5,6 +5,7 @@ sc_usb_audio Change Log
|
||||
-----
|
||||
- ADDED: DFU to UAC1 descriptors (guarded by DFU and FORCE_UAC1_DFU)
|
||||
- RESOLVED: Removed 'reinterpretation to type of larger alignment' warnings
|
||||
- RESOLVED: DFU flash code run on tile[0] even if XUD_TILE and AUDIO_IO_TILE are not 0
|
||||
|
||||
7.1.0
|
||||
-----
|
||||
|
||||
@@ -351,7 +351,8 @@ int main(int argc, char **argv) {
|
||||
fprintf(stderr, "failed to initialise libusb\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
//#define START_IN_DFU 1
|
||||
#ifndef START_IN_DFU
|
||||
r = find_xmos_device(0, listdev);
|
||||
if (r < 0)
|
||||
{
|
||||
@@ -369,6 +370,7 @@ int main(int argc, char **argv) {
|
||||
return -1;
|
||||
}
|
||||
printf("XMOS DFU application started - Interface %d claimed\n", XMOS_DFU_IF);
|
||||
#endif
|
||||
|
||||
/* Dont go into DFU mode for save/restore */
|
||||
if(save)
|
||||
@@ -382,17 +384,18 @@ int main(int argc, char **argv) {
|
||||
else if(!listdev)
|
||||
{
|
||||
|
||||
#ifndef START_IN_DFU
|
||||
printf("Detaching device from application mode.\n");
|
||||
xmos_dfu_resetintodfu(XMOS_DFU_IF);
|
||||
|
||||
libusb_release_interface(devh, XMOS_DFU_IF);
|
||||
libusb_close(devh);
|
||||
|
||||
|
||||
printf("Waiting for device to restart and enter DFU mode...\n");
|
||||
|
||||
// Wait for device to enter dfu mode and restart
|
||||
system("sleep 20");
|
||||
#endif
|
||||
|
||||
// NOW IN DFU APPLICATION MODE
|
||||
|
||||
|
||||
@@ -339,7 +339,11 @@ int DFUReportResetState(chanend ?c_user_cmd)
|
||||
unsigned flag;
|
||||
flag = GetDFUFlag();
|
||||
|
||||
//if (DFU_reset_override == 0x11042011)
|
||||
//#define START_IN_DFU 1
|
||||
#ifdef START_IN_DFU
|
||||
flag = 0x11042011;
|
||||
#endif
|
||||
|
||||
if (flag == 0x11042011)
|
||||
{
|
||||
unsigned int cmd_data[16];
|
||||
|
||||
@@ -1113,7 +1113,7 @@ chanend c_spdif_out,
|
||||
chanend c_dig_rx,
|
||||
#endif
|
||||
chanend ?c_config, chanend ?c
|
||||
#if XUD_TILE != 0
|
||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0)
|
||||
, server interface i_dfu ?dfuInterface
|
||||
#endif
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
@@ -1392,7 +1392,7 @@ chanend ?c_config, chanend ?c
|
||||
|
||||
while (1)
|
||||
{
|
||||
#if XUD_TILE != 0
|
||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0)
|
||||
[[combine]]
|
||||
par
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ void audio(chanend c_in,
|
||||
chanend c_dig,
|
||||
#endif
|
||||
chanend ?c_config, chanend ?c_adc
|
||||
#if (XUD_TILE != 0)
|
||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0)
|
||||
, server interface i_dfu ?dfuInterface
|
||||
#endif
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
|
||||
@@ -479,19 +479,19 @@
|
||||
/**
|
||||
* @brief Product string for Audio Class 2.0 mode.
|
||||
*
|
||||
* Default: "xCore USB Audio 2.0"
|
||||
* Default: "XMOS xCORE (UAC2.0)"
|
||||
*/
|
||||
#ifndef PRODUCT_STR_A2
|
||||
#define PRODUCT_STR_A2 "xCORE USB Audio 2.0"
|
||||
#define PRODUCT_STR_A2 "XMOS xCORE (UAC2.0)"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Product string for Audio Class 1.0 mode
|
||||
*
|
||||
* Default: "xCore USB Audio 1.0"
|
||||
* Default: "XMOS xCORE (UAC1.0)"
|
||||
*/
|
||||
#ifndef PRODUCT_STR_A1
|
||||
#define PRODUCT_STR_A1 "xCORE USB Audio 1.0"
|
||||
#define PRODUCT_STR_A1 "XMOS xCORE (UAC1.0)"
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -415,7 +415,7 @@ void usb_audio_io(chanend c_aud_in, chanend ?c_adc,
|
||||
chanend ?c_adat_rx,
|
||||
chanend ?c_clk_ctl,
|
||||
chanend ?c_clk_int
|
||||
#if (XUD_TILE != 0)
|
||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0)
|
||||
, server interface i_dfu ?dfuInterface
|
||||
#endif
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
@@ -459,7 +459,7 @@ void usb_audio_io(chanend c_aud_in, chanend ?c_adc,
|
||||
c_dig_rx,
|
||||
#endif
|
||||
c_aud_cfg, c_adc
|
||||
#if XUD_TILE != 0
|
||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0)
|
||||
, dfuInterface
|
||||
#endif
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
@@ -606,7 +606,7 @@ int main()
|
||||
, c_mix_ctl
|
||||
#endif
|
||||
,c_aud_cfg, c_spdif_rx, c_adat_rx, c_clk_ctl, c_clk_int
|
||||
#if XUD_TILE != 0
|
||||
#if (XUD_TILE != 0) && (AUDIO_IO_TILE == 0)
|
||||
, dfuInterface
|
||||
#endif
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
@@ -674,7 +674,14 @@ int main()
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef PDM_RECORD
|
||||
|
||||
#if (XUD_TILE != 0 ) && (AUDIO_IO_TILE != 0)
|
||||
/* Run flash code on its own - hope it gets combined */
|
||||
#warning Running DFU flash code on its own
|
||||
on stdcore[0]: DFUHandler(dfuInterface, null);
|
||||
#endif
|
||||
|
||||
#ifndef PDM_RECORD
|
||||
#if (NUM_PDM_MICS > 0)
|
||||
on stdcore[PDM_TILE]: pdm_mic(c_ds_output);
|
||||
#ifdef MIC_PROCESSING_USE_INTERFACE
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#define XS1_SU_PERIPH_USB_ID 0x1
|
||||
|
||||
#if (XUD_SERIES_SUPPORT == XUD_X200_SERIES)
|
||||
#include "xs2_su_registers.h"
|
||||
#define XS2_SU_PERIPH_USB_ID 0x1
|
||||
#define PLL_MASK 0x7FFFFFFF
|
||||
#else
|
||||
#define PLL_MASK 0xFFFFFFFF
|
||||
@@ -33,6 +35,12 @@ void device_reboot_aux(void)
|
||||
unsigned int tileId;
|
||||
unsigned int tileArrayLength;
|
||||
|
||||
#if (XUD_SERIES_SUPPORT == XUD_X200_SERIES)
|
||||
/* Disconnect from bus */
|
||||
unsigned data[] = {4};
|
||||
write_periph_32(usb_tile, XS2_SU_PERIPH_USB_ID, XS1_GLX_PER_UIFM_FUNC_CONTROL_NUM, 1, data);
|
||||
#endif
|
||||
|
||||
/* Find size of tile array - note in future tools versions this will be available from platform.h */
|
||||
asm volatile ("ldc %0, tile.globound":"=r"(tileArrayLength));
|
||||
|
||||
@@ -61,14 +69,6 @@ void device_reboot_aux(void)
|
||||
/* Reboots XMOS device by writing to the PLL config register */
|
||||
void device_reboot(chanend spare)
|
||||
{
|
||||
#if (XUD_SERIES_SUPPORT != XUD_U_SERIES)
|
||||
//outct(spare, XS1_CT_END); // have to do this before freeing the chanend
|
||||
//inct(spare); // Receive end ct from usb_buffer to close down in both directions
|
||||
|
||||
/* Need a spare chanend so we can talk to the pll register */
|
||||
//asm("freer res[%0]"::"r"(spare));
|
||||
#endif
|
||||
device_reboot_aux();
|
||||
|
||||
while(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user