diff --git a/build/scripts/Targets/TargetDescriptionFiles/Services/ValidationService.php b/build/scripts/Targets/TargetDescriptionFiles/Services/ValidationService.php index e0e744f9..cd7a2450 100644 --- a/build/scripts/Targets/TargetDescriptionFiles/Services/ValidationService.php +++ b/build/scripts/Targets/TargetDescriptionFiles/Services/ValidationService.php @@ -121,6 +121,9 @@ class ValidationService if (empty($tdf->pinouts)) { $failures[] = 'Missing pinouts'; + + } elseif (empty($tdf->getInsightCompatiblePinouts())) { + $failures[] = 'No Insight-compatible pinouts'; } $processedPinoutKeys = []; diff --git a/build/scripts/Targets/TargetDescriptionFiles/TargetDescriptionFile.php b/build/scripts/Targets/TargetDescriptionFiles/TargetDescriptionFile.php index e27d7b3b..9713df03 100644 --- a/build/scripts/Targets/TargetDescriptionFiles/TargetDescriptionFile.php +++ b/build/scripts/Targets/TargetDescriptionFiles/TargetDescriptionFile.php @@ -247,6 +247,28 @@ class TargetDescriptionFile 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 { $peripheral = $this->getPeripheral($peripheralKey);