Fix logging (should always be two hex digits for both Sense Key and ASC

This commit is contained in:
Uwe Seimet 2023-10-25 17:06:31 +02:00
parent fa55c9e217
commit 2be845e4aa

View File

@ -411,8 +411,8 @@ void ScsiController::Error(sense_key sense_key, asc asc, status status)
if (sense_key != sense_key::no_sense || asc != asc::no_additional_sense_information) { if (sense_key != sense_key::no_sense || asc != asc::no_additional_sense_information) {
stringstream s; stringstream s;
s << setfill('0') << setw(2) << hex << "Error status: Sense Key $" << static_cast<int>(sense_key) s << setfill('0') << hex << "Error status: Sense Key $" << setw(2) << static_cast<int>(sense_key)
<< ", ASC $" << static_cast<int>(asc); << ", ASC $" << setw(2) << static_cast<int>(asc);
LogDebug(s.str()); LogDebug(s.str());
// Set Sense Key and ASC for a subsequent REQUEST SENSE // Set Sense Key and ASC for a subsequent REQUEST SENSE
@ -422,8 +422,6 @@ void ScsiController::Error(sense_key sense_key, asc asc, status status)
SetStatus(status); SetStatus(status);
SetMessage(0x00); SetMessage(0x00);
LogTrace("Error (to status phase)");
Status(); Status();
} }
@ -478,24 +476,19 @@ void ScsiController::Send()
case phase_t::msgin: case phase_t::msgin:
// Completed sending response to extended message of IDENTIFY message // Completed sending response to extended message of IDENTIFY message
if (scsi.atnmsg) { if (scsi.atnmsg) {
// flag off
scsi.atnmsg = false; scsi.atnmsg = false;
// command phase
Command(); Command();
} else { } else {
// Bus free phase
BusFree(); BusFree();
} }
break; break;
case phase_t::datain: case phase_t::datain:
// status phase
Status(); Status();
break; break;
case phase_t::status: case phase_t::status:
// Message in phase
SetLength(1); SetLength(1);
SetBlocks(1); SetBlocks(1);
GetBuffer()[0] = (uint8_t)GetMessage(); GetBuffer()[0] = (uint8_t)GetMessage();