问答

汇集网友智慧,解决技术难题

newphj

TA的家园币:91  

  • AC78406 多个串口中断失效

    各位前辈好。第一次用AC78406芯片。使用uart0uart1中断接受不定长数据。单个串口可以接收了。两个串口同时使用只有先初始化的那个串口可以进入中断。请问哪里配置有问题吗?代码是用AutoGenStudio生成的。#include"string.h"#include"ckgen_drv.h"#include"gpio_drv.h"#include"gpio_hw.h"#include"uart_drv.h"#include"uart_hw.h"#include"uart_irq.h"#include"dma_drv.h"#include"gpio.h"#include"drv_comm.h"#include"FreeRTOS.h"#include"event_groups.h"#include"ac7840x_irq_cb.h"#defineRECELENGTHMAX1024staticuart_state_ts_uart0State={NULL};/*UART运行变量状态*/staticuart_state_ts_uart1State={NULL};/*UART运行变量状态*/staticuart_user_config_tuart0Config;staticuart_user_config_tuart1Config;staticunsignedcharg_receive0Data=0;staticunsignedshortintg_receive0Data_count=0;staticunsignedcharreceive0Data_group[RECELENGTHMAX={0};staticunsignedcharg_receive1Data=0;staticunsignedshortintg_receive1Data_count=0;staticunsignedcharreceive1Data_group[RECELENGTHMAX={0};EventGroupHandle_tEventGroupHandle_uart=NULL;/***@briefThisfunctionhandleUART0rxinterrupt.*@paramdriverState:callbackparameter*@paramevent:callbackparameter*@paramuserData:callbackparameter*@returnnone*/voidUART0_RX_IRQHandler_Callback(void*driverState,uint32_tevent,void*userData){/*USERCODEBEGINUART0_RX_IRQHandler_Callback*/if(event==UART_EVENT_RX_FULL){//xEventGroupSetBits(EventGroupHandle_uart1,EVENT_UART1_RX);receive0Data_group[g_receive0Data_count=g_receive0Data;g_receive0Data_count++;if(g_receive0Data_count>=RECELENGTHMAX){g_receive0Data_count=0;}}UART_DRV_ReceiveData(0,&g_receive0Data,1);/*USERCODEENDUART0_RX_IRQHandler_Callback*/}/***@briefThisfuncti