change baudrate to 56000bps

master
ThinkPad-T460P 2021-01-06 12:23:39 +08:00
parent eba5553338
commit 93fc34a75c
2 changed files with 21 additions and 4 deletions

View File

@ -6,7 +6,7 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
* All rights reserved.</center></h2> * All rights reserved.</center></h2>
* *
* This software component is licensed by ST under Ultimate Liberty license * This software component is licensed by ST under Ultimate Liberty license
@ -32,7 +32,7 @@ void MX_UART4_Init(void)
{ {
huart4.Instance = UART4; huart4.Instance = UART4;
huart4.Init.BaudRate = 115200; huart4.Init.BaudRate = 56000;
huart4.Init.WordLength = UART_WORDLENGTH_8B; huart4.Init.WordLength = UART_WORDLENGTH_8B;
huart4.Init.StopBits = UART_STOPBITS_1; huart4.Init.StopBits = UART_STOPBITS_1;
huart4.Init.Parity = UART_PARITY_NONE; huart4.Init.Parity = UART_PARITY_NONE;
@ -51,7 +51,7 @@ void MX_USART1_UART_Init(void)
{ {
huart1.Instance = USART1; huart1.Instance = USART1;
huart1.Init.BaudRate = 115200; huart1.Init.BaudRate = 56000;
huart1.Init.WordLength = UART_WORDLENGTH_8B; huart1.Init.WordLength = UART_WORDLENGTH_8B;
huart1.Init.StopBits = UART_STOPBITS_1; huart1.Init.StopBits = UART_STOPBITS_1;
huart1.Init.Parity = UART_PARITY_NONE; huart1.Init.Parity = UART_PARITY_NONE;
@ -172,7 +172,23 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
/* USER CODE BEGIN 1 */ /* USER CODE BEGIN 1 */
//printf redirect
#ifdef __GNUC__
//#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#define PUTCHAR_PROTOTYPE int putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif
PUTCHAR_PROTOTYPE
{
// uint8_t time_out=3;
// while(!__HAL_UART_GET_FLAG(&huart1,UART_FLAG_TXE) && time_out--){
// HAL_Delay(1);
// }
HAL_UART_Transmit(&huart1,(uint8_t *)&ch,1,100);
return ch;
}
/* USER CODE END 1 */ /* USER CODE END 1 */

View File

@ -3,7 +3,7 @@
* @Author: CK.Zh * @Author: CK.Zh
* @Date: 2020-02-20 11:39:38 * @Date: 2020-02-20 11:39:38
* @LastEditors: CK.Zh * @LastEditors: CK.Zh
* @LastEditTime: 2020-04-30 10:15:25 * @LastEditTime: 2021-01-05 16:21:59
--> -->
# NaviKit_stm32 # NaviKit_stm32
PM1导航套件中电源控制板源码STM32F107VCT6开发环境STM32CubeIDE PM1导航套件中电源控制板源码STM32F107VCT6开发环境STM32CubeIDE
@ -32,3 +32,4 @@
`void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd)`函数内 `void HAL_PCD_IRQHandler(PCD_HandleTypeDef *hpcd)`函数内
`HAL_PCD_SuspendCallback(hpcd); `代码段 务必屏蔽,否则导致枚举失败,提示获取设备描述符失败。 `HAL_PCD_SuspendCallback(hpcd); `代码段 务必屏蔽,否则导致枚举失败,提示获取设备描述符失败。
> EC日志输出口波特率为56000bps