diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cf2cb203..b7f0c38b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,12 +1,28 @@ sc_usb_audio Change Log ======================= +6.11.2 +------ + - RESOLVED: (Major) Enumeration issue when MAX_MIX_COUNT > 0 only. Introduced in mixer + optimisations in 6.11.0. Only affects designs using mixer functionality. + - RESOLVED: (Normal) Audio buffering request system modified such that the mixer output is + not silent when in underflow case (i.e. host output stream not active) This issue was + introduced with the addition of DSD functionality and only affects designs using + mixer functionality. + - RESOLVED: (Minor) Potential build issue due to duplicate labels in inline asm in + set_interrupt_handler macro + - RESOLVED: (Minor) BCD_DEVICE define in devicedefines.h now guarded by ifndef (caused issues + with DFU test build configs. + - RESOLVED: (Minor) String descriptor for Clock Selector unit incorrectly reported + - CHANGE: HID report descriptor defines added to shared user_hid.h + - CHANGE: Now uses module_adat_rx from sc_adat (local module_usb_audio_adat removed) + 6.11.1 ------ - ADDED: ADAT transmit functionality, including SMUX. See ADAT_TX and ADAT_TX_INDEX. - - RESOLVED: Build issue with CODEC_MASTER (xCore is I2S slave) enabled - - RESOLVED: Channel ordering issue in when TDM and CODEC_MASTER mode enabled - - RESOLVED: DFU fails when SPDIF_RX enabled due to clock block being shared between SPDIF + - RESOLVED: (Normal) Build issue with CODEC_MASTER (xCore is I2S slave) enabled + - RESOLVED: (Minor) Channel ordering issue in when TDM and CODEC_MASTER mode enabled + - RESOLVED: (Normal) DFU fails when SPDIF_RX enabled due to clock block being shared between SPDIF core and FlashLib 6.11.0 diff --git a/module_usb_audio/audio.xc b/module_usb_audio/audio.xc index c0f1241f..56155f85 100755 --- a/module_usb_audio/audio.xc +++ b/module_usb_audio/audio.xc @@ -219,109 +219,85 @@ static inline void TransferAdatTxSamples(chanend c_adat_out, const unsigned samp static inline unsigned DoSampleTransfer(chanend c_out, int readBuffNo, unsigned underflowWord) { unsigned command; - unsigned underflow; - outuint(c_out, 0); + outuint(c_out, underflowWord); - /* Check for sample freq change (or other command) or new samples from mixer*/ - if(testct(c_out)) - { - unsigned command = inct(c_out); + /* Check for sample freq change (or other command) or new samples from mixer*/ + if(testct(c_out)) + { + unsigned command = inct(c_out); #ifndef CODEC_MASTER - // Set clocks low - p_lrclk <: 0; - p_bclk <: 0; + // Set clocks low + p_lrclk <: 0; + p_bclk <: 0; #if(DSD_CHANS_DAC != 0) /* DSD Clock might not be shared with lrclk or bclk... */ - p_dsd_clk <: 0; + p_dsd_clk <: 0; #endif #endif #if (DSD_CHANS_DAC > 0) - if(dsdMode == DSD_MODE_DOP) - dsdMode = DSD_MODE_OFF; + if(dsdMode == DSD_MODE_DOP) + dsdMode = DSD_MODE_OFF; #endif #pragma xta endpoint "received_command" return command; - - } - else - { - underflow = inuint(c_out); + } + else + { #ifndef MIXER // Interfaces straight to decouple() #if NUM_USB_CHAN_IN > 0 #pragma loop unroll - for(int i = 0; i < I2S_CHANS_ADC; i++) - { - if(readBuffNo) - outuint(c_out, samplesIn_1[i]); - else - outuint(c_out, samplesIn_0[i]); - } - /* Send over the digi channels - no odd buffering required */ -#pragma loop unroll - for(int i = I2S_CHANS_ADC; i < NUM_USB_CHAN_IN; i++) - { + for(int i = 0; i < I2S_CHANS_ADC; i++) + { + if(readBuffNo) + outuint(c_out, samplesIn_1[i]); + else outuint(c_out, samplesIn_0[i]); - } + } + /* Send over the digi channels - no odd buffering required */ +#pragma loop unroll + for(int i = I2S_CHANS_ADC; i < NUM_USB_CHAN_IN; i++) + { + outuint(c_out, samplesIn_0[i]); + } #endif #if NUM_USB_CHAN_OUT > 0 - if(underflow) - { #pragma loop unroll - for(int i = 0; i < NUM_USB_CHAN_OUT; i++) - { - samplesOut[i] = underflowWord; - } - } - else - { -#pragma loop unroll - for(int i = 0; i < NUM_USB_CHAN_OUT; i++) - { - samplesOut[i] = inuint(c_out); - } - } + for(int i = 0; i < NUM_USB_CHAN_OUT; i++) + { + samplesOut[i] = inuint(c_out); + } #endif #else /* ifndef MIXER */ #if NUM_USB_CHAN_OUT > 0 - if(underflow) - { - for(int i = 0; i < NUM_USB_CHAN_OUT; i++) - { - samplesOut[i] = underflowWord; - } - } - else - { #pragma loop unroll - for(int i = 0; i < NUM_USB_CHAN_OUT; i++) - { - int tmp = inuint(c_out); - samplesOut[i] = tmp; - } - } + for(int i = 0; i < NUM_USB_CHAN_OUT; i++) + { + int tmp = inuint(c_out); + samplesOut[i] = tmp; + } #endif #if NUM_USB_CHAN_IN > 0 #pragma loop unroll - for(int i = 0; i < I2S_CHANS_ADC; i++) - { - if(readBuffNo) - outuint(c_out, samplesIn_1[i]); - else - outuint(c_out, samplesIn_0[i]); - } - /* Send over the digi channels - no odd buffering required */ -#pragma loop unroll - for(int i = I2S_CHANS_ADC; i < NUM_USB_CHAN_IN; i++) - { + for(int i = 0; i < I2S_CHANS_ADC; i++) + { + if(readBuffNo) + outuint(c_out, samplesIn_1[i]); + else outuint(c_out, samplesIn_0[i]); - } -#endif -#endif } + /* Send over the digi channels - no odd buffering required */ +#pragma loop unroll + for(int i = I2S_CHANS_ADC; i < NUM_USB_CHAN_IN; i++) + { + outuint(c_out, samplesIn_0[i]); + } +#endif +#endif + } - return 0; + return 0; } @@ -453,9 +429,6 @@ unsigned static deliver(chanend c_out, chanend ?c_spd_out, #if (I2S_CHANS_ADC != 0) || defined(SPDIF) unsigned sample; -#endif - unsigned underflow = 0; -#if NUM_USB_CHAN_OUT > 0 #endif //#if NUM_USB_CHAN_IN > 0 /* Since DAC and ADC buffered ports off by one sample we buffer previous ADC frame */ diff --git a/module_usb_audio/devicedefines.h b/module_usb_audio/devicedefines.h index 672d6eff..675921cc 100644 --- a/module_usb_audio/devicedefines.h +++ b/module_usb_audio/devicedefines.h @@ -479,8 +479,9 @@ * * Default: XMOS USB Audio Release version (e.g. 0x0651 for 6.5.1). */ +#ifndef BCD_DEVICE #define BCD_DEVICE ((BCD_DEVICE_J << 8) | ((BCD_DEVICE_M & 0xF) << 4) | (BCD_DEVICE_N & 0xF)) - +#endif /** * @brief Number of supported output stream formats. diff --git a/module_usb_audio/endpoint0/descriptors.h b/module_usb_audio/endpoint0/descriptors.h index f8202d52..6d2c8361 100644 --- a/module_usb_audio/endpoint0/descriptors.h +++ b/module_usb_audio/endpoint0/descriptors.h @@ -945,7 +945,7 @@ USB_Config_Descriptor_Audio2_t cfgDesc_Audio2= ID_CLKSRC_ADAT, /* baCSourceID */ #endif .bmControl = 0x03, - .iClockSelector = 13, /* TODO Shoudn't be hard-coded */ + .iClockSelector = offsetof(StringDescTable_t, clockSelectorStr)/sizeof(char *), }, #if (NUM_USB_CHAN_OUT > 0) diff --git a/module_usb_audio/main.xc b/module_usb_audio/main.xc index 81429dc7..cd9c4af3 100755 --- a/module_usb_audio/main.xc +++ b/module_usb_audio/main.xc @@ -38,7 +38,7 @@ #endif #ifdef ADAT_RX -#include "adatreceiver.h" +#include "adat_rx.h" #endif #include "clocking.h" diff --git a/module_usb_audio/mixer/mixer.xc b/module_usb_audio/mixer/mixer.xc index 88cb10e4..9d637344 100644 --- a/module_usb_audio/mixer/mixer.xc +++ b/module_usb_audio/mixer/mixer.xc @@ -201,9 +201,8 @@ static inline void GiveSamplesToHost(chanend c, xc_ptr ptr, xc_ptr multIn) } #pragma unsafe arrays -static inline void GetSamplesFromHost(chanend c, unsigned underflow) +static inline void GetSamplesFromHost(chanend c) { - if(!underflow) { #pragma loop unroll for (int i=0; i 96000; - /* Wait for request */ - inuint(c_mixer2); - /* Inform mixer2 (or audio()) about freq change */ outct(c_mixer2, command); outuint(c_mixer2, sampFreq); @@ -515,9 +504,6 @@ static void mixer1(chanend c_host, chanend c_mix_ctl, chanend c_mixer2) case SET_STREAM_FORMAT_OUT: case SET_STREAM_FORMAT_IN: - /* Wait for request */ - inuint(c_mixer2); - /* Inform mixer2 (or audio()) about format change */ outct(c_mixer2, command); outuint(c_mixer2, inuint(c_host)); @@ -545,14 +531,14 @@ static void mixer1(chanend c_host, chanend c_mix_ctl, chanend c_mixer2) } else { - underflow = inuint(c_host); + inuint(c_host); #if MAX_MIX_COUNT > 0 - outuint(c_mixer2, underflow); + outuint(c_mixer2, 0); GiveSamplesToHost(c_host, samples_to_host_map, multIn); outuint(c_mixer2, 0); inuint(c_mixer2); - GetSamplesFromHost(c_host, underflow); + GetSamplesFromHost(c_host); outuint(c_mixer2, 0); inuint(c_mixer2); #ifdef FAST_MIXER @@ -612,9 +598,10 @@ static void mixer1(chanend c_host, chanend c_mix_ctl, chanend c_mixer2) } #else /* IF MAX_MIX_COUNT > 0 */ /* No mixes, this thread runs on its own doing just volume */ - + GiveSamplesToDevice(c_mixer2, samples_to_device_map, multOut); + GetSamplesFromDevice(c_mixer2); GiveSamplesToHost(c_host, samples_to_host_map, multIn); - GetSamplesFromHost(c_host, underflow); + GetSamplesFromHost(c_host); #endif } } @@ -627,13 +614,16 @@ static int mixer2_mix2_flag = (DEFAULT_FREQ > 96000); static void mixer2(chanend c_mixer1, chanend c_audio) { int mixed; - unsigned underflow = 0; + unsigned request; while (1) { - outuint(c_mixer1, 0); #pragma xta endpoint "mixer2_req" - inuint(c_audio); + request = inuint(c_audio); + + /* Forward the request on */ + outuint(c_mixer1, request); + if(testct(c_mixer1)) { int sampFreq; @@ -678,8 +668,8 @@ static void mixer2(chanend c_mixer1, chanend c_audio) } else { - underflow = inuint(c_mixer1); - GiveSamplesToDevice(c_audio, samples_to_device_map, multOut, underflow); + (void) inuint(c_mixer1); + GiveSamplesToDevice(c_audio, samples_to_device_map, multOut); inuint(c_mixer1); outuint(c_mixer1, 0); GetSamplesFromDevice(c_audio); diff --git a/module_usb_audio/uac_hwresources.h b/module_usb_audio/uac_hwresources.h index 2a75326c..7fdbe94a 100644 --- a/module_usb_audio/uac_hwresources.h +++ b/module_usb_audio/uac_hwresources.h @@ -27,8 +27,6 @@ #define CLKBLK_USB_RST XS1_CLKBLK_4 /* Clock block passed into L/G series XUD */ #define CLKBLK_FLASHLIB XS1_CLKBLK_5 /* Clock block for use by flash lib */ -/* #define CLKBLK_SPDIF_TX XS1_CLKBLK_1 */ -/* #define CLKBLK_MCLK XS1_CLKBLK_2 */ #define CLKBLK_I2S_BIT XS1_CLKBLK_3 #else @@ -44,11 +42,8 @@ /* use REF for ADAT_RX on U-series */ /* #define CLKBLK_ADAT_RX XS1_CLKBLK_3 */ /* Note, U-series XUD uses clock blocks 4 and 5 - see XUD_Ports.xc */ +#define CLKBLK_FLASHLIB XS1_CLKBLK_5 /* Clock block for use by flash lib */ -//#define CLKBLK_FLASHLIB XS1_CLKBLK_5 /* Clock block for use by flash lib */ - -/* #define CLKBLK_SPDIF_TX XS1_CLKBLK_1 */ -/* #define CLKBLK_MCLK XS1_CLKBLK_2 */ #define CLKBLK_I2S_BIT XS1_CLKBLK_3 #endif diff --git a/module_usb_audio/usb_buffer/decouple.xc b/module_usb_audio/usb_buffer/decouple.xc index edb985e0..8dd20c01 100644 --- a/module_usb_audio/usb_buffer/decouple.xc +++ b/module_usb_audio/usb_buffer/decouple.xc @@ -129,10 +129,9 @@ void handle_audio_request(chanend c_mix_out) int space_left; /* Input word that triggered interrupt and handshake back */ - (void) inuint(c_mix_out); - - /* Reply with underflow */ - outuint(c_mix_out, outUnderflow); + unsigned underflowSample = inuint(c_mix_out); + + outuint(c_mix_out, 0); /* If in overflow condition then receive samples and throw away */ if(inOverflow || sampsToWrite == 0) @@ -176,7 +175,7 @@ __builtin_unreachable(); int mult; int h; unsigned l; - asm("ldw %0, %1[%2]":"=r"(mult):"r"(p_multIn),"r"(i)); + asm volatile("ldw %0, %1[%2]":"=r"(mult):"r"(p_multIn),"r"(i)); {h, l} = macs(mult, sample, 0, 0); sample = h << 3; @@ -207,7 +206,7 @@ __builtin_unreachable(); int mult; int h; unsigned l; - asm("ldw %0, %1[%2]":"=r"(mult):"r"(p_multIn),"r"(i)); + asm volatile("ldw %0, %1[%2]":"=r"(mult):"r"(p_multIn),"r"(i)); {h, l} = macs(mult, sample, 0, 0); sample = h << 3; #if (STREAM_FORMAT_INPUT_RESOLUTION_32BIT_USED == 1) @@ -240,7 +239,7 @@ __builtin_unreachable(); int mult; int h; unsigned l; - asm("ldw %0, %1[%2]":"=r"(mult):"r"(p_multIn),"r"(i)); + asm volatile("ldw %0, %1[%2]":"=r"(mult):"r"(p_multIn),"r"(i)); {h, l} = macs(mult, sample, 0, 0); sample = h << 3; #endif @@ -290,21 +289,11 @@ __builtin_unreachable(); if(outUnderflow) { #pragma xta endpoint "out_underflow" -#if 0 /* We're still pre-buffering, send out 0 samps */ for(int i = 0; i < NUM_USB_CHAN_OUT; i++) { - unsigned sample; - unsigned mode; - GET_SHARED_GLOBAL(sample, g_muteSample); - GET_SHARED_GLOBAL(mode, dsdMode); - - if(mode == DSD_MODE_DOP) - outuint(c_mix_out, 0xFA969600); - else - outuint(c_mix_out, sample); + outuint(c_mix_out, underflowSample); } -#endif /* Calc how many samples left in buffer */ outSamps = g_aud_from_host_wrptr - g_aud_from_host_rdptr; @@ -343,7 +332,7 @@ __builtin_unreachable(); sample <<= 16; #if (OUTPUT_VOLUME_CONTROL == 1) && !defined(OUT_VOLUME_IN_MIXER) - asm("ldw %0, %1[%2]":"=r"(mult):"r"(p_multOut),"r"(i)); + asm volatile("ldw %0, %1[%2]":"=r"(mult):"r"(p_multOut),"r"(i)); {h, l} = macs(mult, sample, 0, 0); /* Note, in 2 byte subslot mode - ignore lower result of macs */ h <<= 3; @@ -371,7 +360,7 @@ __builtin_unreachable(); g_aud_from_host_rdptr+=4; #if (OUTPUT_VOLUME_CONTROL == 1) && !defined(OUT_VOLUME_IN_MIXER) - asm("ldw %0, %1[%2]":"=r"(mult):"r"(p_multOut),"r"(i)); + asm volatile("ldw %0, %1[%2]":"=r"(mult):"r"(p_multOut),"r"(i)); {h, l} = macs(mult, sample, 0, 0); h <<= 3; #if (STREAM_FORMAT_OUTPUT_RESOLUTION_32BIT_USED == 1) @@ -426,7 +415,7 @@ __builtin_unreachable(); unpackState++; #if (OUTPUT_VOLUME_CONTROL == 1) && !defined(OUT_VOLUME_IN_MIXER) - asm("ldw %0, %1[%2]":"=r"(mult):"r"(p_multOut),"r"(i)); + asm volatile("ldw %0, %1[%2]":"=r"(mult):"r"(p_multOut),"r"(i)); {h, l} = macs(mult, sample, 0, 0); h <<= 3; outuint(c_mix_out, h); @@ -476,7 +465,7 @@ __builtin_unreachable(); } /* Get feedback val - ideally this would be syncronised */ - asm("ldw %0, dp[g_speed]" : "=r" (speed) :); + asm volatile("ldw %0, dp[g_speed]" : "=r" (speed) :); /* Calc packet size to send back based on our fb */ speedRem += speed; @@ -587,7 +576,7 @@ static inline void SetupZerosSendBuffer(XUD_ep aud_to_host_usb_ep, unsigned samp mid *= g_numUsbChan_In * slotSize; - asm("stw %0, %1[0]"::"r"(mid),"r"(g_aud_to_host_zeros)); + asm volatile("stw %0, %1[0]"::"r"(mid),"r"(g_aud_to_host_zeros)); /* Mark EP ready with the zero buffer. Note this will simply update the packet size * if it is already ready */ @@ -648,14 +637,14 @@ void decouple(chanend c_mix_out #ifndef OUT_VOLUME_IN_MIXER for (int i = 0; i < NUM_USB_CHAN_OUT + 1; i++) { - asm("stw %0, %1[%2]"::"r"(MAX_VOL),"r"(p_multOut),"r"(i)); + asm volatile("stw %0, %1[%2]"::"r"(MAX_VOL),"r"(p_multOut),"r"(i)); } #endif #ifndef IN_VOLUME_IN_MIXER for (int i = 0; i < NUM_USB_CHAN_IN + 1; i++) { - asm("stw %0, %1[%2]"::"r"(MAX_VOL),"r"(p_multIn),"r"(i)); + asm volatile("stw %0, %1[%2]"::"r"(MAX_VOL),"r"(p_multIn),"r"(i)); } #endif @@ -751,7 +740,7 @@ void decouple(chanend c_mix_out chkct(c_mix_out, XS1_CT_END); SET_SHARED_GLOBAL(g_freqChange, 0); - asm("outct res[%0],%1"::"r"(buffer_aud_ctl_chan),"r"(XS1_CT_END)); + asm volatile("outct res[%0],%1"::"r"(buffer_aud_ctl_chan),"r"(XS1_CT_END)); ENABLE_INTERRUPTS(); @@ -795,7 +784,7 @@ void decouple(chanend c_mix_out } SET_SHARED_GLOBAL(g_freqChange, 0); - asm("outct res[%0],%1"::"r"(buffer_aud_ctl_chan),"r"(XS1_CT_END)); + asm volatile("outct res[%0],%1"::"r"(buffer_aud_ctl_chan),"r"(XS1_CT_END)); ENABLE_INTERRUPTS(); } @@ -840,7 +829,7 @@ void decouple(chanend c_mix_out /* Wait for handshake back */ chkct(c_mix_out, XS1_CT_END); - asm("outct res[%0],%1"::"r"(buffer_aud_ctl_chan),"r"(XS1_CT_END)); + asm volatile("outct res[%0],%1"::"r"(buffer_aud_ctl_chan),"r"(XS1_CT_END)); SET_SHARED_GLOBAL(g_freqChange, 0); ENABLE_INTERRUPTS(); @@ -1000,7 +989,7 @@ void decouple(chanend c_mix_out { int p, len; GET_SHARED_GLOBAL(p, g_aud_to_host_buffer); - asm("ldw %0, %1[0]":"=r"(len):"r"(p)); + asm volatile("ldw %0, %1[0]":"=r"(len):"r"(p)); XUD_SetReady_InPtr(aud_to_host_usb_ep, p+4, len); } continue; diff --git a/module_usb_audio/usb_buffer/interrupt.h b/module_usb_audio/usb_buffer/interrupt.h index d52ee1b7..044258f6 100644 --- a/module_usb_audio/usb_buffer/interrupt.h +++ b/module_usb_audio/usb_buffer/interrupt.h @@ -160,11 +160,11 @@ #define set_interrupt_handler(f, nstackwords, args, c, ...) \ asm (" .section .dp.data, \"adw\", @progbits\n" \ " .align 4\n" \ - "__" #f "_kernel_stack:\n" \ + "__" #f "_kernel_stack%=:\n" \ " .space " #nstackwords ", 0\n" \ - " .text\n"); \ - asm("mov r10, %0; ldaw r11, dp[__" #f "_kernel_stack];add r11, r11, r10;ldaw r10, sp[0]; "\ - "set sp,r11;stw r10, sp[0]; krestsp 0"::"r"(nstackwords-8):"r10","r11"); \ + " .text\n" \ + "mov r10, %0; ldaw r11, dp[__" #f "_kernel_stack%=];add r11, r11, r10;ldaw r10, sp[0]; "\ + "set sp,r11;stw r10, sp[0]; krestsp 0"::"r"(nstackwords-8):"r10","r11"); \ store_args ## args(c, __VA_ARGS__) \ do_interrupt_handler(f, args) \ asm("ldap r11, __" #f "_handler; setv res[%0],r11"::"r"(c):"r11"); \ diff --git a/module_usb_audio/user_hid.h b/module_usb_audio/user_hid.h index e834aa04..dd0b355e 100644 --- a/module_usb_audio/user_hid.h +++ b/module_usb_audio/user_hid.h @@ -1,3 +1,12 @@ + +/* These defines relate to the HID report desc - do not mod */ +#define HID_CONTROL_PLAYPAUSE_SHIFT 0x01 +#define HID_CONTROL_NEXT_SHIFT 0x02 +#define HID_CONTROL_PREV_SHIFT 0x03 +#define HID_CONTROL_VOLUP_SHIFT 0x04 +#define HID_CONTROL_VOLDN_SHIFT 0x05 +#define HID_CONTROL_MUTE_SHIFT 0x06 + void UserReadHIDButtons(unsigned char hidData[]); diff --git a/module_usb_audio_adat/.cproject b/module_usb_audio_adat/.cproject deleted file mode 100644 index 252164f5..00000000 --- a/module_usb_audio_adat/.cproject +++ /dev/null @@ -1,497 +0,0 @@ - - - - - - - - - - - - - - - - - - xmake - -f .makefile - all - true - true - true - - - xmake - -f .makefile - clean - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/module_usb_audio_adat/.makefile b/module_usb_audio_adat/.makefile deleted file mode 100644 index 87b347b9..00000000 --- a/module_usb_audio_adat/.makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: - @echo "** Module only - only builds as part of application **" - - -clean: - @echo "** Module only - only builds as part of application **" - - diff --git a/module_usb_audio_adat/.project b/module_usb_audio_adat/.project deleted file mode 100644 index 155a17c6..00000000 --- a/module_usb_audio_adat/.project +++ /dev/null @@ -1,76 +0,0 @@ - - - module_usb_audio_adat - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?children? - ?name?=outputEntries\|?children?=?name?=entry\\\\|\\|\|| - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.buildArguments - CONFIG=Debug - - - org.eclipse.cdt.make.core.buildCommand - xmake - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - false - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - com.xmos.cdt.core.XdeProjectNature - - - diff --git a/module_usb_audio_adat/.xproject b/module_usb_audio_adat/.xproject deleted file mode 100644 index d80aba33..00000000 --- a/module_usb_audio_adat/.xproject +++ /dev/null @@ -1 +0,0 @@ -sc_usb_audioXM-004720-SM \ No newline at end of file diff --git a/module_usb_audio_adat/README.rst b/module_usb_audio_adat/README.rst deleted file mode 100644 index a81d321d..00000000 --- a/module_usb_audio_adat/README.rst +++ /dev/null @@ -1,9 +0,0 @@ -ADAT Module for UAC2 MC Reference Design -======================================== - -:scope: General Use -:description: ADAT -:keywords: ADAT -:boards: XR-USB-AUDIO-20-MC - -ADAT code diff --git a/module_usb_audio_adat/module_description b/module_usb_audio_adat/module_description deleted file mode 100644 index e69de29b..00000000 diff --git a/module_usb_audio_adat/src/adatreceiver.h b/module_usb_audio_adat/src/adatreceiver.h deleted file mode 100644 index 451f9df9..00000000 --- a/module_usb_audio_adat/src/adatreceiver.h +++ /dev/null @@ -1,27 +0,0 @@ - -/** ADAT Receive Thread (48kHz sample rate). - * - * \param p ADAT port - should be 1-bit and clocked at 100MHz - * \param oChan channel on which decoded samples are output - * - * The function will return if it cannot lock onto a 44,100/48,000 Hz - * signal. Normally the 48000 function is called in a while(1) loop. If - * both 44,100 and 48,000 need to be supported, they should be called in - * sequence in a while(1) loop. Note that the functions are large, and - * that 44,100 should not be called if it does not need to be supported. - **/ -void adatReceiver48000(buffered in port:32 p, chanend oChan); - -/** ADAT Receive Thread (44.1kHz sample rate). - * - * \param p ADAT port - should be 1-bit and clocked at 100MHz - * \param oChan channel on which decoded samples are output - * - * The function will return if it cannot lock onto a 44,100/48,000 Hz - * signal. Normally the 48000 function is called in a while(1) loop. If - * both 44,100 and 48,000 need to be supported, they should be called in - * sequence in a while(1) loop. Note that the functions are large, and - * that 44,100 should not be called if it does not need to be supported. - **/ - -void adatReceiver44100(buffered in port:32 p, chanend oChan); diff --git a/module_usb_audio_adat/src/adatreceiver.xc b/module_usb_audio_adat/src/adatreceiver.xc deleted file mode 100644 index a2d19ff9..00000000 --- a/module_usb_audio_adat/src/adatreceiver.xc +++ /dev/null @@ -1,947 +0,0 @@ -// GENERATED CODE - DO NOT EDIT -// Comments are in the generator -#include -#include -#pragma unsafe arrays -void adatReceiver48000(buffered in port:32 p, chanend oChan) { - const unsigned int mask = 0x80808080; - unsigned compressed; - unsigned nibble, word = 1, fourBits, data; - int old, violation; - unsigned int lookupCrcF[16] = {8, 9, 12, 13, 7, 6, 3, 2, 10, 11, 14, 15, 5, 4, 1, 0}; - unsigned int lookupNRTZ[32] = {0, 8, 12, 4, 6, 14, 10, 2, 3, 11, 15, 7, 5, 13, 9, 1, - 1, 9, 13, 5, 7, 15, 11, 3, 2, 10, 14, 6, 4, 12, 8, 0}; - for(int i = 0; i < 32; i++) { lookupNRTZ[i] <<= 4; } - do { - old = word; p :> word; - } while (word != old || (word != 0 && word+1 != 0)); - while(1) { - violation = word; - p when pinsneq(violation) :> int _; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - outuint(oChan, nibble << 4 | 1); - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = nibble << 4; - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - old = old | compressed << 1; - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = nibble << 4; - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = nibble << 4; - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - old = compressed; - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = nibble << 4; - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = nibble << 4; - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = nibble << 4; - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = nibble << 4; - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = nibble << 4; - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - if (word != 0 && word+1 != 0) return; - } -} - -// GENERATED CODE - DO NOT EDIT -// Comments are in the generator -#include -#include -#pragma unsafe arrays -void adatReceiver44100(buffered in port:32 p, chanend oChan) { - const unsigned int mask = 0x80402010; - unsigned compressed; - unsigned nibble, word = 1, fourBits, data; - int old, violation; - unsigned int lookupCrcF[16] = {8, 12, 10, 14, 9, 13, 11, 15, 7, 3, 5, 1, 6, 2, 4, 0}; - unsigned int lookupNRTZ[32] = {0, 8, 12, 4, 6, 14, 10, 2, 3, 11, 15, 7, 5, 13, 9, 1, - 1, 9, 13, 5, 7, 15, 11, 3, 2, 10, 14, 6, 4, 12, 8, 0}; - for(int i = 0; i < 32; i++) { lookupNRTZ[i] <<= 4; } - do { - old = word; p :> word; - } while (word != old || (word != 0 && word+1 != 0)); - while(1) { - violation = word; - p when pinsneq(violation) :> int _; - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - outuint(oChan, nibble << 4 | 1); - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = nibble << 4; - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - old = compressed; - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = nibble << 4; - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - old = compressed; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - old = old | compressed << 1; - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = nibble << 4; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - old = compressed; - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = nibble << 4; - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - old = old | compressed << 1; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = nibble << 4; - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - old = compressed; - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = nibble << 4; - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - old = old | compressed << 1; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = nibble << 4; - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 7) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 1) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - old = compressed; - p :> word; - fourBits = (word << 3) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = nibble << 4; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - old = old | compressed << 1; - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 6) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 3)) & 31]; - old = compressed >> 2; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 4) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 1)) & 31]; - old = compressed >> 4; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 0) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - old = compressed; - p :> word; - fourBits = (word << 5) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - compressed = compressed >> 1; - nibble = lookupNRTZ[(old | (compressed << 4)) & 31]; - old = compressed >> 1; - data = (data | nibble) << 4; - p :> word; - fourBits = (word << 2) & mask; - crc32(fourBits, 0xf, 0xf); - compressed = lookupCrcF[fourBits]; - nibble = lookupNRTZ[(old | (compressed << 2)) & 31]; - old = compressed >> 3; - data = (data | nibble) << 4; - outuint(oChan, data); - p :> word; - if (word != 0 && word+1 != 0) return; - } -} -