New TDF rule added to TDF validation: All TDFs must have at least one Insight-compatible pinout.
This commit is contained in:
@@ -121,6 +121,9 @@ class ValidationService
|
|||||||
|
|
||||||
if (empty($tdf->pinouts)) {
|
if (empty($tdf->pinouts)) {
|
||||||
$failures[] = 'Missing pinouts';
|
$failures[] = 'Missing pinouts';
|
||||||
|
|
||||||
|
} elseif (empty($tdf->getInsightCompatiblePinouts())) {
|
||||||
|
$failures[] = 'No Insight-compatible pinouts';
|
||||||
}
|
}
|
||||||
|
|
||||||
$processedPinoutKeys = [];
|
$processedPinoutKeys = [];
|
||||||
|
|||||||
@@ -247,6 +247,28 @@ class TargetDescriptionFile
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all pinouts that are supported by the target package widget, in Bloom's Insight GUI.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getInsightCompatiblePinouts(): array
|
||||||
|
{
|
||||||
|
return array_filter(
|
||||||
|
$this->pinouts,
|
||||||
|
fn (Pinout $pinout): bool => in_array(
|
||||||
|
$pinout->type,
|
||||||
|
[
|
||||||
|
PinoutType::DIP,
|
||||||
|
PinoutType::QFP,
|
||||||
|
PinoutType::QFN,
|
||||||
|
PinoutType::SOIC,
|
||||||
|
PinoutType::SSOP,
|
||||||
|
]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function getTargetPeripheral(string $peripheralKey): ?TargetPeripheral
|
public function getTargetPeripheral(string $peripheralKey): ?TargetPeripheral
|
||||||
{
|
{
|
||||||
$peripheral = $this->getPeripheral($peripheralKey);
|
$peripheral = $this->getPeripheral($peripheralKey);
|
||||||
|
|||||||
Reference in New Issue
Block a user