Skip to content

Commit

Permalink
Merge pull request #463 from ZuluSCSI/dev_watchdog_during_write
Browse files Browse the repository at this point in the history
Reset watchdog while data transfer is progressing
  • Loading branch information
aperezbios authored Oct 16, 2024
2 parents 66f59cc + 93f75e6 commit 7925831
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ZuluSCSI_cdrom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,12 @@ static void doReadCD(uint32_t lba, uint32_t length, uint8_t sector_type,
}
assert(buf == bufstart + result_length);
scsiStartWrite(bufstart, result_length);

// Reset the watchdog while the transfer is progressing.
// If the host stops transferring, the watchdog will eventually expire.
// This is needed to avoid hitting the watchdog if the host performs
// a large transfer compared to its transfer speed.
platform_reset_watchdog();
}

scsiFinishWrite();
Expand Down
12 changes: 12 additions & 0 deletions src/ZuluSCSI_disk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1671,6 +1671,12 @@ void diskDataOut()
}
platform_set_sd_callback(NULL, NULL);
g_disk_transfer.bytes_sd += len;

// Reset the watchdog while the transfer is progressing.
// If the host stops transferring, the watchdog will eventually expire.
// This is needed to avoid hitting the watchdog if the host performs
// a large transfer compared to its transfer speed.
platform_reset_watchdog();
}
}

Expand Down Expand Up @@ -1844,6 +1850,12 @@ static void start_dataInTransfer(uint8_t *buffer, uint32_t count)

platform_poll();
diskEjectButtonUpdate(false);

// Reset the watchdog while the transfer is progressing.
// If the host stops transferring, the watchdog will eventually expire.
// This is needed to avoid hitting the watchdog if the host performs
// a large transfer compared to its transfer speed.
platform_reset_watchdog();
}

static void diskDataIn()
Expand Down

0 comments on commit 7925831

Please sign in to comment.