Replaced TargetIoPortsUpdated event with RegistersWrittenToTarget event

This commit is contained in:
Nav
2021-09-12 23:28:16 +01:00
parent dca5b362b3
commit 39c95857e5
14 changed files with 17 additions and 101 deletions

View File

@@ -559,22 +559,3 @@ void Avr8::setPinState(const TargetPinDescriptor& pinDescriptor, const TargetPin
}
}
}
bool Avr8::memoryAddressRangeClashesWithIoPortRegisters(
TargetMemoryType memoryType,
std::uint32_t startAddress,
std::uint32_t endAddress
) {
auto& targetParameters = this->targetParameters.value();
if (targetParameters.mappedIoSegmentStartAddress.has_value() && targetParameters.mappedIoSegmentSize.has_value()) {
auto mappedIoSegmentStart = targetParameters.mappedIoSegmentStartAddress.value();
auto mappedIoSegmentEnd = mappedIoSegmentStart + targetParameters.mappedIoSegmentSize.value();
return (startAddress >= mappedIoSegmentStart && startAddress <= mappedIoSegmentEnd)
|| (endAddress >= mappedIoSegmentStart && endAddress <= mappedIoSegmentEnd)
|| (startAddress <= mappedIoSegmentStart && endAddress >= mappedIoSegmentStart)
;
}
return false;
}

View File

@@ -149,11 +149,5 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
const TargetPinDescriptor& pinDescriptor,
const TargetPinState& state
) override;
bool memoryAddressRangeClashesWithIoPortRegisters(
TargetMemoryType memoryType,
std::uint32_t startAddress,
std::uint32_t endAddress
) override;
};
}

View File

@@ -300,23 +300,6 @@ namespace Bloom::Targets
const TargetPinState& state
) = 0;
/**
* Should determine whether writing to a certain memory type and address range will affect the target's pin
* states. This is used by Insight to kick off a pin state update if some other component may have updated the
* pin states via a memory write to IO port register addresses.
*
* @param memoryType
* @param startAddress
* @param endAddress
*
* @return
*/
virtual bool memoryAddressRangeClashesWithIoPortRegisters(
TargetMemoryType memoryType,
std::uint32_t startAddress,
std::uint32_t endAddress
) = 0;
virtual ~Target() = default;
};
}