Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

support new uart core

  • Loading branch information...
commit 8239be06539722c6ab540ed476b72d2ebe5a1fe7 1 parent ffad713
Xiangfu Liu authored
Showing with 8 additions and 9 deletions.
  1. +2 −4 src/main.c
  2. +6 −5 src/tests_midi.c
View
6 src/main.c
@@ -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();
View
11 src/tests_midi.c
@@ -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;
}
@@ -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++;
}
Please sign in to comment.
Something went wrong with that request. Please try again.