Skip to content

Commit

Permalink
MIDI: clean RX before start test
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangfu Liu committed Dec 23, 2011
1 parent be5b0e7 commit 2e778b4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tests_midi.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ static int loopback(void)
int timeout; int timeout;
int result = TEST_STATUS_PASSED; int result = TEST_STATUS_PASSED;


if(CSR_MIDI_STAT & MIDI_STAT_RX_EVT) CSR_MIDI_STAT = MIDI_STAT_RX_EVT;

printf("Press 'e' to terminate the MIDI test\n"); printf("Press 'e' to terminate the MIDI test\n");
while(1) { while(1) {
if(c == 256) { if(c == 256) {
Expand All @@ -52,7 +54,7 @@ static int loopback(void)
break; break;
} }
} }

if(timeout > 0) { if(timeout > 0) {
if(CSR_MIDI_RXTX != c) { if(CSR_MIDI_RXTX != c) {
printf("Failed: TX: %d, but RX: %d\n", c, CSR_MIDI_RXTX); printf("Failed: TX: %d, but RX: %d\n", c, CSR_MIDI_RXTX);
Expand All @@ -62,7 +64,7 @@ static int loopback(void)
} }
c++; c++;
} }

return result; return result;
} }


Expand Down

0 comments on commit 2e778b4

Please sign in to comment.