You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

661 B

zstm32uart_irq_rx_service

USAGE

    功能描述:
        初始化串口,让串口以中断的形式,持续不断的接收消息,接收到消息通过HOOK_ZUART_RxCpltCallback回调上来,同时如果串口发生异常,自动重启串口接收。
    

static zstm32uart_t s_uarts[] = {
    {
        .huart = &huart2,
    }  //
};
...
void HOOK_ZUART_RxCpltCallback(UART_HandleTypeDef* huart, uint8_t rxdata) {
  if (huart == &huart2) {
      /**
       * 处理接收到串口消息
       */

  }
}
...
void main() {
  ....

  //启动串口接收
  uart_service_start_all_uart_rx(s_uarts, ARRARY_SIZE(s_uarts));

  ...
}