Skip to content

Commit 2e778b4

Browse files
author
Xiangfu Liu
committedDec 23, 2011
MIDI: clean RX before start test
1 parent be5b0e7 commit 2e778b4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/tests_midi.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ static int loopback(void)
2929
int timeout;
3030
int result = TEST_STATUS_PASSED;
3131

32+
if(CSR_MIDI_STAT & MIDI_STAT_RX_EVT) CSR_MIDI_STAT = MIDI_STAT_RX_EVT;
33+
3234
printf("Press 'e' to terminate the MIDI test\n");
3335
while(1) {
3436
if(c == 256) {
@@ -52,7 +54,7 @@ static int loopback(void)
5254
break;
5355
}
5456
}
55-
57+
5658
if(timeout > 0) {
5759
if(CSR_MIDI_RXTX != c) {
5860
printf("Failed: TX: %d, but RX: %d\n", c, CSR_MIDI_RXTX);
@@ -62,7 +64,7 @@ static int loopback(void)
6264
}
6365
c++;
6466
}
65-
67+
6668
return result;
6769
}
6870

0 commit comments

Comments
 (0)