From 2706bfe910c8045610eba0b06d65d0f8a6b8991b Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 6 Nov 2010 02:42:59 +0000 Subject: [PATCH] Progress debugging serial driver git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3078 42af7a65-404d-4744-a932-0658087f49c3 --- arch/avr/src/at32uc3/at32uc3_serial.c | 4 ++-- arch/avr/src/common/up_initialize.c | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/avr/src/at32uc3/at32uc3_serial.c b/arch/avr/src/at32uc3/at32uc3_serial.c index 7ed9d4b951..e0c2bae48b 100644 --- a/arch/avr/src/at32uc3/at32uc3_serial.c +++ b/arch/avr/src/at32uc3/at32uc3_serial.c @@ -336,7 +336,7 @@ static inline void up_disableusartint(struct up_dev_s *priv, uint32_t *imr) { if (imr) { - *imr = up_serialin(priv, AVR32_USART_IDR_OFFSET); + *imr = up_serialin(priv, AVR32_USART_IMR_OFFSET); } /* Disable all interrupts */ @@ -594,7 +594,7 @@ static int up_receive(struct uart_dev_s *dev, uint32_t *status) static void up_rxint(struct uart_dev_s *dev, bool enable) { struct up_dev_s *priv = (struct up_dev_s*)dev->priv; - + if (enable) { /* Receive an interrupt when their is anything in the Rx data register (or an Rx diff --git a/arch/avr/src/common/up_initialize.c b/arch/avr/src/common/up_initialize.c index fde474ec61..abbff8532d 100644 --- a/arch/avr/src/common/up_initialize.c +++ b/arch/avr/src/common/up_initialize.c @@ -51,6 +51,19 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* Determine which (if any) console driver to use. This will probably cause + * up_serialinit to be incorrectly called if there is no USART configured to + * be an RS-232 device (see as an example arch/avr/src/at32uc23/at32uc3_config.h) + * This will probably have to be revisited someday. + */ + +#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) +# undef CONFIG_USE_SERIALDRIVER +# undef CONFIG_USE_EARLYSERIALINIT +#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0 +# define CONFIG_USE_SERIALDRIVER 1 +# define CONFIG_USE_EARLYSERIALINIT 1 +#endif /**************************************************************************** * Private Types