mirror of
https://github.com/erichelgeson/BlueSCSI.git
synced 2025-01-18 09:30:04 +00:00
Allow optical files that are set to RO on the SD card to be used
This commit is contained in:
parent
b117ebb39d
commit
208e3cdf9a
@ -563,32 +563,38 @@ void findDriveImages(FsFile root) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Valid file, open for reading/writing.
|
||||
file = new FsFile(SD.open(name, O_RDWR));
|
||||
if(file && file->isFile()) {
|
||||
SCSI_DEVICE_TYPE device_type;
|
||||
if(tolower(name[1]) != 'd') {
|
||||
file->close();
|
||||
delete file;
|
||||
LOG_FILE.print("Not an image: ");
|
||||
LOG_FILE.println(name);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (tolower(name[0])) {
|
||||
case 'h': device_type = SCSI_DEVICE_HDD;
|
||||
break;
|
||||
case 'c': device_type = SCSI_DEVICE_OPTICAL;
|
||||
break;
|
||||
if(tolower(name[1]) != 'd')
|
||||
{
|
||||
file->close();
|
||||
delete file;
|
||||
LOG_FILE.print("Not an image: ");
|
||||
LOG_FILE.println(name);
|
||||
continue;
|
||||
}
|
||||
|
||||
SCSI_DEVICE_TYPE device_type;
|
||||
switch (tolower(name[0]))
|
||||
{
|
||||
case 'h':
|
||||
device_type = SCSI_DEVICE_HDD;
|
||||
file = new FsFile(SD.open(name, O_RDWR));
|
||||
break;
|
||||
case 'c':
|
||||
device_type = SCSI_DEVICE_OPTICAL;
|
||||
file = new FsFile(SD.open(name, O_RDONLY));
|
||||
break;
|
||||
default:
|
||||
file->close();
|
||||
delete file;
|
||||
LOG_FILE.print("Not an image: ");
|
||||
LOG_FILE.println(name);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Defaults for Hard Disks
|
||||
// Valid file
|
||||
if(file && file->isFile())
|
||||
{
|
||||
// Defaults drives
|
||||
int id = 1; // 0 and 3 are common in Macs for physical HD and CD, so avoid them.
|
||||
int lun = 0;
|
||||
int blk = 512;
|
||||
|
Loading…
x
Reference in New Issue
Block a user