Permalink
Browse files

MIDI: clean RX before start test

  • Loading branch information...
1 parent be5b0e7 commit 2e778b44e8a79d472b793288d117201bacc6ef61 Xiangfu Liu committed Dec 23, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/tests_midi.c
View
@@ -29,6 +29,8 @@ static int loopback(void)
int timeout;
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");
while(1) {
if(c == 256) {
@@ -52,7 +54,7 @@ static int loopback(void)
break;
}
}
-
+
if(timeout > 0) {
if(CSR_MIDI_RXTX != c) {
printf("Failed: TX: %d, but RX: %d\n", c, CSR_MIDI_RXTX);
@@ -62,7 +64,7 @@ static int loopback(void)
}
c++;
}
-
+
return result;
}

0 comments on commit 2e778b4

Please sign in to comment.