共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 跳转至页
回复
打赏帖 | |
---|---|
分享一种检测按键状态的方法被打赏20分 | |
周末总结一下,STM32C0系列的开发经验被打赏50分 | |
【Cortex-M】Systick Timer使用被打赏10分 | |
分享汽车防盗系统的组成与分类(一)被打赏5分 | |
VOFA+波形显示+JYD-31蓝牙发送和解析不定长数据被打赏10分 | |
【换取手持数字示波器】-STM32F4PWM控制LED灯管亮度被打赏22分 | |
【换取手持数字示波器】STM32F4驱动RPR-0521RS照度、接近一体型传感器被打赏23分 | |
宏定义和const关键字定义被打赏5分 | |
【分享开发笔记,赚取电动螺丝刀】几个单片机I2S外设的BLCK时钟对比被打赏20分 | |
【功率监测与控制系统DIY活动成果贴】DIY功率计与LabVIEW数据采集被打赏100分 |