Other Parts Discussed in Thread: CC2531
CC2531 USB CDC 运行一段时间之后会断开,之后必须重新拔USB或者芯片复位才能重新正常,不然PC上的端口一直显示被占用。
这样的话一些长时间使用的设备就很麻烦。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
dma是poll 你也可以用ISR看你怎么配置。
/******************************************************************************
* @fn HalUARTOpen
*
* @brief Open a port according tp the configuration specified by parameter.
*
* @param port - UART port
* config - contains configuration information
*
* @return Status of the function call
*****************************************************************************/
uint8 HalUARTOpen(uint8 port, halUARTCfg_t *config)
{
(void)port;
(void)config;
#if (HAL_UART_DMA == 1)
if (port == HAL_UART_PORT_0) HalUARTOpenDMA(config);
#endif
#if (HAL_UART_DMA == 2)
if (port == HAL_UART_PORT_1) HalUARTOpenDMA(config);
#endif
#if (HAL_UART_ISR == 1)
if (port == HAL_UART_PORT_0) HalUARTOpenISR(config);
#endif
#if (HAL_UART_ISR == 2)
if (port == HAL_UART_PORT_1) HalUARTOpenISR(config);
#endif
#if (HAL_UART_USB)
HalUARTOpenUSB(config);
#endif
return HAL_UART_SUCCESS;
}