From: arighi Date: Wed, 29 Sep 2010 16:48:00 +0000 (+0000) Subject: STM32: USB: compact code and silent a buggy doxygen warning X-Git-Tag: 2.6.0~38 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=0e8d3b095f4b5ba3ac5c080c0e9edb5226c38bad;p=bertos.git STM32: USB: compact code and silent a buggy doxygen warning git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4363 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/cpu/cortex-m3/drv/usb_stm32.c b/bertos/cpu/cortex-m3/drv/usb_stm32.c index 6e975749..ad91a9b8 100644 --- a/bertos/cpu/cortex-m3/drv/usb_stm32.c +++ b/bertos/cpu/cortex-m3/drv/usb_stm32.c @@ -58,6 +58,7 @@ #include "usb_stm32.h" +#define ALIGNED(x) __attribute__ ((__aligned__(x))) #define ALIGN_UP(value, align) (((value) & ((align) - 1)) ? \ (((value) + ((align) - 1)) & ~((align) - 1)) : \ (value)) @@ -147,6 +148,15 @@ static stm32_UsbMemSlot *mem_use; #define EP_MAX_SLOTS 16 static stm32_UsbMemSlot memory_buffer[EP_MAX_SLOTS]; +/* Endpoint TX and RX buffers */ +/// \cond +/* XXX: use the empty cond section to silent a buggy doxygen warning */ +static bool rx_done, tx_done; +static size_t rx_size, tx_size; +static uint8_t rx_buffer[_MIN(CONFIG_USB_RXBUFSIZE, USB_RX_MAX_SIZE)] ALIGNED(4); +static uint8_t tx_buffer[_MIN(CONFIG_USB_TXBUFSIZE, USB_TX_MAX_SIZE)] ALIGNED(4); +/// \endcond + /* Allocate a free block of the packet memory */ static stm32_UsbMemSlot *usb_malloc(void) { @@ -1092,11 +1102,6 @@ static void usb_status_handler(UNUSED_ARG(int, EP)) } } -static bool rx_done; -static size_t rx_size; -static uint8_t rx_buffer[_MIN(CONFIG_USB_RXBUFSIZE, USB_RX_MAX_SIZE)] - __attribute__ ((__aligned__(4))); - static void usb_endpointRead_complete(int ep) { if (UNLIKELY(ep >= ENP_MAX_NUMB)) @@ -1151,11 +1156,6 @@ ssize_t usb_endpointRead(int ep, void *buffer, ssize_t size) return rx_size; } -static bool tx_done; -static size_t tx_size; -static uint8_t tx_buffer[_MIN(CONFIG_USB_TXBUFSIZE, USB_TX_MAX_SIZE)] - __attribute__ ((__aligned__(4))); - static void usb_endpointWrite_complete(int ep) { if (UNLIKELY(ep >= ENP_MAX_NUMB))