mirror of
https://github.com/erichelgeson/BlueSCSI.git
synced 2025-01-10 17:30:25 +00:00
Remove unused settings as we always use the OPTIMISEd ones
This commit is contained in:
parent
c5447a4098
commit
8a27bcc585
@ -50,9 +50,6 @@
|
|||||||
// 1: Debug information output to USB Serial
|
// 1: Debug information output to USB Serial
|
||||||
// 2: Debug information output to LOG.txt (slow)
|
// 2: Debug information output to LOG.txt (slow)
|
||||||
|
|
||||||
#define READ_SPEED_OPTIMIZE 1 // Faster reads
|
|
||||||
#define WRITE_SPEED_OPTIMIZE 1 // Speeding up writes
|
|
||||||
|
|
||||||
// SCSI config
|
// SCSI config
|
||||||
#define NUM_SCSIID 7 // Maximum number of supported SCSI-IDs (The minimum is 0)
|
#define NUM_SCSIID 7 // Maximum number of supported SCSI-IDs (The minimum is 0)
|
||||||
#define NUM_SCSILUN 2 // Maximum number of LUNs supported (The minimum is 0)
|
#define NUM_SCSILUN 2 // Maximum number of LUNs supported (The minimum is 0)
|
||||||
@ -876,7 +873,6 @@ inline void writeHandshake(byte d)
|
|||||||
while( SCSI_IN(vACK));
|
while( SCSI_IN(vACK));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if READ_SPEED_OPTIMIZE
|
|
||||||
#pragma GCC push_options
|
#pragma GCC push_options
|
||||||
#pragma GCC optimize ("-Os")
|
#pragma GCC optimize ("-Os")
|
||||||
/*
|
/*
|
||||||
@ -938,7 +934,6 @@ void writeDataLoop(uint32_t blocksize, const byte* srcptr)
|
|||||||
WAIT_ACK_INACTIVE();
|
WAIT_ACK_INACTIVE();
|
||||||
}
|
}
|
||||||
#pragma GCC pop_options
|
#pragma GCC pop_options
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Data in phase.
|
* Data in phase.
|
||||||
@ -948,16 +943,10 @@ void writeDataPhase(int len, const byte* p)
|
|||||||
{
|
{
|
||||||
LOGN("DATAIN PHASE");
|
LOGN("DATAIN PHASE");
|
||||||
SCSI_PHASE_CHANGE(SCSI_PHASE_DATAIN);
|
SCSI_PHASE_CHANGE(SCSI_PHASE_DATAIN);
|
||||||
#if READ_SPEED_OPTIMIZE
|
|
||||||
// Bus settle delay 400ns. Following code was measured at 800ns before REQ asserted. STM32F103.
|
// Bus settle delay 400ns. Following code was measured at 800ns before REQ asserted. STM32F103.
|
||||||
SCSI_DB_OUTPUT()
|
SCSI_DB_OUTPUT()
|
||||||
writeDataLoop(len, p);
|
writeDataLoop(len, p);
|
||||||
SCSI_DB_INPUT()
|
SCSI_DB_INPUT()
|
||||||
#else
|
|
||||||
for (int i = 0; i < len; i++) {
|
|
||||||
writeHandshake(p[i]);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -980,13 +969,7 @@ void writeDataPhaseSD(uint32_t adds, uint32_t len)
|
|||||||
m_img->m_file.read(m_buf, m_img->m_blocksize);
|
m_img->m_file.read(m_buf, m_img->m_blocksize);
|
||||||
enableResetJmp();
|
enableResetJmp();
|
||||||
|
|
||||||
#if READ_SPEED_OPTIMIZE
|
|
||||||
writeDataLoop(m_img->m_blocksize, m_buf);
|
writeDataLoop(m_img->m_blocksize, m_buf);
|
||||||
#else
|
|
||||||
for(int j = 0; j < m_img->m_blocksize; j++) {
|
|
||||||
writeHandshake(m_buf[j]);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
SCSI_DB_INPUT()
|
SCSI_DB_INPUT()
|
||||||
#ifdef XCVR
|
#ifdef XCVR
|
||||||
@ -994,7 +977,6 @@ void writeDataPhaseSD(uint32_t adds, uint32_t len)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if WRITE_SPEED_OPTIMIZE
|
|
||||||
#pragma GCC push_options
|
#pragma GCC push_options
|
||||||
#pragma GCC optimize ("-Os")
|
#pragma GCC optimize ("-Os")
|
||||||
|
|
||||||
@ -1036,7 +1018,6 @@ void readDataLoop(uint32_t blockSize, byte* dstptr)
|
|||||||
WAIT_ACK_INACTIVE();
|
WAIT_ACK_INACTIVE();
|
||||||
}
|
}
|
||||||
#pragma GCC pop_options
|
#pragma GCC pop_options
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Data out phase.
|
* Data out phase.
|
||||||
@ -1047,12 +1028,7 @@ void readDataPhase(int len, byte* p)
|
|||||||
LOGN("DATAOUT PHASE");
|
LOGN("DATAOUT PHASE");
|
||||||
SCSI_PHASE_CHANGE(SCSI_PHASE_DATAOUT);
|
SCSI_PHASE_CHANGE(SCSI_PHASE_DATAOUT);
|
||||||
// Bus settle delay 400ns. The following code was measured at 450ns before REQ asserted. STM32F103.
|
// Bus settle delay 400ns. The following code was measured at 450ns before REQ asserted. STM32F103.
|
||||||
#if WRITE_SPEED_OPTIMIZE
|
|
||||||
readDataLoop(len, p);
|
readDataLoop(len, p);
|
||||||
#else
|
|
||||||
for(uint32_t i = 0; i < len; i++)
|
|
||||||
p[i] = readHandshake();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1069,13 +1045,7 @@ void readDataPhaseSD(uint32_t adds, uint32_t len)
|
|||||||
m_img->m_file.seekSet(pos);
|
m_img->m_file.seekSet(pos);
|
||||||
for(uint32_t i = 0; i < len; i++) {
|
for(uint32_t i = 0; i < len; i++) {
|
||||||
m_resetJmp = true;
|
m_resetJmp = true;
|
||||||
#if WRITE_SPEED_OPTIMIZE
|
|
||||||
readDataLoop(m_img->m_blocksize, m_buf);
|
readDataLoop(m_img->m_blocksize, m_buf);
|
||||||
#else
|
|
||||||
for(int j = 0; j < m_img->m_blocksize; j++) {
|
|
||||||
m_buf[j] = readHandshake();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
m_resetJmp = false;
|
m_resetJmp = false;
|
||||||
m_img->m_file.write(m_buf, m_img->m_blocksize);
|
m_img->m_file.write(m_buf, m_img->m_blocksize);
|
||||||
// If a reset happened while writing, break and let the flush happen before it is handled.
|
// If a reset happened while writing, break and let the flush happen before it is handled.
|
||||||
@ -1100,13 +1070,7 @@ void verifyDataPhaseSD(uint32_t adds, uint32_t len)
|
|||||||
uint64_t pos = (uint64_t)adds * m_img->m_blocksize;
|
uint64_t pos = (uint64_t)adds * m_img->m_blocksize;
|
||||||
m_img->m_file.seekSet(pos);
|
m_img->m_file.seekSet(pos);
|
||||||
for(uint32_t i = 0; i < len; i++) {
|
for(uint32_t i = 0; i < len; i++) {
|
||||||
#if WRITE_SPEED_OPTIMIZE
|
|
||||||
readDataLoop(m_img->m_blocksize, m_buf);
|
readDataLoop(m_img->m_blocksize, m_buf);
|
||||||
#else
|
|
||||||
for(int j = 0; j < m_img->m_blocksize; j++) {
|
|
||||||
m_buf[j] = readHandshake();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
// This has just gone through the transfer to make things work, a compare would go here.
|
// This has just gone through the transfer to make things work, a compare would go here.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user