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 / 1925
1924  |  1926
Subject: 
Is this an error in legOS 0.2.5?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 2 Jul 2001 08:09:39 GMT
Reply-To: 
hkgen001@sneakemail.SPAMCAKEcom
Viewed: 
1507 times
  
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
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);
}
---------------------------------------

Now I wonder: shouldn't the second condition read:

    else if (bmv < BATTERY_LOW_THRESHOLD_MV)
dlcd_show(LCD_BATTERY_X);

to check for a sufficient low battery level (or maybe I'm just
getting it wrong...)?

Cheers,
Olaf



Message has 1 Reply:
  Re: Is this an error in legOS 0.2.5?
 
(...) in (...) Statement should be right. It's same behavier found in original firmware: (URL) (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 (...) (23 years ago, 28-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
    

Custom Search

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