To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 419
418  |  420
Subject: 
Re: LegOS 0.2.0a multi-threading problem
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 27 Oct 1999 17:06:28 GMT
Viewed: 
1260 times
  
"Markus L. Noga" <markus@noga.de> writes:

Modemch wrote:
Following up to myself, but here's the error (kernel/program/.c) lines
255-260:

      case KEY_ONOFF:
        // works only if no programs are running.
        if(nb_tasks<=3) {
          killall(PRIO_HIGHEST);
        }
        return 0;
        ^^^^
        This should be 'break'.  The way the code is now, pressing on/off
while anything is running exits the key_handler() thread, and of course all
the keys except for "View" stop working.

If ON/OFF is desired while programs run, just drop the if.
If ON/OFF isn't to work while programs run, it has to be this:

if(nb_tasks<=3) {
  killall(PRIO_HIGHEST);
  return 0; // killall doesn't kill self
}
break;

I'd say this is the way to leave it, since it seems to be how you meant it
in the first place.  It's just very annoying to take out the batteries if
ON/OFF is pressed by mistake while something is running.

What does standard firmware do?

Don't know, I've never used it...

--
Regards,
Modemch



Message is in Reply To:
  Re: LegOS 0.2.0a multi-threading problem
 
(...) If ON/OFF is desired while programs run, just drop the if. If ON/OFF isn't to work while programs run, it has to be this: if(nb_tasks<=3) { killall(PRIO_HIGHEST); return 0; // killall doesn't kill self } break; What does standard firmware do? (...) (25 years ago, 27-Oct-99, to lugnet.robotics.rcx.legos)

5 Messages in This Thread:

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

Custom Search

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