OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 7136|回复: 12

为什么我把战舰例程中的IIC(24c'x'x)和其他模块合并后报错,求解释》》》》》》》

[复制链接]

3

主题

9

帖子

0

精华

初级会员

Rank: 2

积分
50
金钱
50
注册时间
2013-6-4
在线时间
3 小时
发表于 2013-6-26 02:41:01 | 显示全部楼层 |阅读模式
主函数如下:
#include "sys.h"
#include "delay.h"
#include "led.h"
#include "key.h"
#include "usart.h"
#include "ds18b20.h" 
#include"24cxx.h"

//#define SIZE 1

//void GPIO_CFG()
//{
// GPIO_InitTypeDef GPIO_InitType;
// GPIO_InitType.GPIO_Pin = GPIO_Pin_10;
// GPIO_InitType.GPIO_Speed = GPIO_Speed_10MHz;  
//    GPIO_InitType.GPIO_Mode = GPIO_Mode_IPU;
// GPIO_Init(GPIOA,&GPIO_InitType);
//}
int main(void)
{

// u8 key;
// u8 datatemp[SIZE];   //从24c02读取的数据
s16 temperature;  
delay_init();   //延时初始化
NVIC_Configuration(); //设置NVIC中断分组2:2位抢占优先级,2位响应优先级
uart_init(9600); //串口初始化为9600
LED_Init();   //初始化与LED连接的硬件接口
KEY_Init();
// AT24CXX_Init(); //IIC初始化 
while(DS18B20_Init()) //DS18B20初始化
{
LED0 = 0;
delay_ms(500);
LED0 = 1;
delay_ms(500);
}

// while(AT24CXX_Check())//检测不到24c02
// {
// LED1 = 1;
// delay_ms(500);
// LED1 = 0;
// delay_ms(500);
// }
while(1)
{
temperature=DS18B20_Get_Temp();
USART_SendData(USART1,temperature);//向串口1发送数据
while(USART_GetFlagStatus(USART1,USART_FLAG_TC)!=SET);//等待发送结束
delay_ms(1000);

// key=KEY_Scan(0);
// if(key==KEY_UP)//KEY_UP按下,写入24C02
// {
// AT24CXX_Write(0,(u8*)temperature,SIZE);
// printf("24c02写入成功\n");
// }
// if(key==KEY_DOWN)//KEY_DOWN按下,读取字符串并显示
// {
// AT24CXX_Read(0,datatemp,SIZE);
// printf("24c02读取成功\n");
// }
}  
}

报错如下:
Build target 'Template'
compiling main.c...
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(23): error:  #256: invalid redeclaration of type name "s32" (declared at line 487 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef signed long  s32;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                        ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(27): error:  #256: invalid redeclaration of type name "sc32" (declared at line 491 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef signed long  const sc32;  /* Read Only */
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                              ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(31): error:  #256: invalid redeclaration of type name "vs32" (declared at line 495 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef volatile signed long  vs32;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                 ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(35): error:  #256: invalid redeclaration of type name "vsc32" (declared at line 499 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef volatile signed long  const vsc32;  /* Read Only */
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                       ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(39): error:  #256: invalid redeclaration of type name "u32" (declared at line 503 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef unsigned long  u32;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                          ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(43): error:  #256: invalid redeclaration of type name "uc32" (declared at line 507 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef unsigned long  const uc32;  /* Read Only */
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(47): error:  #256: invalid redeclaration of type name "vu32" (declared at line 511 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef volatile unsigned long  vu32;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                   ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(51): error:  #256: invalid redeclaration of type name "vuc32" (declared at line 515 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef volatile unsigned long  const vuc32;  /* Read Only */
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                         ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "RESET" has already been declared in the current scope
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                 ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #101: "SET" has already been declared in the current scope
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                            ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "FlagStatus" (declared at line 519 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                          ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(57): error:  #256: invalid redeclaration of type name "ITStatus" (declared at line 519 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                                      ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "DISABLE" has already been declared in the current scope
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                 ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #101: "ENABLE" has already been declared in the current scope
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                              ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(59): error:  #256: invalid redeclaration of type name "FunctionalState" (declared at line 521 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                                 ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #101: "ERROR" has already been declared in the current scope
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                 ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #101: "SUCCESS" has already been declared in the current scope
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                            ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h(62): error:  #256: invalid redeclaration of type name "ErrorStatus" (declared at line 524 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:   typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h:                                              ^
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h(30): error:  #55: too many arguments in macro invocation
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h:   void __ISB(void);
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h:              ^
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h(30): error:  #79: expected a type specifier
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h:   void __ISB(void);
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h:        ^
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h(31): error:  #55: too many arguments in macro invocation
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h:   void __DSB(void);
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h:              ^
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h(31): error:  #79: expected a type specifier
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h:   void __DSB(void);
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h:        ^
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h(32): error:  #55: too many arguments in macro invocation
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h:   void __DMB(void);
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h:              ^
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h(32): error:  #79: expected a type specifier
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h:   void __DMB(void);
D:\Keil\ARM\INC\ST\STM32F10x\cortexm3_macro.h:        ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h(58): error:  #256: invalid redeclaration of type name "ADC_TypeDef" (declared at line 564 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h:   } ADC_TypeDef;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h:     ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h(154): error:  #256: invalid redeclaration of type name "BKP_TypeDef" (declared at line 663 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h:   } BKP_TypeDef;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h:     ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h(163): error:  #256: invalid redeclaration of type name "CAN_TxMailBox_TypeDef" (declared at line 675 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h:   } CAN_TxMailBox_TypeDef;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h:     ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h(171): error:  #256: invalid redeclaration of type name "CAN_FIFOMailBox_TypeDef" (declared at line 687 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h:   } CAN_FIFOMailBox_TypeDef;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h:     ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h(177): error:  #256: invalid redeclaration of type name "CAN_FilterRegister_TypeDef" (declared at line 697 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h:   } CAN_FilterRegister_TypeDef;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h:     ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h(203): error:  #256: invalid redeclaration of type name "CAN_TypeDef" (declared at line 731 of "..\USER\stm32f10x.h")
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h:   } CAN_TypeDef;
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h:     ^
D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h: main.c: 0 warnings, 30 errors
compiling stm32f10x_it.c...
compiling system_stm32f10x.c...
compiling ds18b20.c...
compiling key.c...
compiling led.c...
compiling myiic.c...
compiling 24cxx.c...
..\CORE\core_cm3.h(715): warning:  #47-D: incompatible redefinition of macro "SCS_BASE" (declared at line 687 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\CORE\core_cm3.h:   #define SCS_BASE            (0xE000E000)                              /*!< System Control Space Base Address */
..\CORE\core_cm3.h:           ^
..\CORE\core_cm3.h(723): warning:  #47-D: incompatible redefinition of macro "SCB" (declared at line 935 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\CORE\core_cm3.h:   #define SCB                 ((SCB_Type *)           SCB_BASE)         /*!< SCB configuration struct          */
..\CORE\core_cm3.h:           ^
..\CORE\core_cm3.h(724): warning:  #47-D: incompatible redefinition of macro "SysTick" (declared at line 930 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\CORE\core_cm3.h:   #define SysTick             ((SysTick_Type *)       SysTick_BASE)     /*!< SysTick configuration struct      */
..\CORE\core_cm3.h:           ^
..\CORE\core_cm3.h(725): warning:  #47-D: incompatible redefinition of macro "NVIC" (declared at line 934 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\CORE\core_cm3.h:   #define NVIC                ((NVIC_Type *)          NVIC_BASE)        /*!< NVIC configuration struct         */
..\CORE\core_cm3.h:           ^
..\USER\stm32f10x.h(487): error:  #256: invalid redeclaration of type name "s32" (declared at line 23 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
..\USER\stm32f10x.h:   typedef int32_t  s32;
..\USER\stm32f10x.h:                    ^
..\USER\stm32f10x.h(491): error:  #256: invalid redeclaration of type name "sc32" (declared at line 27 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
..\USER\stm32f10x.h:   typedef const int32_t sc32;  /*!< Read Only */
..\USER\stm32f10x.h:                         ^
..\USER\stm32f10x.h(495): error:  #256: invalid redeclaration of type name "vs32" (declared at line 31 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
..\USER\stm32f10x.h:   typedef __IO int32_t  vs32;
..\USER\stm32f10x.h:                         ^
..\USER\stm32f10x.h(499): error:  #256: invalid redeclaration of type name "vsc32" (declared at line 35 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
..\USER\stm32f10x.h:   typedef __I int32_t vsc32;  /*!< Read Only */
..\USER\stm32f10x.h:                       ^
..\USER\stm32f10x.h(503): error:  #256: invalid redeclaration of type name "u32" (declared at line 39 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
..\USER\stm32f10x.h:   typedef uint32_t  u32;
..\USER\stm32f10x.h:                     ^
..\USER\stm32f10x.h(507): error:  #256: invalid redeclaration of type name "uc32" (declared at line 43 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
..\USER\stm32f10x.h:   typedef const uint32_t uc32;  /*!< Read Only */
..\USER\stm32f10x.h:                          ^
..\USER\stm32f10x.h(511): error:  #256: invalid redeclaration of type name "vu32" (declared at line 47 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
..\USER\stm32f10x.h:   typedef __IO uint32_t  vu32;
..\USER\stm32f10x.h:                          ^
..\USER\stm32f10x.h(515): error:  #256: invalid redeclaration of type name "vuc32" (declared at line 51 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
..\USER\stm32f10x.h:   typedef __I uint32_t vuc32;  /*!< Read Only */
..\USER\stm32f10x.h:                        ^
..\USER\stm32f10x.h(519): error:  #101: "RESET" has already been declared in the current scope
..\USER\stm32f10x.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
..\USER\stm32f10x.h:                 ^
..\USER\stm32f10x.h(519): error:  #101: "SET" has already been declared in the current scope
..\USER\stm32f10x.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
..\USER\stm32f10x.h:                            ^
..\USER\stm32f10x.h(519): error:  #256: invalid redeclaration of type name "FlagStatus" (declared at line 57 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
..\USER\stm32f10x.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
..\USER\stm32f10x.h:                                          ^
..\USER\stm32f10x.h(519): error:  #256: invalid redeclaration of type name "ITStatus" (declared at line 57 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
..\USER\stm32f10x.h:   typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
..\USER\stm32f10x.h:                                                      ^
..\USER\stm32f10x.h(521): error:  #101: "DISABLE" has already been declared in the current scope
..\USER\stm32f10x.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
..\USER\stm32f10x.h:                 ^
..\USER\stm32f10x.h(521): error:  #101: "ENABLE" has already been declared in the current scope
..\USER\stm32f10x.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
..\USER\stm32f10x.h:                              ^
..\USER\stm32f10x.h(521): error:  #256: invalid redeclaration of type name "FunctionalState" (declared at line 59 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
..\USER\stm32f10x.h:   typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
..\USER\stm32f10x.h:                                                 ^
..\USER\stm32f10x.h(524): error:  #101: "ERROR" has already been declared in the current scope
..\USER\stm32f10x.h:   typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
..\USER\stm32f10x.h:                 ^
..\USER\stm32f10x.h(524): error:  #101: "SUCCESS" has already been declared in the current scope
..\USER\stm32f10x.h:   typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
..\USER\stm32f10x.h:                            ^
..\USER\stm32f10x.h(524): error:  #256: invalid redeclaration of type name "ErrorStatus" (declared at line 62 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_type.h")
..\USER\stm32f10x.h:   typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
..\USER\stm32f10x.h:                                              ^
..\USER\stm32f10x.h(528): warning:  #47-D: incompatible redefinition of macro "HSE_Value" (declared at line 147 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_conf.h")
..\USER\stm32f10x.h:   #define HSE_Value            HSE_VALUE
..\USER\stm32f10x.h:           ^
..\USER\stm32f10x.h(564): error:  #256: invalid redeclaration of type name "ADC_TypeDef" (declared at line 58 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\USER\stm32f10x.h:   } ADC_TypeDef;
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h(663): error:  #256: invalid redeclaration of type name "BKP_TypeDef" (declared at line 154 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\USER\stm32f10x.h:   } BKP_TypeDef;
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h(675): error:  #256: invalid redeclaration of type name "CAN_TxMailBox_TypeDef" (declared at line 163 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\USER\stm32f10x.h:   } CAN_TxMailBox_TypeDef;
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h(687): error:  #256: invalid redeclaration of type name "CAN_FIFOMailBox_TypeDef" (declared at line 171 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\USER\stm32f10x.h:   } CAN_FIFOMailBox_TypeDef;
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h(697): error:  #256: invalid redeclaration of type name "CAN_FilterRegister_TypeDef" (declared at line 177 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\USER\stm32f10x.h:   } CAN_FilterRegister_TypeDef;
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h(731): error:  #256: invalid redeclaration of type name "CAN_TypeDef" (declared at line 203 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\USER\stm32f10x.h:   } CAN_TypeDef;
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h(758): error:  #256: invalid redeclaration of type name "CRC_TypeDef" (declared at line 213 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\USER\stm32f10x.h:   } CRC_TypeDef;
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h(782): error:  #256: invalid redeclaration of type name "DAC_TypeDef" (declared at line 232 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\USER\stm32f10x.h:   } DAC_TypeDef;
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h(792): error:  #256: invalid redeclaration of type name "DBGMCU_TypeDef" (declared at line 239 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\USER\stm32f10x.h:   }DBGMCU_TypeDef;
..\USER\stm32f10x.h:    ^
..\USER\stm32f10x.h(804): error:  #256: invalid redeclaration of type name "DMA_Channel_TypeDef" (declared at line 248 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\USER\stm32f10x.h:   } DMA_Channel_TypeDef;
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h(810): error:  #256: invalid redeclaration of type name "DMA_TypeDef" (declared at line 254 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\USER\stm32f10x.h:   } DMA_TypeDef;
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h(895): error:  #256: invalid redeclaration of type name "EXTI_TypeDef" (declared at line 265 of "D:\Keil\ARM\INC\ST\STM32F10x\stm32f10x_map.h")
..\USER\stm32f10x.h:   } EXTI_TypeDef;
..\USER\stm32f10x.h:     ^
..\USER\stm32f10x.h: 24cxx.c: 5 warnings, 30 errors
compiling misc.c...
compiling stm32f10x_gpio.c...
compiling stm32f10x_rcc.c...
compiling stm32f10x_usart.c...
compiling stm32f10x_i2c.c...
compiling stm32f10x_fsmc.c...
compiling stm32f10x_tim.c...
compiling core_cm3.c...
assembling startup_stm32f10x_hd.s...
compiling delay.c...
compiling sys.c...
compiling usart.c...
Target not created
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

3

主题

9

帖子

0

精华

初级会员

Rank: 2

积分
50
金钱
50
注册时间
2013-6-4
在线时间
3 小时
 楼主| 发表于 2013-6-26 02:42:47 | 显示全部楼层
一加上ii的模块就报错,不加就没有错
回复 支持 反对

使用道具 举报

头像被屏蔽

6168

主题

7036

帖子

1

精华

论坛元老

Rank: 8Rank: 8

积分
19705
金钱
19705
注册时间
2012-12-27
在线时间
25 小时
发表于 2013-6-26 08:48:34 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165540
金钱
165540
注册时间
2010-12-1
在线时间
2117 小时
发表于 2013-6-26 10:26:44 | 显示全部楼层
头文件,把stm32f10x_lib.h去掉.
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复 支持 反对

使用道具 举报

6

主题

90

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
404
金钱
404
注册时间
2013-1-11
在线时间
107 小时
发表于 2013-12-28 09:56:42 | 显示全部楼层
回复【4楼】正点原子:
---------------------------------
原子哥,我用寄存器编程的时候总是报错说某一变量已经在keil的安装路径arm/inc里的stm32f10x_iic.h或别的类似文件声明过了,但是这个文件根本没有在程序里用到啊
为啥还要考试啊。。。。。。。
回复 支持 反对

