Added TargetFamily in TDF scripts
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Bloom\BuildScripts\TargetDescriptionFiles;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use SimpleXMLElement;
|
use SimpleXMLElement;
|
||||||
|
|
||||||
|
require_once __DIR__ . "/TargetFamily.php";
|
||||||
require_once __DIR__ . "/Variant.php";
|
require_once __DIR__ . "/Variant.php";
|
||||||
require_once __DIR__ . "/AddressSpace.php";
|
require_once __DIR__ . "/AddressSpace.php";
|
||||||
require_once __DIR__ . "/PropertyGroup.php";
|
require_once __DIR__ . "/PropertyGroup.php";
|
||||||
@@ -20,6 +21,7 @@ class TargetDescriptionFile
|
|||||||
public ?SimpleXMLElement $xml = null;
|
public ?SimpleXMLElement $xml = null;
|
||||||
|
|
||||||
public ?string $targetName = null;
|
public ?string $targetName = null;
|
||||||
|
public ?TargetFamily $targetFamily = null;
|
||||||
public ?string $configurationValue = null;
|
public ?string $configurationValue = null;
|
||||||
public ?string $targetArchitecture = null;
|
public ?string $targetArchitecture = null;
|
||||||
|
|
||||||
@@ -75,6 +77,10 @@ class TargetDescriptionFile
|
|||||||
$this->configurationValue = strtolower($device['name']);
|
$this->configurationValue = strtolower($device['name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($this->deviceAttributesByName['family'])) {
|
||||||
|
$this->targetFamily = TargetFamily::tryFrom($device['family']);
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($this->deviceAttributesByName['architecture'])) {
|
if (!empty($this->deviceAttributesByName['architecture'])) {
|
||||||
$this->targetArchitecture = stristr($device['architecture'], 'avr') !== false
|
$this->targetArchitecture = stristr($device['architecture'], 'avr') !== false
|
||||||
? self::ARCHITECTURE_AVR8 : $device['architecture'];
|
? self::ARCHITECTURE_AVR8 : $device['architecture'];
|
||||||
@@ -486,6 +492,10 @@ class TargetDescriptionFile
|
|||||||
$failures[] = 'Target name cannot contain whitespaces';
|
$failures[] = 'Target name cannot contain whitespaces';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($this->targetFamily)) {
|
||||||
|
$failures[] = 'Missing/invalid target family';
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($this->targetArchitecture)) {
|
if (empty($this->targetArchitecture)) {
|
||||||
$failures[] = 'Target architecture not found';
|
$failures[] = 'Target architecture not found';
|
||||||
}
|
}
|
||||||
|
|||||||
8
build/scripts/TargetDescriptionFiles/TargetFamily.php
Normal file
8
build/scripts/TargetDescriptionFiles/TargetFamily.php
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
namespace Bloom\BuildScripts\TargetDescriptionFiles;
|
||||||
|
|
||||||
|
enum TargetFamily: string
|
||||||
|
{
|
||||||
|
case AVR_8 = 'AVR8';
|
||||||
|
case RISC_V = 'RISCV';
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user