diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-04 20:49:47 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-04 20:49:47 +0000 |
commit | 99a753f17a5f82ae34fbbbc564757bb99666afbd (patch) | |
tree | e5ab1ef913b7324c1e05d2a6a7a37171f24e2af5 | |
parent | 10b9a1fa0c8d68bb7f2c6fac7176669052831401 (diff) | |
download | px4-nuttx-99a753f17a5f82ae34fbbbc564757bb99666afbd.tar.gz px4-nuttx-99a753f17a5f82ae34fbbbc564757bb99666afbd.tar.bz2 px4-nuttx-99a753f17a5f82ae34fbbbc564757bb99666afbd.zip |
Fix buffer full test in generic CAN driver (plus fixes to comments)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4259 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/ChangeLog | 8 | ||||
-rw-r--r-- | nuttx/TODO | 9 | ||||
-rw-r--r-- | nuttx/drivers/can.c | 2 | ||||
-rw-r--r-- | nuttx/fs/fs_stat.c | 12 | ||||
-rw-r--r-- | nuttx/fs/fs_statfs.c | 28 | ||||
-rw-r--r-- | nuttx/sched/irq_attach.c | 4 |
6 files changed, 36 insertions, 27 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 318adf258..a76c800b5 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -2333,4 +2333,12 @@ performance. * confgs/olimex-lpc1766stk/nsh: Now supports the CAN loopback test as an optional "built-in" application. + * sched/irq_attach.c: Fix an issue with disabling interrupts when they are + detached. For the PIC32, this can't be done because there is a 1-to-many + relationship between vector numbers and interrupt numbers or different. + Added a new configuration option CONFIG_ARCH_VECNOTIRQ to at least flag + the architectures that have this issue and to (at least) avoid doing + something too wrong. + * drivers/can.c: Fix a test for buffer full in the generic, "upper half", + can driver. diff --git a/nuttx/TODO b/nuttx/TODO index a4e9f1174..77daa2d12 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -1,4 +1,4 @@ -NuttX TODO List (Last updated December 27, 2011) +NuttX TODO List (Last updated January 3, 2012) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This file summarizes known NuttX bugs, limitations, inconsistencies with @@ -1185,10 +1185,11 @@ o 8051 / MCS51 (arch/8051/) o MIPS (arch/mips) ^^^^^^^^^^^^^^^^ - Title: PIC32MX PORT UNVERIFIED - Description: A port to the PIC32MX has been completed, but is pending verification. + Title: PIC32MX USB DRIVER UNTESTED + Description: A USB device-side driver has been written for the PIC3MX, + is completely untested as of this writing. Status: Open - Priority: High + Priority: Low -- unless you need a USB device-side driver. o Hitachi/Renesas SH-1 (arch/sh/src/sh1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/drivers/can.c b/nuttx/drivers/can.c index 41c3548ea..40c179e1c 100644 --- a/nuttx/drivers/can.c +++ b/nuttx/drivers/can.c @@ -326,7 +326,7 @@ static ssize_t can_read(FAR struct file *filep, FAR char *buffer, size_t buflen) FAR struct can_msg_s *msg = &dev->cd_recv.cf_buffer[dev->cd_recv.cf_head]; int msglen = CAN_MSGLEN(msg->cm_hdr); - if (ret + msglen > buflen) + if (nread + msglen > buflen) { break; } diff --git a/nuttx/fs/fs_stat.c b/nuttx/fs/fs_stat.c index 85c91bd4e..138d6a2c1 100644 --- a/nuttx/fs/fs_stat.c +++ b/nuttx/fs/fs_stat.c @@ -1,8 +1,8 @@ /**************************************************************************** * fs/fs_stat.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 2007-2009 , 2012Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -187,7 +187,7 @@ int stat(const char *path, FAR struct stat *buf) if (inode->u.i_mops && inode->u.i_mops->stat) { - /* Perform the rewinddir() operation */ + /* Perform the stat() operation */ ret = inode->u.i_mops->stat(inode, relpath, buf); } @@ -215,10 +215,10 @@ int stat(const char *path, FAR struct stat *buf) /* Failure conditions always set the errno appropriately */ - errout_with_inode: +errout_with_inode: inode_release(inode); - errout: - *get_errno_ptr() = ret; +errout: + set_errno(ret); return ERROR; } diff --git a/nuttx/fs/fs_statfs.c b/nuttx/fs/fs_statfs.c index 9ce15efbf..540eb86bb 100644 --- a/nuttx/fs/fs_statfs.c +++ b/nuttx/fs/fs_statfs.c @@ -1,8 +1,8 @@ /**************************************************************************** * fs/fs_statfs.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,10 +57,10 @@ static inline int statpsuedofs(FAR struct inode *inode, FAR struct statfs *buf) { - memset(buf, 0, sizeof(struct statfs)); - buf->f_type = PROC_SUPER_MAGIC; - buf->f_namelen = NAME_MAX; - return OK; + memset(buf, 0, sizeof(struct statfs)); + buf->f_type = PROC_SUPER_MAGIC; + buf->f_namelen = NAME_MAX; + return OK; } /**************************************************************************** @@ -116,7 +116,7 @@ int statfs(FAR const char *path, FAR struct statfs *buf) goto errout; } - /* The way we handle the stat depends on the type of inode that we + /* The way we handle the statfs depends on the type of inode that we * are dealing with. */ @@ -124,12 +124,12 @@ int statfs(FAR const char *path, FAR struct statfs *buf) if (INODE_IS_MOUNTPT(inode)) { /* The node is a file system mointpoint. Verify that the mountpoint - * supports the stat() method + * supports the statfs() method */ if (inode->u.i_mops && inode->u.i_mops->statfs) { - /* Perform the rewinddir() operation */ + /* Perform the statfs() operation */ ret = inode->u.i_mops->statfs(inode, buf); } @@ -142,7 +142,7 @@ int statfs(FAR const char *path, FAR struct statfs *buf) ret = statpsuedofs(inode, buf); } - /* Check if the stat operation was successful */ + /* Check if the statfs operation was successful */ if (ret < 0) { @@ -150,16 +150,16 @@ int statfs(FAR const char *path, FAR struct statfs *buf) goto errout_with_inode; } - /* Successfully stat'ed the file */ + /* Successfully statfs'ed the file */ inode_release(inode); return OK; /* Failure conditions always set the errno appropriately */ - errout_with_inode: +errout_with_inode: inode_release(inode); - errout: - *get_errno_ptr() = ret; +errout: + set_errno(ret); return ERROR; } diff --git a/nuttx/sched/irq_attach.c b/nuttx/sched/irq_attach.c index 99fb62078..07ded0629 100644 --- a/nuttx/sched/irq_attach.c +++ b/nuttx/sched/irq_attach.c @@ -94,9 +94,9 @@ int irq_attach(int irq, xcpt_t isr) /* Disable the interrupt if we can before detaching it. We might * not be able to do this if: (1) the device does not have a * centralized interrupt controller (so up_disable_irq() is not - * supported. Or (2) if the device has different number for vector + * supported). Or (2) if the device has different number for vector * numbers and IRQ numbers (in that case, we don't know the correct - * IRQ number to use to disable the interrupt. In those cases, the + * IRQ number to use to disable the interrupt). In those cases, the * code will just need to be careful that it disables all interrupt * sources before detaching from the interrupt vector. */ |