compileopts: add support for custom binary formats

Some chips (like the ESP family) have a particular image format that is
more complex than simply dumping everything in a raw image.
This commit is contained in:
Ayke van Laethem
2020-08-28 15:53:56 +02:00
committed by Ron Evans
parent 3ee47a9c1b
commit 9a17698d6a
4 changed files with 49 additions and 16 deletions
+4
View File
@@ -47,6 +47,7 @@ type TargetSpec struct {
FlashVolume string `json:"msd-volume-name"`
FlashFilename string `json:"msd-firmware-name"`
UF2FamilyID string `json:"uf2-family-id"`
BinaryFormat string `json:"binary-format"`
OpenOCDInterface string `json:"openocd-interface"`
OpenOCDTarget string `json:"openocd-target"`
OpenOCDTransport string `json:"openocd-transport"`
@@ -128,6 +129,9 @@ func (spec *TargetSpec) copyProperties(spec2 *TargetSpec) {
if spec2.UF2FamilyID != "" {
spec.UF2FamilyID = spec2.UF2FamilyID
}
if spec2.BinaryFormat != "" {
spec.BinaryFormat = spec2.BinaryFormat
}
if spec2.OpenOCDInterface != "" {
spec.OpenOCDInterface = spec2.OpenOCDInterface
}