mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-21 10:33:16 +00:00
Use a standard timer for the DaynaPort delay work-around (#1357)
* Do not use the proprietary system timer for the DaynaPort delay work-around
This commit is contained in:
parent
ec9f83f9df
commit
70bcb78d24
@ -54,7 +54,7 @@ const static int SCSI_DELAY_FAST_NEGATION_PERIOD_NS = 30;
|
||||
// The DaynaPort SCSI Link do a short delay in the middle of transfering
|
||||
// a packet. This is the number of uS that will be delayed between the
|
||||
// header and the actual data.
|
||||
const static int SCSI_DELAY_SEND_DATA_DAYNAPORT_US = 100;
|
||||
const static int SCSI_DELAY_SEND_DATA_DAYNAPORT_NS = 100'000;
|
||||
|
||||
|
||||
class bus_exception : public runtime_error
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#ifdef __linux__
|
||||
#include <sys/epoll.h>
|
||||
#endif
|
||||
@ -278,9 +278,12 @@ int GPIOBUS::SendHandShake(uint8_t *buf, int count, int delay_after_bytes)
|
||||
if (actmode == mode_e::TARGET) {
|
||||
for (i = 0; i < count; i++) {
|
||||
if (i == delay_after_bytes) {
|
||||
spdlog::trace("DELAYING for " + to_string(SCSI_DELAY_SEND_DATA_DAYNAPORT_US) + " us after " +
|
||||
spdlog::trace("DELAYING for " + to_string(SCSI_DELAY_SEND_DATA_DAYNAPORT_NS) + " ns after " +
|
||||
to_string(delay_after_bytes) + " bytes");
|
||||
SysTimer::SleepUsec(SCSI_DELAY_SEND_DATA_DAYNAPORT_US);
|
||||
EnableIRQ();
|
||||
const timespec ts = { .tv_sec = 0, .tv_nsec = SCSI_DELAY_SEND_DATA_DAYNAPORT_NS};
|
||||
nanosleep(&ts, nullptr);
|
||||
DisableIRQ();
|
||||
}
|
||||
|
||||
// Set the DATA signals
|
||||
|
Loading…
Reference in New Issue
Block a user