arch/arm/src/stm32f7/stm32_otgdev.c: Correct hardcoded FIFO size that is wrong for OTG FS.

This commit is contained in:
Ramtin Amin 2019-04-11 10:37:40 -06:00 committed by Gregory Nutt
parent fb04ad1e82
commit e74e46aa7f
2 changed files with 36 additions and 11 deletions

View file

@ -91,12 +91,15 @@
*/
# ifndef CONFIG_USBDEV_RXFIFO_SIZE
# define CONFIG_USBDEV_RXFIFO_SIZE 2048
# define CONFIG_USBDEV_RXFIFO_SIZE \
(STM32_OTG_FIFO_SIZE - \
STM32_OTG_FIFO_SIZE / 4/ 2 / STM32_NENDPOINTS * 4 * STM32_NENDPOINTS)
# endif
# if STM32_NENDPOINTS > 0
# ifndef CONFIG_USBDEV_EP0_TXFIFO_SIZE
# define CONFIG_USBDEV_EP0_TXFIFO_SIZE ((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE)/STM32_NENDPOINTS)
# define CONFIG_USBDEV_EP0_TXFIFO_SIZE \
((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE) / STM32_NENDPOINTS)
# endif
# else
# define CONFIG_USBDEV_EP0_TXFIFO_SIZE 0
@ -104,7 +107,8 @@
# if STM32_NENDPOINTS > 1
# ifndef CONFIG_USBDEV_EP1_TXFIFO_SIZE
# define CONFIG_USBDEV_EP1_TXFIFO_SIZE ((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE)/STM32_NENDPOINTS)
# define CONFIG_USBDEV_EP1_TXFIFO_SIZE \
((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE) / STM32_NENDPOINTS)
# endif
# else
# define CONFIG_USBDEV_EP1_TXFIFO_SIZE 0
@ -112,7 +116,8 @@
# if STM32_NENDPOINTS > 2
# ifndef CONFIG_USBDEV_EP2_TXFIFO_SIZE
# define CONFIG_USBDEV_EP2_TXFIFO_SIZE ((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE)/STM32_NENDPOINTS)
# define CONFIG_USBDEV_EP2_TXFIFO_SIZE \
((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE) / STM32_NENDPOINTS)
# endif
# else
# define CONFIG_USBDEV_EP2_TXFIFO_SIZE 0
@ -120,7 +125,8 @@
# if STM32_NENDPOINTS > 3
# ifndef CONFIG_USBDEV_EP3_TXFIFO_SIZE
# define CONFIG_USBDEV_EP3_TXFIFO_SIZE ((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE)/STM32_NENDPOINTS)
# define CONFIG_USBDEV_EP3_TXFIFO_SIZE \
((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE) / STM32_NENDPOINTS)
# endif
# else
# define CONFIG_USBDEV_EP3_TXFIFO_SIZE 0
@ -128,7 +134,8 @@
# if STM32_NENDPOINTS > 4
# ifndef CONFIG_USBDEV_EP4_TXFIFO_SIZE
# define CONFIG_USBDEV_EP4_TXFIFO_SIZE ((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE)/STM32_NENDPOINTS)
# define CONFIG_USBDEV_EP4_TXFIFO_SIZE \
((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE) / STM32_NENDPOINTS)
# endif
# else
# define CONFIG_USBDEV_EP4_TXFIFO_SIZE 0
@ -136,7 +143,8 @@
# if STM32_NENDPOINTS > 5
# ifndef CONFIG_USBDEV_EP5_TXFIFO_SIZE
# define CONFIG_USBDEV_EP5_TXFIFO_SIZE ((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE)/STM32_NENDPOINTS)
# define CONFIG_USBDEV_EP5_TXFIFO_SIZE \
((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE) / STM32_NENDPOINTS)
# endif
# else
# define CONFIG_USBDEV_EP5_TXFIFO_SIZE 0
@ -144,7 +152,8 @@
# if STM32_NENDPOINTS > 6
# ifndef CONFIG_USBDEV_EP6_TXFIFO_SIZE
# define CONFIG_USBDEV_EP6_TXFIFO_SIZE ((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE)/STM32_NENDPOINTS)
# define CONFIG_USBDEV_EP6_TXFIFO_SIZE (\
(STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE) / STM32_NENDPOINTS)
# endif
# else
# define CONFIG_USBDEV_EP6_TXFIFO_SIZE 0
@ -152,7 +161,8 @@
# if STM32_NENDPOINTS > 7
# ifndef CONFIG_USBDEV_EP7_TXFIFO_SIZE
# define CONFIG_USBDEV_EP7_TXFIFO_SIZE ((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE)/STM32_NENDPOINTS)
# define CONFIG_USBDEV_EP7_TXFIFO_SIZE \
((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE) / STM32_NENDPOINTS)
# endif
# else
# define CONFIG_USBDEV_EP7_TXFIFO_SIZE 0
@ -160,7 +170,8 @@
# if STM32_NENDPOINTS > 8
# ifndef CONFIG_USBDEV_EP8_TXFIFO_SIZE
# define CONFIG_USBDEV_EP8_TXFIFO_SIZE ((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE)/STM32_NENDPOINTS)
# define CONFIG_USBDEV_EP8_TXFIFO_SIZE \
((STM32_OTG_FIFO_SIZE - CONFIG_USBDEV_RXFIFO_SIZE) / STM32_NENDPOINTS)
# endif
# else
# define CONFIG_USBDEV_EP8_TXFIFO_SIZE 0

View file

@ -52,6 +52,13 @@
* Public Functions
****************************************************************************/
void mmcheck(FAR const char *msg, FAR void *raddr) // REMOVE ME
{ // REMOVE ME
struct mallinfo mmcurrent; // REMOVE ME
_err("%s: LR=%p\n", msg, raddr); // REMOVE ME
mmcurrent = mallinfo(); // REMOVE ME
} // REMOVE ME
/****************************************************************************
* Name: nxbe_cursor_enable
*
@ -70,7 +77,10 @@
void nxbe_cursor_enable(FAR struct nxbe_state_s *be, bool enable)
{
/* Are we enabling the cursor? Don't allow the cursor to be enabled if no
* image has been assigned to the cursor */
* image has been assigned to the cursor.
*/
ginfo("enable=%d visible=%u\n", enable, be->cursor.visible);
if (enable && !be->cursor.visible)
{
@ -162,6 +172,8 @@ void nxbe_cursor_setimage(FAR struct nxbe_state_s *be,
size_t allocsize;
unsigned int bpp;
ginfo("image=%p\n", image);
/* If the cursor is visible, then we need to erase the old cursor from the
* device graphics memory.
*/
@ -278,6 +290,8 @@ void nxbe_cursor_setposition(FAR struct nxbe_state_s *be,
nxgl_coord_t dx;
nxgl_coord_t dy;
ginfo("pos=(%d,%d)\n", pos->x, pos->y);
/* If the cursor is visible, then we need to erase the cursor from the
* old position in device graphics memory.
*/