Subject:
|
Re: Polling sensor values with wait_event
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Thu, 28 Nov 2002 00:50:05 GMT
|
Viewed:
|
3531 times
|
| |
| |
Thomas,
I had a thought about this situation. You could write a function that sets
a flag when the event is triggered, do nothing otherwise. You could call
this function from within each of the tasks you write (at a somewhat high
frequency ... say every 20 or so lines of code). Then the task responsible
for responding to the event could read and reset the flag. Now, if you need
to know how many times it was triggered, or for how long it was triggered,
then it gets a little more complicated. However, this would definitely
increase the applications ability to catch those quick events.
Don't forget to put tasks to sleep if/when possible. This yields the
remainder of the time-slice to other tasks.
// Joe
"Thomas Gysi" <t.gysi@fh-aargau.ch> wrote in message
news:3DE4E44E.70701@fh-aargau.ch...
> Hi Joe,
>
> Thanks for your reply, I guess that is the solution to use in this case.
> I'll still just get values every 20ms. By changing the timeslice I
> could have this go a bit faster though.
>
> Thomas
>
|
|
Message is in Reply To:
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|