fix typographical mistakes in comments

Also, fix up some white-space issues.  No functional change here.
This commit is contained in:
William Leara 2024-02-14 13:31:35 -06:00
parent e236b5b054
commit 0be37ccde0
1 changed files with 132 additions and 132 deletions

View File

@ -824,7 +824,7 @@ void onBusReset(void)
LOGN("BusReset!");
if (m_resetJmp) {
m_resetJmp = false;
// Jumping out of the interrupt handler, so need to clear the interupt source.
// Jumping out of the interrupt handler, so need to clear the interrupt source.
uint8 exti = PIN_MAP[RST].gpio_bit;
EXTI_BASE->PR = (1U << exti);
longjmpFromInterrupt(m_resetJmpBuf, 1);
@ -1250,7 +1250,7 @@ void loop()
LOG("CMD:");
SCSI_PHASE_CHANGE(SCSI_PHASE_COMMAND);
// 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
asm("nop;nop;nop;nop;nop;nop;nop;nop");// This asm causes some code reordering, which adds 270ns, plus 8 nop cycles for an additional 110ns. STM32F103
int len;
byte cmd[20];
@ -1717,7 +1717,7 @@ byte onModeSense(SCSI_DEVICE *dev, const byte *cdb)
m_buf[a + 0] = SCSI_SENSE_MODE_CACHING;
m_buf[a + 1] = 0x0A; // Page length
if(pageControl != 1) {
m_buf[a + 2] = 0x01; // Disalbe Read Cache so no one asks for Cache Stats page.
m_buf[a + 2] = 0x01; // Disable Read Cache so no one asks for Cache Stats page.
}
a += 0x0C;
if(pageCode != SCSI_SENSE_MODE_ALL) break;
@ -1937,7 +1937,7 @@ File get_file_from_index(uint8_t index)
return file_test;
}
File file; // global so we can keep it open while transfering.
File file; // global so we can keep it open while transferring.
byte onGetFile(SCSI_DEVICE *dev, const byte *cdb) {
uint8_t index = cdb[1];
uint32_t offset = ((uint32_t)cdb[2] << 24) | ((uint32_t)cdb[3] << 16) | ((uint32_t)cdb[4] << 8) | cdb[5];
@ -1965,7 +1965,7 @@ byte onGetFile(SCSI_DEVICE *dev, const byte *cdb) {
}
/*
Prepares a file for receving. The file name is null terminated in the scsi data.
Prepares a file for receiving. The file name is null terminated in the scsi data.
*/
File receveFile;
byte onSendFilePrep(SCSI_DEVICE *dev, const byte *cdb)
@ -2011,7 +2011,7 @@ byte onSendFile10(SCSI_DEVICE *dev, const byte *cdb)
// 512 byte offset of where to put these bytes.
uint32_t offset = ((uint32_t)cdb[3] << 16) | ((uint32_t)cdb[4] << 8) | cdb[5];
uint16_t buf_size = SCSI_BUF_SIZE;
// Check if last block of file, and not the only bock in file.
// Check if last block of file, and not the only block in file.
if(bytes_sent < buf_size)
{
buf_size = bytes_sent;
@ -2121,7 +2121,7 @@ byte onModeSelect(SCSI_DEVICE *dev, const byte *cdb)
*/
byte onReZeroUnit(SCSI_DEVICE *dev, const byte *cdb) {
LOGN("-ReZeroUnit");
// Make sure we have an image with atleast a first byte.
// Make sure we have an image with at least a first byte.
// Actually seeking to the position wont do anything, so dont.
return checkBlockCommand(dev, 0, 0);
}
@ -2310,44 +2310,44 @@ static byte onReadDVDStructure(SCSI_DEVICE *dev, const byte *cdb)
}
// Thanks RaSCSI :D
// LBA→MSF Conversion
// LBA→MSF Conversion
static inline void LBAtoMSF(const uint32_t lba, byte *msf)
{
uint32_t m, s, f;
uint32_t m, s, f;
// 75 and 75*60 get the remainder
m = lba / (75 * 60);
s = lba % (75 * 60);
f = s % 75;
s /= 75;
// 75 and 75*60 get the remainder
m = lba / (75 * 60);
s = lba % (75 * 60);
f = s % 75;
s /= 75;
// The base point is M=0, S=2, F=0
s += 2;
if (s >= 60) {
s -= 60;
m++;
}
// The base point is M=0, S=2, F=0
s += 2;
if (s >= 60) {
s -= 60;
m++;
}
// Store
msf[0] = 0x00;
msf[1] = (byte)m;
msf[2] = (byte)s;
msf[3] = (byte)f;
// Store
msf[0] = 0x00;
msf[1] = (byte)m;
msf[2] = (byte)s;
msf[3] = (byte)f;
}
static inline uint32_t MSFtoLBA(const byte *msf)
{
uint32_t lba;
uint32_t lba;
// 1, 75, add up in multiples of 75*60
lba = msf[1];
lba *= 60;
lba += msf[2];
lba *= 75;
lba += msf[3];
// 1, 75, add up in multiples of 75*60
lba = msf[1];
lba *= 60;
lba += msf[2];
lba *= 75;
lba += msf[3];
// Since the base point is M=0, S=2, F=0, subtract 150
lba -= 150;
// Since the base point is M=0, S=2, F=0, subtract 150
lba -= 150;
return lba;
return lba;
}