View unanswered posts | View active topics It is currently Thu Sep 18, 2014 7:53 am






Reply to topic  [ 4 posts ] 
Question about RobotCIntrinsics.c 
Author Message
Novice
User avatar

Joined: Sat Jul 10, 2010 3:06 pm
Posts: 86
Location: Roanoke, VA
Post Question about RobotCIntrinsics.c
I was browsing through the file RobotCIntrinsics.c, and noticed that it contains intrinsics for the NXT (starting ~line 680). As I was operating in ROBOTC for Cortex/PIC, I was wondering why the intrinsics file contains this section.

Is there a particular reason, or is this an artifact of ROBOTC?

//Andrew

_________________
Check out my website! www.RoboDesigners.com

VRC Team 2190

Twitter: @RoboDesigners


Wed Mar 07, 2012 7:36 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3223
Location: Rotterdam, The Netherlands
Post Re: Question about RobotCIntrinsics.c
No, if you look carefully you will see that sections are demarked with precompile pragmas that will compile certain parts into your program, depending on which platform you're currently using. Some sections apply to multiple platforms, others just to one.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Mar 10, 2012 2:50 pm
Profile WWW
Novice
User avatar

Joined: Sat Jul 10, 2010 3:06 pm
Posts: 86
Location: Roanoke, VA
Post Re: Question about RobotCIntrinsics.c
mightor wrote:
No, if you look carefully you will see that sections are demarked with precompile pragmas that will compile certain parts into your program, depending on which platform you're currently using. Some sections apply to multiple platforms, others just to one.

- Xander

Ok. That makes more sense...

//Andrew

_________________
Check out my website! www.RoboDesigners.com

VRC Team 2190

Twitter: @RoboDesigners


Sat Mar 10, 2012 9:31 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3223
Location: Rotterdam, The Netherlands
Post Re: Question about RobotCIntrinsics.c
I use a similar technique in my driver suite. All of my drivers that can potentially be used with a Sensor MUX have the code for it. However, it's not until you include a very specific driver file (the one for the actual SMUX itself) that this code becomes compiled into your program. That saves space and it saves me the hassle of having to maintain many different driver files that share quite a lot of common code.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Mar 11, 2012 2:57 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.