Removed obsolete GP register extraction function from AVR8 EDBG driver
This commit is contained in:
@@ -718,37 +718,6 @@ void EdbgAvr8Interface::detach() {
|
|||||||
this->targetAttached = false;
|
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() {
|
void EdbgAvr8Interface::activate() {
|
||||||
if (!this->physicalInterfaceActivated) {
|
if (!this->physicalInterfaceActivated) {
|
||||||
this->activatePhysical();
|
this->activatePhysical();
|
||||||
|
|||||||
@@ -442,20 +442,6 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
|
|||||||
*/
|
*/
|
||||||
void waitForStoppedEvent();
|
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:
|
public:
|
||||||
explicit EdbgAvr8Interface(EdbgInterface& edbgInterface)
|
explicit EdbgAvr8Interface(EdbgInterface& edbgInterface)
|
||||||
: edbgInterface(edbgInterface) {};
|
: edbgInterface(edbgInterface) {};
|
||||||
|
|||||||
Reference in New Issue
Block a user