请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:CC2642R 主题中讨论的其他器件:SysConfig
工具与软件:
您好、团队
SDK:C:\ti\simplelink_cc13xx_cc26xx_sdk_7_41_00_17。
代码:
int bsp_uart_open(uint32_t baudrate, UART_FNCT_RESPONSE respfnct)
{
(void)baudrate;
UART2_Params uartParams;
/* Create a UART where the default read and write mode is BLOCKING */
UART2_Params_init(&uartParams);
uartParams.readMode = UART2_Mode_NONBLOCKING;
uartParams.writeMode = UART2_Mode_BLOCKING;
uartParams.baudRate = UART_DEBUG_BAUDRATE;
uart2_1_handle = UART2_open(CONFIG_UART_1_DEBUG, &uartParams);
if (uart2_1_handle == NULL)
{
/* UART2_1_open() failed */
DEBUG_ASSERT(0);
return -1;
}
/* Create a UART in CALLBACK read mode */
UART2_Params_init(&uartParams);
uartParams.readMode = UART2_Mode_NONBLOCKING;
uartParams.writeMode = UART2_Mode_BLOCKING;
uartParams.baudRate = UART_MCU_BAUDRATE;
uart2_0_handle = UART2_open(CONFIG_UART_0_BLE, &uartParams);
if (uart2_0_handle == NULL)
{
/* UART2_0_open() failed */
DEBUG_ASSERT(0);
return -1;
}
gBspUARTStat.respfnct = respfnct;
gBspUARTStat.open_flag = true;
return 0;
}
在前一个任务调用 UART2_WRITE 后、下一个任务调用该写入接口函数会发生硬故障。
错误代码:




