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 / 1261
1260  |  1262
Subject: 
Re: light sensor problem?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 24 Jul 2000 01:52:16 GMT
Viewed: 
2360 times
  
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 ;)

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...

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.

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.


Eddie C. Dost
ecd@skynet.be



Message has 1 Reply:
  Re: light sensor problem?
 
(...) 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 :) (...) True. (...) I figured this would be the case. gcc is a wonderful tool, but it does tend to (...) (24 years ago, 24-Jul-00, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: light sensor problem?
 
(...) proof that this occurs (even though his logic does seem pretty dead on.) (...) Well, we do... 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 (...) (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

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