View previous topic :: View next topic |
Author |
Message |
mft
Joined: 16 Feb 2009 Posts: 2 Location: Tokyo Japan
|
SETUP_TIMER_1 is "Undefined identifier" in PCD |
Posted: Tue Feb 17, 2009 5:08 am |
|
|
Dear All,
I am using PCD version is 4.06 and I encountered following very simple program cannot be compiled.
Code: |
#include "24FJ64GA002.H"
void main()
{
SETUP_TIMER_1( 0 );
} |
The compiler error message is follws:
Executing: "C:\Program Files\PICC\Ccsc.exe" +FD "timer.c" +DF +LN +T +A +M +Z +Y=9 +EA
*** Error 12 "timer.c" Line 5(16,17): Undefined identifier -- SETUP_TIMER_1
1 Errors, 0 Warnings.
Halting build on first failure as requested.
----
I do checked the header file and I checked the code work with PCH compiler. How do I fix the code to succsess compiling?
Please anyone give me solution. |
|
![](templates/subSilver/images/spacer.gif) |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Tue Feb 17, 2009 6:05 am |
|
|
Just ask the compiler manual. The built-in function is named setup_timer1(); However, I didn't check correct functional behaviour, but it compiles in V4.084 without errors. |
|
![](templates/subSilver/images/spacer.gif) |
crystal_lattice
Joined: 13 Jun 2006 Posts: 164
|
Misspelled function names |
Posted: Tue Feb 17, 2009 6:26 am |
|
|
I think the CCS guys responsible for writing the help files and manual should try the code before they cast it in stone. Alot of the code posted in the help/manuals have errors like this. |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
Re: Misspelled function names |
Posted: Tue Feb 17, 2009 6:42 am |
|
|
crystal_lattice wrote: | I think the CCS guys responsible for writing the help files and manual should try the code before they cast it in stone. Alot of the code posted in the help/manuals have errors like this. | SETUP_TIMER_1 is not in the PCD Reference manual, so you might be blaming the wrong people.
What _is_ a mistake is that CCS decided to change the name of the function:
- For PIC18 and smaller chips it is SETUP_TIMER_x
- For PIC24 the function name was changed to SETUP_TIMERx
I consider this to be a serious problem. CCS might have good reasons to break backwards compatibility but I don't see them, and at least they should have added a note in the Reference Manual. |
|
![](templates/subSilver/images/spacer.gif) |
crystal_lattice
Joined: 13 Jun 2006 Posts: 164
|
|
Posted: Tue Feb 17, 2009 7:28 am |
|
|
I was just throwing it out there... there might be someone else to blame... but the inconsistency is very anoying indeed. |
|
![](templates/subSilver/images/spacer.gif) |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Tue Feb 17, 2009 11:42 am |
|
|
Quote: | at least they should have added a note in the Reference Manual | Cause PCD has a separate reference manual, I wonder where you want to place the note.
Generally, the timer function functionality has changed a lot, there might be even more confusion when continuing the old timer functions for PCD. But using a slightly different name is bad anyway. |
|
![](templates/subSilver/images/spacer.gif) |
mft
Joined: 16 Feb 2009 Posts: 2 Location: Tokyo Japan
|
|
Posted: Tue Feb 17, 2009 7:21 pm |
|
|
Thank for many replies.
I changed the function name “setup_timer1” and I got same result, “Undefined identifier”. Actually I did try it before I raise this topic.
Anyway I create a function to control internal timer module.
MFT |
|
![](templates/subSilver/images/spacer.gif) |
|