|
- kal_bool uart_task_init(void)
- {
- kal_bool ret=KAL_TRUE;
-
- UART_DriverInit(uartPort, 0);
- ret=U_Open(uartPort, MOD_UART3);
- kal_prompt_trace(MOD_CC, "uart_task_init....%d", ret);
- if(ret)
- {
- U_Register_RX_cb(uartPort, MOD_UART3, uart_task_uartRx);
- U_Register_TX_cb(uartPort, MOD_UART3, uart_task_uartTx);
- U_SetDCBConfig(uartPort, &uart_dcb, MOD_UART3);
- }
-
- return ret;
- }
- void uart_task_uartRx(UART_PORT port)
- {
- ilm_struct *send_ilm;
-
- kal_prompt_trace(MOD_CC, "uart_task_uartRx....%d", port);
- //uart_msg_handler();
- //uart_msg_write_handler();
- send_ilm = allocate_ilm(MOD_DRV_HISR);//这里的ID是什么意思,可以换成其他的ID么
- send_ilm->src_mod_id = MOD_DRV_HISR;
- send_ilm->dest_mod_id = MOD_UART3;
- send_ilm->msg_id = MSG_ID_UART_READ;
-
- msg_send_ext_queue(send_ilm);
- }
- void uart_msg_handler(void)
- {
- kal_uint16 nSize = 0,av=0;
- //kal_uint8 szData[64] = {0};
- nSize = U_GetBytes_VFIFO(uartPort, GetData, 100, 0, MOD_UART3);
- GetData[nSize]='\0';
- U_ClrRxBuffer(uartPort,MOD_UART3);
- }
复制代码
我现在一次发送一个大于3k的文件,或者我每0ms发送10个字符会复位,这个问题怎么解决? |
|