[En-Nut-Discussion] New UART driver, 9 Bit Drivers
Brett Abbott
Brett.Abbott at digital-telemetry.com
Mon Dec 1 00:08:16 CET 2003
Harald
FYI. The 9 bit code is still in use and appears very stable.
For memory optimisation, I was about to modify the 9 bit drivers to use
HeapAlloc to create a structure which holds the additional IFSTREAM
buffers required for 9 bit. This would be created only when 9bit is
selected using the set number of bits option (ioctrl). This would
reduce the memory impact on solutions that dont need the 9 bit
functionality by reducing the size of IFSTREAM and avoiding the need to
recompile code that use ifstream.h.
Also, In a lesser way, I find it annoying to have to recompile the
library code if using the 9bit uart feature, to the point where I use
the 9bit code for 8 bit apps too! To address this I was considering
creating new devices... devUart0nine and devUart1nine (or some such
name). These two changes together would allow developers to select the
9 bit option simply at NutRegisterDevice time. The advantages here
would include avoiding the need to use compiler flags and recompile the
libaries. Single c source for uart's could be retained with the c
source being the same for both versions but setting the 9 bit flag
sepending on which device is being built. I am uncertain on whether
this would increase the libary base or not. Disadvantages include
having two uart libraries (not ideal)
In reflection, I favour the heap alloc of the 9bit buffers as required
but retaining a single 9 bit Uart device.
What are your thoughts? I could make these changes to your new code.
Either way, these changes or not, Im extremely happy to be using 9 bit
code from a standard Nutos release and are happy to help test/enhance
/support as requried.
Thanks
Brett
--
-----------------------------------------------------------------
Brett Abbott, Managing Director, Digital Telemetry Limited
Email: Brett.Abbott at digital-telemetry.com
PO Box 24 036 Manners Street, Wellington, New Zealand
Phone +64 (4) 5666-860 Mobile +64 (21) 656-144
------------------- Commercial in confidence --------------------
More information about the En-Nut-Discussion
mailing list