Fixed bug with Insight GUI failing to properly process the TargetExecutionResumed event
This commit is contained in:
@@ -72,6 +72,10 @@ namespace Bloom
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InsightWorker::onTargetStoppedEvent(const Events::TargetExecutionStopped& event) {
|
void InsightWorker::onTargetStoppedEvent(const Events::TargetExecutionStopped& event) {
|
||||||
|
if (this->lastTargetState == TargetState::STOPPED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When we report a target halt to Insight, Insight will immediately seek more data from the target (such as
|
* When we report a target halt to Insight, Insight will immediately seek more data from the target (such as
|
||||||
* GPIO pin states). This can be problematic for cases where the target had halted due to a conditional
|
* GPIO pin states). This can be problematic for cases where the target had halted due to a conditional
|
||||||
@@ -99,17 +103,20 @@ namespace Bloom
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!resumedEvent.has_value()) {
|
if (!resumedEvent.has_value()) {
|
||||||
|
this->lastTargetState = TargetState::STOPPED;
|
||||||
emit this->targetStateUpdated(TargetState::STOPPED);
|
emit this->targetStateUpdated(TargetState::STOPPED);
|
||||||
emit this->targetProgramCounterUpdated(event.programCounter);
|
emit this->targetProgramCounterUpdated(event.programCounter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InsightWorker::onTargetResumedEvent(const Events::TargetExecutionResumed& event) {
|
void InsightWorker::onTargetResumedEvent(const Events::TargetExecutionResumed& event) {
|
||||||
|
this->lastTargetState = TargetState::RUNNING;
|
||||||
emit this->targetStateUpdated(TargetState::RUNNING);
|
emit this->targetStateUpdated(TargetState::RUNNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InsightWorker::onTargetResetEvent(const Events::TargetReset& event) {
|
void InsightWorker::onTargetResetEvent(const Events::TargetReset& event) {
|
||||||
// TODO: Pull PC from target. This will be done as part of the TC refactor (https://github.com/navnavnav/Bloom/issues/25)
|
// TODO: Pull PC from target. This will be done as part of the TC refactor (https://github.com/navnavnav/Bloom/issues/25)
|
||||||
|
this->lastTargetState = TargetState::STOPPED;
|
||||||
emit this->targetStateUpdated(TargetState::STOPPED);
|
emit this->targetStateUpdated(TargetState::STOPPED);
|
||||||
emit this->targetProgramCounterUpdated(0);
|
emit this->targetProgramCounterUpdated(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ namespace Bloom
|
|||||||
TargetController::TargetControllerState lastTargetControllerState =
|
TargetController::TargetControllerState lastTargetControllerState =
|
||||||
TargetController::TargetControllerState::ACTIVE;
|
TargetController::TargetControllerState::ACTIVE;
|
||||||
|
|
||||||
|
Targets::TargetState lastTargetState = Targets::TargetState::UNKNOWN;
|
||||||
|
|
||||||
QTimer* eventDispatchTimer = nullptr;
|
QTimer* eventDispatchTimer = nullptr;
|
||||||
|
|
||||||
SyncSafe<std::queue<InsightWorkerTask*>> queuedTasks;
|
SyncSafe<std::queue<InsightWorkerTask*>> queuedTasks;
|
||||||
|
|||||||
Reference in New Issue
Block a user