Browse Source
usbuart: Moved all the STM32 buffer sizing logic into one header and one location
fix/newlib-file-io-hooks
dragonmux
2 years ago
No known key found for this signature in database
GPG Key ID: 64861EA89B35507A
2 changed files with
7 additions and
6 deletions
-
src/platforms/common/usbuart.h
-
src/platforms/f072/platform.h
|
@ -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) |
|
|