Skip to content

Commit bfb631c

Browse files
committed
update tinyusb
1 parent 40207d9 commit bfb631c

Some content is hidden

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

64 files changed

+741
-390
lines changed

src/class/audio/audio.h

Lines changed: 3 additions & 3 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)
@@ -824,10 +824,10 @@ typedef struct TU_ATTR_PACKED
824824
uint8_t type : 2; ///< Request type tusb_request_type_t.
825825
uint8_t direction : 1; ///< Direction type. tusb_dir_t
826826
} bmRequestType_bit;
827-
827+
828828
uint8_t bmRequestType;
829829
};
830-
830+
831831
uint8_t bRequest; ///< Request type audio_cs_req_t
832832
uint8_t bChannelNumber;
833833
uint8_t bControlSelector;

src/class/audio/audio_device.c

Lines changed: 253 additions & 165 deletions
Large diffs are not rendered by default.

src/class/audio/audio_device.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
* The MIT License (MIT)
33
*
44
* Copyright (c) 2020 Ha Thach (tinyusb.org)
@@ -473,7 +473,7 @@ TU_ATTR_WEAK void tud_audio_fb_done_cb(uint8_t func_id);
473473
// the choice of format is left to the caller and feedback argument is sent as-is. If CFG_TUD_AUDIO_ENABLE_FEEDBACK_FORMAT_CORRECTION is set, then tinyusb
474474
// expects 16.16 format and handles the conversion to 10.14 on FS.
475475
//
476-
// Note that due to a bug in its USB Audio 2.0 driver, Windows currently requires 16.16 format for _all_ USB 2.0 devices. On Linux and macOS it seems the
476+
// Note that due to a bug in its USB Audio 2.0 driver, Windows currently requires 16.16 format for _all_ USB 2.0 devices. On Linux and macOS it seems the
477477
// driver can work with either format. So a good compromise is to keep format correction disabled and stick to 16.16 format.
478478

479479
// Feedback value can be determined from within the SOF ISR of the audio driver. This should reduce jitter. If the feature is used, the user can not set the feedback value.

src/class/bth/bth_device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
* The MIT License (MIT)
33
*
44
* Copyright (c) 2020 Jerzy Kasenberg

src/class/cdc/cdc.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,9 @@ typedef struct TU_ATTR_PACKED
377377
uint32_t incoming_distinctive : 1; ///< 0 : Reports only incoming ringing. 1 : Reports incoming distinctive ringing patterns.
378378
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.
379379
uint32_t line_state_change : 1; ///< 0 : Does not support line state change notification. 1 : Does support line state change notification
380-
uint32_t TU_RESERVED : 26;
380+
uint32_t TU_RESERVED0 : 2;
381+
uint32_t TU_RESERVED1 : 16;
382+
uint32_t TU_RESERVED2 : 8;
381383
} bmCapabilities;
382384
}cdc_desc_func_telephone_call_state_reporting_capabilities_t;
383385

@@ -404,7 +406,8 @@ typedef struct TU_ATTR_PACKED
404406
{
405407
uint16_t dtr : 1;
406408
uint16_t rts : 1;
407-
uint16_t : 14;
409+
uint16_t : 6;
410+
uint16_t : 8;
408411
} cdc_line_control_state_t;
409412

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

src/class/cdc/cdc_device.c

Lines changed: 7 additions & 7 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)
@@ -76,7 +76,7 @@ typedef struct
7676
//--------------------------------------------------------------------+
7777
// INTERNAL OBJECT & FUNCTION DECLARATION
7878
//--------------------------------------------------------------------+
79-
CFG_TUSB_MEM_SECTION static cdcd_interface_t _cdcd_itf[CFG_TUD_CDC];
79+
CFG_TUSB_MEM_SECTION tu_static cdcd_interface_t _cdcd_itf[CFG_TUD_CDC];
8080

8181
static bool _prep_out_transaction (cdcd_interface_t* p_cdc)
8282
{
@@ -386,7 +386,7 @@ bool cdcd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t
386386
bool const rts = tu_bit_test(request->wValue, 1);
387387

388388
p_cdc->line_state = (uint8_t) request->wValue;
389-
389+
390390
// Disable fifo overwriting if DTR bit is set
391391
tu_fifo_set_overwritable(&p_cdc->tx_ff, !dtr);
392392

@@ -433,7 +433,7 @@ bool cdcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_
433433
if ( ep_addr == p_cdc->ep_out )
434434
{
435435
tu_fifo_write_n(&p_cdc->rx_ff, p_cdc->epout_buf, (uint16_t) xferred_bytes);
436-
436+
437437
// Check for wanted char and invoke callback if needed
438438
if ( tud_cdc_rx_wanted_cb && (((signed char) p_cdc->wanted_char) != -1) )
439439
{
@@ -445,14 +445,14 @@ bool cdcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_
445445
}
446446
}
447447
}
448-
448+
449449
// invoke receive callback (if there is still data)
450450
if (tud_cdc_rx_cb && !tu_fifo_empty(&p_cdc->rx_ff) ) tud_cdc_rx_cb(itf);
451-
451+
452452
// prepare for OUT transaction
453453
_prep_out_transaction(p_cdc);
454454
}
455-
455+
456456
// Data sent to host, we continue to fetch from tx fifo to send.
457457
// Note: This will cause incorrect baudrate set in line coding.
458458
// Though maybe the baudrate is not really important !!!

src/class/cdc/cdc_device.h

Lines changed: 1 addition & 1 deletion
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)

src/class/cdc/cdc_host.c

Lines changed: 4 additions & 4 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)
@@ -97,7 +97,7 @@ static inline uint8_t get_idx_by_ep_addr(uint8_t daddr, uint8_t ep_addr)
9797
}
9898
}
9999

100-
return TUSB_INDEX_INVALID;
100+
return TU_INDEX_INVALID_8;
101101
}
102102

103103

@@ -124,7 +124,7 @@ uint8_t tuh_cdc_itf_get_index(uint8_t daddr, uint8_t itf_num)
124124
if (p_cdc->daddr == daddr && p_cdc->bInterfaceNumber == itf_num) return i;
125125
}
126126

127-
return TUSB_INDEX_INVALID;
127+
return TU_INDEX_INVALID_8;
128128
}
129129

130130
bool tuh_cdc_itf_get_info(uint8_t idx, tuh_cdc_itf_info_t* info)
@@ -533,7 +533,7 @@ static void process_cdc_config(tuh_xfer_t* xfer)
533533
uintptr_t const state = xfer->user_data;
534534
uint8_t const itf_num = (uint8_t) tu_le16toh(xfer->setup->wIndex);
535535
uint8_t const idx = tuh_cdc_itf_get_index(xfer->daddr, itf_num);
536-
TU_ASSERT(idx != TUSB_INDEX_INVALID, );
536+
TU_ASSERT(idx != TU_INDEX_INVALID_8, );
537537

538538
switch(state)
539539
{

src/class/cdc/cdc_host.h

Lines changed: 1 addition & 1 deletion
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)

src/class/dfu/dfu_device.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ typedef struct
5656
} dfu_state_ctx_t;
5757

5858
// Only a single dfu state is allowed
59-
CFG_TUSB_MEM_SECTION static dfu_state_ctx_t _dfu_ctx;
59+
CFG_TUSB_MEM_SECTION tu_static dfu_state_ctx_t _dfu_ctx;
6060

6161
static void reset_state(void)
6262
{
@@ -74,7 +74,7 @@ static bool process_manifest_get_status(uint8_t rhport, uint8_t stage, tusb_cont
7474
//--------------------------------------------------------------------+
7575
#if CFG_TUSB_DEBUG >= 2
7676

77-
static tu_lookup_entry_t const _dfu_request_lookup[] =
77+
tu_static tu_lookup_entry_t const _dfu_request_lookup[] =
7878
{
7979
{ .key = DFU_REQUEST_DETACH , .data = "DETACH" },
8080
{ .key = DFU_REQUEST_DNLOAD , .data = "DNLOAD" },
@@ -85,13 +85,13 @@ static tu_lookup_entry_t const _dfu_request_lookup[] =
8585
{ .key = DFU_REQUEST_ABORT , .data = "ABORT" },
8686
};
8787

88-
static tu_lookup_table_t const _dfu_request_table =
88+
tu_static tu_lookup_table_t const _dfu_request_table =
8989
{
9090
.count = TU_ARRAY_SIZE(_dfu_request_lookup),
9191
.items = _dfu_request_lookup
9292
};
9393

94-
static tu_lookup_entry_t const _dfu_state_lookup[] =
94+
tu_static tu_lookup_entry_t const _dfu_state_lookup[] =
9595
{
9696
{ .key = APP_IDLE , .data = "APP_IDLE" },
9797
{ .key = APP_DETACH , .data = "APP_DETACH" },
@@ -106,13 +106,13 @@ static tu_lookup_entry_t const _dfu_state_lookup[] =
106106
{ .key = DFU_ERROR , .data = "ERROR" },
107107
};
108108

109-
static tu_lookup_table_t const _dfu_state_table =
109+
tu_static tu_lookup_table_t const _dfu_state_table =
110110
{
111111
.count = TU_ARRAY_SIZE(_dfu_state_lookup),
112112
.items = _dfu_state_lookup
113113
};
114114

115-
static tu_lookup_entry_t const _dfu_status_lookup[] =
115+
tu_static tu_lookup_entry_t const _dfu_status_lookup[] =
116116
{
117117
{ .key = DFU_STATUS_OK , .data = "OK" },
118118
{ .key = DFU_STATUS_ERR_TARGET , .data = "errTARGET" },
@@ -132,7 +132,7 @@ static tu_lookup_entry_t const _dfu_status_lookup[] =
132132
{ .key = DFU_STATUS_ERR_STALLEDPKT , .data = "errSTALLEDPKT" },
133133
};
134134

135-
static tu_lookup_table_t const _dfu_status_table =
135+
tu_static tu_lookup_table_t const _dfu_status_table =
136136
{
137137
.count = TU_ARRAY_SIZE(_dfu_status_lookup),
138138
.items = _dfu_status_lookup

0 commit comments

Comments
 (0)