Add annotation to manage hardware ressources used by actorclasses
When using eTrice in an embedded context there are usually ActorClasses which directly interface with specific hardware resources of the target. Hardware resources usage of a all ActorRefs in any given system may not overlap. I.e. there cannot be more than one ActorRef using a specific hardware resource. Resource overlap may lead to undefined behavior or hard to catch runtime issues.
To solve this problem annotation based hardware resource management could be introduced. The idea is to add a new ActorClass annotation which allows the user to specify a "hardware resource key" (string). The annotation may be used multiple times on an ActorClass to specify all used resources.
During validation it should be checked that no two ActorRefs present in the system use the same hardware resource key. This also means that any annotated ActorClass may only be used in exactly one ActorRef in a system.
If the hardware the ActorClass is exposing shall be used in multiple places in the same system a good option would be to expose the functionality using an SPP and use the ActorClass as service.
E.g.
AnnotationType HardwareRessourceConstraint {
target = ActorClass
mandatory attribute ressourceID: ptCharacter
}
ActorClass AUsart2Adapter_miniHILV2_PD5_PD6_DMA2S2_DMA2S3 {
@HardwareRessourceConstraint(ressourceID="DMA2_STREAM2")
@HardwareRessourceConstraint(ressourceID="DMA2_STREAM3")
@HardwareRessourceConstraint(ressourceID="PORT_D5")
@HardwareRessourceConstraint(ressourceID="PORT_D6")
@HardwareRessourceConstraint(ressourceID="USART2")
Interface {
[.....]