Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
d1ece646
Commit
d1ece646
authored
Oct 11, 2018
by
Cristian Maglie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added cores.Board method to get config options
parent
9add6ce5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
arduino/cores/board.go
arduino/cores/board.go
+23
-0
No files found.
arduino/cores/board.go
View file @
d1ece646
...
...
@@ -60,6 +60,29 @@ func (b *Board) String() string {
return
b
.
FQBN
()
}
// GetConfigOptions returns an OrderedMap of configuration options for this board.
// The returned map will have key and value as option id and option name, respectively.
func
(
b
*
Board
)
GetConfigOptions
()
*
properties
.
Map
{
res
:=
properties
.
NewMap
()
menu
:=
b
.
Properties
.
SubTree
(
"menu"
)
for
_
,
option
:=
range
menu
.
FirstLevelKeys
()
{
res
.
Set
(
option
,
b
.
PlatformRelease
.
Menus
.
Get
(
option
))
}
return
res
}
// GetConfigOptionValues returns an OrderedMap of possible values for a specific configuratio options
// for this board. The returned map will have key and value as option value and option value name,
// respectively.
func
(
b
*
Board
)
GetConfigOptionValues
(
option
string
)
*
properties
.
Map
{
res
:=
properties
.
NewMap
()
menu
:=
b
.
Properties
.
SubTree
(
"menu"
)
.
SubTree
(
option
)
for
_
,
value
:=
range
menu
.
FirstLevelKeys
()
{
res
.
Set
(
value
,
menu
.
Get
(
value
))
}
return
res
}
// GetBuildProperties returns the build properties and the build
// platform for the Board with the configuration passed as parameter.
func
(
b
*
Board
)
GetBuildProperties
(
userConfigs
*
properties
.
Map
)
(
*
properties
.
Map
,
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment