瀏覽代碼

RP2040 Initiator mode: set initiator ID in selection phase

Petteri Aimonen 2 年之前
父節點
當前提交
cd05ad7a2c
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      lib/ZuluSCSI_platform_RP2040/scsiHostPhy.cpp

+ 6 - 3
lib/ZuluSCSI_platform_RP2040/scsiHostPhy.cpp

@@ -86,12 +86,15 @@ bool scsiHostPhySelect(int target_id)
         }
     }
 
+    // Choose initiator ID different than target ID
+    uint8_t initiator_id = (target_id == 7) ? 0 : 7;
+
     // Selection phase
     scsiLogInitiatorPhaseChange(SELECTION);
-    dbgmsg("------ SELECTING ", target_id);
+    dbgmsg("------ SELECTING ", target_id, " with initiator ID ", (int)initiator_id);
     SCSI_OUT(SEL, 1);
     delayMicroseconds(5);
-    SCSI_OUT_DATA(1 << target_id);
+    SCSI_OUT_DATA((1 << target_id) | (1 << initiator_id));
     delayMicroseconds(5);
     SCSI_OUT(BSY, 0);
 
@@ -300,4 +303,4 @@ void scsiHostPhyRelease()
     SCSI_RELEASE_OUTPUTS();
 }
 
-#endif
+#endif