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 CCS Technical Support

Build error

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



Joined: 02 Aug 2015
Posts: 38
Location: Tucson

View user's profile Send private message

Build error
PostPosted: Mon Oct 07, 2024 2:07 pm     Reply with quote

Hi all,

I have an odd one. While building I get an error in the 16F1947.h file.

595 #bit C1OUT = getenv("SFR:CM1CON0").6

The error is;
1 Errors, 0 Warnings, Build Failed., Time: 1 Seconds
/opt/picc/devices/16F1947.h:595:34: Error#28 Expecting an identifier Bad SFR name
Build Failed.

I confirmed that there is an SFR named CM1CON0 so what gives?

Thanks.
Glenn
_________________
-Glenn
jeremiah



Joined: 20 Jul 2010
Posts: 1354

View user's profile Send private message

Re: Build error
PostPosted: Mon Oct 07, 2024 6:18 pm     Reply with quote

ghamblin wrote:


I confirmed that there is an SFR named CM1CON0 so what gives?

Thanks.
Glenn


did you confirm it in the device database in CCS or in the datasheet? Sometimes the device database has errors, so I would check there.
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Tue Oct 08, 2024 1:48 am     Reply with quote

The 'bit' syntax, when using a bit in a named SFR, has oddities. If there are
multiple names for the same register, this will only work on (I think), the
first name, not on later names. Also if the bit has a unique name already,
it seems not to work.
Just use the named bit syntax instead:

#bit C1OUT=getenv("BIT:C1OE")

It has caught me on several occasions....
ghamblin



Joined: 02 Aug 2015
Posts: 38
Location: Tucson

View user's profile Send private message

PostPosted: Tue Oct 08, 2024 7:15 pm     Reply with quote

Thanks. It just seems odd since the include file is supplied by CCS.
_________________
-Glenn
jeremiah



Joined: 20 Jul 2010
Posts: 1354

View user's profile Send private message

PostPosted: Wed Oct 09, 2024 7:06 am     Reply with quote

ghamblin wrote:
Thanks. It just seems odd since the include file is supplied by CCS.


Well they are human. Sometimes they make mistakes. It's easy to do when microchip is putting out so many new chips and chip variants. Also sometimes the datasheets from Microchip are wrong. And if no one reports the error to them, it may not get fixed for a long time.

Side note: I hope you at least send them in a report about the name not working as expected so they can fix it up.
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