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:
parent
75a1c1b2f3
commit
540ab99c57
@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* 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>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include "arm.h"
|
||||
#include "up_arch.h"
|
||||
@ -92,8 +93,11 @@ void up_irqinitialize(void)
|
||||
* (Needs more investigation).
|
||||
*/
|
||||
|
||||
up_mdelay(50); /* Wait a bit */
|
||||
#if 0
|
||||
putreg32(0, STR71X_EIC_IER); /* Make sure that all interrupts are disabled */
|
||||
putreg32(0xffffffff, STR71X_EIC_IPR); /* And that no interrupts are pending */
|
||||
#endif
|
||||
|
||||
/* Enable global ARM interrupts */
|
||||
|
||||
|
@ -300,17 +300,17 @@ void up_lowsetup(void)
|
||||
|
||||
#if HAVE_UART
|
||||
reg16 = getreg16(STR71X_GPIO0_PC0);
|
||||
reg16 &= STR71X_UART_GPIO0_MASK;
|
||||
reg16 &= ~STR71X_UART_GPIO0_MASK;
|
||||
reg16 |= STR71X_UART_GPIO0_PC0BITS;
|
||||
putreg16(reg16, STR71X_GPIO0_PC0);
|
||||
|
||||
reg16 = getreg16(STR71X_GPIO0_PC1);
|
||||
reg16 &= STR71X_UART_GPIO0_MASK;
|
||||
reg16 &= ~STR71X_UART_GPIO0_MASK;
|
||||
reg16 |= STR71X_UART_GPIO0_PC1BITS;
|
||||
putreg16(reg16, STR71X_GPIO0_PC1);
|
||||
|
||||
reg16 = getreg16(STR71X_GPIO0_PC2);
|
||||
reg16 &= STR71X_UART_GPIO0_MASK;
|
||||
reg16 &= ~STR71X_UART_GPIO0_MASK;
|
||||
reg16 |= STR71X_UART_GPIO0_PC2BITS;
|
||||
putreg16(reg16, STR71X_GPIO0_PC2);
|
||||
#endif
|
||||
|
@ -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;
|
||||
if (enable)
|
||||
{
|
||||
/* Receive an interrupt when the Rx FIFO is half full (or an IDLE
|
||||
* timeout occurs.
|
||||
/* Receive an interrupt when the Rx FIFO is half full (or if a timeout
|
||||
* occurs while the Rx FIFO is not empty).
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_SUPPRESS_SERIAL_INTS
|
||||
priv->ier |= (STR71X_UARTIER_RHF|STR71X_UARTIER_TIMEOUTIDLE);
|
||||
priv->ier |= (STR71X_UARTIER_RHF|STR71X_UARTIER_TIMEOUTNE);
|
||||
#endif
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user