summaryrefslogtreecommitdiff
path: root/bsp/amebaz/drivers/drv_uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsp/amebaz/drivers/drv_uart.c')
-rw-r--r--bsp/amebaz/drivers/drv_uart.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/bsp/amebaz/drivers/drv_uart.c b/bsp/amebaz/drivers/drv_uart.c
index 88a4ba9d68..008fa3bda5 100644
--- a/bsp/amebaz/drivers/drv_uart.c
+++ b/bsp/amebaz/drivers/drv_uart.c
@@ -111,7 +111,7 @@ static int ameba_uart_getc (struct rt_serial_device *serial)
{
struct device_uart* uart = serial->parent.user_data;
- if(!serial_readable(&uart->serial))
+ if(!serial_readable(&uart->serial))
return -1;
/* Receive Data Available */
@@ -126,13 +126,13 @@ static rt_size_t ameba_uart_dma_transmit (struct rt_serial_device *serial, rt_ui
static void ameba_uart_irq(uint32_t id, SerialIrq event)
{
struct rt_serial_device *serial = (struct rt_serial_device *)id;
- if(event == RxIrq)
+ if(event == RxIrq)
{
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND);
- }
- else if(event == TxIrq)
+ }
+ else if(event == TxIrq)
{
- }
+ }
}
static rt_err_t dbg_configure(struct rt_serial_device *serial, struct serial_configure *cfg);
@@ -141,7 +141,7 @@ static int dbg_putc(struct rt_serial_device *serial, char c);
static int dbg_getc(struct rt_serial_device *serial);
static struct rt_serial_device ameba_dbg_serial;
-const struct rt_uart_ops _ambed_dbg_ops =
+const struct rt_uart_ops _ambed_dbg_ops =
{
dbg_configure,
dbg_control,
@@ -163,7 +163,7 @@ void dbg_uart_irq_handler(void * data)
DiagSetIsrEnReg(0);
rt_hw_serial_isr(&ameba_dbg_serial, RT_SERIAL_EVENT_RX_IND);
-
+
DiagSetIsrEnReg(IrqEn);
}
@@ -178,9 +178,9 @@ static rt_err_t dbg_control(struct rt_serial_device *serial, int cmd, void *arg)
case RT_DEVICE_CTRL_SET_INT:
/* install interrupt */
- DIAG_UartReInit((IRQ_FUN) dbg_uart_irq_handler);
+ DIAG_UartReInit((IRQ_FUN) dbg_uart_irq_handler);
/* Enable the UART Interrupt */
- NVIC_SetPriority(UART_LOG_IRQ, 10); /* this is rom_code_patch */
+ NVIC_SetPriority(UART_LOG_IRQ, 10); /* this is rom_code_patch */
break;
}
@@ -200,12 +200,12 @@ static int dbg_getc(struct rt_serial_device *serial)
if(!UART_Readable(UART2_DEV))
return -1;
-
+
c = DiagGetChar(_FALSE);
return c;
}
-
+
/*
* UART Initiation
*/
@@ -217,7 +217,7 @@ int rt_hw_uart_init(void)
#ifdef BSP_USING_UART0
{
struct device_uart *uart;
-
+
serial = &serial0;
uart = &uart0;
@@ -242,7 +242,7 @@ int rt_hw_uart_init(void)
serial->ops = &_ambed_dbg_ops;
serial->config = config;
-
+
rt_hw_serial_register(serial,
RT_CONSOLE_DEVICE_NAME,
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,