关于warning:Deprecated declaration函数 | 您所在的位置:网站首页 › warning函数 › 关于warning:Deprecated declaration函数 |
关于 warning : Deprecated declaration/ 函数 / - give arg types 的编译问题
在调试 STM32 程序时 ( MDK 开发) 出现了, Deprecated declaration Globle_UART_Init - give arg types 问题;
我的程序如下
void Globle_UART_Init() { /* 串口参数配置 */ USART_InitStructure.USART_BaudRate = 115200;
/* 设置波特率为 115200*/ USART_InitStructure.USART_WordLength = USART_WordLength_8b; /* 设置数据位为 8 位 */ USART_InitStructure.USART_StopBits = USART_StopBits_1;
/* 设置停止位为 1 位 */ USART_InitStructure.USART_Parity = USART_Parity_No;
/* 无奇偶校验 */
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; /* 没有硬件流控 */ USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
/* 发送与 接收 */ USART_DeInit(USART1); USART_Init(USART1,&USART_InitStructure); }
声明: void Globle_UART_Init();
查找了原因,改成如下就可以了:
void Globle_UART_Init( void ) { /* 串口参数配置 */ USART_InitStructure.USART_BaudRate = 115200;
/* 设置波特率为 115200*/ USART_InitStructure.USART_WordLength = USART_WordLength_8b; /* 设置数据位为 8 位 */ USART_InitStructure.USART_StopBits = USART_StopBits_1;
/* 设置停止位为 1 位 */ USART_InitStructure.USART_Parity = USART_Parity_No;
/* 无奇偶校验 */
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; /* 没有硬件流控 */ |
CopyRight 2018-2019 实验室设备网 版权所有 |