forked from PAWPAW-Mirror/lib_xua
Remove USB with define NO_USB in main & audio_io.
This commit is contained in:
@@ -255,6 +255,7 @@ static inline void TransferAdatTxSamples(chanend c_adat_out, const unsigned samp
|
|||||||
/* sampsFromAudioToUsb: The sample frame that was received from the audio interfaces and that the device is going to send to the host */
|
/* sampsFromAudioToUsb: The sample frame that was received from the audio interfaces and that the device is going to send to the host */
|
||||||
void UserBufferManagement(unsigned sampsFromUsbToAudio[], unsigned sampsFromAudioToUsb[], client audManage_if i_audMan);
|
void UserBufferManagement(unsigned sampsFromUsbToAudio[], unsigned sampsFromAudioToUsb[], client audManage_if i_audMan);
|
||||||
|
|
||||||
|
#ifndef NO_USB
|
||||||
#pragma unsafe arrays
|
#pragma unsafe arrays
|
||||||
static inline unsigned DoSampleTransfer(chanend c_out, const int readBuffNo, const unsigned underflowWord, client audManage_if i_audMan)
|
static inline unsigned DoSampleTransfer(chanend c_out, const int readBuffNo, const unsigned underflowWord, client audManage_if i_audMan)
|
||||||
{
|
{
|
||||||
@@ -312,6 +313,15 @@ static inline unsigned DoSampleTransfer(chanend c_out, const int readBuffNo, con
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else /* NO_USB */
|
||||||
|
#pragma unsafe arrays
|
||||||
|
static inline unsigned DoSampleTransfer(chanend c_out, const int readBuffNo, const unsigned underflowWord, client audManage_if i_audMan)
|
||||||
|
{
|
||||||
|
UserBufferManagement(samplesOut, samplesIn[readBuffNo], i_audMan);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif /* NO_USB */
|
||||||
|
|
||||||
static inline void InitPorts(unsigned divide)
|
static inline void InitPorts(unsigned divide)
|
||||||
{
|
{
|
||||||
unsigned tmp;
|
unsigned tmp;
|
||||||
@@ -1231,7 +1241,9 @@ chanend ?c_config, chanend ?c
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Handshake back */
|
/* Handshake back */
|
||||||
|
#ifndef NO_USB
|
||||||
outct(c_mix_out, XS1_CT_END);
|
outct(c_mix_out, XS1_CT_END);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
firstRun = 0;
|
firstRun = 0;
|
||||||
@@ -1297,6 +1309,7 @@ chanend ?c_config, chanend ?c
|
|||||||
null, i_audMan
|
null, i_audMan
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#ifndef NO_USB
|
||||||
if(command == SET_SAMPLE_FREQ)
|
if(command == SET_SAMPLE_FREQ)
|
||||||
{
|
{
|
||||||
curSamFreq = inuint(c_mix_out) * I2S_DOWNSAMPLE_FACTOR;
|
curSamFreq = inuint(c_mix_out) * I2S_DOWNSAMPLE_FACTOR;
|
||||||
@@ -1339,6 +1352,8 @@ chanend ?c_config, chanend ?c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* NO_USB */
|
||||||
|
|
||||||
#ifdef SPDIF_TX
|
#ifdef SPDIF_TX
|
||||||
/* Notify S/PDIF task of impending new freq... */
|
/* Notify S/PDIF task of impending new freq... */
|
||||||
outct(c_spdif_out, XS1_CT_END);
|
outct(c_spdif_out, XS1_CT_END);
|
||||||
|
|||||||
@@ -577,6 +577,7 @@ int main()
|
|||||||
DFUHandler(dfuInterface, null);
|
DFUHandler(dfuInterface, null);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef NO_USB
|
||||||
usb_audio_core(c_mix_out
|
usb_audio_core(c_mix_out
|
||||||
#ifdef MIDI
|
#ifdef MIDI
|
||||||
, c_midi
|
, c_midi
|
||||||
@@ -594,6 +595,7 @@ int main()
|
|||||||
VENDOR_REQUESTS_PARAMS_
|
VENDOR_REQUESTS_PARAMS_
|
||||||
|
|
||||||
);
|
);
|
||||||
|
#endif /* NO_USB */
|
||||||
}
|
}
|
||||||
|
|
||||||
on tile[AUDIO_IO_TILE]: usb_audio_io(c_mix_out, c_adc
|
on tile[AUDIO_IO_TILE]: usb_audio_io(c_mix_out, c_adc
|
||||||
|
|||||||
Reference in New Issue
Block a user