Added address space key to TargetRegister in TDF scripts
This commit is contained in:
@@ -340,17 +340,18 @@ class TargetDescriptionFile
|
||||
}
|
||||
|
||||
foreach ($registerGroup->registers as $register) {
|
||||
$output->registers[] = $this->targetRegisterFromRegister($register, $addressOffset);
|
||||
$output->registers[] = $this->targetRegisterFromRegister($register, $addressOffset, $addressSpaceKey);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function targetRegisterFromRegister(Register $register, int $addressOffset): TargetRegister
|
||||
{
|
||||
private function targetRegisterFromRegister(Register $register, int $addressOffset, ?string $addressSpaceKey)
|
||||
: TargetRegister {
|
||||
return new TargetRegister(
|
||||
$register->key,
|
||||
$register->name,
|
||||
$addressSpaceKey,
|
||||
$addressOffset + $register->offset,
|
||||
$register->size,
|
||||
$register->description,
|
||||
|
||||
@@ -19,6 +19,7 @@ class TargetRegister
|
||||
{
|
||||
public ?string $key = null;
|
||||
public ?string $name = null;
|
||||
public ?string $addressSpaceKey = null;
|
||||
public ?int $address = null;
|
||||
public ?int $size = null;
|
||||
public ?string $description = null;
|
||||
@@ -29,6 +30,7 @@ class TargetRegister
|
||||
public function __construct(
|
||||
?string $key,
|
||||
?string $name,
|
||||
?string $addressSpaceKey,
|
||||
?int $address,
|
||||
?int $size,
|
||||
?string $description,
|
||||
@@ -36,6 +38,7 @@ class TargetRegister
|
||||
) {
|
||||
$this->key = $key;
|
||||
$this->name = $name;
|
||||
$this->addressSpaceKey = $addressSpaceKey;
|
||||
$this->address = $address;
|
||||
$this->size = $size;
|
||||
$this->description = $description;
|
||||
|
||||
Reference in New Issue
Block a user