Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Cooperative RTOS ( was Re: Teenagers ...)

2004-09-07 by Graham Davies

--- In AVR-Chat@yahoogroups.com, Dave VanHorn <dvanhorn@d...> wrote:

> > > How exactly do you "send" an event to a task?
> > There is an ECROS function to do this.
> That didn't really illuminate much for me. :)

OK, sorry, Dave. In ECROS, every task has its own set of eight events 
it can respond to. When you call the OS function, you specify which 
task you want to target and which events you want to send. The new 
events are combined with any previously existing events and compared 
to an OS-wide condition for task readiness. The default condition is 
that any of four events are set or either of two pairs of the others. 
If the task is ready, it is placed on the queue corresponding to its 
priority. When the scheduler runs the task, the events are passed to 
the task function. The task can also inspect and clear events using 
other OS functions.

ECROS events can be sent directly from an OS function, delayed by a 
timer, repeatedly by a recurring timer, attached to a message and 
from an interrupt.

> > In ECROS, you use a printf-like function ...
> Ok, that's very similar to what I do...
> but of course it's possible to get stuck
> with a 10 char message, and a 9 char buffer.
> ... I don't have an elegant handler for that. 

Neither do I. If your intent is not to block on UART output, you're 
doomed to design the system to accomodate the UART data rate and any 
limit on the buffering you can afford. The best thing to do is never 
try to send more than will fit in the buffer. Once you've done that, 
you can (using ECROS) avoid sending anything else until you get the 
event that means the buffer is empty. This is an order of magnitude 
more complicated for the user than anything else in ECROS (except for 
addressing the same problem with UART reception) so I wouldn't call 
it elegant.

> > If the point of your message is to take issue ...
> Not at all!

OK, sorry. Just making sure.

Graham.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.