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) {
|
foreach ($registerGroup->registers as $register) {
|
||||||
$output->registers[] = $this->targetRegisterFromRegister($register, $addressOffset);
|
$output->registers[] = $this->targetRegisterFromRegister($register, $addressOffset, $addressSpaceKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function targetRegisterFromRegister(Register $register, int $addressOffset): TargetRegister
|
private function targetRegisterFromRegister(Register $register, int $addressOffset, ?string $addressSpaceKey)
|
||||||
{
|
: TargetRegister {
|
||||||
return new TargetRegister(
|
return new TargetRegister(
|
||||||
$register->key,
|
$register->key,
|
||||||
$register->name,
|
$register->name,
|
||||||
|
$addressSpaceKey,
|
||||||
$addressOffset + $register->offset,
|
$addressOffset + $register->offset,
|
||||||
$register->size,
|
$register->size,
|
||||||
$register->description,
|
$register->description,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class TargetRegister
|
|||||||
{
|
{
|
||||||
public ?string $key = null;
|
public ?string $key = null;
|
||||||
public ?string $name = null;
|
public ?string $name = null;
|
||||||
|
public ?string $addressSpaceKey = null;
|
||||||
public ?int $address = null;
|
public ?int $address = null;
|
||||||
public ?int $size = null;
|
public ?int $size = null;
|
||||||
public ?string $description = null;
|
public ?string $description = null;
|
||||||
@@ -29,6 +30,7 @@ class TargetRegister
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
?string $key,
|
?string $key,
|
||||||
?string $name,
|
?string $name,
|
||||||
|
?string $addressSpaceKey,
|
||||||
?int $address,
|
?int $address,
|
||||||
?int $size,
|
?int $size,
|
||||||
?string $description,
|
?string $description,
|
||||||
@@ -36,6 +38,7 @@ class TargetRegister
|
|||||||
) {
|
) {
|
||||||
$this->key = $key;
|
$this->key = $key;
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
|
$this->addressSpaceKey = $addressSpaceKey;
|
||||||
$this->address = $address;
|
$this->address = $address;
|
||||||
$this->size = $size;
|
$this->size = $size;
|
||||||
$this->description = $description;
|
$this->description = $description;
|
||||||
|
|||||||
Reference in New Issue
Block a user