Replaced TargetIoPortsUpdated event with RegistersWrittenToTarget event
This commit is contained in:
@@ -75,7 +75,6 @@ void Insight::startup() {
|
||||
this->connect(this->insightWorker, &InsightWorker::targetControllerResumed, this->mainWindow, &InsightWindow::onTargetControllerResumed);
|
||||
this->connect(this->insightWorker, &InsightWorker::targetStateUpdated, this->mainWindow, &InsightWindow::onTargetStateUpdate);
|
||||
this->connect(this->insightWorker, &InsightWorker::targetProgramCounterUpdated, this->mainWindow, &InsightWindow::onTargetProgramCounterUpdate);
|
||||
this->connect(this->insightWorker, &InsightWorker::targetIoPortsUpdated, this->mainWindow, &InsightWindow::onTargetIoPortsUpdate);
|
||||
this->connect(this->mainWindow, &InsightWindow::refreshTargetPinStates, this->insightWorker, &InsightWorker::requestPinStates);
|
||||
|
||||
this->mainWindow->setInsightConfig(this->insightConfig);
|
||||
|
||||
@@ -28,10 +28,6 @@ void InsightWorker::startup() {
|
||||
std::bind(&InsightWorker::onTargetResumedEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventListener->registerCallbackForEventType<Events::TargetIoPortsUpdated>(
|
||||
std::bind(&InsightWorker::onTargetIoPortsUpdatedEvent, this, std::placeholders::_1)
|
||||
);
|
||||
|
||||
this->eventListener->registerCallbackForEventType<Events::RegistersWrittenToTarget>(
|
||||
std::bind(&InsightWorker::onTargetRegistersWrittenEvent, this, std::placeholders::_1)
|
||||
);
|
||||
@@ -117,10 +113,6 @@ void InsightWorker::onTargetResumedEvent(const Events::TargetExecutionResumed& e
|
||||
emit this->targetStateUpdated(TargetState::RUNNING);
|
||||
}
|
||||
|
||||
void InsightWorker::onTargetIoPortsUpdatedEvent(const Events::TargetIoPortsUpdated& event) {
|
||||
emit this->targetIoPortsUpdated();
|
||||
}
|
||||
|
||||
void InsightWorker::onTargetRegistersWrittenEvent(const Events::RegistersWrittenToTarget& event) {
|
||||
emit this->targetRegistersWritten(event.registers);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ namespace Bloom
|
||||
|
||||
void onTargetStoppedEvent(const Events::TargetExecutionStopped& event);
|
||||
void onTargetResumedEvent(const Events::TargetExecutionResumed& event);
|
||||
void onTargetIoPortsUpdatedEvent(const Events::TargetIoPortsUpdated& event);
|
||||
void onTargetRegistersWrittenEvent(const Events::RegistersWrittenToTarget& event);
|
||||
void onTargetControllerStateReportedEvent(const Events::TargetControllerStateReported& event);
|
||||
|
||||
@@ -63,7 +62,6 @@ namespace Bloom
|
||||
void taskQueued();
|
||||
void targetStateUpdated(Bloom::Targets::TargetState newState);
|
||||
void targetProgramCounterUpdated(quint32 programCounter);
|
||||
void targetIoPortsUpdated();
|
||||
void targetControllerSuspended();
|
||||
void targetControllerResumed(const Bloom::Targets::TargetDescriptor& targetDescriptor);
|
||||
void targetRegistersWritten(const Bloom::Targets::TargetRegisters& targetRegisters);
|
||||
|
||||
@@ -482,12 +482,6 @@ void InsightWindow::onTargetProgramCounterUpdate(quint32 programCounter) {
|
||||
);
|
||||
}
|
||||
|
||||
void InsightWindow::onTargetIoPortsUpdate() {
|
||||
if (this->targetState == TargetState::STOPPED && this->selectedVariant != nullptr) {
|
||||
emit this->refreshTargetPinStates(this->selectedVariant->id);
|
||||
}
|
||||
}
|
||||
|
||||
void InsightWindow::toggleTargetRegistersPane() {
|
||||
if (this->targetRegistersSidePane->activated) {
|
||||
this->targetRegistersSidePane->deactivate();
|
||||
|
||||
@@ -90,7 +90,6 @@ namespace Bloom
|
||||
void onTargetControllerResumed(const Bloom::Targets::TargetDescriptor& targetDescriptor);
|
||||
void onTargetStateUpdate(Targets::TargetState newState);
|
||||
void onTargetProgramCounterUpdate(quint32 programCounter);
|
||||
void onTargetIoPortsUpdate();
|
||||
void close();
|
||||
void openReportIssuesUrl();
|
||||
void openGettingStartedUrl();
|
||||
|
||||
@@ -23,13 +23,9 @@ TargetPackageWidget::TargetPackageWidget(
|
||||
|
||||
this->connect(
|
||||
&(this->insightWorker),
|
||||
&InsightWorker::targetIoPortsUpdated,
|
||||
&InsightWorker::targetRegistersWritten,
|
||||
this,
|
||||
[this] {
|
||||
if (this->targetState == TargetState::STOPPED) {
|
||||
this->refreshPinStates();
|
||||
}
|
||||
}
|
||||
&TargetPackageWidget::onRegistersWritten
|
||||
);
|
||||
|
||||
this->setDisabled(true);
|
||||
@@ -81,3 +77,17 @@ void TargetPackageWidget::onTargetStateChanged(TargetState newState) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void TargetPackageWidget::onRegistersWritten(Targets::TargetRegisters targetRegisters) {
|
||||
if (this->targetState != TargetState::STOPPED) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If a PORT register was just updated, refresh pin states.
|
||||
for (const auto& targetRegister : targetRegisters) {
|
||||
if (targetRegister.descriptor.type == Targets::TargetRegisterType::PORT_REGISTER) {
|
||||
this->refreshPinStates();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Bloom::Widgets::InsightTargetWidgets
|
||||
protected slots:
|
||||
virtual void updatePinStates(const Targets::TargetPinStateMappingType& pinStatesByNumber);
|
||||
void onTargetStateChanged(Targets::TargetState newState);
|
||||
void onRegistersWritten(Targets::TargetRegisters targetRegisters);
|
||||
|
||||
public:
|
||||
TargetPackageWidget(Targets::TargetVariant targetVariant, InsightWorker& insightWorker, QWidget* parent);
|
||||
|
||||
Reference in New Issue
Block a user