Move TRANSCEIVER_IO_SET out of writeDataLoop.

Add matching TRANSCEIVER_IO_SET(vTR_DBP,TR_INPUT) to writeDataPhase() and writeDataPhaseSD()
This commit is contained in:
Glenn Anderson 2022-06-01 12:44:05 -07:00
parent 2338d8f153
commit 8167ddea6c

View File

@ -920,9 +920,6 @@ void writeDataLoop(uint32_t blocksize, const byte* srcptr)
// Start the first bus cycle.
FETCH_BSRR_DB();
REQ_OFF_DB_SET(bsrr_val);
#ifdef XCVR
TRANSCEIVER_IO_SET(vTR_DBP,TR_OUTPUT)
#endif
REQ_ON();
FETCH_BSRR_DB();
WAIT_ACK_ACTIVE();
@ -959,9 +956,15 @@ void writeDataPhase(int len, const byte* p)
LOGN("DATAIN PHASE");
SCSI_PHASE_CHANGE(SCSI_PHASE_DATAIN);
// Bus settle delay 400ns. Following code was measured at 800ns before REQ asserted. STM32F103.
#ifdef XCVR
TRANSCEIVER_IO_SET(vTR_DBP,TR_OUTPUT)
#endif
SCSI_DB_OUTPUT()
writeDataLoop(len, p);
SCSI_DB_INPUT()
#ifdef XCVR
TRANSCEIVER_IO_SET(vTR_DBP,TR_INPUT)
#endif
}
/*
@ -977,6 +980,9 @@ void writeDataPhaseSD(uint32_t adds, uint32_t len)
uint64_t pos = (uint64_t)adds * m_img->m_blocksize;
m_img->m_file.seekSet(pos);
#ifdef XCVR
TRANSCEIVER_IO_SET(vTR_DBP,TR_OUTPUT)
#endif
SCSI_DB_OUTPUT()
for(uint32_t i = 0; i < len; i++) {
// Asynchronous reads will make it faster ...