DFUHandler now combinable with dummy_deliver

This commit is contained in:
Ross Owen
2015-06-12 16:52:58 +01:00
parent 4d93a9c906
commit a22fb94e9d

View File

@@ -880,12 +880,11 @@ void testct_byref(chanend c, int &returnVal)
returnVal = 1; returnVal = 1;
} }
[[combinable]]
unsigned static dummy_deliver(chanend c_out) static void dummy_deliver(chanend c_out, unsigned &command)
{ {
int ct; int ct;
outuint(c_out, 0);
while (1) while (1)
{ {
@@ -895,9 +894,8 @@ unsigned static dummy_deliver(chanend c_out)
case testct_byref(c_out, ct): case testct_byref(c_out, ct):
if(ct) if(ct)
{ {
unsigned command = inct(c_out); unsigned command = inct(c_out);
return command; return;
} }
else else
{ {
@@ -933,7 +931,6 @@ unsigned static dummy_deliver(chanend c_out)
break; break;
} }
} }
return 0;
} }
#define SAMPLE_RATE 200000 #define SAMPLE_RATE 200000
#define NUMBER_CHANNELS 1 #define NUMBER_CHANNELS 1
@@ -1240,14 +1237,20 @@ chanend ?c_config, chanend ?c
{ {
outct(c_mix_out, XS1_CT_END); outct(c_mix_out, XS1_CT_END);
outuint(c_mix_out, 0);
while (1) while (1)
{ {
par{
#if XUD_TILE != 0 #if XUD_TILE != 0
[[combine]]
par
{
DFUHandler(dfuInterface, null); DFUHandler(dfuInterface, null);
#endif dummy_deliver(c_mix_out, command);
command = dummy_deliver(c_mix_out);
} }
#else
dummy_deliver(c_mix_out, command);
#endif
curSamFreq = inuint(c_mix_out); curSamFreq = inuint(c_mix_out);
if (curSamFreq == AUDIO_START_FROM_DFU) if (curSamFreq == AUDIO_START_FROM_DFU)