From c5447a40986f6287062159bea5ec643c2a10bac5 Mon Sep 17 00:00:00 2001 From: Eric Helgeson Date: Tue, 19 Apr 2022 20:44:49 -0500 Subject: [PATCH] Add back LUN filename parsing --- src/BlueSCSI.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/BlueSCSI.cpp b/src/BlueSCSI.cpp index e36c81c..2ba2740 100644 --- a/src/BlueSCSI.cpp +++ b/src/BlueSCSI.cpp @@ -620,6 +620,18 @@ void findDriveImages(FsFile root) { } } + if(file_name_length > 3) { // HDN[N] + int tmp_lun = name[HDIMG_LUN_POS] - '0'; + + // If valid lun, set it, else use default + if(tmp_lun == 0 || tmp_lun == 1) { + lun = tmp_lun; + } else { + LOG_FILE.print(name); + LOG_FILE.println(" - bad SCSI LUN in filename, Using default LUN ID 0"); + } + } + int blk1 = 0, blk2, blk3, blk4 = 0; if(file_name_length > 8) { // HD00_[111] blk1 = name[HDIMG_BLK_POS] - '0';