SOC OV788开发:10.uart 中断接收 以及usb启动模式
IRQ_HANDLER_DECLARE_START
IRQ_MAP(UART, uart_irq_handler);
#if defined(CONFIG_WIFIMODULE_BRCM4334X) || defined(CONFIG_WIFIMODULE_RTL8195A)
extern void app_scio_irq_handler_1(void);
#ifdef CONFIG_WIFIMODULE_USE_SCIO1
IRQ_MAP(SCIF1, app_scio_irq_handler_1);
#else
IRQ_MAP(SCIF2, app_scio_irq_handler_1);
#endif
#endif
IRQ_MAP(VP, vp_irq_handler);
IRQ_MAP(EOF, eof_intr_process);
IRQ_MAP(VSYNC, vsync_irq_handler);
IRQ_MAP(GPIO, gpio_irq_handler);
#ifdef CONFIG_MIMG_EN
IRQ_MAP(IMG, mimg_irq_handler);
#endif
#ifdef CONFIG_SCIF_USE_INTR
#ifdef CONFIG_APP_USE_SCIF02
IRQ_MAP(SCIF2, app_scif_irq_handler);
#else
IRQ_MAP(SCIF1, app_scif_irq_handler);
#endif
#endif
IRQ_HANDLER_DECLARE_END
static void uart_irq_handler(void)
{
static unsigned char uart_buf[128] = {0};
static int uart_count = 0;
while(1)
{
int ch = uart_testgetc();
if(ch == -1)
break;
uart_buf[uart_count++] = ch;
if(uart_count >= 128)
{
memset(uart_buf, 0, sizeof(uart_buf));
uart_count= 0;
break;
}
if(ch != ‘\r’ && ch != ‘\n’)
uart_putc(ch);
else
{
uart_putc(’\r’);
uart_putc(’\n’);
while((uart_count >= 1) && (uart_buf[–uart_count] == ‘\r’ || uart_buf[–uart_count] == ‘\n’))
uart_buf[uart_count] = ‘\0’;
handle_uart_data_cmd(uart_buf);
memset(uart_buf, 0, sizeof(uart_buf));
uart_count= 0;
}
}
}
static void board_usb_boot(void)
{
debug_printf(“Enter usb debug mode\n”);
disable_cache();
PADCLKSET;
usbdbg_en();
while(1);
}