From 9ac2b2617bf979b2aab31500e4f50e04d38eee5f Mon Sep 17 00:00:00 2001 From: Nav Date: Tue, 31 Aug 2021 19:40:30 +0100 Subject: [PATCH] Removed obsolete GP register extraction function from AVR8 EDBG driver --- .../EDBG/AVR/EdbgAvr8Interface.cpp | 31 ------------------- .../EDBG/AVR/EdbgAvr8Interface.hpp | 14 --------- 2 files changed, 45 deletions(-) diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp index 3e300aac..bcd609c5 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp @@ -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(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(); diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp index be63baa6..b42c3a62 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp @@ -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) {};