summaryrefslogtreecommitdiff
path: root/bsp/rm48x50
diff options
context:
space:
mode:
authorGrissiom <[email protected]>2013-05-29 23:38:10 +0800
committerGrissiom <[email protected]>2013-05-29 23:38:10 +0800
commiteda09ab002f2403d9d5a9821c0802cf6ef96c256 (patch)
tree8477ec89c47f4ddd0bdc0fcbe60f3fa81421cc65 /bsp/rm48x50
parent27ee5b627b59aaf2fcf08267c368998bc15971c6 (diff)
rm48x50/uart.c: fix bugs
Diffstat (limited to 'bsp/rm48x50')
-rw-r--r--bsp/rm48x50/drivers/uart.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bsp/rm48x50/drivers/uart.c b/bsp/rm48x50/drivers/uart.c
index ced1cb7c75..3f0237e648 100644
--- a/bsp/rm48x50/drivers/uart.c
+++ b/bsp/rm48x50/drivers/uart.c
@@ -38,7 +38,7 @@ enum sciIntFlags
/* LIN1 High level interrupt. Change this if you set a different channel in
* HALCoGen. */
-#define SCI_INT_VEC 13
+#define SCI_INT_VEC 14
#define VCLK_HZ 100000000L
@@ -176,6 +176,11 @@ static const struct rt_uart_ops _sci_ops =
_getc,
};
+static void _irq_wrapper(int vector, void *param)
+{
+ rt_hw_serial_isr((struct rt_serial_device*)param);
+}
+
static struct rt_serial_device _sci2_serial;
static struct serial_ringbuffer _sci2_int_rx;
@@ -199,6 +204,7 @@ void rt_hw_uart_init(void)
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_STREAM,
(void*)scilinREG);
- rt_hw_interrupt_install(SCI_INT_VEC, rt_hw_serial_isr, &_sci2_serial, "sci2");
+ rt_device_control(&_sci2_serial.parent, RT_DEVICE_CTRL_SET_INT, 0);
+ rt_hw_interrupt_install(SCI_INT_VEC, _irq_wrapper, &_sci2_serial, "sci2");
rt_hw_interrupt_umask(SCI_INT_VEC);
}