From 324301e3bc23d3c5d2b7aebff745999c38532d19 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 23 Nov 2018 12:51:11 -0800 Subject: [PATCH] Update tinyusb to include control fixes. --- lib/tinyusb | 2 +- ports/atmel-samd/Makefile | 6 ++---- ports/nrf/Makefile | 9 +-------- supervisor/shared/usb/usb_msc_flash.c | 15 ++++----------- supervisor/supervisor.mk | 2 +- 5 files changed, 9 insertions(+), 25 deletions(-) diff --git a/lib/tinyusb b/lib/tinyusb index c62d9a1fef..47fabe42ed 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit c62d9a1fefa76bf59d43ff56ce6ca1e138a69c76 +Subproject commit 47fabe42edaae4a5da6aa0d48c664a9184578753 diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 23fb39779c..99b8842c6c 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -61,7 +61,6 @@ BASE_CFLAGS = \ -Wno-endif-labels \ -Wstrict-prototypes \ -Werror-implicit-function-declaration \ - -Wpointer-arith \ -Wfloat-equal \ -Wundef \ -Wshadow \ @@ -69,7 +68,6 @@ BASE_CFLAGS = \ -Wsign-compare \ -Wmissing-format-attribute \ -Wno-deprecated-declarations \ - -Wpacked \ -Wnested-externs \ -Wunreachable-code \ -Wcast-align \ @@ -265,8 +263,8 @@ SRC_C = \ lib/oofatfs/ff.c \ lib/oofatfs/option/ccsbcs.c \ lib/timeutils/timeutils.c \ - lib/tinyusb/src/portable/microchip/$(CHIP_FAMILY)/dcd.c \ - lib/tinyusb/src/portable/microchip/$(CHIP_FAMILY)/hal.c \ + lib/tinyusb/src/portable/microchip/$(CHIP_FAMILY)/dcd_$(CHIP_FAMILY).c \ + lib/tinyusb/src/portable/microchip/$(CHIP_FAMILY)/hal_$(CHIP_FAMILY).c \ lib/utils/buffer_helper.c \ lib/utils/context_manager_helpers.c \ lib/utils/interrupt_char.c \ diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 8d0d6d000f..558731a444 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -218,14 +218,7 @@ ifeq ($(MCU_SUB_VARIANT),nrf52840) SRC_C += \ lib/tinyusb/src/portable/nordic/nrf5x/dcd_nrf5x.c \ - lib/tinyusb/src/portable/nordic/nrf5x/hal_nrf5x.c \ - lib/tinyusb/src/common/tusb_fifo.c \ - lib/tinyusb/src/device/control.c \ - lib/tinyusb/src/device/usbd.c \ - lib/tinyusb/src/class/msc/msc_device.c \ - lib/tinyusb/src/class/cdc/cdc_device.c \ - lib/tinyusb/src/class/hid/hid_device.c \ - lib/tinyusb/src/tusb.c \ + lib/tinyusb/src/portable/nordic/nrf5x/hal_nrf5x.c SRC_SHARED_MODULE += \ usb_hid/__init__.c \ diff --git a/supervisor/shared/usb/usb_msc_flash.c b/supervisor/shared/usb/usb_msc_flash.c index 13b5c3966e..658aab0d87 100644 --- a/supervisor/shared/usb/usb_msc_flash.c +++ b/supervisor/shared/usb/usb_msc_flash.c @@ -133,17 +133,10 @@ int32_t tud_msc_scsi_cb (uint8_t lun, const uint8_t scsi_cmd[16], void* buffer, return resplen; } -bool tud_lun_capacity_cb(uint8_t lun, uint32_t* last_valid_sector, uint16_t* sector_size) { - fs_user_mount_t * vfs = get_vfs(lun); - if (vfs == NULL || - disk_ioctl(vfs, GET_SECTOR_COUNT, last_valid_sector) != RES_OK || - disk_ioctl(vfs, GET_SECTOR_SIZE, sector_size) != RES_OK) { - return false; - } - // Subtract one from the sector count to get the last valid sector. - (*last_valid_sector)--; - - return true; +void tud_msc_capacity_cb(uint8_t lun, uint32_t* block_count, uint16_t* block_size) { + fs_user_mount_t * vfs = get_vfs(lun); + disk_ioctl(vfs, GET_SECTOR_COUNT, block_count); + disk_ioctl(vfs, GET_SECTOR_SIZE, block_size); } bool tud_msc_is_writable_cb(uint8_t lun) { diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index ac982d2773..73c76ebb77 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -43,8 +43,8 @@ ifeq ($(USB),FALSE) endif else SRC_SUPERVISOR += lib/tinyusb/src/common/tusb_fifo.c \ - lib/tinyusb/src/device/control.c \ lib/tinyusb/src/device/usbd.c \ + lib/tinyusb/src/device/usbd_control.c \ lib/tinyusb/src/class/msc/msc_device.c \ lib/tinyusb/src/class/cdc/cdc_device.c \ lib/tinyusb/src/class/hid/hid_device.c \