This commit is contained in:
Nav
2022-12-12 01:15:06 +00:00
parent bf8d59644a
commit 29d548b017

View File

@@ -724,18 +724,25 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
) const { ) const {
const auto& programMemorySegments = programAddressSpace.memorySegmentsByTypeAndName; const auto& programMemorySegments = programAddressSpace.memorySegmentsByTypeAndName;
if (programMemorySegments.find(MemorySegmentType::FLASH) != programMemorySegments.end()) { const auto flashMemorySegmentsIt = programMemorySegments.find(MemorySegmentType::FLASH);
const auto& flashMemorySegments = programMemorySegments.find(MemorySegmentType::FLASH)->second; if (flashMemorySegmentsIt != programMemorySegments.end()) {
const auto& flashMemorySegments = flashMemorySegmentsIt->second;
/* /*
* In AVR8 TDFs, flash application memory segments are typically named "APP_SECTION", "PROGMEM" or * In AVR8 TDFs, flash application memory segments are typically named "APP_SECTION", "PROGMEM" or
* "FLASH". * "FLASH".
*/ */
auto flashSegmentIt = flashMemorySegments.find("app_section") != flashMemorySegments.end() ? const auto appSectionSegmentIt = flashMemorySegments.find("app_section");
flashMemorySegments.find("app_section") if (appSectionSegmentIt != flashMemorySegments.end()) {
: flashMemorySegments.find("progmem") != flashMemorySegments.end() return appSectionSegmentIt->second;
? flashMemorySegments.find("progmem") : flashMemorySegments.find("flash"); }
const auto programMemSegmentIt = flashMemorySegments.find("progmem");
if (programMemSegmentIt != flashMemorySegments.end()) {
return programMemSegmentIt->second;
}
const auto flashSegmentIt = flashMemorySegments.find("flash");
if (flashSegmentIt != flashMemorySegments.end()) { if (flashSegmentIt != flashMemorySegments.end()) {
return flashSegmentIt->second; return flashSegmentIt->second;
} }