summaryrefslogtreecommitdiff
path: root/nuttx/drivers/serial
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-12-15 14:25:14 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-12-15 14:25:14 +0000
commit329bf67f0c4b6beb77e5856c8038a3202909be58 (patch)
treed607f3c7db4e8415665c0ef9c35bc5cbc287b971 /nuttx/drivers/serial
parent2b8c1142b851c7a81eafe69ed35c490f3d9c6735 (diff)
downloadpx4-nuttx-329bf67f0c4b6beb77e5856c8038a3202909be58.tar.gz
px4-nuttx-329bf67f0c4b6beb77e5856c8038a3202909be58.tar.bz2
px4-nuttx-329bf67f0c4b6beb77e5856c8038a3202909be58.zip
Changing NuttX fixed size type names to C99 standard names -- things will be broken for awhile
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2343 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/serial')
-rw-r--r--nuttx/drivers/serial/serial.c18
-rw-r--r--nuttx/drivers/serial/serialirq.c10
2 files changed, 16 insertions, 12 deletions
diff --git a/nuttx/drivers/serial/serial.c b/nuttx/drivers/serial/serial.c
index 5675f1791..3fa3b43d3 100644
--- a/nuttx/drivers/serial/serial.c
+++ b/nuttx/drivers/serial/serial.c
@@ -40,6 +40,8 @@
#include <nuttx/config.h>
#include <sys/types.h>
+#include <stdint.h>
+#include <stdbool.h>
#include <unistd.h>
#include <semaphore.h>
#include <string.h>
@@ -82,7 +84,7 @@ static ssize_t uart_read(FAR struct file *filep, FAR char *buffer, size_t buflen
static ssize_t uart_write(FAR struct file *filep, FAR const char *buffer, size_t buflen);
static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
#ifndef CONFIG_DISABLE_POLL
-static int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setup);
+static int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup);
#endif
/************************************************************************************
@@ -179,7 +181,7 @@ static void uart_putxmitchar(FAR uart_dev_t *dev, int ch)
{
/* Inform the interrupt level logic that we are waiting */
- dev->xmitwaiting = TRUE;
+ dev->xmitwaiting = true;
/* Wait for some characters to be sent from the buffer
* with the TX interrupt enabled. When the TX interrupt
@@ -374,7 +376,7 @@ static ssize_t uart_read(FAR struct file *filep, FAR char *buffer, size_t buflen
* with the TX interrupt re-enabled.
*/
- dev->recvwaiting = TRUE;
+ dev->recvwaiting = true;
uart_enablerxint(dev);
uart_takesem(&dev->recvsem);
uart_disablerxint(dev);
@@ -403,7 +405,7 @@ static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
****************************************************************************/
#ifndef CONFIG_DISABLE_POLL
-int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, boolean setup)
+int uart_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
{
FAR struct inode *inode = filep->f_inode;
FAR uart_dev_t *dev = inode->i_private;
@@ -589,7 +591,7 @@ static int uart_open(FAR struct file *filep)
{
struct inode *inode = filep->f_inode;
uart_dev_t *dev = inode->i_private;
- ubyte tmp;
+ uint8_t tmp;
int ret = OK;
/* If the port is the middle of closing, wait until the close is finished */
@@ -602,7 +604,7 @@ static int uart_open(FAR struct file *filep)
tmp = dev->open_count + 1;
if (tmp == 0)
{
- /* More than 255 opens; ubyte overflows to zero */
+ /* More than 255 opens; uint8_t overflows to zero */
ret = -EMFILE;
goto errout_with_sem;
@@ -707,7 +709,7 @@ void uart_datareceived(FAR uart_dev_t *dev)
if (dev->recvwaiting)
{
- dev->recvwaiting = FALSE;
+ dev->recvwaiting = false;
(void)sem_post(&dev->recvsem);
}
@@ -732,7 +734,7 @@ void uart_datasent(FAR uart_dev_t *dev)
{
if (dev->xmitwaiting)
{
- dev->xmitwaiting = FALSE;
+ dev->xmitwaiting = false;
(void)sem_post(&dev->xmitsem);
}
diff --git a/nuttx/drivers/serial/serialirq.c b/nuttx/drivers/serial/serialirq.c
index a4ce80944..bc79adc47 100644
--- a/nuttx/drivers/serial/serialirq.c
+++ b/nuttx/drivers/serial/serialirq.c
@@ -1,7 +1,7 @@
/************************************************************************************
* drivers/serial/serialirq.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,13 +38,15 @@
************************************************************************************/
#include <nuttx/config.h>
+
#include <sys/types.h>
+#include <stdint.h>
#include <semaphore.h>
#include <debug.h>
#include <nuttx/serial.h>
/************************************************************************************
- * Definitions
+ * Pre-processor Definitions
************************************************************************************/
/************************************************************************************
@@ -80,7 +82,7 @@
void uart_xmitchars(FAR uart_dev_t *dev)
{
- uint16 nbytes = 0;
+ uint16_t nbytes = 0;
/* Send while we still have data & room in the fifo */
@@ -133,7 +135,7 @@ void uart_recvchars(FAR uart_dev_t *dev)
{
unsigned int status;
int nexthead = dev->recv.head + 1;
- uint16 nbytes = 0;
+ uint16_t nbytes = 0;
if (nexthead >= dev->recv.size)
{