Added postActivate() to the target interface, for outputting any target specific info after activation.
Removed the logging of the generic target ID from the TargetController
This commit is contained in:
@@ -518,8 +518,9 @@ namespace TargetController
|
||||
this->target->activate();
|
||||
Logger::info("Target activated");
|
||||
|
||||
this->target->postActivate();
|
||||
|
||||
Logger::info("Target name: " + this->targetDescriptor->name);
|
||||
Logger::info("Target ID: " + this->targetDescriptor->marketId);
|
||||
|
||||
this->targetState = std::make_unique<TargetState>(
|
||||
TargetExecutionState::UNKNOWN,
|
||||
|
||||
@@ -253,6 +253,10 @@ namespace Targets::Microchip::Avr8
|
||||
}
|
||||
}
|
||||
|
||||
void Avr8::postActivate() {
|
||||
Logger::info("AVR signature: " + this->avr8DebugInterface->getDeviceId().toHex());
|
||||
}
|
||||
|
||||
TargetDescriptor Avr8::targetDescriptor() {
|
||||
auto descriptor = TargetDescriptor{
|
||||
this->targetDescriptionFile.getName(),
|
||||
|
||||
@@ -53,6 +53,8 @@ namespace Targets::Microchip::Avr8
|
||||
void activate() override;
|
||||
void deactivate() override;
|
||||
|
||||
void postActivate() override;
|
||||
|
||||
TargetDescriptor targetDescriptor() override;
|
||||
|
||||
void run(std::optional<TargetMemoryAddress> toAddress) override;
|
||||
|
||||
@@ -77,6 +77,10 @@ namespace Targets::RiscV
|
||||
this->riscVDebugInterface->deactivate();
|
||||
}
|
||||
|
||||
void RiscV::postActivate() {
|
||||
Logger::info("WCH target ID: " + this->riscVIdInterface->getDeviceId());
|
||||
}
|
||||
|
||||
TargetDescriptor RiscV::targetDescriptor() {
|
||||
auto descriptor = TargetDescriptor{
|
||||
this->targetDescriptionFile.getName(),
|
||||
|
||||
@@ -34,6 +34,8 @@ namespace Targets::RiscV
|
||||
void activate() override;
|
||||
void deactivate() override;
|
||||
|
||||
void postActivate() override;
|
||||
|
||||
TargetDescriptor targetDescriptor() override;
|
||||
|
||||
void run(std::optional<TargetMemoryAddress> toAddress = std::nullopt) override;
|
||||
|
||||
@@ -78,6 +78,13 @@ namespace Targets
|
||||
*/
|
||||
virtual void deactivate() = 0;
|
||||
|
||||
/**
|
||||
* This function is called immediately after successful target activation.
|
||||
*
|
||||
* It's a good place to log any info that we can extract from the target, that will be useful to the user.
|
||||
*/
|
||||
virtual void postActivate() = 0;
|
||||
|
||||
/**
|
||||
* Should generate a TargetDescriptor for the current target.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user