OpenEdv-开源电子网

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

如果出现重定义如何进行外部函数声明

[复制链接]

21

主题

77

帖子

0

精华

初级会员

Rank: 2

积分
182
金钱
182
注册时间
2015-4-5
在线时间
0 小时
发表于 2015-6-17 10:40:03 | 显示全部楼层 |阅读模式
5金钱
基础好的勿喷,如果出现重定义如果使用外部函数进行操作,比如这样
filter.h(15): warning:  #1-D: last line of file ends without a newline
  #endif
main.c(8): warning:  #260-D: explicit type is missing ("int" assumed)
  extern  TIM2_TIM_GetCapture1_Init;
main.c(18): error:  #109: expression must have (pointer-to-) function type
    TIM2_TIM_GetCapture1_Init(60000,60000);
main.c(19): warning:  #223-D: function "TIM2_TIM_GetCapture2_Init" declared implicitly
        TIM2_TIM_GetCapture2_Init(60000,60000);
main.c(20): warning:  #223-D: function "TIM2_TIM_GetCapture3_Init" declared implicitly
        TIM2_TIM_GetCapture3_Init(60000,60000);
main.c(21): warning:  #223-D: function "TIM2_TIM_GetCapture4_Init" declared implicitly
        TIM2_TIM_GetCapture4_Init(60000,60000);
main.c(23): warning:  #223-D: function "TIM3_TIM_GetCapture1_Init" declared implicitly
        TIM3_TIM_GetCapture1_Init(60000,60000);
main.c(24): warning:  #223-D: function "TIM3_TIM_GetCapture2_Init" declared implicitly
    TIM3_TIM_GetCapture2_Init(60000,60000);
main.c(25): warning:  #223-D: function "TIM3_TIM_GetCapture3_Init" declared implicitly
        TIM3_TIM_GetCapture3_Init(60000,60000);
main.c(26): warning:  #223-D: function "TIM3_TIM_GetCapture4_Init" declared implicitly
        TIM3_TIM_GetCapture4_Init(60000,60000);
main.c(28): warning:  #223-D: function "TIM4_TIM_GetCapture1_Init" declared implicitly
        TIM4_TIM_GetCapture1_Init(60000,60000);
main.c(29): warning:  #223-D: function "TIM4_TIM_GetCapture2_Init" declared implicitly
    TIM4_TIM_GetCapture2_Init(60000,60000);
main.c(30): warning:  #223-D: function "TIM4_TIM_GetCapture3_Init" declared implicitly
        TIM4_TIM_GetCapture3_Init(60000,60000);
main.c(31): warning:  #223-D: function "TIM4_TIM_GetCapture4_Init" declared implicitly
        TIM4_TIM_GetCapture4_Init(60000,60000);
main.c: 13 warnings, 1 error
compiling stm32f10x_it.c...
compiling delay.c...
compiling sys.c...
compiling tim.c...
compiling filter.c...
filter.c(16): warning:  #177-D: label "case1" was declared but never referenced
                case1: DJ_capture_temp = TIM_GetCapture1(TIM2);      //定时器2通道1捕获
filter.c(18): warning:  #177-D: label "case2" was declared but never referenced
                case2: DJ_capture_temp = TIM_GetCapture2(TIM2);
filter.c(20): warning:  #177-D: label "case3" was declared but never referenced
                case3: DJ_capture_temp = TIM_GetCapture3(TIM2);
filter.c(22): warning:  #177-D: label "case4" was declared but never referenced
                case4: DJ_capture_temp = TIM_GetCapture4(TIM2);
filter.c(24): warning:  #177-D: label "case5" was declared but never referenced
                case5: DJ_capture_temp = TIM_GetCapture1(TIM3);
filter.c(26): warning:  #177-D: label "case6" was declared but never referenced
                case6: DJ_capture_temp = TIM_GetCapture2(TIM3);
filter.c(28): warning:  #177-D: label "case7" was declared but never referenced
                case7: DJ_capture_temp = TIM_GetCapture3(TIM3);
filter.c(30): warning:  #177-D: label "case8" was declared but never referenced
                case8: DJ_capture_temp = TIM_GetCapture4(TIM3);
filter.c(32): warning:  #177-D: label "case9" was declared but never referenced
                case9: DJ_capture_temp = TIM_GetCapture1(TIM4);
filter.c(34): warning:  #177-D: label "case10" was declared but never referenced
                case10: DJ_capture_temp = TIM_GetCapture2(TIM4);
filter.c(36): warning:  #177-D: label "case11" was declared but never referenced
                case11: DJ_capture_temp = TIM_GetCapture3(TIM4);
filter.c(80): warning:  #940-D: missing return statement at end of non-void function "T_f_filter"
                }
filter.c: 12 warnings, 0 errors
compiling system_stm32f10x.c...
compiling core_cm3.c...
assembling startup_stm32f10x_hd.s...
"..\OUTPUT\demo.axf" - 1 Error(s), 25 Warning(s).
Target not created

正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

70

主题

6763

帖子

0

精华

论坛大神

Rank: 7Rank: 7Rank: 7

积分
13129
金钱
13129
注册时间
2012-11-26
在线时间
3814 小时
发表于 2015-6-17 11:19:42 | 显示全部楼层
貌似是你没声明

而不是重复定义!
学无止境
回复

使用道具 举报

70

主题

6763

帖子

0

精华

论坛大神

Rank: 7Rank: 7Rank: 7

积分
13129
金钱
13129
注册时间
2012-11-26
在线时间
3814 小时
发表于 2015-6-17 11:20:06 | 显示全部楼层
case 语法还拼错了!
学无止境
回复

使用道具 举报

21

主题

77

帖子

0

精华

初级会员

Rank: 2

积分
182
金钱
182
注册时间
2015-4-5
在线时间
0 小时
 楼主| 发表于 2015-6-17 11:26:57 | 显示全部楼层
回复【2楼】jermy_z:
---------------------------------
嗯 多谢  C语言和单片机都是从零学,太水
回复

使用道具 举报

21

主题

77

帖子

0

精华

初级会员

Rank: 2

积分
182
金钱
182
注册时间
2015-4-5
在线时间
0 小时
 楼主| 发表于 2015-6-17 11:28:07 | 显示全部楼层
回复【3楼】jermy_z:
---------------------------------
不会吧  我就会这些
回复

使用道具 举报

70

主题

6763

帖子

0

精华

论坛大神

Rank: 7Rank: 7Rank: 7

积分
13129
金钱
13129
注册时间
2012-11-26
在线时间
3814 小时
发表于 2015-6-17 11:30:30 | 显示全部楼层
回复【4楼】whygrasp:
---------------------------------
还是打好C语言基础  再搞单片机吧  否则搞不动
学无止境
回复

使用道具 举报

21

主题

77

帖子

0

精华

初级会员

Rank: 2

积分
182
金钱
182
注册时间
2015-4-5
在线时间
0 小时
 楼主| 发表于 2015-6-17 11:46:38 | 显示全部楼层
回复【6楼】jermy_z:
---------------------------------

回复

使用道具 举报

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

本版积分规则



关闭

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

正点原子公众号

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

GMT+8, 2025-6-21 09:54

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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