Skip to content

Commit

Permalink
support new uart core
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiangfu Liu committed Nov 22, 2011
1 parent ffad713 commit 8239be0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 2 additions & 4 deletions src/main.c
Expand Up @@ -29,10 +29,8 @@ void isr()

irqs = irq_pending() & irq_getmask();

if(irqs & IRQ_UARTRX)
uart_isr_rx();
if(irqs & IRQ_UARTTX)
uart_isr_tx();
if(irqs & IRQ_UART)
uart_isr();

if(irqs & IRQ_USB)
usb_isr();
Expand Down
11 changes: 6 additions & 5 deletions src/tests_midi.c
Expand Up @@ -29,22 +29,23 @@ static int loopback()
int result = TEST_STATUS_PASSED;

printf("press 'e' exit MIDI test\n");
irq_ack(IRQ_MIDITX|IRQ_MIDIRX);
irq_ack(IRQ_MIDI);
while(1) {
if (c == 256) {
printf("0 ~ 255 sent out, press 'e' for exit\n");
c = 0;
}
CSR_MIDI_RXTX = c;
while(!(irq_pending() & IRQ_MIDITX)) {
while(!(CSR_MIDI_STAT & MIDI_STAT_TX_EVT)) {
if(readchar_nonblock()) {
e = readchar();
if(e == 'e') return result;
}
}
irq_ack(IRQ_MIDITX);
CSR_MIDI_STAT = MIDI_STAT_TX_EVT;

if(!(irq_pending() & IRQ_MIDIRX)) {

if(CSR_MIDI_STAT & MIDI_STAT_RX_EVT) {
printf("Failed: RX receive problem\n");
result = TEST_STATUS_FAILED;
}
Expand All @@ -53,7 +54,7 @@ static int loopback()
printf("Failed: TX: %d, but RX: %d\n", c, CSR_MIDI_RXTX);
result = TEST_STATUS_FAILED;
}
irq_ack(IRQ_MIDIRX);
CSR_MIDI_STAT = MIDI_STAT_RX_EVT;
c++;
}

Expand Down

0 comments on commit 8239be0

Please sign in to comment.