mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
Fix compile errors
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1851 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* arch/arm/src/str71x/chip.h
|
* arch/arm/src/str71x/chip.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
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
#include "up_arch.h"
|
#include "up_arch.h"
|
||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
#include "os_internal.h"
|
||||||
#include "str71x_internal.h"
|
#include "str71x_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -500,7 +501,7 @@ static int up_setup(struct uart_dev_s *dev)
|
|||||||
cr |= STR71X_UARTCR_MODE9BIT;
|
cr |= STR71X_UARTCR_MODE9BIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parity == 1)
|
if (priv->parity == 1)
|
||||||
{
|
{
|
||||||
cr |= STR71X_UARTCR_PARITYODD;
|
cr |= STR71X_UARTCR_PARITYODD;
|
||||||
}
|
}
|
||||||
@@ -518,8 +519,8 @@ static int up_setup(struct uart_dev_s *dev)
|
|||||||
|
|
||||||
/* Clear FIFOs */
|
/* Clear FIFOs */
|
||||||
|
|
||||||
up_serialout(priv, STR71X_UART2_TXRSTR_OFFSET, 0);
|
up_serialout(priv, STR71X_UART_TXRSTR_OFFSET, 0);
|
||||||
up_serialout(priv, SSTR71X_UART2_RXRSTR_OFFSET, 0);
|
up_serialout(priv, STR71X_UART_RXRSTR_OFFSET, 0);
|
||||||
|
|
||||||
/* We will take RX interrupts on either the FIFO half full or upon
|
/* We will take RX interrupts on either the FIFO half full or upon
|
||||||
* a timeout. The timeout is based upon BAUD rate ticks
|
* a timeout. The timeout is based upon BAUD rate ticks
|
||||||
@@ -700,7 +701,6 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||||||
{
|
{
|
||||||
struct inode *inode = filep->f_inode;
|
struct inode *inode = filep->f_inode;
|
||||||
struct uart_dev_s *dev = inode->i_private;
|
struct uart_dev_s *dev = inode->i_private;
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
|
||||||
int ret = OK;
|
int ret = OK;
|
||||||
|
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
@@ -710,8 +710,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||||||
struct up_dev_s *user = (struct up_dev_s*)arg;
|
struct up_dev_s *user = (struct up_dev_s*)arg;
|
||||||
if (!user)
|
if (!user)
|
||||||
{
|
{
|
||||||
*get_errno_ptr() = EINVAL;
|
ret = -EINVAL;
|
||||||
ret = ERROR;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -721,8 +720,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
*get_errno_ptr() = ENOTTY;
|
ret = -ENOTTY;
|
||||||
ret = ERROR;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -942,11 +940,11 @@ int up_putc(int ch)
|
|||||||
{
|
{
|
||||||
#ifdef HAVE_CONSOLE
|
#ifdef HAVE_CONSOLE
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv;
|
struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv;
|
||||||
ubyte ier;
|
uint16 ier;
|
||||||
|
|
||||||
up_disableuartint(priv, &ier);
|
up_disableuartint(priv, &ier);
|
||||||
up_waittxnotfull(priv);
|
up_waittxnotfull(priv);
|
||||||
up_serialout(priv, STR71X_UART_THR_OFFSET, (ubyte)ch);
|
up_serialout(priv, STR71X_UART_TXBUFR_OFFSET, (uint16)ch);
|
||||||
|
|
||||||
/* Check for LF */
|
/* Check for LF */
|
||||||
|
|
||||||
@@ -955,7 +953,7 @@ int up_putc(int ch)
|
|||||||
/* Add CR */
|
/* Add CR */
|
||||||
|
|
||||||
up_waittxnotfull(priv);
|
up_waittxnotfull(priv);
|
||||||
up_serialout(priv, STR71X_UART_THR_OFFSET, '\r');
|
up_serialout(priv, STR71X_UART_TXBUFR_OFFSET, (uint16)'\r');
|
||||||
}
|
}
|
||||||
|
|
||||||
up_waittxnotfull(priv);
|
up_waittxnotfull(priv);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* arch/arm/src/str71x/str71x_uart.h
|
* arch/arm/src/str71x/str71x_uart.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
|
||||||
|
|||||||
Reference in New Issue
Block a user