Skip to content

Commit 1e79604

Browse files
authored
Merge pull request arduino#77 from alrvid/main
Adapt to changed function signatures in TinyUSB Former-commit-id: 5ef8470
2 parents c682c3c + 7ac0c32 commit 1e79604

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: libraries/UsbHostMsd/UsbHostMsd.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ bool USBHostMSD::connect() {
9494
/* */
9595
/* -------------------------------------------------------------------------- */
9696
static bool in_progress = false;
97-
bool complete_cb(uint8_t dev_addr, msc_cbw_t const* cbw, msc_csw_t const* csw) {
97+
bool complete_cb(uint8_t dev_addr, tuh_msc_complete_data_t const * cb_data) {
9898
in_progress = false;
99+
return true;
99100
}
100101

101-
102102
/* -------------------------------------------------------------------------- */
103103
/* WRITE */
104104
/* -------------------------------------------------------------------------- */
@@ -115,7 +115,7 @@ int USBHostMSD::write(const void *buffer, bd_addr_t addr, bd_size_t size) {
115115

116116
for (uint32_t b = block_number; b < block_number + count; b++) {
117117
in_progress = true;
118-
if(tuh_msc_write10(usb_host_msd_get_device_address(), get_lun(), buf, b, 1, complete_cb)) {
118+
if(tuh_msc_write10(usb_host_msd_get_device_address(), get_lun(), buf, b, 1, complete_cb, 0)) {
119119
while(in_progress) {
120120
delay(10);
121121
}
@@ -147,7 +147,7 @@ int USBHostMSD::read(void *buffer, bd_addr_t addr, bd_size_t size)
147147

148148
for (uint32_t b = block_number; b < block_number + count; b++) {
149149
in_progress = true;
150-
if(tuh_msc_read10(usb_host_msd_get_device_address(), get_lun(), buf, b, 1, complete_cb)) {
150+
if(tuh_msc_read10(usb_host_msd_get_device_address(), get_lun(), buf, b, 1, complete_cb, 0)) {
151151
while(in_progress) {
152152
delay(10);
153153
}
@@ -236,4 +236,4 @@ const char *USBHostMSD::get_type() const {
236236

237237
bool USBHostMSD::attach_detected_callback(void (*cbk)()) {
238238
usb_host_msd_attach_mnt_cbk(cbk);
239-
}
239+
}

0 commit comments

Comments
 (0)