avoid unnecessary waits when there is no signal
This commit is contained in:
@@ -362,6 +362,9 @@ void BusHandler::clear() {
|
||||
}
|
||||
|
||||
result_t BusHandler::sendAndWait(const MasterSymbolString& master, SlaveSymbolString* slave) {
|
||||
if (m_state == bs_noSignal) {
|
||||
return RESULT_ERR_NO_SIGNAL; // don't wait when there is no signal
|
||||
}
|
||||
result_t result = RESULT_ERR_NO_SIGNAL;
|
||||
slave->clear();
|
||||
ActiveBusRequest request(master, slave);
|
||||
|
||||
@@ -299,7 +299,7 @@ void MainLoop::run() {
|
||||
reload = false;
|
||||
}
|
||||
}
|
||||
if (!loadDelay) {
|
||||
if (!loadDelay && m_busHandler->hasSignal()) {
|
||||
lastScanAddress = m_busHandler->getNextScanAddress(lastScanAddress, scanCompleted >= SCAN_REPEAT_COUNT);
|
||||
if (lastScanAddress == SYN) {
|
||||
taskDelay = 5;
|
||||
@@ -1825,6 +1825,9 @@ result_t MainLoop::executeScan(const vector<string>& args, const string& levels,
|
||||
return RESULT_OK;
|
||||
}
|
||||
|
||||
if (!m_busHandler->hasSignal()) {
|
||||
return RESULT_ERR_NO_SIGNAL;
|
||||
}
|
||||
result_t result;
|
||||
symbol_t dstAddress = (symbol_t)parseInt(args[1].c_str(), 16, 0, 0xff, &result);
|
||||
if (result == RESULT_OK && !isValidAddress(dstAddress, false)) {
|
||||
|
||||
Reference in New Issue
Block a user