Explorar el Código

usbstorage 1.5.1: lock system during block transfers

tags/1.5.1
mntmn hace 1 año
padre
commit
0cf0bfb37f
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. +7
    -1
      usb-storage/mntsd_cmd.c

+ 7
- 1
usb-storage/mntsd_cmd.c Ver fichero

@@ -35,7 +35,8 @@ uint16 sdcmd_read_blocks(void* registers, uint8* data, uint32 block, uint32 len)
uint32 offset=0;
uint32 num_blocks=1;
volatile struct MNTUSBSRegs* regs = (volatile struct MNTUSBSRegs*)registers;

Forbid();
while (i<len) {
offset = i<<SD_SECTOR_SHIFT;

@@ -60,6 +61,8 @@ uint16 sdcmd_read_blocks(void* registers, uint8* data, uint32 block, uint32 len)

i += num_blocks;
}
Permit();
return 0;
}

@@ -70,6 +73,7 @@ uint16 sdcmd_write_blocks(void* registers, uint8* data, uint32 block, uint32 len
uint32 num_blocks=1;
struct MNTUSBSRegs* regs = (struct MNTUSBSRegs*)registers;
Forbid();
while (i<len) {
offset = i<<SD_SECTOR_SHIFT;
@@ -94,6 +98,8 @@ uint16 sdcmd_write_blocks(void* registers, uint8* data, uint32 block, uint32 len
i += num_blocks;
}
Permit();
return 0;
}



Cargando…
Cancelar
Guardar