Tidying
This commit is contained in:
@@ -1546,20 +1546,22 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
|
||||
) {
|
||||
std::uint16_t alignTo = 1;
|
||||
|
||||
if (
|
||||
memoryType == Avr8MemoryType::FLASH_PAGE
|
||||
|| memoryType == Avr8MemoryType::SPM
|
||||
|| memoryType == Avr8MemoryType::APPL_FLASH
|
||||
|| memoryType == Avr8MemoryType::BOOT_FLASH
|
||||
) {
|
||||
alignTo = this->targetParameters.flashPageSize.value();
|
||||
}
|
||||
|
||||
if (
|
||||
memoryType == Avr8MemoryType::EEPROM_ATOMIC
|
||||
|| memoryType == Avr8MemoryType::EEPROM_PAGE
|
||||
) {
|
||||
alignTo = this->targetParameters.eepromPageSize.value();
|
||||
switch (memoryType) {
|
||||
case Avr8MemoryType::FLASH_PAGE:
|
||||
case Avr8MemoryType::SPM:
|
||||
case Avr8MemoryType::APPL_FLASH:
|
||||
case Avr8MemoryType::BOOT_FLASH: {
|
||||
alignTo = this->targetParameters.flashPageSize.value();
|
||||
break;
|
||||
}
|
||||
case Avr8MemoryType::EEPROM_ATOMIC:
|
||||
case Avr8MemoryType::EEPROM_PAGE: {
|
||||
alignTo = this->targetParameters.eepromPageSize.value();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->maximumMemoryAccessSizePerRequest.has_value() && alignTo > this->maximumMemoryAccessSizePerRequest) {
|
||||
@@ -1583,20 +1585,22 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
|
||||
) {
|
||||
std::uint16_t alignTo = 1;
|
||||
|
||||
if (
|
||||
memoryType == Avr8MemoryType::FLASH_PAGE
|
||||
|| memoryType == Avr8MemoryType::SPM
|
||||
|| memoryType == Avr8MemoryType::APPL_FLASH
|
||||
|| memoryType == Avr8MemoryType::BOOT_FLASH
|
||||
) {
|
||||
alignTo = this->targetParameters.flashPageSize.value();
|
||||
}
|
||||
|
||||
if (
|
||||
memoryType == Avr8MemoryType::EEPROM_ATOMIC
|
||||
|| memoryType == Avr8MemoryType::EEPROM_PAGE
|
||||
) {
|
||||
alignTo = this->targetParameters.eepromPageSize.value();
|
||||
switch (memoryType) {
|
||||
case Avr8MemoryType::FLASH_PAGE:
|
||||
case Avr8MemoryType::SPM:
|
||||
case Avr8MemoryType::APPL_FLASH:
|
||||
case Avr8MemoryType::BOOT_FLASH: {
|
||||
alignTo = this->targetParameters.flashPageSize.value();
|
||||
break;
|
||||
}
|
||||
case Avr8MemoryType::EEPROM_ATOMIC:
|
||||
case Avr8MemoryType::EEPROM_PAGE: {
|
||||
alignTo = this->targetParameters.eepromPageSize.value();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((bytes % alignTo) != 0) {
|
||||
@@ -1794,7 +1798,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
|
||||
throw Avr8CommandFailure("AVR8 Read memory command failed", responseFrame);
|
||||
}
|
||||
|
||||
const auto data = responseFrame.getMemoryBuffer();
|
||||
const auto data = responseFrame.getMemoryData();
|
||||
|
||||
if (data.size() != bytes) {
|
||||
throw Avr8CommandFailure("Unexpected number of bytes returned from EDBG debug tool");
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::ResponseFrame
|
||||
: Avr8GenericResponseFrame(avrResponses)
|
||||
{}
|
||||
|
||||
Targets::TargetMemoryBuffer getMemoryBuffer() const {
|
||||
Targets::TargetMemoryBuffer getMemoryData() const {
|
||||
/*
|
||||
* AVR8 data payloads are typically in little endian form, but this does not apply the data returned
|
||||
* AVR8 data payloads are typically in little endian form, but this does not apply to the data returned
|
||||
* from the READ MEMORY commands.
|
||||
*/
|
||||
return std::vector<unsigned char>(
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Command.hpp"
|
||||
#include "src/TargetController/Responses/TargetMemoryRead.hpp"
|
||||
|
||||
#include "src/Targets/TargetMemory.hpp"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user