Fix warnings

This commit is contained in:
Eric Helgeson 2021-12-15 10:23:20 -06:00
parent 5e26988f93
commit 3e616f6a38

View File

@ -481,16 +481,19 @@ void setup()
if(file_name_length > 2) { // HD[N] if(file_name_length > 2) { // HD[N]
int tmp_id = name[HDIMG_ID_POS] - '0'; int tmp_id = name[HDIMG_ID_POS] - '0';
// If valid id, set it, else use default
if(tmp_id > -1 && tmp_id < 8) { if(tmp_id > -1 && tmp_id < 8) {
id = tmp_id; // If valid id, set it, else use default id = tmp_id;
} else {
usedDefaultId++; usedDefaultId++;
} }
} }
if(file_name_length > 3) { // HD0[N] if(file_name_length > 3) { // HD0[N]
int tmp_lun = name[HDIMG_LUN_POS] - '0'; int tmp_lun = name[HDIMG_LUN_POS] - '0';
if(tmp_lun > -1 && tmp_lun < 2) { if(tmp_lun != 0) {
lun = tmp_lun; // If valid id, set it, else use default LOG_FILE.println("!! Only 0 is supported for LUN, forcing to 0 !!");
LOG_FILE.sync();
} }
} }
int blk1, blk2, blk3, blk4 = 0; int blk1, blk2, blk3, blk4 = 0;
@ -527,8 +530,8 @@ void setup()
} }
} }
} }
if(usedDefaultId > 0) { if(usedDefaultId > 1) {
LOG_FILE.println("!! More than one image did not specify a SCSI ID. Last file will be used at ID 1. !!"); LOG_FILE.println("!! More than one image did not specify a SCSI ID. Last file will be used at ID 1 !!");
LOG_FILE.sync(); LOG_FILE.sync();
} }
root.close(); root.close();