Fix typo/compilation error with USB device DMA memory allocation is enabled

This commit is contained in:
Gregory Nutt 2013-07-12 07:09:24 -06:00
parent c6b141d190
commit 352c313fa7
4 changed files with 26 additions and 24 deletions

View File

@ -5126,3 +5126,6 @@
transfers (From Chia Cheng Tsao, 2013-7-8) transfers (From Chia Cheng Tsao, 2013-7-8)
* drivers/rwbuffer.c: SourceForge bug #17: Correct typos that can cause * drivers/rwbuffer.c: SourceForge bug #17: Correct typos that can cause
failures in some configurations (From Chia Cheng Tsao, 2013-7-8). failures in some configurations (From Chia Cheng Tsao, 2013-7-8).
* include/nuttx/usb/usbdev.h: Fix some typos that cause compiler errors
when CONFIG_USBDEV_DMA and CONFIG_USBDEV_DMAMEMORY are selected (From
Chia Cheng Tsao, 2013-7-12).

View File

@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* include/nuttx/usb/usbdev.h * include/nuttx/usb/usbdev.h
* *
* Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2008-2010, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* NOTE: This interface was inspired by the Linux gadget interface by * NOTE: This interface was inspired by the Linux gadget interface by
@ -86,8 +86,8 @@
/* Allocate/free an I/O buffer. Should not be called from interrupt processing! */ /* Allocate/free an I/O buffer. Should not be called from interrupt processing! */
#ifdef CONFIG_USBDEV_DMA #ifdef CONFIG_USBDEV_DMA
# define EP_ALLOCBUFFER(ep,nb) (ep)->ops->alloc(ep,nb) # define EP_ALLOCBUFFER(ep,nb) (ep)->ops->allocbuffer(ep,nb)
# define EP_FREEBUFFER(ep,buff) (ep)->ops->free(ep,buf) # define EP_FREEBUFFER(ep,buf) (ep)->ops->freebuffer(ep,buf)
#else #else
# define EP_ALLOCBUFFER(ep,nb) malloc(nb) # define EP_ALLOCBUFFER(ep,nb) malloc(nb)
# define EP_FREEBUFFER(ep,buf) free(buf) # define EP_FREEBUFFER(ep,buf) free(buf)
@ -340,7 +340,7 @@ extern "C"
* *
************************************************************************************/ ************************************************************************************/
EXTERN int usbdev_register(FAR struct usbdevclass_driver_s *driver); int usbdev_register(FAR struct usbdevclass_driver_s *driver);
/************************************************************************************ /************************************************************************************
* Name: usbdev_unregister * Name: usbdev_unregister
@ -352,7 +352,7 @@ EXTERN int usbdev_register(FAR struct usbdevclass_driver_s *driver);
* *
************************************************************************************/ ************************************************************************************/
EXTERN int usbdev_unregister(FAR struct usbdevclass_driver_s *driver); int usbdev_unregister(FAR struct usbdevclass_driver_s *driver);
/**************************************************************************** /****************************************************************************
* Name: usbdev_dma_alloc and usbdev_dma_free * Name: usbdev_dma_alloc and usbdev_dma_free
@ -381,8 +381,8 @@ EXTERN int usbdev_unregister(FAR struct usbdevclass_driver_s *driver);
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_USBDEV_DMA) && defined(CONFIG_USBDEV_DMAMEMORY) #if defined(CONFIG_USBDEV_DMA) && defined(CONFIG_USBDEV_DMAMEMORY)
EXTERN FAR void *usbdev_dma_alloc(size_t size); FAR void *usbdev_dma_alloc(size_t size);
EXTERN void usbdev_dma_free(FAR void *memory); void usbdev_dma_free(FAR void *memory);
#endif #endif
#undef EXTERN #undef EXTERN

View File

@ -246,23 +246,24 @@ extern "C" {
#define EXTERN extern #define EXTERN extern
#endif #endif
EXTERN int kill(pid_t, int); int kill(pid_t, int);
EXTERN int sigemptyset(FAR sigset_t *set); int sigemptyset(FAR sigset_t *set);
EXTERN int sigfillset(FAR sigset_t *set); int sigfillset(FAR sigset_t *set);
EXTERN int sigaddset(FAR sigset_t *set, int signo); int sigaddset(FAR sigset_t *set, int signo);
EXTERN int sigdelset(FAR sigset_t *set, int signo); int sigdelset(FAR sigset_t *set, int signo);
EXTERN int sigismember(FAR const sigset_t *set, int signo); int sigismember(FAR const sigset_t *set, int signo);
EXTERN int sigaction(int sig, FAR const struct sigaction *act, FAR struct sigaction *oact); int sigaction(int sig, FAR const struct sigaction *act,
EXTERN int sigprocmask(int how, FAR const sigset_t *set, FAR sigset_t *oset); FAR struct sigaction *oact);
EXTERN int sigpending(FAR sigset_t *set); int sigprocmask(int how, FAR const sigset_t *set, FAR sigset_t *oset);
EXTERN int sigsuspend(FAR const sigset_t *sigmask); int sigpending(FAR sigset_t *set);
EXTERN int sigwaitinfo(FAR const sigset_t *set, FAR struct siginfo *value); int sigsuspend(FAR const sigset_t *sigmask);
EXTERN int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *value, int sigwaitinfo(FAR const sigset_t *set, FAR struct siginfo *value);
FAR const struct timespec *timeout); int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *value,
FAR const struct timespec *timeout);
#ifdef CONFIG_CAN_PASS_STRUCTS #ifdef CONFIG_CAN_PASS_STRUCTS
EXTERN int sigqueue(int pid, int signo, union sigval value); int sigqueue(int pid, int signo, union sigval value);
#else #else
EXTERN int sigqueue(int pid, int signo, FAR void *sival_ptr); int sigqueue(int pid, int signo, FAR void *sival_ptr);
#endif #endif
#undef EXTERN #undef EXTERN

View File

@ -99,8 +99,6 @@ static uint16_t crc16_tab[256] =
0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0
}; };
#define updcrc(cp, crc) ( crc16_tab[((crc >> 8) & 255)] ^ (crc << 8) ^ cp)
/************************************************************************************************ /************************************************************************************************
* Public Functions * Public Functions
************************************************************************************************/ ************************************************************************************************/