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.

CC2541

Other Parts Discussed in Thread: CC2541

请问我的CC2541串口我就发了一条数据进去,然后会连续不断的进入串口回调函数,这是怎末回事。

static void  Uart_Init(halUARTCBack_t SunnyCBack) {
  halUARTCfg_t uartConfig;
  // configure UART
  uartConfig.configured           = TRUE;
  uartConfig.baudRate             = NPI_UART_BR;
  uartConfig.flowControl          = NPI_UART_FC;
  uartConfig.flowControlThreshold = NPI_UART_FC_THRESHOLD;
  uartConfig.rx.maxBufSize        = NPI_UART_RX_BUF_SIZE;
  uartConfig.tx.maxBufSize        = NPI_UART_TX_BUF_SIZE;
  uartConfig.idleTimeout          = NPI_UART_IDLE_TIMEOUT;
  uartConfig.intEnable            = NPI_UART_INT_ENABLE;
  uartConfig.callBackFunc         = (halUARTCBack_t)SunnyCBack;
 (void)HalUARTOpen( NPI_UART_PORT, &uartConfig );
   return;
}
//串口回调函数
static void UartCallBack(uint8 port, uint8 event) {
 
  if (event & (HAL_UART_RX_TIMEOUT|HAL_UART_RX_FULL)) {
   
      Sunny_Send_Data("CCCCC",5);
      osal_set_event(UartTaskId, UART_RXCB_EVT);
    }
}