From 329bf67f0c4b6beb77e5856c8038a3202909be58 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 15 Dec 2009 14:25:14 +0000 Subject: 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 --- nuttx/drivers/can.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'nuttx/drivers/can.c') diff --git a/nuttx/drivers/can.c b/nuttx/drivers/can.c index 834765183..47525257d 100644 --- a/nuttx/drivers/can.c +++ b/nuttx/drivers/can.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/can.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -44,6 +44,8 @@ #include #include +#include +#include #include #include #include @@ -58,7 +60,7 @@ #include /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ #define HALF_SECOND_MSEC 500 @@ -113,7 +115,7 @@ static int can_open(FAR struct file *filep) { FAR struct inode *inode = filep->f_inode; FAR struct can_dev_s *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 */ @@ -132,7 +134,7 @@ static int can_open(FAR struct file *filep) tmp = dev->cd_ocount + 1; if (tmp == 0) { - /* More than 255 opens; ubyte overflows to zero */ + /* More than 255 opens; uint8_t overflows to zero */ ret = -EMFILE; } @@ -157,7 +159,7 @@ static int can_open(FAR struct file *filep) /* Finally, Enable the CAN RX interrupt */ - dev_rxint(dev, TRUE); + dev_rxint(dev, true); /* Save the new open count on success */ @@ -210,7 +212,7 @@ static int can_close(FAR struct file *filep) /* Stop accepting input */ - dev_rxint(dev, FALSE); + dev_rxint(dev, false); /* Now we wait for the transmit FIFO to clear */ @@ -347,7 +349,7 @@ return_with_irqdisabled: static int can_xmit(FAR struct can_dev_s *dev) { - boolean enable = FALSE; + bool enable = false; int ret = OK; /* Check if the xmit FIFO is empty */ @@ -360,7 +362,7 @@ static int can_xmit(FAR struct can_dev_s *dev) /* Make sure the TX done interrupts are enabled */ - enable = (ret == OK ? TRUE : FALSE); + enable = (ret == OK ? true : false); } dev_txint(dev, enable); return ret; @@ -376,7 +378,7 @@ static ssize_t can_write(FAR struct file *filep, FAR const char *buffer, size_t FAR struct can_dev_s *dev = inode->i_private; FAR struct can_fifo_s *fifo = &dev->cd_xmit; FAR struct can_msg_s *msg; - boolean empty = FALSE; + bool empty = false; ssize_t nsent = 0; irqstate_t flags; int nexttail; @@ -632,10 +634,10 @@ int can_register(FAR const char *path, FAR struct can_dev_s *dev) * ************************************************************************************/ -int can_receive(FAR struct can_dev_s *dev, uint16 hdr, FAR ubyte *data) +int can_receive(FAR struct can_dev_s *dev, uint16_t hdr, FAR uint8_t *data) { FAR struct can_fifo_s *fifo = &dev->cd_recv; - FAR ubyte *dest; + FAR uint8_t *dest; int nexttail; int err = -ENOMEM; int i; -- cgit v1.2.3