Skip to content

Commit 5d19f7d

Browse files
authored
Merge pull request #134 from adafruit/update-tinyusb
update tinyusb to post 0.12.0
2 parents 145ed6f + 5ba1be7 commit 5d19f7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2366
-4283
lines changed

src/class/audio/audio.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -494,18 +494,6 @@ typedef enum
494494

495495
/// All remaining definitions are taken from the descriptor descriptions in the UAC2 main specification
496496

497-
/// Isochronous End Point Attributes
498-
typedef enum
499-
{
500-
TUSB_ISO_EP_ATT_NO_SYNC = 0x00,
501-
TUSB_ISO_EP_ATT_ASYNCHRONOUS = 0x04,
502-
TUSB_ISO_EP_ATT_ADAPTIVE = 0x08,
503-
TUSB_ISO_EP_ATT_SYNCHRONOUS = 0x0C,
504-
TUSB_ISO_EP_ATT_DATA = 0x00, ///< Data End Point
505-
TUSB_ISO_EP_ATT_EXPLICIT_FB = 0x10, ///< Feedback End Point
506-
TUSB_ISO_EP_ATT_IMPLICIT_FB = 0x20, ///< Data endpoint that also serves as an implicit feedback
507-
} tusb_iso_ep_attribute_t;
508-
509497
/// Audio Class-Control Values UAC2
510498
typedef enum
511499
{

src/class/audio/audio_device.c

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,19 @@
6464
// MACRO CONSTANT TYPEDEF
6565
//--------------------------------------------------------------------+
6666

67+
// Use ring buffer if it's available, some MCUs need extra RAM requirements
68+
#ifndef TUD_AUDIO_PREFER_RING_BUFFER
69+
#if CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
70+
#define TUD_AUDIO_PREFER_RING_BUFFER 0
71+
#else
72+
#define TUD_AUDIO_PREFER_RING_BUFFER 1
73+
#endif
74+
#endif
75+
6776
// Linear buffer in case target MCU is not capable of handling a ring buffer FIFO e.g. no hardware buffer
6877
// is available or driver is would need to be changed dramatically
6978

70-
// Only STM32 synopsys use non-linear buffer for now
79+
// Only STM32 synopsys and dcd_transdimension use non-linear buffer for now
7180
// Synopsys detection copied from dcd_synopsys.c (refactor later on)
7281
#if defined (STM32F105x8) || defined (STM32F105xB) || defined (STM32F105xC) || \
7382
defined (STM32F107xB) || defined (STM32F107xC)
@@ -90,11 +99,18 @@
9099
CFG_TUSB_MCU == OPT_MCU_RX63X || \
91100
CFG_TUSB_MCU == OPT_MCU_RX65X || \
92101
CFG_TUSB_MCU == OPT_MCU_RX72N || \
93-
CFG_TUSB_MCU == OPT_MCU_GD32VF103
102+
CFG_TUSB_MCU == OPT_MCU_GD32VF103 || \
103+
CFG_TUSB_MCU == OPT_MCU_LPC18XX || \
104+
CFG_TUSB_MCU == OPT_MCU_LPC43XX || \
105+
CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX
106+
#if TUD_AUDIO_PREFER_RING_BUFFER
94107
#define USE_LINEAR_BUFFER 0
95108
#else
96109
#define USE_LINEAR_BUFFER 1
97110
#endif
111+
#else
112+
#define USE_LINEAR_BUFFER 1
113+
#endif
98114

99115
// Declaration of buffers
100116

@@ -1553,20 +1569,21 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
15531569
{
15541570
if (tu_desc_type(p_desc) == TUSB_DESC_ENDPOINT)
15551571
{
1556-
TU_ASSERT(usbd_edpt_open(rhport, (tusb_desc_endpoint_t const *)p_desc));
1572+
tusb_desc_endpoint_t const* desc_ep = (tusb_desc_endpoint_t const *) p_desc;
1573+
TU_ASSERT(usbd_edpt_open(rhport, desc_ep));
15571574

1558-
uint8_t ep_addr = ((tusb_desc_endpoint_t const *) p_desc)->bEndpointAddress;
1575+
uint8_t const ep_addr = desc_ep->bEndpointAddress;
15591576

15601577
//TODO: We need to set EP non busy since this is not taken care of right now in ep_close() - THIS IS A WORKAROUND!
15611578
usbd_edpt_clear_stall(rhport, ep_addr);
15621579

15631580
#if CFG_TUD_AUDIO_ENABLE_EP_IN
1564-
if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN && ((tusb_desc_endpoint_t const *) p_desc)->bmAttributes.usage == 0x00) // Check if usage is data EP
1581+
if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN && desc_ep->bmAttributes.usage == 0x00) // Check if usage is data EP
15651582
{
15661583
// Save address
15671584
audio->ep_in = ep_addr;
15681585
audio->ep_in_as_intf_num = itf;
1569-
audio->ep_in_sz = ((tusb_desc_endpoint_t const *) p_desc)->wMaxPacketSize.size;
1586+
audio->ep_in_sz = tu_edpt_packet_size(desc_ep);
15701587

15711588
// If software encoding is enabled, parse for the corresponding parameters - doing this here means only AS interfaces with EPs get scanned for parameters
15721589
#if CFG_TUD_AUDIO_ENABLE_ENCODING
@@ -1600,7 +1617,7 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
16001617
// Save address
16011618
audio->ep_out = ep_addr;
16021619
audio->ep_out_as_intf_num = itf;
1603-
audio->ep_out_sz = ((tusb_desc_endpoint_t const *) p_desc)->wMaxPacketSize.size;
1620+
audio->ep_out_sz = tu_edpt_packet_size(desc_ep);
16041621

16051622
#if CFG_TUD_AUDIO_ENABLE_DECODING
16061623
audiod_parse_for_AS_params(audio, p_desc_parse_for_params, p_desc_end, itf);
@@ -1619,7 +1636,7 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
16191636

16201637
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
16211638
// In case of asynchronous EP, call Cb after ep_fb is set
1622-
if (!(((tusb_desc_endpoint_t const *) p_desc)->bmAttributes.sync == 0x01 && audio->ep_fb == 0))
1639+
if ( !(desc_ep->bmAttributes.sync == 0x01 && audio->ep_fb == 0) )
16231640
{
16241641
if (tud_audio_set_itf_cb) TU_VERIFY(tud_audio_set_itf_cb(rhport, p_request));
16251642
}
@@ -1636,7 +1653,7 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
16361653
}
16371654

16381655
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
1639-
if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN && ((tusb_desc_endpoint_t const *) p_desc)->bmAttributes.usage == 1) // Check if usage is explicit data feedback
1656+
if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN && desc_ep->bmAttributes.usage == 1) // Check if usage is explicit data feedback
16401657
{
16411658
audio->ep_fb = ep_addr;
16421659

src/class/bth/bth_device.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ uint16_t btd_open(uint8_t rhport, tusb_desc_interface_t const *itf_desc, uint16_
142142
dir = tu_edpt_dir(desc_ep->bEndpointAddress);
143143
_btd_itf.ep_voice[dir] = desc_ep->bEndpointAddress;
144144
// Store endpoint size for alternative
145-
_btd_itf.ep_voice_size[dir][itf_desc->bAlternateSetting] = (uint8_t)desc_ep->wMaxPacketSize.size;
145+
_btd_itf.ep_voice_size[dir][itf_desc->bAlternateSetting] = (uint8_t) tu_edpt_packet_size(desc_ep);
146146

147147
desc_ep = (tusb_desc_endpoint_t const *)tu_desc_next(desc_ep);
148148
TU_ASSERT(desc_ep->bDescriptorType == TUSB_DESC_ENDPOINT, 0);
149149
dir = tu_edpt_dir(desc_ep->bEndpointAddress);
150150
_btd_itf.ep_voice[dir] = desc_ep->bEndpointAddress;
151151
// Store endpoint size for alternative
152-
_btd_itf.ep_voice_size[dir][itf_desc->bAlternateSetting] = (uint8_t)desc_ep->wMaxPacketSize.size;
152+
_btd_itf.ep_voice_size[dir][itf_desc->bAlternateSetting] = (uint8_t) tu_edpt_packet_size(desc_ep);
153153
drv_len += iso_alt_itf_size;
154154

155155
for (int i = 1; i < CFG_TUD_BTH_ISO_ALT_COUNT && drv_len + iso_alt_itf_size <= max_len; ++i) {
@@ -170,14 +170,14 @@ uint16_t btd_open(uint8_t rhport, tusb_desc_interface_t const *itf_desc, uint16_
170170
// Verify that alternative endpoint are same as first ones
171171
TU_ASSERT(desc_ep->bDescriptorType == TUSB_DESC_ENDPOINT &&
172172
_btd_itf.ep_voice[dir] == desc_ep->bEndpointAddress, 0);
173-
_btd_itf.ep_voice_size[dir][itf_desc->bAlternateSetting] = (uint8_t)desc_ep->wMaxPacketSize.size;
173+
_btd_itf.ep_voice_size[dir][itf_desc->bAlternateSetting] = (uint8_t) tu_edpt_packet_size(desc_ep);
174174

175175
desc_ep = (tusb_desc_endpoint_t const *)tu_desc_next(desc_ep);
176176
dir = tu_edpt_dir(desc_ep->bEndpointAddress);
177177
// Verify that alternative endpoint are same as first ones
178178
TU_ASSERT(desc_ep->bDescriptorType == TUSB_DESC_ENDPOINT &&
179179
_btd_itf.ep_voice[dir] == desc_ep->bEndpointAddress, 0);
180-
_btd_itf.ep_voice_size[dir][itf_desc->bAlternateSetting] = (uint8_t)desc_ep->wMaxPacketSize.size;
180+
_btd_itf.ep_voice_size[dir][itf_desc->bAlternateSetting] = (uint8_t) tu_edpt_packet_size(desc_ep);
181181
drv_len += iso_alt_itf_size;
182182
}
183183
}
@@ -214,14 +214,14 @@ bool btd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t c
214214
}
215215
else return false;
216216

217-
return tud_control_xfer(rhport, request, &_btd_itf.hci_cmd, request->wLength);
217+
return tud_control_xfer(rhport, request, &_btd_itf.hci_cmd, sizeof(_btd_itf.hci_cmd));
218218
}
219219
else if ( stage == CONTROL_STAGE_DATA )
220220
{
221221
// Handle class request only
222222
TU_VERIFY(request->bmRequestType_bit.type == TUSB_REQ_TYPE_CLASS);
223223

224-
if (tud_bt_hci_cmd_cb) tud_bt_hci_cmd_cb(&_btd_itf.hci_cmd, request->wLength);
224+
if (tud_bt_hci_cmd_cb) tud_bt_hci_cmd_cb(&_btd_itf.hci_cmd, tu_min16(request->wLength, sizeof(_btd_itf.hci_cmd)));
225225
}
226226

