using system serial tty drivers

David david.a.borowski at gmail.com
Fri Nov 18 12:27:47 EST 2016


The purpose of defines is that all drivers will dump the old serial stuff
eventually. Just wrappping serial_out to do one character transfers
is a performance hit big time. that is why I refactored the buffer handlers
so you can do.
while ( (bytes = synth_buffer_status(true) ) != 0) {
if (bytes < 0) {
// flush code goes here
// drain tty buffers etc. and break loop
}
// we have something to write to synth
this_write = synth_buffer_gets(my_buff, 256 );
written = write_serial(fd, my_buff,  this_write);
if (written < this_write)
synth_buffer_ungets(this_write-written);
// synth is full so push back unwritten chars and  wait ...
}
} // do_catchup



More information about the Speakup mailing list