这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 综合技术 » 基础知识 » 430c 【求助】关于430c 的中断服务程序问题

共2条 1/1 1 跳转至

430c 【求助】关于430c 的中断服务程序问题

院士
2006-09-17 18:14:16     打赏
430c 【求助】关于430c 的中断服务程序问题



关键词: 求助     关于     中断     服务     程序     问题    

院士
2006-12-22 22:43:00     打赏
2楼
问 刚开始学习430,写了如下中断程序:
interrupt[BASICTIMER_VECTOR] void basic_timer (void)
{
second++;
IFG2=BTIFG^0X80; //clear the interrupt flag
}

在进行编译的时候,有如下错误:

Error[Pe094]: the size of an array must be greater than zero

Error[Pe077]: this declaration has no storage class or type specifier

Error[Pe065]: expected a ";"

请问高手这是什么原因,难道是我的编译器不支持中断么?
在解决error[pe077]这个错误时,只要在interrupt前面增加static关键词就可以了,但是为什么不可以省略?

请各位高手指点。 1: 不同版本的中断书写格式是不一样的,请参考安装目录下的例程的书写格式。 2: 谢谢hzyhy得指点,我参考安装目录下的例程书写格式书写之后,上述的几个错误提示消失,但又出现了如下的错误提示:
Building configuration: t3 - Debug

display.c
icc430.exe -I C:\Program Files\IAR Systems\Embedded Workbench 3.2\430\INC\ -I C:\Program Files\IAR Systems\Embedded Workbench 3.2\430\INC\CLIB\ -o D:\
porgram of 430\430\Debug\Obj\ -z2 --no_cse --no_unroll --no_inline --no_code_motion --debug -e --double=32 D:\porgram of 430\430\display.c

IAR MSP430 C Compiler V2.21B-P1/W32 [Kickstart]
Copyright 1996-2003 IAR Systems. All rights reserved.

424 bytes of CODE memory
22 bytes of CONST memory
26 bytes of DATA memory (+ 9 bytes shared)

Errors: none
Warnings: none

Linking
xlink.exe D:\porgram of 430\430\Debug\Obj\display.r43 -o D:\porgram of 430\430\Debug\Exe\t3.d43 -rt -IC:\Program Files\IAR Systems\Embedded Workbench 3.2\430\
LIB\ -f C:\Program Files\IAR Systems\Embedded Workbench 3.2\430\config\lnk430F449.xcl -e_small_write=_formatted_write -e_medium_read=_formatted_read -f C:\
Program Files\IAR Systems\Embedded Workbench 3.2\430\config\multiplier.xcl -f C:\Program Files\IAR Systems\Embedded Workbench 3.2\430\config\
compactmath.xcl

IAR Universal Linker V4.56E/386
Copyright 1987-2003 IAR Systems. All rights reserved.
Error[e46]: Undefined external "?SwitchKey16" referred in display ( D:\porgram of 430\430\Debug\Obj\display.r43 )
Error[e46]: Undefined external "?Epilogue4" referred in display ( D:\porgram of 430\430\Debug\Obj\display.r43 )
Error[e46]: Undefined external "?Epilogue3" referred in display ( D:\porgram of 430\430\Debug\Obj\display.r43 )
Error[e46]: Undefined external "?DivMod16u" referred in display ( D:\porgram of 430\430\Debug\Obj\display.r43 )
Error[e46]: Undefined external "?DivMod16s" referred in display ( D:\porgram of 430\430\Debug\Obj\display.r43 )
Error[e46]: Undefined external "?cstart_init_copy" referred in display ( D:\porgram of 430\430\Debug\Obj\display.r43 )
Error[e46]: Undefined external "?cstart_init_zero" referred in display ( D:\porgram of 430\430\Debug\Obj\display.r43 )
Error[e46]: Undefined external "?longjmp_r4" referred in display ( D:\porgram of 430\430\Debug\Obj\display.r43 )
Error[e46]: Undefined external "?longjmp_r5" referred in display ( D:\porgram of 430\430\Debug\Obj\display.r43 )
Error[e46]: Undefined external "?setjmp_r4" referred in display ( D:\porgram of 430\430\Debug\Obj\display.r43 )
Error[e46]: Undefined external "?setjmp_r5" referred in display ( D:\porgram of 430\430\Debug\Obj\display.r43 )

58 bytes of CODE memory
6 bytes of DATA memory (+ 9 absolute )
2 bytes of CONST memory

Errors: 11
Warnings: none


Total number of errors: 11
Total number of warnings: 0

上述错误提示应该都在LINKING的时候发生的情况,不明白这是为什么,敬请高手们再指点指点

共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]