termios support

Geoffroy Montel g_montel at yahoo.com
Wed May 6 08:22:41 UTC 1998


Hello

> > But, wouldn't it be better if
> > void rtems_termios_dequeue_characters (void *ttyp, int len)
> > would be stg like
> > int rtems_termios_dequeue_characters (void *ttyp, int len)
> > and we'd return the state of the buffer ? (for instance, 0 when
> > it's empty
> > so that we stop the interrupts then, and 1 otherwise)
> >
> 
> No, that would be redundant.
> 
> Have a look at the example write and transmit interrupt routines.   
> I'll show them again since they're so short....
> 
> Notice that the transmit interrupt service routine disables the  
> transmit interrupt before calling
rtems_termios_dequeue_characters().  
> 
> 
> If the termios output buffer is empty,  
> rtems_termios_dequeue_characters () just returns to the interrupt  
> handler which returns and leaves the transmit interrupt disabled.
> 
> If the termios output buffer is not empty,  
> rtems_termios_dequeue_characters() calls device_write_routine () to  
> transmit the next character and reenable the transmit interrupt. 
The  
> device_write_routine returns to rtems_termios_dequeue_characters  
> which in turn returns to the interrupt handler which returns and
will  
> again be invoked when the transmitter is ready.

Yeah, I understood that. I just thought that it would have been nice not
to disable interrupts when it was not necessary, and I found it
logical that
a function, which changes the state of the buffer, returns its state. 
Anyway, this is not important and your solution is very satisfying!

Thanks for the help

Geoffroy
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com




More information about the users mailing list