Skip to content

Commit 8239be0

Browse files
author
Xiangfu Liu
committedNov 22, 2011
support new uart core
1 parent ffad713 commit 8239be0

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed
 

‎src/main.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ void isr()
2929

3030
irqs = irq_pending() & irq_getmask();
3131

32-
if(irqs & IRQ_UARTRX)
33-
uart_isr_rx();
34-
if(irqs & IRQ_UARTTX)
35-
uart_isr_tx();
32+
if(irqs & IRQ_UART)
33+
uart_isr();
3634

3735
if(irqs & IRQ_USB)
3836
usb_isr();

‎src/tests_midi.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,23 @@ static int loopback()
2929
int result = TEST_STATUS_PASSED;
3030

3131
printf("press 'e' exit MIDI test\n");
32-
irq_ack(IRQ_MIDITX|IRQ_MIDIRX);
32+
irq_ack(IRQ_MIDI);
3333
while(1) {
3434
if (c == 256) {
3535
printf("0 ~ 255 sent out, press 'e' for exit\n");
3636
c = 0;
3737
}
3838
CSR_MIDI_RXTX = c;
39-
while(!(irq_pending() & IRQ_MIDITX)) {
39+
while(!(CSR_MIDI_STAT & MIDI_STAT_TX_EVT)) {
4040
if(readchar_nonblock()) {
4141
e = readchar();
4242
if(e == 'e') return result;
4343
}
4444
}
45-
irq_ack(IRQ_MIDITX);
45+
CSR_MIDI_STAT = MIDI_STAT_TX_EVT;
4646

47-
if(!(irq_pending() & IRQ_MIDIRX)) {
47+
48+
if(CSR_MIDI_STAT & MIDI_STAT_RX_EVT) {
4849
printf("Failed: RX receive problem\n");
4950
result = TEST_STATUS_FAILED;
5051
}
@@ -53,7 +54,7 @@ static int loopback()
5354
printf("Failed: TX: %d, but RX: %d\n", c, CSR_MIDI_RXTX);
5455
result = TEST_STATUS_FAILED;
5556
}
56-
irq_ack(IRQ_MIDIRX);
57+
CSR_MIDI_STAT = MIDI_STAT_RX_EVT;
5758
c++;
5859
}
5960

0 commit comments

Comments
 (0)
Please sign in to comment.