Skip to content

Commit

Permalink
Merge pull request arduino#77 from alrvid/main
Browse files Browse the repository at this point in the history
Adapt to changed function signatures in TinyUSB

Former-commit-id: 5ef8470
  • Loading branch information
alrvid authored Jun 7, 2023
2 parents c682c3c + 7ac0c32 commit 1e79604
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libraries/UsbHostMsd/UsbHostMsd.cpp
Original file line number Diff line number Diff line change
@@ -94,11 +94,11 @@ bool USBHostMSD::connect() {
/* */
/* -------------------------------------------------------------------------- */
static bool in_progress = false;
bool complete_cb(uint8_t dev_addr, msc_cbw_t const* cbw, msc_csw_t const* csw) {
bool complete_cb(uint8_t dev_addr, tuh_msc_complete_data_t const * cb_data) {
in_progress = false;
return true;
}


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

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

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

bool USBHostMSD::attach_detected_callback(void (*cbk)()) {
usb_host_msd_attach_mnt_cbk(cbk);
}
}

0 comments on commit 1e79604

Please sign in to comment.