Enforced single register group instance in GPIO port peripherals, in AVR8 TDFs

This commit is contained in:
Nav
2024-04-29 20:27:07 +01:00
parent 081d1e0bcd
commit 49bf0e0fdd

View File

@@ -179,6 +179,11 @@ class ValidationService extends \Targets\TargetDescriptionFiles\Services\Validat
$failures[] = 'No signals defined for port peripheral "' . $portPeripheral->name . '"'; $failures[] = 'No signals defined for port peripheral "' . $portPeripheral->name . '"';
} }
if (count($portPeripheral->registerGroupInstances) !== 1) {
$failures[] = 'Unexpected number of register group instances in port peripheral "'
. $portPeripheral->name . '"';
}
$alternativePortRegisterGroupKey = 'port' . substr(strtolower($portPeripheral->name), -1); $alternativePortRegisterGroupKey = 'port' . substr(strtolower($portPeripheral->name), -1);
$portRegisterGroup = $tdf->getTargetRegisterGroup($portPeripheral->key, 'port') $portRegisterGroup = $tdf->getTargetRegisterGroup($portPeripheral->key, 'port')
?? $tdf->getTargetRegisterGroup($portPeripheral->key, $alternativePortRegisterGroupKey); ?? $tdf->getTargetRegisterGroup($portPeripheral->key, $alternativePortRegisterGroupKey);