Subject:
|
Re: LegOS 0.2.0a multi-threading problem
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Wed, 27 Oct 1999 16:22:22 GMT
|
Viewed:
|
1090 times
|
| |
| |
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;
What does standard firmware do?
Markus.
--
"Nieder mit den Zitaten!" -Markus L. Noga <markus@noga.de>
|
|
Message has 1 Reply: | | Re: LegOS 0.2.0a multi-threading problem
|
| (...) 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. (...) Don't know, I've never used (...) (25 years ago, 27-Oct-99, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Re: LegOS 0.2.0a multi-threading problem
|
| (...) 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 (...) (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
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|