From 070578356e7fa374f968514689a201bf50e6b9ce Mon Sep 17 00:00:00 2001 From: Mike Bruno Date: Fri, 19 Jan 2018 14:35:04 -0500 Subject: [PATCH 1/7] Fix I2S_MODE_TDM handling and Dop Check build fix --- lib_xua/src/core/audiohub/xua_audiohub.xc | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/lib_xua/src/core/audiohub/xua_audiohub.xc b/lib_xua/src/core/audiohub/xua_audiohub.xc index 9290f988..c580b813 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. @@ -335,6 +334,7 @@ static inline int DoDsdDopCheck(unsigned &dsdMode, int &dsdCount, unsigned curSa } return 1; } +#endif #if !CODEC_MASTER static inline void InitPorts_master(unsigned divide) @@ -404,7 +404,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 @@ -607,7 +607,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; @@ -734,7 +734,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 @@ -770,13 +770,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) @@ -1143,7 +1142,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) From b4c9ef9fd7167f37d0537147c535828f0b2186f9 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Thu, 18 Jan 2018 16:51:58 +0000 Subject: [PATCH 2/7] Get rid of channel end in device reboot function --- CHANGELOG.rst | 1 + lib_xua/src/core/endpoint0/xua_endpoint0.c | 6 +++--- lib_xua/src/core/support/reboot.xc | 13 +++++-------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 278e1263..d7224b95 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,6 +13,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/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..59612418 100644 --- a/lib_xua/src/core/support/reboot.xc +++ b/lib_xua/src/core/support/reboot.xc @@ -30,8 +30,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 */ @@ -96,11 +98,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); } From 67a9d9b6c43cbce6ce15d7ab3fb2a139e2ca52ea Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Tue, 23 Jan 2018 12:30:43 +0000 Subject: [PATCH 3/7] #207: Bug fixes in new reboot code --- lib_xua/src/core/support/reboot.xc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_xua/src/core/support/reboot.xc b/lib_xua/src/core/support/reboot.xc index 59612418..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 @@ -74,10 +75,10 @@ void device_reboot(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! */ From b50ae223e8858e6210182e43d2a747b7f37b6b2b Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Fri, 19 Jan 2018 05:26:44 +0000 Subject: [PATCH 4/7] audiohub: use #if rather than #ifdef for I2S_MODE_TDM --- lib_xua/src/core/audiohub/xua_audiohub.xc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib_xua/src/core/audiohub/xua_audiohub.xc b/lib_xua/src/core/audiohub/xua_audiohub.xc index 05403057..1f4c73f4 100755 --- a/lib_xua/src/core/audiohub/xua_audiohub.xc +++ b/lib_xua/src/core/audiohub/xua_audiohub.xc @@ -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 @@ -778,7 +778,7 @@ unsigned static deliver_master(chanend ?c_out, chanend ?c_spd_out return 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) @@ -1145,7 +1145,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) From ebf49fa05215eabb7b0ba89dacedb9f1e0386372 Mon Sep 17 00:00:00 2001 From: Larry Snizek Date: Fri, 19 Jan 2018 13:22:32 +0000 Subject: [PATCH 5/7] Git ignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) 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 From d9010104353a0485e21df567b6125b3b046856de Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Thu, 25 Jan 2018 10:58:16 +0000 Subject: [PATCH 6/7] Delete test_i2s_loopback.pyc --- tests/test_i2s_loopback.pyc | Bin 2367 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tests/test_i2s_loopback.pyc diff --git a/tests/test_i2s_loopback.pyc b/tests/test_i2s_loopback.pyc deleted file mode 100644 index 274660b521c0f033e402511e9233eaf2010c08ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2367 zcmcIl?{3>R5I@Pb>^O1Lc5Bjf{owVJF~D(B4BZM8MOOp++ogfh0Yis@lSL*~qCcKU z1x{mq${uP@vKQDR>;byp(XQ)cjq|0Gbkvc@`|<90M^^r6HQ)5b%aEpzi~kdlzK2HQ zb0{Wy3C5*Az&Io;mT_6M*QsJ!^ajsP=z(1UwLpE4zU5f`(j!B32u+vH94hM!aR~h? zjWMA{V~9K&W28>w3dshIt0b3bT%$Ac%7#_1kilS+5#%z-6_PEApap~~Jz$6$e!%eX z14tb|C^Yb^G1!B%8kN9YqC>3cF^(gzkzA#9c^z~Ebd%Q0rZwavI&vxhi^ffoAJZ2+ z3htKWQY^Vf<+3#k7Qi2uHpUH->kKb%liVN!SC*}@cSwH1+6VB)bsfZXuX7jS*)cT^ zQj#4hct$kRQKJ6@6W!M$&a&Yk2#etr zEu(aPAS+A>5~n&yhOrWPU{u+g2Nxd@cypvo1;)cv!-+64)-_g{$ZAKTmQt@dTo@2qqoz|KN|@2>`Uz7XJts{wWw0zA7K;H!lIUt8%U zU*q6dEsVy~g;3vKZA*V4z&BPJ{r2}7*+kgl6P1;5Q$3&2y_>5$$>h1X;0rvu6uc= zbx#MW9AqN}ZXk~L1xl?qEw>&ouWc*lOKWp@Vr~K^FH)WX50wbBbU!*^KlEp4$nl(2 zcgtCID)wzU_37JkTGdtXD^AmCxtX&I;6xa(0_s09y!03AfGmVQ-uxg@lPJk<7rg6>>2xb}=1<=3+gzusN8uJ3l z*9)JTJ9gKn$rfd)%{FYDO_wC#qKP=?Y*l~$< Date: Thu, 25 Jan 2018 10:58:32 +0000 Subject: [PATCH 7/7] Delete runtests.pyc --- tests/runtests.pyc | Bin 528 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tests/runtests.pyc diff --git a/tests/runtests.pyc b/tests/runtests.pyc deleted file mode 100644 index 814ee1c1701c5010f85975f172a5ef00c7947cce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 528 zcmYLFJx{|h5WP5Q3sGTUU}Estsgb%N5MpIvDJ*5MoY+lF6Fc$;YUlnz{tG_C*iH&s?x+n~D_v9HNXmmyrU@mj zjF1?#mX$}DHfz9_?-(#rd5 z1Xk7xuUS@G6Z$AbH_@^mBfmzaYi5YxKe&557Vl14S6Jg*;kXv1*-Atu`&u*nu;Tb> mMXXhviq898Z1UI{5nA~)7<4xnrpc5{)0|u;X_Ag6Bqx76fQU>0