Skip to content

Commit 68afc10

Browse files
committed
Update TinyUSB
1 parent 47fb95e commit 68afc10

Some content is hidden

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

54 files changed

+1096
-306
lines changed

cores/esp32/USB.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extern "C" {
3636
#include "tinyusb.h"
3737
}
3838

39-
#if CFG_TUD_DFU_RT
39+
#if CFG_TUD_DFU_RUNTIME
4040
static uint16_t load_dfu_descriptor(uint8_t * dst, uint8_t * itf)
4141
{
4242
#define DFU_ATTR_CAN_DOWNLOAD 1
@@ -59,7 +59,7 @@ void tud_dfu_rt_reboot_to_dfu(void)
5959
{
6060
usb_persist_restart(RESTART_BOOTLOADER_DFU);
6161
}
62-
#endif /* CFG_TUD_DFU_RT */
62+
#endif /* CFG_TUD_DFU_RUNTIME */
6363

6464
ESP_EVENT_DEFINE_BASE(ARDUINO_USB_EVENTS);
6565

@@ -187,9 +187,9 @@ ESPUSB::operator bool() const
187187
}
188188

189189
bool ESPUSB::enableDFU(){
190-
#if CFG_TUD_DFU_RT
190+
#if CFG_TUD_DFU_RUNTIME
191191
return tinyusb_enable_interface(USB_INTERFACE_DFU, TUD_DFU_RT_DESC_LEN, load_dfu_descriptor) == ESP_OK;
192-
#endif /* CFG_TUD_DFU_RT */
192+
#endif /* CFG_TUD_DFU_RUNTIME */
193193
return false;
194194
}
195195

cores/esp32/esp32-hal-tinyusb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ bool tud_vendor_control_complete_cb(uint8_t rhport, tusb_control_request_t const
294294
* Required Callbacks
295295
* */
296296
#if CFG_TUD_HID
297-
__attribute__ ((weak)) const uint8_t * tud_hid_descriptor_report_cb(void){return NULL;}
298-
__attribute__ ((weak)) uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen){return 0;}
299-
__attribute__ ((weak)) void tud_hid_set_report_cb(uint8_t report_id, hid_report_type_t report_type, const uint8_t * buffer, uint16_t bufsize){}
297+
__attribute__ ((weak)) const uint8_t * tud_hid_descriptor_report_cb(uint8_t itf){return NULL;}
298+
__attribute__ ((weak)) uint16_t tud_hid_get_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen){return 0;}
299+
__attribute__ ((weak)) void tud_hid_set_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, const uint8_t * buffer, uint16_t bufsize){}
300300
#endif
301301
#if CFG_TUD_MSC
302302
__attribute__ ((weak)) bool tud_msc_test_unit_ready_cb(uint8_t lun){return false;}

tools/sdk/esp32s2/include/tinyusb/additions/include/tusb_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ extern "C" {
100100
#define CFG_TUD_HID CONFIG_USB_HID_ENABLED
101101
#define CFG_TUD_MIDI CONFIG_USB_MIDI_ENABLED
102102
#define CFG_TUD_CUSTOM_CLASS CONFIG_USB_CUSTOM_CLASS_ENABLED
103-
#define CFG_TUD_DFU_RT CONFIG_USB_DFU_RT_ENABLED
103+
#define CFG_TUD_DFU_RUNTIME CONFIG_USB_DFU_RT_ENABLED
104104
#define CFG_TUD_VENDOR CONFIG_USB_VENDOR_ENABLED
105105

106106
// CDC FIFO size of TX and RX

tools/sdk/esp32s2/include/tinyusb/tinyusb/src/class/audio/audio.h

100755100644
File mode changed.

tools/sdk/esp32s2/include/tinyusb/tinyusb/src/class/audio/audio_device.h

100755100644
File mode changed.

tools/sdk/esp32s2/include/tinyusb/tinyusb/src/class/cdc/cdc.h

100755100644
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
* The MIT License (MIT)
33
*
44
* Copyright (c) 2019 Ha Thach (tinyusb.org)
@@ -277,7 +277,7 @@ typedef struct TU_ATTR_PACKED
277277
struct {
278278
uint8_t handle_call : 1; ///< 0 - Device sends/receives call management information only over the Communications Class interface. 1 - Device can send/receive call management information over a Data Class interface.
279279
uint8_t send_recv_call : 1; ///< 0 - Device does not handle call management itself. 1 - Device handles call management itself.
280-
uint8_t : 0;
280+
uint8_t TU_RESERVED : 6;
281281
} bmCapabilities;
282282

283283
uint8_t bDataInterface;
@@ -290,7 +290,7 @@ typedef struct TU_ATTR_PACKED
290290
uint8_t support_line_request : 1; ///< Device supports the request combination of Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, and the notification Serial_State.
291291
uint8_t support_send_break : 1; ///< Device supports the request Send_Break
292292
uint8_t support_notification_network_connection : 1; ///< Device supports the notification Network_Connection.
293-
uint8_t : 0;
293+
uint8_t TU_RESERVED : 4;
294294
}cdc_acm_capability_t;
295295

