diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp index 6ff95e16..7c18d148 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp @@ -696,7 +696,8 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit TargetMemoryAddressRange( flashStartAddress, flashStartAddress + this->targetParameters->flashSize.value() - 1 - ) + ), + this->targetParameters->flashPageSize ) )); diff --git a/src/Targets/TargetMemory.hpp b/src/Targets/TargetMemory.hpp index 51a11171..a7520ef4 100644 --- a/src/Targets/TargetMemory.hpp +++ b/src/Targets/TargetMemory.hpp @@ -2,6 +2,7 @@ #include #include +#include namespace Bloom::Targets { @@ -26,7 +27,9 @@ namespace Bloom::Targets TargetMemoryAddressRange() = default; TargetMemoryAddressRange(std::uint32_t startAddress, std::uint32_t endAddress) - : startAddress(startAddress), endAddress(endAddress) {}; + : startAddress(startAddress) + , endAddress(endAddress) + {}; bool operator == (const TargetMemoryAddressRange& rhs) const { return this->startAddress == rhs.startAddress && this->endAddress == rhs.endAddress; @@ -56,9 +59,17 @@ namespace Bloom::Targets { TargetMemoryType type; TargetMemoryAddressRange addressRange; + std::optional pageSize; - TargetMemoryDescriptor(TargetMemoryType type, TargetMemoryAddressRange addressRange) - : type(type), addressRange(addressRange) {}; + TargetMemoryDescriptor( + TargetMemoryType type, + TargetMemoryAddressRange addressRange, + std::optional pageSize = std::nullopt + ) + : type(type) + , addressRange(addressRange) + , pageSize(pageSize) + {}; bool operator == (const TargetMemoryDescriptor& rhs) const { return this->type == rhs.type && this->addressRange == rhs.addressRange;