Pārlūkot izejas kodu

Merge pull request #140 from mynameistroy/troy/icd

Support for Atari ST ICD commands
Eric Helgeson 3 gadi atpakaļ
vecāks
revīzija
2bd79bb487
2 mainītis faili ar 10 papildinājumiem un 1 dzēšanām
  1. 9 1
      src/BlueSCSI.cpp
  2. 1 0
      src/scsi_cmds.h

+ 9 - 1
src/BlueSCSI.cpp

@@ -1589,8 +1589,16 @@ void loop()
   // Bus settle delay 400ns. The following code was measured at 20ns before REQ asserted. Added another 380ns. STM32F103.
   asm("nop;nop;nop;nop;nop;nop;nop;nop");// This asm causes some code reodering, which adds 270ns, plus 8 nop cycles for an additional 110ns. STM32F103
   int len;
-  byte cmd[12];
+  byte cmd[20];
+
   cmd[0] = readHandshake();
+  // Atari ST ICD extension support
+  // It sends a 0x1F as a indicator there is a 
+  // proper full size SCSI command byte to follow
+  // so just read it and re-read it again to get the
+  // real command byte
+  if(cmd[0] == SCSI_ICD_EXTENDED_CMD) { cmd[0] = readHandshake(); }
+
   LOGHEX(cmd[0]);
   // Command length selection, reception
   static const int cmd_class_len[8]={6,10,10,6,6,12,6,6};

+ 1 - 0
src/scsi_cmds.h

@@ -21,6 +21,7 @@
 #define SCSI_RECV_DIAG_RESULTS      0x1C
 #define SCSI_SEND_DIAG              0x1D
 #define SCSI_PREVENT_ALLOW_REMOVAL  0x1E
+#define SCSI_ICD_EXTENDED_CMD       0x1F
 #define SCSI_READ_CAPACITY          0x25
 #define SCSI_READ10                 0x28
 #define SCSI_WRITE10                0x2A