refactor: multi format generation and llgo build flags

This commit is contained in:
Li Jie
2025-09-07 13:32:11 +08:00
parent c0afe199c2
commit 16c8402065
12 changed files with 541 additions and 979 deletions

16
internal/firmware/env.go Normal file
View File

@@ -0,0 +1,16 @@
package firmware
import "strings"
// BinaryFormatToEnvName returns the environment variable name based on the binary format
// Returns the format name for template expansion (e.g., "bin", "uf2", "zip")
func BinaryFormatToEnvName(binaryFormat string) string {
if strings.HasPrefix(binaryFormat, "esp") {
return "bin"
} else if strings.HasPrefix(binaryFormat, "uf2") {
return "uf2"
} else if strings.HasPrefix(binaryFormat, "nrf-dfu") {
return "zip"
}
return ""
}