fix unnecessary arbitration start

This commit is contained in:
John
2022-09-24 17:57:24 +02:00
parent eb39bb7149
commit 046fbebc35
+5 -1
View File
@@ -361,7 +361,7 @@ result_t Device::recv(unsigned int timeout, symbol_t* value, ArbitrationState* a
}
return RESULT_ERR_TIMEOUT;
} while (true);
if (m_enhancedProto || *value != SYN || m_arbitrationMaster == SYN) {
if (m_enhancedProto || *value != SYN || m_arbitrationMaster == SYN || m_arbitrationCheck) {
if (m_listener != nullptr) {
m_listener->notifyDeviceData(*value, true);
}
@@ -435,7 +435,11 @@ bool Device::write(symbol_t value, bool startArbitration) {
fprintf(stdout, "raw > %2.2x\n", value);
fflush(stdout);
#endif
#ifdef SIMULATE_NON_WRITABILITY
return true;
#else
return ::write(m_fd, &value, 1) == 1;
#endif
}
bool Device::available() {