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 / 755
754  |  756
Subject: 
Re: newbie questions...
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Mon, 11 Sep 2000 08:28:24 GMT
Viewed: 
4622 times
  
On Sat, 9 Sep 2000 05:30:24 GMT,
Dave Baum <dbaum@spambgoneenteract.com> wrote:

> The above looks good, but I haven't tried it so there could be a subtle
> problem.  Using ActiveEvents() is pretty awkward at present because you
> need to know the task number of the running task (task main is 0).  With
> the latest firmware (firm0328.lgo) you can use ActiveEvents(10) to
> always get active events for the current task.

Ok, so the 'if ( ActiveEvents(10) & EVENT_MASK(0) )' is the
correct syntax to check if event 0 was triggered ?

> I'll probably add more
> sophisticated catch code to NQC in the future that takes advantage of
> ActiveEvents(10).

Or a function that returns the current task number ?

Thanks for your advices and keep up the good work !

Stelian.

--
Stelian Pop <stelian.pop@alcove.fr>



Message has 1 Reply:
  Re: newbie questions...
 
(...) yes (...) That's pretty tough to implement. Code in the tasks is easy...the task number is a constant. Same for subs that are only called from one task. Inline functions are also easy...provided they are called from one of the above. The (...) (26 years ago, 12-Sep-00, to lugnet.robotics.rcx.nqc)

Message is in Reply To:
  Re: newbie questions...
 
(...) Both versions should work ok. Personally I prefer something like the following code because its less code overall and the "modality" of the program is apparent from the listing. But its really a matter of personal style. #define TOUCH SENSOR_1 (...) (26 years ago, 9-Sep-00, to lugnet.robotics.rcx.nqc)

5 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
    

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