mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-22 01:31:25 +00:00
* Fix MESSAGE OUT handling * Update logging * Add assertion
This commit is contained in:
parent
a6136c7f4a
commit
0ab2f20a00
@ -38,11 +38,10 @@ bool GPIOBUS::Init(mode_e mode)
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
int GPIOBUS::CommandHandShake(vector<uint8_t> &buf)
|
int GPIOBUS::CommandHandShake(vector<uint8_t> &buf)
|
||||||
{
|
{
|
||||||
GPIO_FUNCTION_TRACE
|
|
||||||
// Only works in TARGET mode
|
// Only works in TARGET mode
|
||||||
if (actmode != mode_e::TARGET) {
|
assert(actmode == mode_e::TARGET);
|
||||||
return 0;
|
|
||||||
}
|
GPIO_FUNCTION_TRACE
|
||||||
|
|
||||||
DisableIRQ();
|
DisableIRQ();
|
||||||
|
|
||||||
@ -321,12 +320,6 @@ int GPIOBUS::SendHandShake(uint8_t *buf, int count, int delay_after_bytes)
|
|||||||
phase_t phase = GetPhase();
|
phase_t phase = GetPhase();
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
if (i == delay_after_bytes) {
|
|
||||||
spdlog::trace("DELAYING for " + to_string(SCSI_DELAY_SEND_DATA_DAYNAPORT_US) + " after " +
|
|
||||||
to_string(delay_after_bytes) + " bytes");
|
|
||||||
SysTimer::SleepUsec(SCSI_DELAY_SEND_DATA_DAYNAPORT_US);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the DATA signals
|
// Set the DATA signals
|
||||||
SetDAT(*buf);
|
SetDAT(*buf);
|
||||||
|
|
||||||
@ -338,6 +331,11 @@ int GPIOBUS::SendHandShake(uint8_t *buf, int count, int delay_after_bytes)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Signal the last MESSAGE OUT byte
|
||||||
|
if (phase == phase_t::msgout && i == count - 1) {
|
||||||
|
SetATN(false);
|
||||||
|
}
|
||||||
|
|
||||||
// Phase error
|
// Phase error
|
||||||
Acquire();
|
Acquire();
|
||||||
if (GetPhase() != phase) {
|
if (GetPhase() != phase) {
|
||||||
@ -389,7 +387,6 @@ bool GPIOBUS::PollSelectEvent()
|
|||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
GPIO_FUNCTION_TRACE
|
GPIO_FUNCTION_TRACE
|
||||||
spdlog::trace(__PRETTY_FUNCTION__);
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
|
||||||
if (epoll_event epev; epoll_wait(epfd, &epev, 1, -1) <= 0) {
|
if (epoll_event epev; epoll_wait(epfd, &epev, 1, -1) <= 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user