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 / 1642
1641  |  1643
Subject: 
Re: undefined reference to `___ucmpsi2'
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Thu, 18 Jan 2001 21:34:00 GMT
Viewed: 
1277 times
  
"Pat Welch" <legos@mousebrains.com> writes:

Hi,

The problem is that wakeup_t is an unsigned long, and in order to save space,
the switch statement is optimized to call a library comparator, ucmpsi2.  Since
the argument to ds_scale is an unsigned int, the argument to LIGHT should also
be an unsigned int.  If you specify the argument prototype to light_found as an
unsigned int, all works fine.  You should also specify the return type of
light_found as an unsigned int too.  Another option is to add the comparator
function into lib/mint.

Another choice may be a cast in the switch statement, like this:

static wakeup_t light_found(wakeup_t sens_num) {
  switch ((unsigned int)sens_num) {
  case 2:
    return (LIGHT(SENSOR_2) > THRESHOLD);
    break;
  case 3:
    return (LIGHT(SENSOR_3) > THRESHOLD);
    break;
  }
  return 0;
}

bye
Bernardo



Message is in Reply To:
  Re: undefined reference to `___ucmpsi2'
 
Hi, The problem is that wakeup_t is an unsigned long, and in order to save space, the switch statement is optimized to call a library comparator, ucmpsi2. Since the argument to ds_scale is an unsigned int, the argument to LIGHT should also be an (...) (24 years ago, 18-Jan-01, to lugnet.robotics.rcx.legos)

4 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