Merge pull request #677 from tannewt/usb_active_read
Move usb read finish into interrupt.
This commit is contained in:
commit
b64d568267
@ -260,6 +260,9 @@ int32_t usb_msc_xfer_done(uint8_t lun) {
|
||||
if (active_read) {
|
||||
active_addr += 1;
|
||||
active_nblocks--;
|
||||
if (active_nblocks == 0) {
|
||||
active_read = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (active_write) {
|
||||
@ -278,10 +281,6 @@ int32_t usb_msc_xfer_done(uint8_t lun) {
|
||||
// sector. Once the sector is transmitted, xfer_done will be called.
|
||||
void usb_msc_background(void) {
|
||||
if (active_read && !usb_busy) {
|
||||
if (active_nblocks == 0) {
|
||||
active_read = false;
|
||||
return;
|
||||
}
|
||||
fs_user_mount_t * vfs = get_vfs(active_lun);
|
||||
disk_read(vfs, sector_buffer, active_addr, 1);
|
||||
CRITICAL_SECTION_ENTER();
|
||||
|
Loading…
x
Reference in New Issue
Block a user