View previous topic :: View next topic |
Author |
Message |
ghamblin
Joined: 02 Aug 2015 Posts: 38 Location: Tucson
|
Build error |
Posted: Mon Oct 07, 2024 2:07 pm |
|
|
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: 1351
|
Re: Build error |
Posted: Mon Oct 07, 2024 6:18 pm |
|
|
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: 19529
|
|
Posted: Tue Oct 08, 2024 1:48 am |
|
|
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
|
|
Posted: Tue Oct 08, 2024 7:15 pm |
|
|
Thanks. It just seems odd since the include file is supplied by CCS. _________________ -Glenn |
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1351
|
|
Posted: Wed Oct 09, 2024 7:06 am |
|
|
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. |
|
|
|