Index: ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/devs/serial/generic/16x5x/current/ChangeLog,v retrieving revision 1.18 diff -u -r1.18 ChangeLog --- ChangeLog 29 Jan 2009 17:48:39 -0000 1.18 +++ ChangeLog 17 Feb 2009 22:37:48 -0000 @@ -1,3 +1,10 @@ +2009-02-17 Rene Schipp von Branitz Nielsen + + * src/ser_16x5x.c: + Allow platform code to override the default implementation for + writing the LCR register and reading the ISR register by using + the SER_16X5X_WRITE_LCR() and SER_16X5X_READ_ISR() macros. + 2008-07-08 Uwe Kindler * cdl/ser_generic_16x5x.cdl Index: src/ser_16x5x.c =================================================================== RCS file: /cvs/ecos/ecos/packages/devs/serial/generic/16x5x/current/src/ser_16x5x.c,v retrieving revision 1.17 diff -u -r1.17 ser_16x5x.c --- src/ser_16x5x.c 29 Jan 2009 17:48:39 -0000 1.17 +++ src/ser_16x5x.c 17 Feb 2009 22:37:49 -0000 @@ -229,6 +229,17 @@ # define CYG_IO_SERIAL_GENERIC_16X5X_INT_PRIORITY 4 #endif +// Allow platform code to override the default implementation of +// a write to the LCR +#ifndef SER_16X5X_WRITE_LCR +#define SER_16X5X_WRITE_LCR(_base_, _val_) HAL_WRITE_UINT8((_base_) + REG_lcr, _val_) +#endif + +// Allow platform code to override the default implementation of +// a read of the ISR +#ifndef SER_16X5X_READ_ISR +#define SER_16X5X_READ_ISR(_base_, _val_) HAL_READ_UINT8((_base_) + REG_isr, _val_) +#endif // Internal function to actually configure the hardware to desired // baud rate, etc. @@ -259,10 +270,10 @@ _lcr = select_word_length[new_config->word_length - CYGNUM_SERIAL_WORD_LENGTH_5] | select_stop_bits[new_config->stop] | select_parity[new_config->parity]; - HAL_WRITE_UINT8(base+REG_lcr, _lcr | LCR_DL); + SER_16X5X_WRITE_LCR(base, _lcr | LCR_DL); HAL_WRITE_UINT8(base+REG_mdl, baud_divisor >> 8); HAL_WRITE_UINT8(base+REG_ldl, baud_divisor & 0xFF); - HAL_WRITE_UINT8(base+REG_lcr, _lcr); + SER_16X5X_WRITE_LCR(base, _lcr); if (init) { #ifdef CYGPKG_IO_SERIAL_GENERIC_16X5X_FIFO unsigned char _fcr_thresh; @@ -580,7 +591,7 @@ // Check if we have an interrupt pending - note that the interrupt // is pending of the low bit of the isr is *0*, not 1. - HAL_READ_UINT8(base+REG_isr, _isr); + SER_16X5X_READ_ISR(base, _isr); while ((_isr & ISR_nIP) == 0) { switch (_isr&0xE) { case ISR_Rx: