Skip to content

Commit e77c06e

Browse files
authored
Merge pull request #1353 from tannewt/usb_update
Update tinyusb to include control fixes.
2 parents 3ca74d8 + 324301e commit e77c06e

File tree

5 files changed

+9
-25
lines changed

5 files changed

+9
-25
lines changed

lib/tinyusb

Submodule tinyusb updated 182 files

ports/atmel-samd/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,13 @@ BASE_CFLAGS = \
6161
-Wno-endif-labels \
6262
-Wstrict-prototypes \
6363
-Werror-implicit-function-declaration \
64-
-Wpointer-arith \
6564
-Wfloat-equal \
6665
-Wundef \
6766
-Wshadow \
6867
-Wwrite-strings \
6968
-Wsign-compare \
7069
-Wmissing-format-attribute \
7170
-Wno-deprecated-declarations \
72-
-Wpacked \
7371
-Wnested-externs \
7472
-Wunreachable-code \
7573
-Wcast-align \
@@ -265,8 +263,8 @@ SRC_C = \
265263
lib/oofatfs/ff.c \
266264
lib/oofatfs/option/ccsbcs.c \
267265
lib/timeutils/timeutils.c \
268-
lib/tinyusb/src/portable/microchip/$(CHIP_FAMILY)/dcd.c \
269-
lib/tinyusb/src/portable/microchip/$(CHIP_FAMILY)/hal.c \
266+
lib/tinyusb/src/portable/microchip/$(CHIP_FAMILY)/dcd_$(CHIP_FAMILY).c \
267+
lib/tinyusb/src/portable/microchip/$(CHIP_FAMILY)/hal_$(CHIP_FAMILY).c \
270268
lib/utils/buffer_helper.c \
271269
lib/utils/context_manager_helpers.c \
272270
lib/utils/interrupt_char.c \

ports/nrf/Makefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,7 @@ ifeq ($(MCU_SUB_VARIANT),nrf52840)
218218

219219
SRC_C += \
220220
lib/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c \
221-
lib/tinyusb/src/portable/nordic/nrf5x/hal_nrf5x.c \
222-
lib/tinyusb/src/common/tusb_fifo.c \
223-
lib/tinyusb/src/device/control.c \
224-
lib/tinyusb/src/device/usbd.c \
225-
lib/tinyusb/src/class/msc/msc_device.c \
226-
lib/tinyusb/src/class/cdc/cdc_device.c \
227-
lib/tinyusb/src/class/hid/hid_device.c \
228-
lib/tinyusb/src/tusb.c \
221+
lib/tinyusb/src/portable/nordic/nrf5x/hal_nrf5x.c
229222

230223
SRC_SHARED_MODULE += \
231224
usb_hid/__init__.c \

supervisor/shared/usb/usb_msc_flash.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,10 @@ int32_t tud_msc_scsi_cb (uint8_t lun, const uint8_t scsi_cmd[16], void* buffer,
133133
return resplen;
134134
}
135135

136-
bool tud_lun_capacity_cb(uint8_t lun, uint32_t* last_valid_sector, uint16_t* sector_size) {
137-
fs_user_mount_t * vfs = get_vfs(lun);
138-
if (vfs == NULL ||
139-
disk_ioctl(vfs, GET_SECTOR_COUNT, last_valid_sector) != RES_OK ||
140-
disk_ioctl(vfs, GET_SECTOR_SIZE, sector_size) != RES_OK) {
141-
return false;
142-
}
143-
// Subtract one from the sector count to get the last valid sector.
144-
(*last_valid_sector)--;
145-
146-
return true;
136+
void tud_msc_capacity_cb(uint8_t lun, uint32_t* block_count, uint16_t* block_size) {
137+
fs_user_mount_t * vfs = get_vfs(lun);
138+
disk_ioctl(vfs, GET_SECTOR_COUNT, block_count);
139+
disk_ioctl(vfs, GET_SECTOR_SIZE, block_size);
147140
}
148141

149142
bool tud_msc_is_writable_cb(uint8_t lun) {

supervisor/supervisor.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ ifeq ($(USB),FALSE)
4343
endif
4444
else
4545
SRC_SUPERVISOR += lib/tinyusb/src/common/tusb_fifo.c \
46-
lib/tinyusb/src/device/control.c \
4746
lib/tinyusb/src/device/usbd.c \
47+
lib/tinyusb/src/device/usbd_control.c \
4848
lib/tinyusb/src/class/msc/msc_device.c \
4949
lib/tinyusb/src/class/cdc/cdc_device.c \
5050
lib/tinyusb/src/class/hid/hid_device.c \

0 commit comments

Comments
 (0)