binary-format supports uf2, nrf-dfu

This commit is contained in:
Li Jie
2025-08-23 10:24:18 +08:00
parent 508b23a584
commit e40bdc196b
12 changed files with 437 additions and 10 deletions

View File

@@ -29,6 +29,8 @@ type Config struct {
// Binary and firmware configuration
BinaryFormat string `json:"binary-format"`
// UF2 configuration
UF2FamilyID string `json:"uf2-family-id"`
// Flash and deployment configuration
FlashCommand string `json:"flash-command"`
@@ -39,9 +41,6 @@ type Config struct {
MSDVolumeName []string `json:"msd-volume-name"`
MSDFirmwareName string `json:"msd-firmware-name"`
// UF2 configuration
UF2FamilyID string `json:"uf2-family-id"`
// Device-specific configuration
RP2040BootPatch bool `json:"rp2040-boot-patch"`
@@ -66,6 +65,13 @@ func (c *Config) IsEmpty() bool {
return c.Name == "" && c.LLVMTarget == "" && c.GOOS == "" && c.GOARCH == ""
}
func (c *Config) FormatDetail() string {
if c.BinaryFormat == "uf2" {
return c.UF2FamilyID
}
return ""
}
// HasInheritance returns true if this config inherits from other configs
func (rc *RawConfig) HasInheritance() bool {
return len(rc.Inherits) > 0