cancel running request on arbitration error

This commit is contained in:
John-Michael Baier
2020-11-01 16:10:48 +01:00
parent 0092320c0f
commit db8fc965df
+11 -1
View File
@@ -647,7 +647,17 @@ result_t BusHandler::handleSymbol() {
case as_running:
break;
case as_error:
logError(lf_bus, "arbitration start error"); // TODO cancel all requests?
logError(lf_bus, "arbitration start error");
// cancel request
if (!m_currentRequest) {
BusRequest *startRequest = m_nextRequests.peek();
if (startRequest && m_nextRequests.remove(startRequest)) {
m_currentRequest = startRequest;
}
}
if (m_currentRequest) {
setState(m_state, RESULT_ERR_BUS_LOST);
}
break;
default: // only as_none
break;