Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add programmer to the sketch profile
  • Loading branch information
MatteoPologruto committed Jan 18, 2024
commit c0a84fccb2de7c227b732f5acb4129753af16401
19 changes: 12 additions & 7 deletions internal/arduino/sketch/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,20 @@ func (p *projectRaw) getProfiles() ([]*Profile, error) {
// Profile is a sketch profile, it contains a reference to all the resources
// needed to build and upload a sketch
type Profile struct {
Name string
Notes string `yaml:"notes"`
FQBN string `yaml:"fqbn"`
Platforms ProfileRequiredPlatforms `yaml:"platforms"`
Libraries ProfileRequiredLibraries `yaml:"libraries"`
Name string
Notes string `yaml:"notes"`
FQBN string `yaml:"fqbn"`
Programmer string `yaml:"programmer"`
Platforms ProfileRequiredPlatforms `yaml:"platforms"`
Libraries ProfileRequiredLibraries `yaml:"libraries"`
}

// ToRpc converts this Profile to an rpc.SketchProfile
func (p *Profile) ToRpc() *rpc.SketchProfile {
return &rpc.SketchProfile{
Name: p.Name,
Fqbn: p.FQBN,
Name: p.Name,
Fqbn: p.FQBN,
Programmer: p.Programmer,
}
}

Expand All @@ -115,6 +117,9 @@ func (p *Profile) AsYaml() string {
res += fmt.Sprintf(" notes: %s\n", p.Notes)
}
res += fmt.Sprintf(" fqbn: %s\n", p.FQBN)
if p.Programmer != "" {
res += fmt.Sprintf(" programmer: %s\n", p.Programmer)
}
res += p.Platforms.AsYaml()
res += p.Libraries.AsYaml()
return res
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
profiles:
nanorp:
fqbn: arduino:mbed_nano:nanorp2040connect
programmer: p1
platforms:
- platform: arduino:mbed_nano (2.1.0)
libraries:
Expand Down