完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
#include "STM32f10x.h"
#include "tiMcounter.h" #include "sys.h" #include "stm32f10x_gpio.h" #include "timer.h" GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_12; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //50MʱÖÓËÙ¶È GPIO_Init(GPIOA, &GPIO_InitStructure);/* PA0,PA12-> ×óÓÒÂö³åÊäÈë */ RCC_ClocksTypeDef RCC_ClockFreq; SystemInit(); RCC_GetClocksFreq(&RCC_ClockFreq); RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); 各位大佬帮忙看下,出了25个错,研究半天也没看出哪里错了,下面是编译结果 Build target 'ROBOT' compiling TIMcounter.c... ..HARDWARETIMcounterTIMcounter.c(11): error: #77-D: this declaration has no storage class or type specifier GPIO_InitStructure.GPIO_Pin=GPIO_Pin_0|GPIO_Pin_12; ..HARDWARETIMcounterTIMcounter.c(11): error: #147: declaration is incompatible with "GPIO_InitTypeDef GPIO_InitStructure" (declared at line 10) GPIO_InitStructure.GPIO_Pin=GPIO_Pin_0|GPIO_Pin_12; ..HARDWARETIMcounterTIMcounter.c(11): error: #65: expected a ";" GPIO_InitStructure.GPIO_Pin=GPIO_Pin_0|GPIO_Pin_12; ..HARDWARETIMcounterTIMcounter.c(12): error: #77-D: this declaration has no storage class or type specifier GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; ..HARDWARETIMcounterTIMcounter.c(12): error: #147: declaration is incompatible with "GPIO_InitTypeDef GPIO_InitStructure" (declared at line 11) GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; ..HARDWARETIMcounterTIMcounter.c(12): error: #65: expected a ";" GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; ..HARDWARETIMcounterTIMcounter.c(13): error: #77-D: this declaration has no storage class or type specifier GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //50M时钟速度 ..HARDWARETIMcounterTIMcounter.c(13): error: #147: declaration is incompatible with "GPIO_InitTypeDef GPIO_InitStructure" (declared at line 12) GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //50M时钟速度 ..HARDWARETIMcounterTIMcounter.c(13): error: #65: expected a ";" GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //50M时钟速度 ..HARDWARETIMcounterTIMcounter.c(14): error: #79: expected a type specifier GPIO_Init(GPIOA, &GPIO_InitStructure);/* PA0,PA12-> 左右脉冲输入 */ ..HARDWARETIMcounterTIMcounter.c(14): error: #79: expected a type specifier GPIO_Init(GPIOA, &GPIO_InitStructure);/* PA0,PA12-> 左右脉冲输入 */ ..HARDWARETIMcounterTIMcounter.c(14): warning: #77-D: this declaration has no storage class or type specifier GPIO_Init(GPIOA, &GPIO_InitStructure);/* PA0,PA12-> 左右脉冲输入 */ ..HARDWARETIMcounterTIMcounter.c(14): error: #147: declaration is incompatible with "void GPIO_Init(GPIO_TypeDef *, GPIO_InitTypeDef *)" (declared at line 351 of "..STM32F10x_FWLibincstm32f10x_gpio.h") GPIO_Init(GPIOA, &GPIO_InitStructure);/* PA0,PA12-> 左右脉冲输入 */ ..HARDWARETIMcounterTIMcounter.c(18): warning: #1295-D: Deprecated declaration SystemInit - give arg types SystemInit();//??system_stm32f10x.c??,????????,????RCC???. ..HARDWARETIMcounterTIMcounter.c(18): warning: #77-D: this declaration has no storage class or type specifier SystemInit();//??system_stm32f10x.c??,????????,????RCC???. ..HARDWARETIMcounterTIMcounter.c(18): error: #147: declaration is incompatible with "void SystemInit(void)" (declared at line 79 of "..USERsystem_stm32f10x.h") SystemInit();//??system_stm32f10x.c??,????????,????RCC???. ..HARDWARETIMcounterTIMcounter.c(19): error: #79: expected a type specifier RCC_GetClocksFreq(&RCC_ClockFreq); ..HARDWARETIMcounterTIMcounter.c(19): warning: #77-D: this declaration has no storage class or type specifier RCC_GetClocksFreq(&RCC_ClockFreq); ..HARDWARETIMcounterTIMcounter.c(19): error: #147: declaration is incompatible with "void RCC_GetClocksFreq(RCC_ClocksTypeDef *)" (declared at line 691 of "..STM32F10x_FWLibincstm32f10x_rcc.h") RCC_GetClocksFreq(&RCC_ClockFreq); ..HARDWARETIMcounterTIMcounter.c(21): error: #79: expected a type specifier RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); ..HARDWARETIMcounterTIMcounter.c(21): error: #757: constant "ENABLE" is not a type name RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); ..HARDWARETIMcounterTIMcounter.c(21): warning: #77-D: this declaration has no storage class or type specifier RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); ..HARDWARETIMcounterTIMcounter.c(21): error: #147: declaration is incompatible with "void RCC_APB2PeriphClockCmd(uint32_t, FunctionalState)" (declared at line 693 of "..STM32F10x_FWLibincstm32f10x_rcc.h") RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); ..HARDWARETIMcounterTIMcounter.c(22): error: #79: expected a type specifier RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); ..HARDWARETIMcounterTIMcounter.c(22): error: #757: constant "ENABLE" is not a type name RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); ..HARDWARETIMcounterTIMcounter.c(22): warning: #77-D: this declaration has no storage class or type specifier RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); ..HARDWARETIMcounterTIMcounter.c(23): error: #79: expected a type specifier RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); ..HARDWARETIMcounterTIMcounter.c(23): error: #757: constant "ENABLE" is not a type name RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); ..HARDWARETIMcounterTIMcounter.c(23): warning: #77-D: this declaration has no storage class or type specifier RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); ..HARDWARETIMcounterTIMcounter.c(24): warning: #1-D: last line of file ends without a newline RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); ..HARDWARETIMcounterTIMcounter.c(24): error: #79: expected a type specifier RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); ..HARDWARETIMcounterTIMcounter.c(24): error: #757: constant "ENABLE" is not a type name RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); ..HARDWARETIMcounterTIMcounter.c(24): warning: #77-D: this declaration has no storage class or type specifier RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); ..HARDWARETIMcounterTIMcounter.c(24): error: #147: declaration is incompatible with "void RCC_APB1PeriphClockCmd(uint32_t, FunctionalState)" (declared at line 694 of "..STM32F10x_FWLibincstm32f10x_rcc.h") RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); ..HARDWARETIMcounterTIMcounter.c: 9 warnings, 25 errors compiling stm32f10x_adc.c... "no source": Error: #5: cannot open source input file "C:UsersAdministratorDesktopstm32搴揬LQ-F103Z-SYS 20140917娴嬭瘯绋嬪簭stm32娴嬭瘯STM32F10x_FWLibsrcstm32f10x_adc.c": No such file or directory C:UsersAdministratorDesktopstm32库LQ-F103Z-SYS 20140917测试程序stm32测试STM32F10x_FWLibsrcstm32f10x_adc.c: 0 warnings, 1 error "..OBJPRACTICE.axf" - 25 Error(s), 9 Warning(s). Target not created. Build Time Elapsed: 00:00:01 |
|
相关推荐
12个回答
|
|
哈哈,我一看怎么看怎么别扭,以后得注意函数的应用
最佳答案
|
|
|
|
|
|
|
|
哈哈哈哈哈
|
|
|
|
|
|
|
|
累死在了学单片机途中
|
|
|
|
|
|
|
|
给大佬 哈哈哈哈哈!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
【每周推荐】采用11代Intel CPU,基于youyeetoo X1开发板搭建少儿AI智能STEAM积木平台
765 浏览 0 评论
2235 浏览 2 评论
【youyeetoo X1 windows 开发板体验】+ 影音处理和AI模型移植
2094 浏览 5 评论
I.MX6ULL-飞凌 ElfBoard ELF1板卡- 移植zbar的方法
1682 浏览 0 评论
2646 浏览 3 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
5490 浏览 31 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-4-19 04:49 , Processed in 0.586477 second(s), Total 81, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号