usbuart: Moved all the STM32 buffer sizing logic into one header and one location
This commit is contained in:
parent
5108ecf759
commit
39df8fa6a6
|
@ -28,11 +28,14 @@ void debug_uart_run(void);
|
||||||
#define TX_LED_ACT (1 << 0)
|
#define TX_LED_ACT (1 << 0)
|
||||||
#define RX_LED_ACT (1 << 1)
|
#define RX_LED_ACT (1 << 1)
|
||||||
|
|
||||||
#if defined(STM32F0) || defined(STM32F1) || defined(STM32F3) || defined(STM32F4)
|
/* XXX: Does the st_usbfs_v2_usb_driver work on F3 with 128 byte buffers? */
|
||||||
/* F072 with st_usbfs_v2_usb_drive drops characters at the 64 byte boundary!*/
|
#if defined(STM32F1) || defined(STM32F3) || defined(STM32F4)
|
||||||
#if !defined(USART_DMA_BUF_SIZE)
|
#define USART_DMA_BUF_SIZE 128
|
||||||
# define USART_DMA_BUF_SIZE 128
|
#elif defined(STM32F0)
|
||||||
|
/* The st_usbfs_v2_usb_driver only works with up to 64-byte buffers on the F0 parts */
|
||||||
|
#define USART_DMA_BUF_SIZE 64
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define RX_FIFO_SIZE (USART_DMA_BUF_SIZE)
|
#define RX_FIFO_SIZE (USART_DMA_BUF_SIZE)
|
||||||
#define TX_BUF_SIZE (USART_DMA_BUF_SIZE)
|
#define TX_BUF_SIZE (USART_DMA_BUF_SIZE)
|
||||||
|
|
||||||
|
|
|
@ -90,8 +90,6 @@
|
||||||
#define SWDIO_MODE_DRIVE() \
|
#define SWDIO_MODE_DRIVE() \
|
||||||
gpio_mode_setup(SWDIO_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, SWDIO_PIN);
|
gpio_mode_setup(SWDIO_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, SWDIO_PIN);
|
||||||
|
|
||||||
/* FIXME: Does st_usbfs_v2_usb_driver work on F3 with 128 Bytes buffer*/
|
|
||||||
#define USART_DMA_BUF_SIZE 64
|
|
||||||
#define USB_DRIVER st_usbfs_v2_usb_driver
|
#define USB_DRIVER st_usbfs_v2_usb_driver
|
||||||
#define USB_IRQ NVIC_USB_IRQ
|
#define USB_IRQ NVIC_USB_IRQ
|
||||||
#define USB_ISR(x) usb_isr(x)
|
#define USB_ISR(x) usb_isr(x)
|
||||||
|
|
Loading…
Reference in New Issue