Merge branch 'master' into 6V3_DEV

This commit is contained in:
Ross Owen
2013-11-28 16:23:54 +00:00
4 changed files with 91 additions and 109 deletions

View File

@@ -1,6 +1,5 @@
#include <xs1.h> #include <xs1.h>
#include <platform.h> #include <platform.h>
#include <print.h>
#include "devicedefines.h" #include "devicedefines.h"
#include "xud.h" #include "xud.h"

View File

@@ -1,7 +1,6 @@
#include <xs1.h> #include <xs1.h>
#include <flash.h> #include <flash.h>
#include <flashlib.h> #include <flashlib.h>
#include <print.h>
#include <string.h> #include <string.h>
#include <xclib.h> #include <xclib.h>

View File

@@ -169,7 +169,6 @@ static inline void doI2SClocks(unsigned divide)
unsigned dsdSample_l = 0x96960000; unsigned dsdSample_l = 0x96960000;
unsigned dsdSample_r = 0x96960000; unsigned dsdSample_r = 0x96960000;
#endif #endif
int counter = 0;
unsigned underflowWord = 0; unsigned underflowWord = 0;
#if NUM_USB_CHAN_IN > 0 #if NUM_USB_CHAN_IN > 0
@@ -365,7 +364,6 @@ static inline void doI2SClocks(unsigned divide)
{ {
outuint(c_out, 0); outuint(c_out, 0);
/* Check for sample freq change (or other command) or new samples from mixer*/ /* Check for sample freq change (or other command) or new samples from mixer*/
if(testct(c_out)) if(testct(c_out))
{ {
@@ -391,7 +389,6 @@ static inline void doI2SClocks(unsigned divide)
{ {
#ifndef MIXER // Interfaces straight to decouple() #ifndef MIXER // Interfaces straight to decouple()
underflow = inuint(c_out); underflow = inuint(c_out);
counter++;
#if NUM_USB_CHAN_IN > 0 #if NUM_USB_CHAN_IN > 0
#pragma loop unroll #pragma loop unroll
for(int i = 0; i < NUM_USB_CHAN_IN; i++) for(int i = 0; i < NUM_USB_CHAN_IN; i++)
@@ -418,7 +415,7 @@ static inline void doI2SClocks(unsigned divide)
} }
} }
#endif #endif
#else #else /* ifndef MIXER */
#pragma loop unroll #pragma loop unroll
for(int i = 0; i < NUM_USB_CHAN_OUT; i++) for(int i = 0; i < NUM_USB_CHAN_OUT; i++)
{ {
@@ -543,11 +540,9 @@ static inline void doI2SClocks(unsigned divide)
case 2: case 2:
p_dsd_clk <: 0xAAAAAAAA; p_dsd_clk <: 0xAAAAAAAA;
break; break;
case 1:
break;
} }
} }
else if(everyOther) else // everyOther
{ {
everyOther = 0; everyOther = 0;
dsdSample_l = dsdSample_l | ((samplesOut[0] & 0xffff00) >> 8); dsdSample_l = dsdSample_l | ((samplesOut[0] & 0xffff00) >> 8);
@@ -575,8 +570,6 @@ static inline void doI2SClocks(unsigned divide)
case 2: case 2:
p_dsd_clk <: 0xAAAAAAAA; p_dsd_clk <: 0xAAAAAAAA;
break; break;
case 1:
break;
} }
} }
@@ -624,21 +617,6 @@ static inline void doI2SClocks(unsigned divide)
outuint(c_spd_out, samplesOut[SPDIF_TX_INDEX]); /* Forward sample to S/PDIF Tx thread */ outuint(c_spd_out, samplesOut[SPDIF_TX_INDEX]); /* Forward sample to S/PDIF Tx thread */
sample = samplesOut[SPDIF_TX_INDEX + 1]; sample = samplesOut[SPDIF_TX_INDEX + 1];
outuint(c_spd_out, sample); /* Forward sample to S/PDIF Tx thread */ outuint(c_spd_out, sample); /* Forward sample to S/PDIF Tx thread */
#ifdef RAMP_CHECK
sample >>= 8;
if (started<10000) {
if (sample == prev+1)
started++;
}
else
if (sample != prev+1 && sample != 0) {
printintln(prev);
printintln(sample);
printintln(prev-sample+1);
}
prev = sample;
#endif
#endif #endif
tmp = 0; tmp = 0;
#pragma xta endpoint "i2s_output_r" #pragma xta endpoint "i2s_output_r"
@@ -726,9 +704,7 @@ static inline void doI2SClocks(unsigned divide)
} }
} }
} }
#endif #endif
} }
return {0,0}; return {0,0};
} }

View File

@@ -191,6 +191,14 @@
#error MCLK_441 not defined #error MCLK_441 not defined
#endif #endif
#if ((MCLK_441 % DEFAULT_FREQ) == 0)
#define DEFAULT_MCLK_FREQ MCLK_441
#elif ((MCLK_48 % DEFAULT_FREQ) == 0)
#define DEFAULT_MCLK_FREQ MCLK_48
#else
#error Bad DEFAULT_MCLK_FREQ
#endif
/* The number of clock ticks to wait for the audio PLL to lock */ /* The number of clock ticks to wait for the audio PLL to lock */
#ifndef AUDIO_PLL_LOCK_DELAY #ifndef AUDIO_PLL_LOCK_DELAY
#define AUDIO_PLL_LOCK_DELAY (40000000) #define AUDIO_PLL_LOCK_DELAY (40000000)