增加串口初始化操作

This commit is contained in:
魔罗技术 2020-07-11 12:33:54 +08:00
parent 6bb9546232
commit 92fce520cb

View File

@ -38,8 +38,10 @@ static void uart_init(int baudrate)
ring_buf_init(&rbsend, txbuf, sizeof(txbuf));/*<2A><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD> */
ring_buf_init(&rbrecv, rxbuf, sizeof(rxbuf));
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA , ENABLE);
GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_USART1);
GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_USART1);
GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_USART1);
gpio_conf(GPIOA, GPIO_Mode_AF, GPIO_PuPd_NOPULL,
GPIO_Pin_9 | GPIO_Pin_10);