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 / 1262
1261  |  1263
Subject: 
Re: light sensor problem?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 24 Jul 2000 02:06:05 GMT
Viewed: 
2625 times
  
On Mon, 24 Jul 2000, Eddie C. Dost wrote:
I see. Interesting post. Like Kekoa points out, though, we have no actual
proof that this occurs (even though his logic does seem pretty dead on.)

This is why I want to measure things in our lab at work ;)

Right. I made the connection between Kekoa saying "I need to test" and you
saying "I will test" right /after/ sending the message, of course :)

time_t current_time = sys_time;
while (sys_time < current_time + the amount of time I want to wait)
{
do nothing;
}

It's not pretty, but it is functional.

And keeps lower prio tasks from running, which they could do if we slept...

True.

I have absolutely no idea about how efficient the compiler is. I suppose,
worst comes to worst, we can always re-implement and then test.

Oh well, there are some optimizations missing. I just looked at the code
generated by ad_value[0] = AD_C >> 6. egcs is generating a loop with
shlr and rotxr run 6 times. You could use 2 left shifts and swap high and low
registers for this if you are smart.

I figured this would be the case. gcc is a wonderful tool, but it does
tend to lag on platforms that aren't x86. I have no idea to what extent
Markus tried to test for these poor optimizations, so some of his large
assembler statements may be an attempt at a workaround. Or they could just
be big blocks of assembler :)

One philosophical note: part of what I like about legOS is the very
low-level, close to the metal feel that you can get from it. This includes
overly fast sampling, raw sensor values, etc. While I agree that the base
of the OS needs work, and in nearly all use these "extreme" cases are
irrelevant, I'd still argue against doing anything that removes too much
power from the programmer.* Not that I think that these changes would do
such a thing, but in general this is to be avoided.

*Yes, I am still bitter that I can no longer control On/Off and Run :)

Oh, if it's only this: look at the sample code I wrote for the sensors and
do it like this: Steal the interrupt from legOS ;) Yes, I know this is not
nice... No, don't take this to serious, it's 4 in the morning and I need
some sleep.

That's the only real objection I have so far, which is why I was stating
it up front. Not that I actually plan on doing this anytime soon, but I am
interested in seeing how. I assume you mean the sample code attached a few
emails back? I'll go take a look.

Luis

P.S. 4am? I thought I was the only one playing with legOS at that hour.
We need to modify CVSWeb so that it'll report checkin times at the
author's home location, so that we can see who has checked in code at the
latest time of the morning :)

-----------------------------------------------------------------------

    "Summertime... and the living is easy...
    fish are jumping and the cotton is high...
    So hush, little baby, baby don't you cry."
-Ella

-----------------------------------------------------------------------



Message is in Reply To:
  Re: light sensor problem?
 
(...) This is why I want to measure things in our lab at work ;) (...) And keeps lower prio tasks from running, which they could do if we slept... (...) Oh well, there are some optimizations missing. I just looked at the code generated by (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)

26 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