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 / 2516
2515  |  2517
Subject: 
Re: sys_timer
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Fri, 3 May 2002 10:16:00 GMT
Viewed: 
2252 times
  
Is sys_timer accurate to within 1 ms?

Yes.

    unsigned long timer_str;
    time_str = sys_time;
    wait_event(... );
    time_str = sys_time - time_str;
    lcd_int((int)timer_str);

this only seems to update by 20 ms at a time.

That is right.

That doesn't really make sense though...

It does, actually. The timer itself counts the millisec. But if you do a
wait_event() call, your running program gives up its time slice, the OS
waits for the event and then continues your task with the next task switch.
And the granularity for a task switch is 20ms ( or whatever you want it to
be. Look in include/sys/tm.h and try what happens with a TM_DEFAULT_SLICE
of 10 or 30.)

Mike



Message has 1 Reply:
  Accurate msleep and timeslicing - was Re: sys_timer
 
"Michael Obenland" <obenland@t-online.de> wrote in message news:GvJ5vD.7MC@lugnet.com... <snip> (...) switch. (...) I made some modifications to the tm_sleep_wakeup that allows high priority tasks to wake up at exactly the time specified for msleep (...) (22 years ago, 3-May-02, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  sys_timer
 
I recently adopted legOS as my development environment and I have to say I tremendously impressed. Thanks to everyone who has worked so hard on it. It is really a first class, grade A product. Is sys_timer accurate to within 1 ms? unsigned long (...) (22 years ago, 3-May-02, to lugnet.robotics.rcx.legos)

4 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