Fixed issue with automatic config variant selection, where we were not properly handling XMEGA targets with the JTAG physical interface.

Also introduced new AVR8 families, for D series targets.
Also moved AVR family param outside of TargetParameters struct
This commit is contained in:
Nav
2021-06-06 17:44:13 +01:00
parent 5ba95e6967
commit 3f1247ce74
11 changed files with 178 additions and 28 deletions

View File

@@ -10,6 +10,9 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile
const AVR8_FAMILY_MEGA = 'MEGA';
const AVR8_FAMILY_TINY = 'TINY';
const AVR8_FAMILY_XMEGA = 'XMEGA';
const AVR8_FAMILY_DB = 'DB';
const AVR8_FAMILY_DA = 'DA';
const AVR8_FAMILY_DD = 'DD';
const AVR8_FAMILY_OTHER = 'OTHER';
const AVR8_PHYSICAL_INTERFACE_JTAG = 'JTAG';
@@ -77,6 +80,15 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile
} else if (stristr($deviceAttributes['family'], 'mega') !== false) {
$this->family = self::AVR8_FAMILY_MEGA;
} else if (strtolower(trim($deviceAttributes['family'])) == 'avr da') {
$this->family = self::AVR8_FAMILY_DA;
} else if (strtolower(trim($deviceAttributes['family'])) == 'avr db') {
$this->family = self::AVR8_FAMILY_DB;
} else if (strtolower(trim($deviceAttributes['family'])) == 'avr dd') {
$this->family = self::AVR8_FAMILY_DD;
} else {
$this->family = self::AVR8_FAMILY_OTHER;
}
@@ -338,6 +350,10 @@ class Avr8TargetDescriptionFile extends TargetDescriptionFile
return $failures;
}
if (is_null($this->family) || $this->family == self::AVR8_FAMILY_OTHER) {
$failures[] = 'Unknown AVR8 family';
}
if (is_null($this->stackPointerRegisterStartAddress)) {
$failures[] = 'Missing stack pointer register start address.';
}