227227
return true;

src/class/cdc/cdc.h

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -58,31 +58,32 @@ typedef enum
5858
/// Communication Interface Subclass Codes
5959
typedef enum
6060
{
61-
CDC_COMM_SUBCLASS_DIRECT_LINE_CONTROL_MODEL = 0x01 , ///< Direct Line Control Model [USBPSTN1.2]
62-
CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL , ///< Abstract Control Model [USBPSTN1.2]
63-
CDC_COMM_SUBCLASS_TELEPHONE_CONTROL_MODEL , ///< Telephone Control Model [USBPSTN1.2]
64-
CDC_COMM_SUBCLASS_MULTICHANNEL_CONTROL_MODEL , ///< Multi-Channel Control Model [USBISDN1.2]
65-
CDC_COMM_SUBCLASS_CAPI_CONTROL_MODEL , ///< CAPI Control Model [USBISDN1.2]
66-
CDC_COMM_SUBCLASS_ETHERNET_CONTROL_MODEL , ///< Ethernet Networking Control Model [USBECM1.2]
67-
CDC_COMM_SUBCLASS_ATM_NETWORKING_CONTROL_MODEL , ///< ATM Networking Control Model [USBATM1.2]
68-
CDC_COMM_SUBCLASS_WIRELESS_HANDSET_CONTROL_MODEL , ///< Wireless Handset Control Model [USBWMC1.1]
69-
CDC_COMM_SUBCLASS_DEVICE_MANAGEMENT , ///< Device Management [USBWMC1.1]
70-
CDC_COMM_SUBCLASS_MOBILE_DIRECT_LINE_MODEL , ///< Mobile Direct Line Model [USBWMC1.1]
71-
CDC_COMM_SUBCLASS_OBEX , ///< OBEX [USBWMC1.1]
72-
CDC_COMM_SUBCLASS_ETHERNET_EMULATION_MODEL ///< Ethernet Emulation Model [USBEEM1.0]
61+
CDC_COMM_SUBCLASS_DIRECT_LINE_CONTROL_MODEL = 0x01 , ///< Direct Line Control Model [USBPSTN1.2]
62+
CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL = 0x02 , ///< Abstract Control Model [USBPSTN1.2]
63+
CDC_COMM_SUBCLASS_TELEPHONE_CONTROL_MODEL = 0x03 , ///< Telephone Control Model [USBPSTN1.2]
64+
CDC_COMM_SUBCLASS_MULTICHANNEL_CONTROL_MODEL = 0x04 , ///< Multi-Channel Control Model [USBISDN1.2]
65+
CDC_COMM_SUBCLASS_CAPI_CONTROL_MODEL = 0x05 , ///< CAPI Control Model [USBISDN1.2]
66+
CDC_COMM_SUBCLASS_ETHERNET_CONTROL_MODEL = 0x06 , ///< Ethernet Networking Control Model [USBECM1.2]
67+
CDC_COMM_SUBCLASS_ATM_NETWORKING_CONTROL_MODEL = 0x07 , ///< ATM Networking Control Model [USBATM1.2]
68+
CDC_COMM_SUBCLASS_WIRELESS_HANDSET_CONTROL_MODEL = 0x08 , ///< Wireless Handset Control Model [USBWMC1.1]
69+
CDC_COMM_SUBCLASS_DEVICE_MANAGEMENT = 0x09 , ///< Device Management [USBWMC1.1]
70+
CDC_COMM_SUBCLASS_MOBILE_DIRECT_LINE_MODEL = 0x0A , ///< Mobile Direct Line Model [USBWMC1.1]
71+
CDC_COMM_SUBCLASS_OBEX = 0x0B , ///< OBEX [USBWMC1.1]
72+
CDC_COMM_SUBCLASS_ETHERNET_EMULATION_MODEL = 0x0C , ///< Ethernet Emulation Model [USBEEM1.0]
73+
CDC_COMM_SUBCLASS_NETWORK_CONTROL_MODEL = 0x0D ///< Network Control Model [USBNCM1.0]
7374
} cdc_comm_sublcass_type_t;
7475

