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 / 1954
1953  |  1955
Subject: 
Re: Is this an error in legOS 0.2.5?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sat, 28 Jul 2001 13:08:54 GMT
Viewed: 
1555 times
  
browsing through the legOS 0.2.5 source I found the following part • in
kernel/battery.c:
---------------------------------------
//! battery indicator handler, called from system timer interrupt
#ifdef CONF_RCX_COMPILER
void battery_refresh(void) {
#else
HANDLER_WRAPPER("battery_refresh","battery_refresh_core");
void battery_refresh_core(void) {
#endif
    int bmv = get_battery_mv();

    if (bmv > BATTERY_NORMAL_THRESHOLD_MV)
dlcd_hide(LCD_BATTERY_X);
    else if (bmv > BATTERY_LOW_THRESHOLD_MV)       <------ ???
dlcd_show(LCD_BATTERY_X);
}
---------------------------------------

Statement should be right. It's same behavier found in original
firmware:

http://graphics.stanford.edu/~kekoa/rcx/index.html#Rom

if (battery power (cc5a) > 1a2c (6700 mV))
   call ROM 1e4a (r6=301b) // clear battery low indicator
else if (battery power (cc5a) > 189c (6300 mV))
   call ROM 1b62 (r6=301b) // set battery low indicator

In original firmware we also got:

else
   battery low (cc64) = 1
   call ROM 27ac
   call ROM 1b62 (r6=301b) // set battery low indicator
   call ROM 27c8
   call ROM 339a (r6=0) // reset internal minute timer
   minutes to power off (cc12) = 1

that in legOS is missing.

Bye,
     Paolo.

---
Segal's Law: A man with a watch knows what time it is. A man with two
watches is never sure.



Message has 1 Reply:
  Re: Is this an error in legOS 0.2.5?
 
So in the original firmware, the system is shut down if ultra-low battery is detected. If we don't want tot do that, we could change the ">" in the 2nd compare to a "<" to get some hysteresis. Or would it be usefull to stop legOS and do a shut-down (...) (23 years ago, 29-Jul-01, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Is this an error in legOS 0.2.5?
 
Hi, browsing through the legOS 0.2.5 source I found the following part in kernel/battery.c: ---...--- //! battery indicator handler, called from system timer interrupt #ifdef CONF_RCX_COMPILER void battery_refresh(void) { #else (...) (23 years ago, 2-Jul-01, to lugnet.robotics.rcx.legos)

6 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