共2条
1/1 1 跳转至页
Iar,EW3,interrupt 请教各位前辈, Iar EW3.1 不能识别关键字interrupt是怎么回事?

问
我是这样定义的:
void interrupt[BASICTIMER_VECTOR] IntBasicTimer(void)
{
P1OUT│=BIT0;
P1OUT&=~BIT0;
}
编译出错信息如下:
Rebuilding configuration: AmmeterIar - Debug
0 file(s) deleted.
LzgMain.c
icc430.exe -I C:\Program Files\IAR Systems\Embedded Workbench 4.0\430\INC\ -I C:\Program Files\IAR Systems\Embedded
Workbench 4.0\430\INC\CLIB\ -o D:\LzgPg\Ammeter430\Debug\Obj\ -z3 --no_cse --no_unroll --no_inline --no_code_motion
--no_tbaa --debug -e --double=32 D:\LzgPg\Ammeter430\LzgMain.c
IAR MSP430 C/C++ Compiler V3.10A/W32
Copyright 1996-2004 IAR Systems. All rights reserved.
Error[Pe094]: the size of an array must be greater than zero
Error[Pe065]: expected a ";"
Warning[Pe012]: parsing restarts here after previous syntax error
Error[Pe077]: this declaration has no storage class or type specifier
Error[Pe147]: declaration is incompatible with "unsigned char volatile __data16 P1OUT" (declared at line 216 of "C:\Program
Files\IAR Systems\Embedded Workbench 4.0\430\INC\MSP430XE42X.H")
Error[Be012]: location address not allowed (object must have static storage duration and be const or __no_init)
Error[Pe065]: expected a ";"
Error[Pe169]: expected a declaration
Warning[Pe012]: parsing restarts here after previous syntax error
Warning[Pe001]: last line of file ends without a newline
Error[Pe169]: expected a declaration
Errors: 8
Warnings: 3
Total number of errors: 8
Total number of warnings: 3 答 1: 那是老版本的格式,新版本的格式如下:
#pragma vector=BASICTIMER_VECTOR
__interrupt void IntBasicTimer (void)
void interrupt[BASICTIMER_VECTOR] IntBasicTimer(void)
{
P1OUT│=BIT0;
P1OUT&=~BIT0;
}
编译出错信息如下:
Rebuilding configuration: AmmeterIar - Debug
0 file(s) deleted.
LzgMain.c
icc430.exe -I C:\Program Files\IAR Systems\Embedded Workbench 4.0\430\INC\ -I C:\Program Files\IAR Systems\Embedded
Workbench 4.0\430\INC\CLIB\ -o D:\LzgPg\Ammeter430\Debug\Obj\ -z3 --no_cse --no_unroll --no_inline --no_code_motion
--no_tbaa --debug -e --double=32 D:\LzgPg\Ammeter430\LzgMain.c
IAR MSP430 C/C++ Compiler V3.10A/W32
Copyright 1996-2004 IAR Systems. All rights reserved.
Error[Pe094]: the size of an array must be greater than zero
Error[Pe065]: expected a ";"
Warning[Pe012]: parsing restarts here after previous syntax error
Error[Pe077]: this declaration has no storage class or type specifier
Error[Pe147]: declaration is incompatible with "unsigned char volatile __data16 P1OUT" (declared at line 216 of "C:\Program
Files\IAR Systems\Embedded Workbench 4.0\430\INC\MSP430XE42X.H")
Error[Be012]: location address not allowed (object must have static storage duration and be const or __no_init)
Error[Pe065]: expected a ";"
Error[Pe169]: expected a declaration
Warning[Pe012]: parsing restarts here after previous syntax error
Warning[Pe001]: last line of file ends without a newline
Error[Pe169]: expected a declaration
Errors: 8
Warnings: 3
Total number of errors: 8
Total number of warnings: 3 答 1: 那是老版本的格式,新版本的格式如下:
#pragma vector=BASICTIMER_VECTOR
__interrupt void IntBasicTimer (void)
共2条
1/1 1 跳转至页