Discussion:
using system serial tty drivers
David
2016-11-18 17:27:47 UTC
Permalink
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
Samuel Thibault
2016-11-18 17:30:16 UTC
Permalink
Post by David
The purpose of defines is that all drivers will dump the old serial stuff
eventually.
Yes, but we don't want to do that without testing.
Post by David
Just wrappping serial_out to do one character transfers is a
performance hit big time.
No. We are talking about serial ports, which are very slow anyway.
Post by David
that is why I refactored the buffer handlers
so you can do.
Did you measure any actual performance improvement ?

A function call is at most like a few instructions, i.e. the order of a
nanosecond. On serial ports, at the very very best, characters take an
order of a microsecond to transfer.

Again, complex code is really not what you want in the end if it doesn't
bring much improvement.

Samuel
Samuel Thibault
2016-11-18 17:42:49 UTC
Permalink
Post by Samuel Thibault
Post by David
The purpose of defines is that all drivers will dump the old serial stuff
eventually.
Yes, but we don't want to do that without testing.
One thing you may not know: some drivers can only work with an ISA card,
because they poke ports outside the standard serial ports. They will
not work with the new serial access method, and that's fine, since they
don't exist as non-ISA cards.

Samuel

Loading...