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