CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

SETUP_TIMER_1 is "Undefined identifier" in PCD

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mft



Joined: 16 Feb 2009
Posts: 2
Location: Tokyo Japan

View user's profile Send private message

SETUP_TIMER_1 is "Undefined identifier" in PCD
PostPosted: Tue Feb 17, 2009 5:08 am     Reply with quote

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.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Feb 17, 2009 6:05 am     Reply with quote

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.
crystal_lattice



Joined: 13 Jun 2006
Posts: 164

View user's profile Send private message

Misspelled function names
PostPosted: Tue Feb 17, 2009 6:26 am     Reply with quote

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.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

Re: Misspelled function names
PostPosted: Tue Feb 17, 2009 6:42 am     Reply with quote

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.
crystal_lattice



Joined: 13 Jun 2006
Posts: 164

View user's profile Send private message

PostPosted: Tue Feb 17, 2009 7:28 am     Reply with quote

I was just throwing it out there... there might be someone else to blame... but the inconsistency is very anoying indeed.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Feb 17, 2009 11:42 am     Reply with quote

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.
mft



Joined: 16 Feb 2009
Posts: 2
Location: Tokyo Japan

View user's profile Send private message

PostPosted: Tue Feb 17, 2009 7:21 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group