Added pageSize to TargetMemoryDescriptor struct

This commit is contained in:
Nav
2022-05-14 22:39:37 +01:00
parent 6a4bf89706
commit 159c77a5f1
2 changed files with 16 additions and 4 deletions

View File

@@ -696,7 +696,8 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
TargetMemoryAddressRange( TargetMemoryAddressRange(
flashStartAddress, flashStartAddress,
flashStartAddress + this->targetParameters->flashSize.value() - 1 flashStartAddress + this->targetParameters->flashSize.value() - 1
) ),
this->targetParameters->flashPageSize
) )
)); ));

View File

@@ -2,6 +2,7 @@
#include <cstdint> #include <cstdint>
#include <vector> #include <vector>
#include <optional>
namespace Bloom::Targets namespace Bloom::Targets
{ {
@@ -26,7 +27,9 @@ namespace Bloom::Targets
TargetMemoryAddressRange() = default; TargetMemoryAddressRange() = default;
TargetMemoryAddressRange(std::uint32_t startAddress, std::uint32_t endAddress) TargetMemoryAddressRange(std::uint32_t startAddress, std::uint32_t endAddress)
: startAddress(startAddress), endAddress(endAddress) {}; : startAddress(startAddress)
, endAddress(endAddress)
{};
bool operator == (const TargetMemoryAddressRange& rhs) const { bool operator == (const TargetMemoryAddressRange& rhs) const {
return this->startAddress == rhs.startAddress && this->endAddress == rhs.endAddress; return this->startAddress == rhs.startAddress && this->endAddress == rhs.endAddress;
@@ -56,9 +59,17 @@ namespace Bloom::Targets
{ {
TargetMemoryType type; TargetMemoryType type;
TargetMemoryAddressRange addressRange; TargetMemoryAddressRange addressRange;
std::optional<std::uint32_t> pageSize;
TargetMemoryDescriptor(TargetMemoryType type, TargetMemoryAddressRange addressRange) TargetMemoryDescriptor(
: type(type), addressRange(addressRange) {}; TargetMemoryType type,
TargetMemoryAddressRange addressRange,
std::optional<std::uint32_t> pageSize = std::nullopt
)
: type(type)
, addressRange(addressRange)
, pageSize(pageSize)
{};
bool operator == (const TargetMemoryDescriptor& rhs) const { bool operator == (const TargetMemoryDescriptor& rhs) const {
return this->type == rhs.type && this->addressRange == rhs.addressRange; return this->type == rhs.type && this->addressRange == rhs.addressRange;