106
106
#define USE_LINEAR_BUFFER 1
107
107
#endif
108
108
109
+ #if defined(STM32F102x6 ) || defined(STM32F102xB ) || \
110
+ defined(STM32F103x6 ) || defined(STM32F103xB ) || \
111
+ defined(STM32F103xE ) || defined(STM32F103xG )
112
+ #define STM32F1_FSDEV
113
+ #endif
114
+
115
+ #if defined(STM32L412xx ) || defined(STM32L422xx ) || \
116
+ defined(STM32L432xx ) || defined(STM32L433xx ) || \
117
+ defined(STM32L442xx ) || defined(STM32L443xx ) || \
118
+ defined(STM32L452xx ) || defined(STM32L462xx )
119
+ #define STM32L4_FSDEV
120
+ #endif
121
+
109
122
// Temporarily put the check here for stm32_fsdev
110
123
#if CFG_TUSB_MCU == OPT_MCU_STM32F0 || \
111
124
CFG_TUSB_MCU == OPT_MCU_STM32F3 || \
112
125
CFG_TUSB_MCU == OPT_MCU_STM32L0 || \
113
126
CFG_TUSB_MCU == OPT_MCU_STM32L1 || \
114
127
CFG_TUSB_MCU == OPT_MCU_STM32G4 || \
115
- CFG_TUSB_MCU == OPT_MCU_STM32WB
128
+ CFG_TUSB_MCU == OPT_MCU_STM32WB || \
129
+ (TU_CHECK_MCU (OPT_MCU_STM32F1 ) && defined(STM32F1_FSDEV )) || \
130
+ (TU_CHECK_MCU (OPT_MCU_STM32L4 ) && defined(STM32L4_FSDEV ))
116
131
#define USE_ISO_EP_ALLOCATION 1
117
132
#else
118
133
#define USE_ISO_EP_ALLOCATION 0
@@ -1481,18 +1496,17 @@ uint16_t audiod_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uin
1481
1496
1482
1497
#if USE_ISO_EP_ALLOCATION
1483
1498
#if CFG_TUD_AUDIO_ENABLE_EP_IN
1484
- uint8_t ep_in = 0 ;
1499
+ uint8_t ep_in = 0 ;
1485
1500
uint16_t ep_in_size = 0 ;
1486
1501
#endif
1487
1502
#if CFG_TUD_AUDIO_ENABLE_EP_OUT
1488
- uint8_t ep_out = 0 ;
1503
+ uint8_t ep_out = 0 ;
1489
1504
uint16_t ep_out_size = 0 ;
1490
1505
#endif
1491
1506
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
1492
1507
uint8_t ep_fb = 0 ;
1493
1508
#endif
1494
1509
1495
- // First find EP addr
1496
1510
uint8_t const * p_desc = _audiod_fct [i ].p_desc ;
1497
1511
uint8_t const * p_desc_end = p_desc + _audiod_fct [i ].desc_length - TUD_AUDIO_DESC_IAD_LEN ;
1498
1512
while (p_desc < p_desc_end )
@@ -1516,11 +1530,13 @@ uint16_t audiod_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uin
1516
1530
{
1517
1531
#if CFG_TUD_AUDIO_ENABLE_EP_IN
1518
1532
ep_in = desc_ep -> bEndpointAddress ;
1533
+ ep_in_size = TU_MAX (tu_edpt_packet_size (desc_ep ), ep_in_size );
1519
1534
#endif
1520
1535
} else
1521
1536
{
1522
1537
#if CFG_TUD_AUDIO_ENABLE_EP_OUT
1523
1538
ep_out = desc_ep -> bEndpointAddress ;
1539
+ ep_out_size = TU_MAX (tu_edpt_packet_size (desc_ep ), ep_out_size );
1524
1540
#endif
1525
1541
}
1526
1542
}
@@ -1530,32 +1546,6 @@ uint16_t audiod_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uin
1530
1546
p_desc = tu_desc_next (p_desc );
1531
1547
}
1532
1548
1533
- // Then find EP max size
1534
- p_desc = _audiod_fct [i ].p_desc ;
1535
- while (p_desc < p_desc_end )
1536
- {
1537
- if (tu_desc_type (p_desc ) == TUSB_DESC_ENDPOINT )
1538
- {
1539
- tusb_desc_endpoint_t const * desc_ep = (tusb_desc_endpoint_t const * ) p_desc ;
1540
- if (desc_ep -> bmAttributes .xfer == TUSB_XFER_ISOCHRONOUS )
1541
- {
1542
- #if CFG_TUD_AUDIO_ENABLE_EP_IN
1543
- if (desc_ep -> bEndpointAddress == ep_in )
1544
- {
1545
- ep_in_size = TU_MAX (tu_edpt_packet_size (desc_ep ), ep_in_size );
1546
- }
1547
- #endif
1548
- #if CFG_TUD_AUDIO_ENABLE_EP_OUT
1549
- if (desc_ep -> bEndpointAddress == ep_out )
1550
- {
1551
- ep_out_size = TU_MAX (tu_edpt_packet_size (desc_ep ), ep_out_size );
1552
- }
1553
- #endif
1554
- }
1555
- }
1556
- p_desc = tu_desc_next (p_desc );
1557
- }
1558
-
1559
1549
#if CFG_TUD_AUDIO_ENABLE_EP_IN
1560
1550
if (ep_in )
1561
1551
{
0 commit comments