Skip to content

Commit

Permalink
Revert "Remove ifdef"
Browse files Browse the repository at this point in the history
This reverts commit e663f49.
  • Loading branch information
uweseimet committed Nov 11, 2023
1 parent 33e64de commit 43bd575
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions cpp/hal/gpiobus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ int GPIOBUS::CommandHandShake(vector<uint8_t> &buf)

bool ack = WaitACK(true);

#ifdef NO_DELAY
// Wait until the signal line stabilizes
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
#endif

buf[0] = GetDAT();

SetREQ(false);
Expand All @@ -64,6 +69,11 @@ int GPIOBUS::CommandHandShake(vector<uint8_t> &buf)

ack = WaitACK(true);

#ifdef NO_DELAY
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
#endif

// Get the actual SCSI command
buf[0] = GetDAT();

SetREQ(false);
Expand Down Expand Up @@ -93,6 +103,11 @@ int GPIOBUS::CommandHandShake(vector<uint8_t> &buf)

ack = WaitACK(true);

#ifdef NO_DELAY
// Wait until the signal line stabilizes
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
#endif

buf[offset] = GetDAT();

SetREQ(false);
Expand Down Expand Up @@ -121,6 +136,11 @@ int GPIOBUS::ReceiveHandShake(uint8_t *buf, int count)

const bool ack = WaitACK(true);

#ifdef NO_DELAY
// Wait until the signal line stabilizes
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
#endif

*buf = GetDAT();

SetREQ(false);
Expand Down Expand Up @@ -148,6 +168,11 @@ int GPIOBUS::ReceiveHandShake(uint8_t *buf, int count)
break;
}

#ifdef NO_DELAY
// Wait until the signal line stabilizes
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
#endif

*buf = GetDAT();

SetACK(true);
Expand Down

0 comments on commit 43bd575

Please sign in to comment.