To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 533
532  |  534
Subject: 
Re: NQC Ignores based on your pbrink
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Sun, 9 Apr 2000 01:15:36 GMT
Viewed: 
2047 times
  
Have you considered adding the firmware build version to that symbol or to a
new one?

__RCX = 2
__FIRMWARE=3.21

This would facilitate creation of portable, work-around code that would
accomodate an end-user who hasn't updated their firmware (or has a reason not
to). It could also be useful in comparing code functionality side-by-side on
two firmware versions.

Dennis

Dave Baum wrote:

In article <slrn8euqu4.cbl.mattdm@jadzia.bu.edu>, mattdm@mattdm.org
wrote:

Dean Husby <nntp@akasa.bc.ca> wrote:
Dave Can  you setup NQC to automatically ignore things a pbrink doesn't
understand? For example The scout.

Coincidentally, I think someone just posted the answer to your question a
few hours ago....

<http://www.lugnet.com/robotics/rcx/nqc/?n=525>

Yes, I agree with the approach to using __RCX for conditional compile -
that's really why its there.

I had thought about adding some of the functions (SetSensor() etc.) as
no-ops in the Scout API, but this really didn't feel right to me.  I
figured someone could build their own API which no-oped things
accordingly, but I didn't want to take the official API in this
direction.  Really more of a philisophical thing.

Incidentally, the __RCX symbol is currently either defined or undefined.
Soon it will be defined to a certain value indicating the firmware level
of the RCX - for example...

#if __RCX == 1
// RCX 1.0 firmware (actually 3.09)
#elif __RCX == 2
// RCX 2.0 firmware (3.21 or better)
#endif

Again, in cases where the functionality present in 1.0 and 2.0, the API
will exist in both.  However, new features for 2.0 will have no
corresponding API in 1.0 builds, so using them (without the appropriate
conditional compile) will cause an error.

Dave Baum

--
reply to: dbaum at enteract dot com

--
Dennis Williamson - Certified Y2K Complacent

Bad News: The next millenium starts on a Monday.
Good News: You get the day off.

(remove .NO and SPAM. to reply)



Message has 1 Reply:
  Re: NQC Ignores based on your pbrink
 
(...) This first define (__RCX = 2) will happen automatically in NQC when you select RCX 2.0 as the target for compilation. Selecting an RCX 1.0 target will cause the symbol to be defined as 1. (...) I hope I don't have to add a __FIRMWARE symbol... (...) (25 years ago, 9-Apr-00, to lugnet.robotics.rcx.nqc)  

Message is in Reply To:
  Re: NQC Ignores based on your pbrink
 
(...) Yes, I agree with the approach to using __RCX for conditional compile - that's really why its there. I had thought about adding some of the functions (SetSensor() etc.) as no-ops in the Scout API, but this really didn't feel right to me. I (...) (25 years ago, 8-Apr-00, to lugnet.robotics.rcx.nqc)

10 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR