diff --git a/.gitignore b/.gitignore index 91fb6736..ff869912 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ module_dfu/host/xmosdfu/xmosdfu .lock-waf_* .waf-*/ build/ +host/xmosdfu/xmosdfu diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 214ba8f5..9abaf5fb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,6 +17,7 @@ lib_xua Change Log so it shows up with a descriptive name in Windows Device Manager - CHANGE: DFU_BCD_DEVICE removed (now uses BCD_DEVICE) - CHANGE: Renaming in descriptors.h to avoid clashes with application + - CHANGE: Make device reboot function no-argument (was one channel end) - RESOLVED: FIR gain compensation for PDM mics set incorrectly for divide of 8 - RESOLVED: Incorrect xmosdfu DYLD path in test script code - RESOLVED: xmosdfu cannot find XMOS device on modern MacBook Pro (#17897) diff --git a/lib_xua/src/core/audiohub/xua_audiohub.xc b/lib_xua/src/core/audiohub/xua_audiohub.xc index 05403057..af66f2a7 100755 --- a/lib_xua/src/core/audiohub/xua_audiohub.xc +++ b/lib_xua/src/core/audiohub/xua_audiohub.xc @@ -282,7 +282,6 @@ static inline void DoDsdDop(int &everyOther, unsigned samplesOut[], unsigned &ds asm volatile("out res[%0], %1"::"r"(p_dsd_dac[1]),"r"(bitrev(dsdSample_r))); } } -#endif /* When DSD is enabled and streaming is standard PCM, this function checks for a series of DoP markers in the upper byte. If found it will exit deliver() with the command to restart in DoP mode. @@ -337,6 +336,7 @@ static inline int DoDsdDopCheck(unsigned &dsdMode, int &dsdCount, unsigned curSa #endif return 1; } +#endif #if !CODEC_MASTER static inline void InitPorts_master(unsigned divide) @@ -406,7 +406,7 @@ static inline void InitPorts_slave(unsigned divide) p_lrclk when pinseq(1) :> void; p_lrclk when pinseq(0) :> void; p_lrclk when pinseq(1) :> void; -#ifdef I2S_MODE_TDM +#if I2S_MODE_TDM p_lrclk when pinseq(0) :> void; p_lrclk when pinseq(1) :> void @ tmp; #else @@ -609,7 +609,7 @@ unsigned static deliver_master(chanend ?c_out, chanend ?c_spd_out /* LR clock delayed by one clock, This is so MSB is output on the falling edge of BCLK * after the falling edge on which LRCLK was toggled. (see I2S spec) */ /* Generate clocks LR Clock low - LEFT */ -#ifdef I2S_MODE_TDM +#if I2S_MODE_TDM p_lrclk <: 0x00000000; #else p_lrclk <: 0x80000000; @@ -736,7 +736,7 @@ unsigned static deliver_master(chanend ?c_out, chanend ?c_spd_out } #endif -#ifdef I2S_MODE_TDM +#if I2S_MODE_TDM if(frameCount == (I2S_CHANS_PER_FRAME-2)) p_lrclk <: 0x80000000; else @@ -772,13 +772,12 @@ unsigned static deliver_master(chanend ?c_out, chanend ?c_spd_out } // !dsdMode - if((DSD_CHANS_DAC != 0) && (NUM_USB_CHAN_OUT > 0)) - { - if(DoDsdDopCheck(dsdMode, dsdCount, curSamFreq, samplesOut, dsdMarker) == 0) - return 0; - } +#if (DSD_CHANS_DAC != 0) && (NUM_USB_CHAN_OUT > 0) + if(DoDsdDopCheck(dsdMode, dsdCount, curSamFreq, samplesOut, dsdMarker) == 0) + return 0; +#endif -#ifdef I2S_MODE_TDM +#if I2S_MODE_TDM /* Increase frameCount by 2 since we have output two channels (per data line) */ frameCount+=2; if(frameCount == I2S_CHANS_PER_FRAME) @@ -1145,7 +1144,7 @@ unsigned static deliver_slave(chanend ?c_out, chanend ?c_spd_out #endif // (I2S_CHANS_DAC != 0) && (NUM_USB_CHAN_OUT != 0) -#ifdef I2S_MODE_TDM +#if I2S_MODE_TDM /* Increase frameCount by 2 since we have output two channels (per data line) */ frameCount+=2; if(frameCount == I2S_CHANS_PER_FRAME) diff --git a/lib_xua/src/core/endpoint0/xua_endpoint0.c b/lib_xua/src/core/endpoint0/xua_endpoint0.c index c1b14088..390b6cb3 100755 --- a/lib_xua/src/core/endpoint0/xua_endpoint0.c +++ b/lib_xua/src/core/endpoint0/xua_endpoint0.c @@ -56,7 +56,7 @@ #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); +extern void device_reboot(void); #endif unsigned int DFU_mode_active = 0; // 0 - App active, 1 - DFU active @@ -579,7 +579,7 @@ void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl, if(reset) { DFUDelay(50000000); - device_reboot(c_audioControl); + device_reboot(); } } #endif @@ -794,7 +794,7 @@ void XUA_Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl, /* Send reboot command */ DFUDelay(5000000); - device_reboot(c_audioControl); + device_reboot(); } } #endif diff --git a/lib_xua/src/core/support/reboot.xc b/lib_xua/src/core/support/reboot.xc index f23ebdd2..e3bbd1d1 100644 --- a/lib_xua/src/core/support/reboot.xc +++ b/lib_xua/src/core/support/reboot.xc @@ -1,5 +1,6 @@ #include #include +#include #include #define XS1_SU_PERIPH_USB_ID 0x1 @@ -30,8 +31,10 @@ static void reset_tile(unsigned const tileId) write_sswitch_reg_no_ack(tileId, 6, pllVal); } -/* Note - resetting is per *node* not tile */ -static inline void device_reboot_aux(void) +/* Reboots XMOS device by writing to the PLL config register + * Note - resetting is per *node* not tile + */ +void device_reboot(void) { #if (XUD_SERIES_SUPPORT == 1) /* Disconnect from bus */ @@ -72,10 +75,10 @@ static inline void device_reboot_aux(void) #ifdef __XS2A__ /* Reset all even tiles, starting from the remote ones */ - for(unsigned int tileNum = tileArrayLength-2; tileNum>=0; tileNum-=2) + for(int tileNum = tileArrayLength-2; tileNum>=0; tileNum-=2) #else /* Reset all tiles, starting from the remote ones */ - for(unsigned int tileNum = tileArrayLength-1; tileNum>=0; tileNum--) + for(int tileNum = tileArrayLength-1; tileNum>=0; tileNum--) #endif { /* Cannot cast tileref to unsigned! */ @@ -96,11 +99,6 @@ static inline void device_reboot_aux(void) /* Finally reboot the node this tile resides on */ reset_tile(localTileId); #endif -} -/* Reboots XMOS device by writing to the PLL config register */ -void device_reboot(chanend spare) -{ - device_reboot_aux(); - while(1); + while (1); } diff --git a/tests/runtests.pyc b/tests/runtests.pyc deleted file mode 100644 index 814ee1c1..00000000 Binary files a/tests/runtests.pyc and /dev/null differ diff --git a/tests/test_i2s_loopback.pyc b/tests/test_i2s_loopback.pyc deleted file mode 100644 index 274660b5..00000000 Binary files a/tests/test_i2s_loopback.pyc and /dev/null differ