More UART GPIO pin/interrupt fixes

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1858 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2009-06-06 16:01:38 +00:00
parent ce84f9db4e
commit 70c20896f3
4 changed files with 12 additions and 8 deletions

View File

@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* arch/arm/src/str71x/str71x_gpio.h * arch/arm/src/str71x/str71x_gpio.h
* *
* Copyright (C) 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View File

@ -41,6 +41,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <errno.h> #include <errno.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>
#include <nuttx/arch.h>
#include "arm.h" #include "arm.h"
#include "up_arch.h" #include "up_arch.h"
@ -92,8 +93,11 @@ void up_irqinitialize(void)
* (Needs more investigation). * (Needs more investigation).
*/ */
up_mdelay(50); /* Wait a bit */
#if 0
putreg32(0, STR71X_EIC_IER); /* Make sure that all interrupts are disabled */ putreg32(0, STR71X_EIC_IER); /* Make sure that all interrupts are disabled */
putreg32(0xffffffff, STR71X_EIC_IPR); /* And that no interrupts are pending */ putreg32(0xffffffff, STR71X_EIC_IPR); /* And that no interrupts are pending */
#endif
/* Enable global ARM interrupts */ /* Enable global ARM interrupts */

View File

@ -300,17 +300,17 @@ void up_lowsetup(void)
#if HAVE_UART #if HAVE_UART
reg16 = getreg16(STR71X_GPIO0_PC0); reg16 = getreg16(STR71X_GPIO0_PC0);
reg16 &= STR71X_UART_GPIO0_MASK; reg16 &= ~STR71X_UART_GPIO0_MASK;
reg16 |= STR71X_UART_GPIO0_PC0BITS; reg16 |= STR71X_UART_GPIO0_PC0BITS;
putreg16(reg16, STR71X_GPIO0_PC0); putreg16(reg16, STR71X_GPIO0_PC0);
reg16 = getreg16(STR71X_GPIO0_PC1); reg16 = getreg16(STR71X_GPIO0_PC1);
reg16 &= STR71X_UART_GPIO0_MASK; reg16 &= ~STR71X_UART_GPIO0_MASK;
reg16 |= STR71X_UART_GPIO0_PC1BITS; reg16 |= STR71X_UART_GPIO0_PC1BITS;
putreg16(reg16, STR71X_GPIO0_PC1); putreg16(reg16, STR71X_GPIO0_PC1);
reg16 = getreg16(STR71X_GPIO0_PC2); reg16 = getreg16(STR71X_GPIO0_PC2);
reg16 &= STR71X_UART_GPIO0_MASK; reg16 &= ~STR71X_UART_GPIO0_MASK;
reg16 |= STR71X_UART_GPIO0_PC2BITS; reg16 |= STR71X_UART_GPIO0_PC2BITS;
putreg16(reg16, STR71X_GPIO0_PC2); putreg16(reg16, STR71X_GPIO0_PC2);
#endif #endif

View File

@ -775,17 +775,17 @@ static void up_rxint(struct uart_dev_s *dev, boolean enable)
struct up_dev_s *priv = (struct up_dev_s*)dev->priv; struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
if (enable) if (enable)
{ {
/* Receive an interrupt when the Rx FIFO is half full (or an IDLE /* Receive an interrupt when the Rx FIFO is half full (or if a timeout
* timeout occurs. * occurs while the Rx FIFO is not empty).
*/ */
#ifndef CONFIG_SUPPRESS_SERIAL_INTS #ifndef CONFIG_SUPPRESS_SERIAL_INTS
priv->ier |= (STR71X_UARTIER_RHF|STR71X_UARTIER_TIMEOUTIDLE); priv->ier |= (STR71X_UARTIER_RHF|STR71X_UARTIER_TIMEOUTNE);
#endif #endif
} }
else else
{ {
priv->ier &= ~(STR71X_UARTIER_RHF|STR71X_UARTIER_TIMEOUTIDLE); priv->ier &= ~(STR71X_UARTIER_RHF|STR71X_UARTIER_TIMEOUTNE);
} }
up_serialout(priv, STR71X_UART_IER_OFFSET, priv->ier); up_serialout(priv, STR71X_UART_IER_OFFSET, priv->ier);
} }