7576
/// Communication Interface Protocol Codes
7677
typedef enum
7778
{
78-
CDC_COMM_PROTOCOL_NONE = 0x00 , ///< No specific protocol
79-
CDC_COMM_PROTOCOL_ATCOMMAND , ///< AT Commands: V.250 etc
80-
CDC_COMM_PROTOCOL_ATCOMMAND_PCCA_101 , ///< AT Commands defined by PCCA-101
81-
CDC_COMM_PROTOCOL_ATCOMMAND_PCCA_101_AND_ANNEXO , ///< AT Commands defined by PCCA-101 & Annex O
82-
CDC_COMM_PROTOCOL_ATCOMMAND_GSM_707 , ///< AT Commands defined by GSM 07.07
83-
CDC_COMM_PROTOCOL_ATCOMMAND_3GPP_27007 , ///< AT Commands defined by 3GPP 27.007
84-
CDC_COMM_PROTOCOL_ATCOMMAND_CDMA , ///< AT Commands defined by TIA for CDMA
85-
CDC_COMM_PROTOCOL_ETHERNET_EMULATION_MODEL ///< Ethernet Emulation Model
79+
CDC_COMM_PROTOCOL_NONE = 0x00 , ///< No specific protocol
80+
CDC_COMM_PROTOCOL_ATCOMMAND = 0x01 , ///< AT Commands: V.250 etc
81+
CDC_COMM_PROTOCOL_ATCOMMAND_PCCA_101 = 0x02 , ///< AT Commands defined by PCCA-101
82+
CDC_COMM_PROTOCOL_ATCOMMAND_PCCA_101_AND_ANNEXO = 0x03 , ///< AT Commands defined by PCCA-101 & Annex O
83+
CDC_COMM_PROTOCOL_ATCOMMAND_GSM_707 = 0x04 , ///< AT Commands defined by GSM 07.07
84+
CDC_COMM_PROTOCOL_ATCOMMAND_3GPP_27007 = 0x05 , ///< AT Commands defined by 3GPP 27.007
85+
CDC_COMM_PROTOCOL_ATCOMMAND_CDMA = 0x06 , ///< AT Commands defined by TIA for CDMA
86+
CDC_COMM_PROTOCOL_ETHERNET_EMULATION_MODEL = 0x07 ///< Ethernet Emulation Model
8687
} cdc_comm_protocol_type_t;
8788

