Skip to content

Commit

Permalink
Reorder bus phase change and file.seek() so that file.seek() acts as …
Browse files Browse the repository at this point in the history
…a bus settle delay.
  • Loading branch information
mactcp authored and androda committed Apr 7, 2022
1 parent 0a12c2c commit 916e0e6
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions F4_BlueSCSI/F4_BlueSCSI.ino
Original file line number Diff line number Diff line change
Expand Up @@ -922,12 +922,13 @@ void writeDataLoop(uint32_t blocksize)
void writeDataPhaseSD(uint32_t adds, uint32_t len)
{
LOGN("DATAIN PHASE(SD)");
uint32_t pos = adds * m_img->m_blocksize;
m_img->m_file.seek(pos);

SCSI_OUT(vMSG,inactive) // gpio_write(MSG, low);
SCSI_OUT(vCD ,inactive) // gpio_write(CD, low);
SCSI_OUT(vIO , active) // gpio_write(IO, high);
//Bus settle delay 400ns, file.seek() measured at over 1000ns.

uint32_t pos = adds * m_img->m_blocksize;
m_img->m_file.seek(pos);

SCSI_DB_OUTPUT()
for(uint32_t i = 0; i < len; i++) {
Expand Down Expand Up @@ -1011,11 +1012,13 @@ void readDataLoop(uint32_t blockSize)
void readDataPhaseSD(uint32_t adds, uint32_t len)
{
LOGN("DATAOUT PHASE(SD)");
uint32_t pos = adds * m_img->m_blocksize;
m_img->m_file.seek(pos);
SCSI_OUT(vMSG,inactive) // gpio_write(MSG, low);
SCSI_OUT(vCD ,inactive) // gpio_write(CD, low);
SCSI_OUT(vIO ,inactive) // gpio_write(IO, low);
//Bus settle delay 400ns, file.seek() measured at over 1000ns.

uint32_t pos = adds * m_img->m_blocksize;
m_img->m_file.seek(pos);
for(uint32_t i = 0; i < len; i++) {
m_resetJmp = true;
#if WRITE_SPEED_OPTIMIZE
Expand Down Expand Up @@ -1043,11 +1046,13 @@ void readDataPhaseSD(uint32_t adds, uint32_t len)
void verifyDataPhaseSD(uint32_t adds, uint32_t len)
{
LOGN("DATAOUT PHASE(SD)");
uint32_t pos = adds * m_img->m_blocksize;
m_img->m_file.seek(pos);
SCSI_OUT(vMSG,inactive) // gpio_write(MSG, low);
SCSI_OUT(vCD ,inactive) // gpio_write(CD, low);
SCSI_OUT(vIO ,inactive) // gpio_write(IO, low);
//Bus settle delay 400ns, file.seek() measured at over 1000ns.

uint32_t pos = adds * m_img->m_blocksize;
m_img->m_file.seek(pos);
for(uint32_t i = 0; i < len; i++) {
#if WRITE_SPEED_OPTIMIZE
readDataLoop(m_img->m_blocksize);
Expand Down

0 comments on commit 916e0e6

Please sign in to comment.