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

CCS in MPLAB X -- syntax underlining, etc

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



Joined: 07 Jan 2013
Posts: 31

View user's profile Send private message

CCS in MPLAB X -- syntax underlining, etc
PostPosted: Mon Jan 07, 2013 6:48 pm     Reply with quote

I am new to the CCS compiler, and decided to use it in from within the MPLAB X IDE since it has some spiffy features that the CCS IDE doesn't. However, I'm a little disappointed that the IDE appears to have no knowledge of any of the CCS functions or special identifiers (e.g. setup_timer_0(), #use, true), as there is no header file that I can find with all the function prototypes -- I guess these functions are embedded in the compiler and so don't need to be defined in a header file? Unfortunately this makes the IDE underline these functions and keywords as unresolved identifiers, and of course auto complete is off the table as well. So my question is, does anybody know a trick to fix this, or do I just have to live with it? Thanks!
jeremiah



Joined: 20 Jul 2010
Posts: 1346

View user's profile Send private message

PostPosted: Wed Jan 09, 2013 7:46 pm     Reply with quote

I find them annoying as well. What I do is make my own function prototypes for the CCS built ins. Note that they prototypes only have to have the same name as the built in to stop the underlining. You can use void return type and no parameters in your prototype.

So stuff like:

Code:

void i2c_write();


Should be sufficient. I will say I haven't tried in a while though so I don't know if MPLABX 1.51 still falls for this trick.
DireSpume



Joined: 07 Jan 2013
Posts: 31

View user's profile Send private message

PostPosted: Wed Jan 09, 2013 8:05 pm     Reply with quote

Looks like it still works, thanks!
DireSpume



Joined: 07 Jan 2013
Posts: 31

View user's profile Send private message

PostPosted: Mon Jan 14, 2013 2:03 pm     Reply with quote

I called CCS technical support, and they said that this issue is a bug with MPLAB X, and that they are just waiting for Microchip to fix it.
Diego López



Joined: 25 May 2012
Posts: 11
Location: Colombia

View user's profile Send private message

PostPosted: Sun Jan 20, 2013 6:05 pm     Reply with quote

Hello friends, I excuse the language.


MplabX not recognize CCS functions, you can do something?

jeremiah



Joined: 20 Jul 2010
Posts: 1346

View user's profile Send private message

PostPosted: Sun Jan 20, 2013 7:19 pm     Reply with quote

My first reply shows a way to handle functions. For variables, you can probably do some #define trickery or extern trickery, but I haven't tried that yet.
dezso



Joined: 04 Mar 2010
Posts: 102

View user's profile Send private message

PostPosted: Mon Jan 21, 2013 12:43 am     Reply with quote

Go to...
Tools->Options->C/C++->deselect "Highlight Unresolved Identifiers"
_________________
I'm could be wrong many time's, at least I know what I'm doing Smile
Diego López



Joined: 25 May 2012
Posts: 11
Location: Colombia

View user's profile Send private message

PostPosted: Mon Jan 21, 2013 8:13 am     Reply with quote

Hello friends

thanks for replying,

1:
I defined functions, but there are many
Example: void delay_ms ()

I do not know how to define other functions Example: int_timer0

2:
Go to ...
Tools-> Options-> C / C + + -> deselect "Highlight Unresolved Identifiers"

It works, but then I can not see errors, subsequent

best regards
jeremiah



Joined: 20 Jul 2010
Posts: 1346

View user's profile Send private message

PostPosted: Mon Jan 21, 2013 10:37 am     Reply with quote

Diego López wrote:

1:
I defined functions, but there are many
Example: void delay_ms ()

I do not know how to define other functions Example: int_timer0


Same as I mention above:
void int_timer0();

Should work for all functions.
void <insert_function_name_here>();
Diego López



Joined: 25 May 2012
Posts: 11
Location: Colombia

View user's profile Send private message

PostPosted: Mon Jan 21, 2013 10:43 am     Reply with quote

jeremiah, now I understand, thank you very much.
Jeff King



Joined: 20 Oct 2003
Posts: 43
Location: Hillsdale, Michigan USA

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Mar 22, 2013 12:50 pm     Reply with quote

jeremiah wrote:
I find them annoying as well. What I do is make my own function prototypes for the CCS built ins. Note that they prototypes only have to have the same name as the built in to stop the underlining. You can use void return type and no parameters in your prototype.

So stuff like:

Code:

void i2c_write();


Should be sufficient. I will say I haven't tried in a while though so I don't know if MPLABX 1.51 still falls for this trick.


So this would just be an include .h file making these prototypes?

Anyone put something like this together with all the CCS functions and might be willing to share? Hate typing something someone else already did ;-) Sounds like a good include for the CCS release as well.
jeremiah



Joined: 20 Jul 2010
Posts: 1346

View user's profile Send private message

PostPosted: Fri Mar 22, 2013 2:17 pm     Reply with quote

yeah, you can make it an include file if needed. I've never used enough of them to motivate myself to make an all encompassing file. Not to mention I don't have enough different chips to test against to ensure everything works fine with the dummy includes (should in theory be no issue).

If someone were to go through the process of making and verifying it, it would be a nice addition to the code library.
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