diff options
| author | Dan Halbert <halbert@halwitz.org> | 2018-11-26 10:16:29 -0500 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2018-11-26 10:16:29 -0500 |
| commit | 6fb75902804dc5cd90ebdf8d6bc04c569cf40fca (patch) | |
| tree | dd5cf23eb9ebadefe7a6ef7f7abf9b2a772706fe /supervisor/shared | |
| parent | 1763ffe2450fa07c74db225cc5ef3a6e2feb669b (diff) | |
| parent | 292737fa2b3c18d18ccefe9b8cf6eef5e158fdd0 (diff) | |
Merge remote-tracking branch 'adafruit/master' into bleio-rev
Diffstat (limited to 'supervisor/shared')
| -rw-r--r-- | supervisor/shared/usb/usb_msc_flash.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/supervisor/shared/usb/usb_msc_flash.c b/supervisor/shared/usb/usb_msc_flash.c index 13b5c3966..658aab0d8 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) { |
