Removed obsolete GP register extraction function from AVR8 EDBG driver

This commit is contained in:
Nav
2021-08-31 19:40:30 +01:00
parent 21f89df9ad
commit 9ac2b2617b
2 changed files with 0 additions and 45 deletions

View File

@@ -718,37 +718,6 @@ void EdbgAvr8Interface::detach() {
this->targetAttached = false;
}
TargetRegisters EdbgAvr8Interface::readGeneralPurposeRegisters(const TargetRegisterDescriptors& descriptors) {
auto output = TargetRegisters();
auto gpRegisterStartAddress = this->targetParameters.gpRegisterStartAddress.value_or(0x00);
auto registers = this->readMemory(
this->configVariant == Avr8ConfigVariant::XMEGA || this->configVariant == Avr8ConfigVariant::UPDI
? Avr8MemoryType::REGISTER_FILE : Avr8MemoryType::SRAM,
gpRegisterStartAddress,
this->targetParameters.gpRegisterSize.value_or(32)
);
for (const auto& descriptor : descriptors) {
assert(descriptor.type == TargetRegisterType::GENERAL_PURPOSE_REGISTER);
/*
* All 32 single-byte AVR8 GP registers will be sorted from R0 to R31, so registers[0] == R0,
* registers[5] == R5, registers[31] == R31, etc.
*
* We use the register address to calculate the index.
*/
auto registerIndex = static_cast<std::uint8_t>(descriptor.startAddress.value() - gpRegisterStartAddress);
if (registerIndex > (registers.size() - 1)) {
throw Exception("Invalid register index deduced from register start address");
}
output.emplace_back(TargetRegister(descriptor,{registers[registerIndex]}));
}
return output;
}
void EdbgAvr8Interface::activate() {
if (!this->physicalInterfaceActivated) {
this->activatePhysical();

View File

@@ -442,20 +442,6 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
*/
void waitForStoppedEvent();
/**
* Reads the requested general purpose registers.
*
* When reading numerous GP registers, this function should be used as it reads all 32 registers in a single
* call and then returns what's needed. This is much faster than reading each individual GP register.
*
* readRegisters() will use this when there are numerous GP registers to read.
*
* @param descriptors
* A collection of GP register descriptors to read. *Do not include non GP register descriptors.*
* @return
*/
Targets::TargetRegisters readGeneralPurposeRegisters(const Targets::TargetRegisterDescriptors& descriptors);
public:
explicit EdbgAvr8Interface(EdbgInterface& edbgInterface)
: edbgInterface(edbgInterface) {};