8889
//------------- SubType Descriptor in COMM Functional Descriptor -------------//
@@ -114,15 +115,17 @@ typedef enum
114115
CDC_FUNC_DESC_COMMAND_SET = 0x16 , ///< Command Set Functional Descriptor
115116
CDC_FUNC_DESC_COMMAND_SET_DETAIL = 0x17 , ///< Command Set Detail Functional Descriptor
116117
CDC_FUNC_DESC_TELEPHONE_CONTROL_MODEL = 0x18 , ///< Telephone Control Model Functional Descriptor
117-
CDC_FUNC_DESC_OBEX_SERVICE_IDENTIFIER = 0x19 ///< OBEX Service Identifier Functional Descriptor
118+
CDC_FUNC_DESC_OBEX_SERVICE_IDENTIFIER = 0x19 , ///< OBEX Service Identifier Functional Descriptor
119+
CDC_FUNC_DESC_NCM = 0x1A , ///< NCM Functional Descriptor
118120
}cdc_func_desc_type_t;
119121

120122
//--------------------------------------------------------------------+
121123
// CDC Data Interface Class
122124
//--------------------------------------------------------------------+
123125

124126
// SUBCLASS code of Data Interface is not used and should/must be zero
125-
/// Data Interface Protocol Codes
127+
128+
// Data Interface Protocol Codes
126129
typedef enum{
127130
CDC_DATA_PROTOCOL_ISDN_BRI = 0x30, ///< Physical interface protocol for ISDN BRI
128131
CDC_DATA_PROTOCOL_HDLC = 0x31, ///< HDLC
@@ -147,7 +150,6 @@ typedef enum
147150
{
148151
CDC_REQUEST_SEND_ENCAPSULATED_COMMAND = 0x00, ///< is used to issue a command in the format of the supported control protocol of the Communications Class interface
149152
CDC_REQUEST_GET_ENCAPSULATED_RESPONSE = 0x01, ///< is used to request a response in the format of the supported control protocol of the Communications Class interface.
150-
151153
CDC_REQUEST_SET_COMM_FEATURE = 0x02,
152154
CDC_REQUEST_GET_COMM_FEATURE = 0x03,
153155
CDC_REQUEST_CLEAR_COMM_FEATURE = 0x04,
@@ -194,30 +196,27 @@ typedef enum
194196
// Management Elemenent Notification (Notification Endpoint)
195197
//--------------------------------------------------------------------+
196198

197-
/// Communication Interface Management Element Notification Codes
199+
/// 6.3 Notification Codes
198200
typedef enum
199201
{
200-
NETWORK_CONNECTION = 0x00, ///< This notification allows the device to notify the host about network connection status.
201-
RESPONSE_AVAILABLE = 0x01, ///< This notification allows the device to notify the hostthat a response is available. This response can be retrieved with a subsequent \ref CDC_REQUEST_GET_ENCAPSULATED_RESPONSE request.
202-
203-
AUX_JACK_HOOK_STATE = 0x08,
204-
RING_DETECT = 0x09,
205-
206-
SERIAL_STATE = 0x20,
207-
208-
CALL_STATE_CHANGE = 0x28,
209-
LINE_STATE_CHANGE = 0x29,
210-
CONNECTION_SPEED_CHANGE = 0x2A, ///< This notification allows the device to inform the host-networking driver that a change in either the upstream or the downstream bit rate of the connection has occurred
211-
MDLM_SEMANTIC_MODEL_NOTIFICATION = 0x40,
202+
CDC_NOTIF_NETWORK_CONNECTION = 0x00, ///< This notification allows the device to notify the host about network connection status.
203+
CDC_NOTIF_RESPONSE_AVAILABLE = 0x01, ///< This notification allows the device to notify the hostthat a response is available. This response can be retrieved with a subsequent \ref CDC_REQUEST_GET_ENCAPSULATED_RESPONSE request.
204+
CDC_NOTIF_AUX_JACK_HOOK_STATE = 0x08,
205+
CDC_NOTIF_RING_DETECT = 0x09,
206+
CDC_NOTIF_SERIAL_STATE = 0x20,
207+
CDC_NOTIF_CALL_STATE_CHANGE = 0x28,
208+
CDC_NOTIF_LINE_STATE_CHANGE = 0x29,
209+
CDC_NOTIF_CONNECTION_SPEED_CHANGE = 0x2A, ///< This notification allows the device to inform the host-networking driver that a change in either the upstream or the downstream bit rate of the connection has occurred
210+
CDC_NOTIF_MDLM_SEMANTIC_MODEL_NOTIFICATION = 0x40,
212211
}cdc_notification_request_t;
213212

214213
//--------------------------------------------------------------------+
215214
// Class Specific Functional Descriptor (Communication Interface)
216215
//--------------------------------------------------------------------+
217216

218217
// Start of all packed definitions for compiler without per-type packed
219-
// TU_ATTR_PACKED_BEGIN
220-
// TU_ATTR_BIT_FIELD_ORDER_BEGIN
218+
TU_ATTR_PACKED_BEGIN
219+
TU_ATTR_BIT_FIELD_ORDER_BEGIN
221220

222221
/// Header Functional Descriptor (Communication Interface)
223222
typedef struct TU_ATTR_PACKED
@@ -398,8 +397,8 @@ typedef struct TU_ATTR_PACKED
398397

399398
TU_VERIFY_STATIC(sizeof(cdc_line_control_state_t) == 2, "size is not correct");
400399

401-
// TU_ATTR_PACKED_END // End of all packed definitions
402-
// TU_ATTR_BIT_FIELD_ORDER_END
400+
TU_ATTR_PACKED_END // End of all packed definitions
401+
TU_ATTR_BIT_FIELD_ORDER_END
403402

404403
#ifdef __cplusplus
405404
}

src/class/cdc/cdc_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ void cdcd_init(void)
229229
{
230230
cdcd_interface_t* p_cdc = &_cdcd_itf[i];
231231

232-
p_cdc->wanted_char = -1;
232+
p_cdc->wanted_char = (char) -1;
233233

234234
// default line coding is : stop bit = 1, parity = none, data bits = 8
235235
p_cdc->line_coding.bit_rate = 115200;

src/class/cdc/cdc_device.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ int32_t tud_cdc_n_read_char (uint8_t itf);
8282
void tud_cdc_n_read_flush (uint8_t itf);
8383

8484
// Get a byte from FIFO at the specified position without removing it
85-
bool tud_cdc_n_peek (uint8_t itf, uint8_t* u8);
85+
bool tud_cdc_n_peek (uint8_t itf, uint8_t* ui8);
8686

8787
// Write bytes to TX FIFO, data may remain in the FIFO for a while
8888
uint32_t tud_cdc_n_write (uint8_t itf, void const* buffer, uint32_t bufsize);
@@ -116,7 +116,7 @@ static inline uint32_t tud_cdc_available (void);
116116
static inline int32_t tud_cdc_read_char (void);
117117
static inline uint32_t tud_cdc_read (void* buffer, uint32_t bufsize);
118118
static inline void tud_cdc_read_flush (void);
119-
static inline bool tud_cdc_peek (uint8_t* u8);
119+
static inline bool tud_cdc_peek (uint8_t* ui8);
120120

121121
static inline uint32_t tud_cdc_write_char (char ch);
122122
static inline uint32_t tud_cdc_write (void const* buffer, uint32_t bufsize);
@@ -206,9 +206,9 @@ static inline void tud_cdc_read_flush (void)
206206
tud_cdc_n_read_flush(0);
207207
}
208208

209-
static inline bool tud_cdc_peek (uint8_t* u8)
209+
static inline bool tud_cdc_peek (uint8_t* ui8)
210210
{
211-
return tud_cdc_n_peek(0, u8);
211+
return tud_cdc_n_peek(0, ui8);
212212
}
213213

214214
static inline uint32_t tud_cdc_write_char (char ch)

src/class/dfu/dfu_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ uint16_t dfu_moded_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc,
190190
_dfu_ctx.attrs = func_desc->bAttributes;
191191

192192
// CFG_TUD_DFU_XFER_BUFSIZE has to be set to the buffer size used in TUD_DFU_DESCRIPTOR
193-
uint16_t const transfer_size = tu_le16toh( tu_unaligned_read16((uint8_t*) func_desc + offsetof(tusb_desc_dfu_functional_t, wTransferSize)) );
193+
uint16_t const transfer_size = tu_le16toh( tu_unaligned_read16((uint8_t const*) func_desc + offsetof(tusb_desc_dfu_functional_t, wTransferSize)) );
194194
TU_ASSERT(transfer_size <= CFG_TUD_DFU_XFER_BUFSIZE, drv_len);
195195

196196
return drv_len;

0 commit comments

Comments
 (0)