summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-02-08 17:25:29 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-02-08 17:25:29 +0000
commit4d38c9e58c3e7ffc7647b5729d77c91053bc49f7 (patch)
tree576daf7298d9450ab824fdb9a7626de65cd50d63 /nuttx/include
parentebff820250129b6361ff9de635578e07d11fe16c (diff)
downloadpx4-nuttx-4d38c9e58c3e7ffc7647b5729d77c91053bc49f7.tar.gz
px4-nuttx-4d38c9e58c3e7ffc7647b5729d77c91053bc49f7.tar.bz2
px4-nuttx-4d38c9e58c3e7ffc7647b5729d77c91053bc49f7.zip
Fix DM320 serial configuration problem
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@661 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/can.h20
-rw-r--r--nuttx/include/nuttx/serial.h32
2 files changed, 30 insertions, 22 deletions
diff --git a/nuttx/include/nuttx/can.h b/nuttx/include/nuttx/can.h
index 14e36318e..23d251435 100644
--- a/nuttx/include/nuttx/can.h
+++ b/nuttx/include/nuttx/can.h
@@ -49,14 +49,22 @@
* Definitions
************************************************************************************/
-/* Default configuration settings that may be overridden in the board configuration file */
+/* Default configuration settings that may be overridden in the board configuration.
+ * file. The configured size is limited to 255 to fit into a ubyte.
+ */
-#ifndef CONFIG_CAN_FIFOSIZE
+#if !defined(CONFIG_CAN_FIFOSIZE)
# define CONFIG_CAN_FIFOSIZE 8
+#elif CONFIG_CAN_FIFOSIZE > 255
+# undef CONFIG_CAN_FIFOSIZE
+# define CONFIG_CAN_FIFOSIZE 255
#endif
-#ifndef CONFIG_CAN_NPENDINGRTR
+#if !defined(CONFIG_CAN_NPENDINGRTR)
# define CONFIG_CAN_NPENDINGRTR 4
+#elif CONFIG_CAN_NPENDINGRTR > 255
+# undef CONFIG_CAN_NPENDINGRTR
+# define CONFIG_CAN_NPENDINGRTR 255
#endif
/* Convenience macros */
@@ -206,8 +214,8 @@ struct can_ops_s
struct can_dev_s
{
- int cd_ocount; /* The number of times the device has been opened */
- int cd_npendrtr; /* Number of pending RTR messages */
+ ubyte cd_ocount; /* The number of times the device has been opened */
+ ubyte cd_npendrtr; /* Number of pending RTR messages */
sem_t cd_closesem; /* Locks out new opens while close is in progress */
sem_t cd_recvsem; /* Used to wakeup user waiting for space in cd_recv.buffer */
struct can_fifo_s cd_xmit; /* Describes transmit FIFO */
@@ -222,7 +230,7 @@ struct can_dev_s
struct canioctl_rtr_s
{
- uint16 ci_id; /* The ID to use in the RTR message */
+ uint16 ci_id; /* The 11-bit ID to use in the RTR message */
FAR struct can_msg_s *ci_msg; /* The location to return the RTR response */
};
diff --git a/nuttx/include/nuttx/serial.h b/nuttx/include/nuttx/serial.h
index a17713616..3d2bfb34d 100644
--- a/nuttx/include/nuttx/serial.h
+++ b/nuttx/include/nuttx/serial.h
@@ -97,14 +97,14 @@ struct uart_ops_s
* performed when the attach() method is called.
*/
- int (*setup)(struct uart_dev_s *dev);
+ CODE int (*setup)(FAR struct uart_dev_s *dev);
/* Disable the UART. This method is called when the serial port is closed.
* This method reverses the operation the setup method. NOTE that the serial
* console is never shutdown.
*/
- void (*shutdown)(struct uart_dev_s *dev);
+ CODE void (*shutdown)(FAR struct uart_dev_s *dev);
/* Configure the UART to operation in interrupt driven mode. This method is
* called when the serial port is opened. Normally, this is just after the
@@ -116,47 +116,47 @@ struct uart_ops_s
* interrupts are not enabled until the txint() and rxint() methods are called.
*/
- int (*attach)(struct uart_dev_s *dev);
+ CODE int (*attach)(FAR struct uart_dev_s *dev);
/* Detach UART interrupts. This method is called when the serial port is
* closed normally just before the shutdown method is called. The exception is
* the serial console which is never shutdown.
*/
- void (*detach)(struct uart_dev_s *dev);
+ CODE void (*detach)(FAR struct uart_dev_s *dev);
/* All ioctl calls will be routed through this method */
- int (*ioctl)(struct file *filep, int cmd, unsigned long arg);
+ CODE int (*ioctl)(FAR struct file *filep, int cmd, unsigned long arg);
/* Called (usually) from the interrupt level to receive one character from
* the UART. Error bits associated with the receipt are provided in the
* the return 'status'.
*/
- int (*receive)(struct uart_dev_s *dev, unsigned int *status);
+ CODE int (*receive)(FAR struct uart_dev_s *dev, unsigned int *status);
/* Call to enable or disable RX interrupts */
- void (*rxint)(struct uart_dev_s *dev, boolean enable);
+ CODE void (*rxint)(FAR struct uart_dev_s *dev, boolean enable);
/* Return TRUE if the receive data is available */
- boolean (*rxavailable)(struct uart_dev_s *dev);
+ CODE boolean (*rxavailable)(FAR struct uart_dev_s *dev);
/* This method will send one byte on the UART */
- void (*send)(struct uart_dev_s *dev, int ch);
+ CODE void (*send)(FAR struct uart_dev_s *dev, int ch);
/* Call to enable or disable TX interrupts */
- void (*txint)(struct uart_dev_s *dev, boolean enable);
+ CODE void (*txint)(FAR struct uart_dev_s *dev, boolean enable);
/* Return TRUE if the tranmsit hardware is ready to send another byte. This
* is used to determine if send() method can be called.
*/
- boolean (*txready)(struct uart_dev_s *dev);
+ CODE boolean (*txready)(FAR struct uart_dev_s *dev);
/* Return TRUE if all characters have been sent. If for example, the UART
* hardware implements FIFOs, then this would mean the the transmit FIFO is
@@ -164,7 +164,7 @@ struct uart_ops_s
* all characters are "drained" from the TX hardware.
*/
- boolean (*txempty)(struct uart_dev_s *dev);
+ CODE boolean (*txempty)(FAR struct uart_dev_s *dev);
};
/* This is the device structure used by the driver. The caller of
@@ -179,7 +179,7 @@ struct uart_ops_s
struct uart_dev_s
{
- int open_count; /* The number of times
+ ubyte open_count; /* The number of times
* the device has been opened */
boolean xmitwaiting; /* TRUE: User is waiting
* for space in xmit.buffer */
@@ -223,7 +223,7 @@ extern "C" {
*
************************************************************************************/
-EXTERN int uart_register(const char *path, uart_dev_t *dev);
+EXTERN int uart_register(FAR const char *path, FAR uart_dev_t *dev);
/************************************************************************************
* Name: uart_xmitchars
@@ -236,7 +236,7 @@ EXTERN int uart_register(const char *path, uart_dev_t *dev);
*
************************************************************************************/
-EXTERN void uart_xmitchars(uart_dev_t *dev);
+EXTERN void uart_xmitchars(FAR uart_dev_t *dev);
/************************************************************************************
* Name: uart_receivechars
@@ -249,7 +249,7 @@ EXTERN void uart_xmitchars(uart_dev_t *dev);
*
************************************************************************************/
-EXTERN void uart_recvchars(uart_dev_t *dev);
+EXTERN void uart_recvchars(FAR uart_dev_t *dev);
#undef EXTERN
#if defined(__cplusplus)