本帖最后由 freebird 于 2012-4-12 11:56 编辑
程序之前在 Keil 里面编译成功了,这次换做IAR5.20,编译报错,不知道为什么。
请问有人知道吗?
报错信息如下:
Building configuration: IAR_PWM - Debug
Updating build tree...
stm32f10x_it.c
Error[Pe125]: expected a "(" D:\Documents and Settings\Administrator.79207641234A429\桌面\PWM信号\IAR_PWM\source\stm32f10x_it.c 88
Error[Pe194]: expected an asm string D:\Documents and Settings\Administrator.79207641234A429\桌面\PWM信号\IAR_PWM\source\stm32f10x_it.c 88
Error[Pe065]: expected a ";" D:\Documents and Settings\Administrator.79207641234A429\桌面\PWM信号\IAR_PWM\source\stm32f10x_it.c 89
Error[Pe010]: "#" not expected here D:\Documents and Settings\Administrator.79207641234A429\桌面\PWM信号\IAR_PWM\source\stm32f10x_it.c 91
Error[Pe010]: "#" not expected here D:\Documents and Settings\Administrator.79207641234A429\桌面\PWM信号\IAR_PWM\source\stm32f10x_it.c 94
Error[Pe010]: "#" not expected here D:\Documents and Settings\Administrator.79207641234A429\桌面\PWM信号\IAR_PWM\source\stm32f10x_it.c 96
Warning[Pe012]: parsing restarts here after previous syntax error D:\Documents and Settings\Administrator.79207641234A429\桌面\PWM信号\IAR_PWM\source\stm32f10x_it.c 98
Error while running C/C++ Compiler
Total number of errors: 6
Total number of warnings: 1
源程序如下:
88 __asm void HardFault_Handler(void)
89 {
90 //#ifdef DEBUG
91 TST LR, #0x4 // EXC_RETURN.2=0?
92 ITTEE EQ // 如是为零,则
93 MRSEQ R0, MSP //把MSP加载入R0中
94 LDREQ R0,[R0,#0x24] //从MSP中获取入栈的PC
95 MRSNE R0, PSP //否则, 就把PSP加载入R0中
96 LDRNE R0,[R0,#0x24] //从PSP中获取入栈的PC
97 //#endif
98 };