共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 跳转至页
回复
有奖活动 | |
---|---|
【EEPW电子工程师创研计划】技术变现通道已开启~ | |
发原创文章 【每月瓜分千元赏金 凭实力攒钱买好礼~】 | |
【EEPW在线】E起听工程师的声音! | |
“我踩过的那些坑”主题活动——第001期 | |
高校联络员开始招募啦!有惊喜!! | |
【工程师专属福利】每天30秒,积分轻松拿!EEPW宠粉打卡计划启动! | |
送您一块开发板,2025年“我要开发板活动”又开始了! | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
【我踩过的那些坑】STM32的硬件通讯调试过程的“坑”被打赏50分 | |
【我踩过的那些坑】晶振使用的问题被打赏100分 | |
【我踩过的那些坑】电感选型错误导致的处理器连接不上被打赏50分 | |
【我踩过的那些坑】工作那些年踩过的记忆深刻的坑被打赏10分 | |
【我踩过的那些坑】DRC使用位置错误导致的问题被打赏100分 | |
我踩过的那些坑之混合OTL功放与落地音箱被打赏50分 | |
汽车电子中巡航控制系统的使用被打赏10分 | |
【我踩过的那些坑】工作那些年踩过的记忆深刻的坑被打赏100分 | |
分享汽车电子中巡航控制系统知识被打赏10分 | |
分享安全气囊系统的检修注意事项被打赏10分 |