diff --git a/src/BlueSCSI.cpp b/src/BlueSCSI.cpp index 0773101..482b13a 100644 --- a/src/BlueSCSI.cpp +++ b/src/BlueSCSI.cpp @@ -1180,8 +1180,7 @@ void loop() LOGHEX(cmd[0]); // Command length selection, reception - static const int cmd_class_len[8]={6,10,10,6,6,12,6,6}; - len = cmd_class_len[cmd[0] >> 5]; + len = cdb_len_lookup[cmd[0]]; cmd[1] = readHandshake(); LOG(":");LOGHEX(cmd[1]); cmd[2] = readHandshake(); LOG(":");LOGHEX(cmd[2]); cmd[3] = readHandshake(); LOG(":");LOGHEX(cmd[3]); diff --git a/src/BlueSCSI.h b/src/BlueSCSI.h index 3e6c7bb..1d6eaff 100644 --- a/src/BlueSCSI.h +++ b/src/BlueSCSI.h @@ -325,5 +325,19 @@ typedef __attribute__((aligned(4))) struct _SCSI_DEVICE uint8_t m_sector_offset; // optical sector offset for missing sync header } SCSI_DEVICE; +static byte cdb_len_lookup[] = { + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, + 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, + 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, + 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, + 10,10,10,10,10,10,10,10,10,10,10,10,10,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,10,10,10,10,10,10,10, + 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, + 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, + 10,10,10,10,10,10,10,10,10,10,10,10,10,10 +}; -#endif \ No newline at end of file +#endif