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 / 45
44  |  46
Subject: 
Re: Idle process
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 9 Mar 1999 15:46:02 GMT
Viewed: 
1258 times
  
"Markus L. Noga" wrote:

Hi Lou,

the sleep instruction effectively shuts down the CPU until the next
interrupt occurs.
Thus, the idle process conserves battery power if no task wishes to run.
I consider this a worthwile feature. If you can do this without a
dedicated idle task, feel free to move sleep somewhere else.

I, too, consider power saving to be a valuable (indispensible) feature.
That is precisely the sort of thing that I feared I might be
overlooking.  Up 'till now, I had not worked on an embedded project
which would benefit from using sleep/powerdown modes.

Rereading your code (again), It appears that the situation which causes
this desired behavior is when the loop (in tm.c) wraps around and finds
the idle process at its head.

I think I can achieve a similar effect by putting the idle task at the
lowest priority in my structure.  The caveat would be that one should
not assign other tasks to that priority, lest they not ever run or cease
to do so.  In the final version, that caveat may not exist.  The upside,
in terms of flexibility, is that the idle task (might want to call it
the sleep or power_saving task) would be like any other task, not
treated specially in the code.  If you really wanted to get crafty, you
could (already can, actually) insert a sleep task in the middle of the
chain to temporarily disable lower priority tasks.  This sort of thing,
I plan to mention in the documentation, once I get that far.

As you might have surmised by now, I am a sucker for elegance,
efficiency, and flexibility.

The fact that process lists depend on tm_idle to be there is plain bad
style. I guess I wrote it like that. Sigh.

Don't be too hard on yourself.  I have been quite impressed with the
general quality of your code, and the elegance of some of the mechanisms
implemented therein.

I think the hardest part of this is going to be sufficiently testing the
new code.  Do you have a jig for testing this stuff on the host system,
or do you just burn-and-crash on the RCX?



Message has 1 Reply:
  Re: Idle process
 
(...) The idle task actually has the lowest priority in my scheme, but there was some efficiency gained in making the task list loop around. If the idle task is always there, it makes for simplified code in multitasking startup if you rely on that. (...) (26 years ago, 11-Mar-99, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: Idle process
 
Hi Lou, the sleep instruction effectively shuts down the CPU until the next interrupt occurs. Thus, the idle process conserves battery power if no task wishes to run. I consider this a worthwile feature. If you can do this without a dedicated idle (...) (26 years ago, 8-Mar-99, to lugnet.robotics.rcx.legos)

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