CW for DSC56F800\E - Declaration Syntax Error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

CW for DSC56F800\E - Declaration Syntax Error

3,543 次查看
v_dave
Contributor IV
Hello All,
 
My project was moving along just fine but the other day something happened and I am not sure what.  Now when I compile my project I get 6 errors, all of them are the same type of error and all occur in the same spot no matter what I change.
 
Here is a sample of what I get:
 
Error   : declaration syntax error
Events.c line 48   void QD1_OnHome(void) 
 
Here isthe code that generates the above error:
 
Code:
/* MODULE Events */#include "Cpu.h"#include "Events.h"#include "BCD_IF.h"#include "Step_Events.h"#include "CW_UA_RevA.h"#include "Mot_Cntrl.h"/*** ===================================================================**     Event       :  QD1_OnHome (module Events)****     From bean   :  QD1 [QuadratureDecoder]**     Description :**         This event is called when Home signal occurs (only when**         the Events are enabled <EnableEvent>)**     Parameters  : None**     Returns     : Nothing** ===================================================================*/#pragma interrupt called /* Comment this line if the appropriate 'Interrupt preserve registers' property */                         /* is set to 'yes' (#pragma interrupt saveall is generated before the ISR)      */void QD1_OnHome(void){   if(UA_Cntrl.Find_Home)   {        /* Write your code here ... */    stop_motor();     }}

 

 
I don't see any cause for the error.  Does anyone else see it?
 
 
--
Alban Edit: target MCU in Subject line - Code Formatted


Message Edited by Alban on 2007-07-19 03:20 PM
标签 (1)
标记 (1)
0 项奖励
回复
4 回复数

1,311 次查看
v_dave
Contributor IV
Sorry, I forgot:
 
Codewarrior for the DSC56F800\E
Version 8.0
 
This particular error is in the events.c file that was generated by PE.
 
 
0 项奖励
回复

1,311 次查看
CompilerGuru
NXP Employee
NXP Employee
Errors given by code which looks correct are usually somewhere else.
As your function is just behind the includes, I would suspect that the includes contain the actual bug. But its always also possible that it's a macro.
The simple check is to create a proprocessor output file via context menu, then look at it. In case you still dont see the bug, save and compile it too.

Daniel
0 项奖励
回复

1,311 次查看
v_dave
Contributor IV
Hello,
 
Daniel, you were correct, the error was in an include file.  It was actually a dumb error (is there any other kind?) I was working on this file and then stepped away from my PC and forgot that I was in the middle of declaring a new function.  so all that was there was "void     "  and this was the last line (before the endif) so of course it carried thorugh to the .c files. 
 
Lesson to be learned:
 
Finish your function declarations before stepping away from the PC....
 
 
0 项奖励
回复

1,311 次查看
CrasyCat
Specialist III
Hello
 
I checked on a simple project.
 
Following code snippet can be build without any trouble.
 
#pragma interrupt called
void QD1_OnHome(void)
{
   if(test)
   {
   
    /* Write your code here ... */
    stop_motor();
 
   }
There should be something else some other places.
 
I would suggest you to submit a service Request through our web site for that.
Click here to submit a SR.
 
Make sure to attach the whole project reproducing the trouble (.mcp, all source and header files, ....) to your SR.
Also make sure to attach Installed product information to the  SR.
To retrieve that info:
- Start CodeWarrior
- Select Help -> About Freescale CodeWarrior
- Click on "Install Products"
- Click on Save as to save the information in a text file.
 
CrasyCat
0 项奖励
回复