初级会员

- 积分
- 119
- 金钱
- 119
- 注册时间
- 2021-4-11
- 在线时间
- 7 小时
|
1金钱
main.c(8): error: #169: expected a declaration
{
main.c(29): error: #77-D: this declaration has no storage class or type specifier
USART_InitStructure.USART_StopBits = USART_StopBits_1;//一个停止位
main.c(29): error: #65: expected a ";"
USART_InitStructure.USART_StopBits = USART_StopBits_1;//一个停止位
main.c(30): error: #77-D: this declaration has no storage class or type specifier
USART_InitStructure.USART_Parity = USART_Parity_No;//无奇偶校验位
main.c(30): error: #65: expected a ";"
USART_InitStructure.USART_Parity = USART_Parity_No;//无奇偶校验位
main.c(31): error: #77-D: this declaration has no storage class or type specifier
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;//无硬件数据流控制
main.c(31): error: #65: expected a ";"
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;//无硬件数据流控制
main.c(32): error: #77-D: this declaration has no storage class or type specifier
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //收发模式
main.c(32): error: #65: expected a ";"
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; //收发模式
main.c(33): error: #79: expected a type specifier
USART_Init(USART1, &USART_InitStructure); //初始化串口1
main.c(33): error: #79: expected a type specifier
USART_Init(USART1, &USART_InitStructure); //初始化串口1
main.c(33): warning: #77-D: this declaration has no storage class or type specifier
USART_Init(USART1, &USART_InitStructure); //初始化串口1
main.c(33): error: #147: declaration is incompatible with "void USART_Init(USART_TypeDef *, USART_InitTypeDef *)" (declared at line 372 of "..\FWLIB\inc\stm32f4xx_usart.h")
USART_Init(USART1, &USART_InitStructure); //初始化串口1
main.c(35): error: #79: expected a type specifier
USART_Cmd(USART1, ENABLE); //使能串口1
main.c(35): error: #757: constant "ENABLE" is not a type name
USART_Cmd(USART1, ENABLE); //使能串口1
main.c(35): warning: #77-D: this declaration has no storage class or type specifier
USART_Cmd(USART1, ENABLE); //使能串口1
main.c(35): error: #147: declaration is incompatible with "void USART_Cmd(USART_TypeDef *, FunctionalState)" (declared at line 376 of "..\FWLIB\inc\stm32f4xx_usart.h")
USART_Cmd(USART1, ENABLE); //使能串口1
main.c(37): error: #79: expected a type specifier
USART_ITConfig(USART1,USART_IT_RXNE,ENABLE);
main.c(37): error: #79: expected a type specifier
USART_ITConfig(USART1,USART_IT_RXNE,ENABLE);
main.c(37): error: #757: constant "ENABLE" is not a type name
USART_ITConfig(USART1,USART_IT_RXNE,ENABLE);
main.c(37): warning: #77-D: this declaration has no storage class or type specifier
USART_ITConfig(USART1,USART_IT_RXNE,ENABLE);
main.c(37): error: #147: declaration is incompatible with "void USART_ITConfig(USART_TypeDef *, uint16_t, FunctionalState)" (declared at line 411 of "..\FWLIB\inc\stm32f4xx_usart.h")
USART_ITConfig(USART1,USART_IT_RXNE,ENABLE);
main.c(39): error: #77-D: this declaration has no storage class or type specifier
NVIC_InitStructure.NVIC_IRQChannelCmd=ENABLE;
main.c(39): error: #65: expected a ";"
NVIC_InitStructure.NVIC_IRQChannelCmd=ENABLE;
main.c(40): error: #77-D: this declaration has no storage class or type specifier
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=1;
main.c(40): error: #65: expected a ";"
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=1;
main.c(41): error: #77-D: this declaration has no storage class or type specifier
NVIC_InitStructure.NVIC_IRQChannelSubPriority=1;
main.c(41): error: #65: expected a ";"
NVIC_InitStructure.NVIC_IRQChannelSubPriority=1;
main.c(42): error: #77-D: this declaration has no storage class or type specifier
NVIC_InitStructure.NVIC_IRQChannel=USART1_IRQn;
main.c(42): error: #65: expected a ";"
NVIC_InitStructure.NVIC_IRQChannel=USART1_IRQn;
main.c(43): error: #79: expected a type specifier
NVIC_Init( &NVIC_InitStructure);
main.c(43): warning: #77-D: this declaration has no storage class or type specifier
NVIC_Init( &NVIC_InitStructure);
main.c(43): error: #147: declaration is incompatible with "void NVIC_Init(NVIC_InitTypeDef *)" (declared at line 159 of "..\FWLIB\inc\misc.h")
NVIC_Init( &NVIC_InitStructure);
main.c(45): error: #169: expected a declaration
}
main.c: 4 warnings, 30 errors
compiling stm32f4xx_wwdg.c...
compiling stm32f4xx_it.c...
compiling delay.c...
compiling system_stm32f4xx.c...
compiling sys.c...
compiling usart.c...
"..\OBJ\Template.axf" - 30 Error(s), 5 Warning(s).
Target not created.
Build Time Elapsed: 00:00:04
|
|