296296
TU_VERIFY_STATIC(sizeof(cdc_acm_capability_t) == 1, "mostly problem with compiler");
@@ -316,7 +316,7 @@ typedef struct TU_ATTR_PACKED
316316
uint8_t require_pulse_setup : 1; ///< Device requires extra Pulse_Setup request during pulse dialing sequence to disengage holding circuit.
317317
uint8_t support_aux_request : 1; ///< Device supports the request combination of Set_Aux_Line_State, Ring_Aux_Jack, and notification Aux_Jack_Hook_State.
318318
uint8_t support_pulse_request : 1; ///< Device supports the request combination of Pulse_Setup, Send_Pulse, and Set_Pulse_Time.
319-
uint8_t : 0;
319+
uint8_t TU_RESERVED : 5;
320320
} bmCapabilities;
321321
}cdc_desc_func_direct_line_management_t;
322322

@@ -344,7 +344,7 @@ typedef struct TU_ATTR_PACKED
344344
uint8_t simple_mode : 1;
345345
uint8_t standalone_mode : 1;
346346
uint8_t computer_centric_mode : 1;
347-
uint8_t : 0;
347+
uint8_t TU_RESERVED : 5;
348348
} bmCapabilities;
349349
}cdc_desc_func_telephone_operational_modes_t;
350350

@@ -363,7 +363,7 @@ typedef struct TU_ATTR_PACKED
363363
uint32_t incoming_distinctive : 1; ///< 0 : Reports only incoming ringing. 1 : Reports incoming distinctive ringing patterns.
364364
uint32_t dual_tone_multi_freq : 1; ///< 0 : Cannot report dual tone multi-frequency (DTMF) digits input remotely over the telephone line. 1 : Can report DTMF digits input remotely over the telephone line.
365365
uint32_t line_state_change : 1; ///< 0 : Does not support line state change notification. 1 : Does support line state change notification
366-
uint32_t : 0;
366+
uint32_t TU_RESERVED : 26;
367367
} bmCapabilities;
368368
}cdc_desc_func_telephone_call_state_reporting_capabilities_t;
369369

tools/sdk/esp32s2/include/tinyusb/tinyusb/src/class/cdc/cdc_device.h

100755100644
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ TU_ATTR_WEAK void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts);
145145
// Invoked when line coding is change via SET_LINE_CODING
146146
TU_ATTR_WEAK void tud_cdc_line_coding_cb(uint8_t itf, cdc_line_coding_t const* p_line_coding);
147147

148+
// Invoked when received send break
149+
TU_ATTR_WEAK void tud_cdc_send_break_cb(uint8_t itf, uint16_t duration_ms);
150+
148151
//--------------------------------------------------------------------+
149152
// Inline Functions
150153
//--------------------------------------------------------------------+

tools/sdk/esp32s2/include/tinyusb/tinyusb/src/class/cdc/cdc_host.h

100755100644
File mode changed.

tools/sdk/esp32s2/include/tinyusb/tinyusb/src/class/cdc/cdc_rndis.h

100755100644
File mode changed.

tools/sdk/esp32s2/include/tinyusb/tinyusb/src/class/cdc/cdc_rndis_host.h

100755100644
File mode changed.

tools/sdk/esp32s2/include/tinyusb/tinyusb/src/class/dfu/dfu_rt_device.h

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ typedef enum
5858
//--------------------------------------------------------------------+
5959

6060
// Invoked when received new data
61-
TU_ATTR_WEAK void tud_dfu_rt_reboot_to_dfu(void); // TODO rename to _cb convention
61+
TU_ATTR_WEAK void tud_dfu_runtime_reboot_to_dfu_cb(void);
6262

6363
//--------------------------------------------------------------------+
6464
// Internal Class Driver API

0 commit comments

Comments
 (0)