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 / 1369
1368  |  1370
Subject: 
Idle Powerdown
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sun, 13 Aug 2000 06:06:07 GMT
Viewed: 
1105 times
  
I've successfully implemented an idle powerdown into the legOS kernel.  On
more than one occasion I have left my RCX on overnight, resulting in the
need to buy a new set of batteries.

The tricky part was doing a successful powerdown from within the interrupt.
Rather than spend a great deal of time deciphering the interrupt handlers
and rewriting them, I cheated.  I implemented a new interrupt timer task in
systime.c very similar to the battery indicator handler.  My routine fires
off once each second and checks if the number of active tasks indicates no
programs are running (if (nb_tasks <=3)).  If no tasks are running it
increments a counter.  When the counter exceeds 15 minutes (15*60) it sets a
flag to indicate a powerdown is needed.  Here's the trick.  I modifed
dkey_pressed in kdey.c to return KEY_ONOFF if the shutdown flag is TRUE.  I
also modifed the key handler to reset the shutdown counter each time a key
is pressed.  The last change was in kmain.c to reset the counters when the
unit is turned on.

I still need to add code to reset the counter when the IR port is active.

I've not been successful in submitting code to Sourceforge so I'll need to
email my changes to someone.  Paolo?  Luis?

Rossz



Message has 2 Replies:
  Re: Idle Powerdown
 
(...) need to (...) You can send the code/patch to me, Rossz. I can commit it for you. As anyone knows :-) I've solved my old problems with CVS (WINCVS). Please feel free to contact me if you need to solve your CVS problem too. :-) Bye, Paolo. --- (...) (24 years ago, 13-Aug-00, to lugnet.robotics.rcx.legos)
  Re: Idle Powerdown
 
Paolo was kind enough to check into Sourceforge my changes to implement idle powerdown. The default is 15 minutes of idle time (no programs running, no buttons pressed, no LNP activity) before automatically turning itself off. BTW, in my previous (...) (24 years ago, 15-Aug-00, to lugnet.robotics.rcx.legos)

8 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