|
> 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:
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 (...) (23 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
|
|
|
|