在4.0.3版中在对串口配置时,为什么只配了接收错误中断,
static rt_err_t hc32_configure(struct rt_serial_device *serial,
struct serial_configure *cfg)
{
............
/* Register RX error interrupt */
hc32_install_irq_handler(&uart->config.rxerr_irq_config,
uart_irq_handlers[hc32_get_uart_index(uart->Instance)].rxerr_irq_handler,
RT_TRUE);
USART_FuncCmd(uart->Instance, UsartRxInt, Enable);
...........
}
而串口其它的中断要在stdio.c中
int libc_stdio_set_console(const char* device_name, int mode)
{
int fd;
char name[STDIO_DEVICE_NAME_MAX];
snprintf(name, sizeof(name) - 1, "/dev/%s", device_name);
name[STDIO_DEVICE_NAME_MAX - 1] = '\0';
fd = open(name, mode, 0);
if (fd >= 0)
{
if (std_fd >= 0)
{
close(std_fd);
}
std_fd = fd;
}
return std_fd;
}
在open里才配接收,发送中断