AW: [En-Nut-Discussion] Ethernut, UART HW Flowcontrol andmaybe Bluetooth
Oliver Schulz
olischulz at web.de
Tue Dec 9 22:28:40 CET 2003
Hi Harald,
>
> Btw. Any idea anyone, how to add UART1 without copying code
> or spoil the code with ifdefs? Nah...no code in include
> files. I fear that this may confuse other tools like debuggers.
What about storing all needed registers in a two-dimensional array. One
dimension for the different registers and the other one for uart0 and uart1.
In the device or dcb structure the index for the second dimension must be
stored and all accesses to the uart registers must be "translated" by this
array. Thus you can use the complete code from usart0avr.c for both usarts.
Just an idea.
Cheers,
Oliver.
More information about the En-Nut-Discussion
mailing list