使用道具 举报

6

主题

90

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
404
金钱
404
注册时间
2013-1-11
在线时间
107 小时
发表于 2013-12-28 11:00:19 | 显示全部楼层
回复【4楼】正点原子:
---------------------------------
但是新建工程之后,不添加文件,将keil关闭,所有工程文件移到到user里面去,重新打开添加,就不存在这个问题,为什么啊原子哥,为什么要移动一下呢?
为啥还要考试啊。。。。。。。
回复 支持 反对

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165540
金钱
165540
注册时间
2010-12-1
在线时间
2117 小时
发表于 2013-12-28 11:03:41 | 显示全部楼层
回复【5楼】unciauncia:
---------------------------------
什么变量?
你打开IIC.H
看看了。
你没用到,可能其他头文件包含了这个stm32f10x_iic.h,你全文搜索下看看了。
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复 支持 反对

使用道具 举报

6

主题

90

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
404
金钱
404
注册时间
2013-1-11
在线时间
107 小时
发表于 2013-12-28 12:50:34 | 显示全部楼层
回复【7楼】正点原子:
---------------------------------
全文搜索了,还是没有。原来建立工程是直接把文件夹选在工程文件夹/user下。这时候就报错
之后我把工程建立在工程文件夹下,然后关闭keil 把全部文件移到到user下面去,之后操作一样,就没有报错了
为啥还要考试啊。。。。。。。
回复 支持 反对

使用道具 举报

4

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
81
金钱
81
注册时间
2015-3-16
在线时间
3 小时
发表于 2015-3-20 17:55:23 | 显示全部楼层
回复【4楼】正点原子:
---------------------------------
我根本就没有用这个头文件  还是有这样的错误
回复 支持 反对

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165540
金钱
165540
注册时间
2010-12-1
在线时间
2117 小时
发表于 2015-3-20 22:34:07 | 显示全部楼层
回复【9楼】GUN_xing:
---------------------------------
其他地方包含了吧
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复 支持 反对

使用道具 举报

4

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
81
金钱
81
注册时间
2015-3-16
在线时间
3 小时
发表于 2015-3-21 12:15:08 | 显示全部楼层
回复【10楼】正点原子:
---------------------------------
我查找了一下 没找到。。。
回复 支持 反对

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165540
金钱
165540
注册时间
2010-12-1
在线时间
2117 小时
发表于 2015-3-21 23:26:00 | 显示全部楼层
回复【11楼】GUN_xing:
---------------------------------
慢慢查
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复 支持 反对

使用道具 举报

4

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
81
金钱
81
注册时间
2015-3-16
在线时间
3 小时
发表于 2015-3-22 10:19:26 | 显示全部楼层
回复【12楼】正点原子:
---------------------------------查到了  谢谢
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-24 19:28

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表