Skip to content

Commit 1081992

Browse files
committed
Removed unused Platform.DefaultBoard field
1 parent 8c91a0a commit 1081992

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

hardware_loader.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ func loadPlatform(targetPlatform *types.Platform, packageId string, folder strin
184184
return i18n.WrapError(err)
185185
}
186186

187-
assignDefaultBoardToPlatform(targetPlatform)
188-
189187
platformTxt, err := properties.SafeLoad(filepath.Join(folder, constants.FILE_PLATFORM_TXT))
190188
if err != nil {
191189
return i18n.WrapError(err)
@@ -209,16 +207,6 @@ func loadPlatform(targetPlatform *types.Platform, packageId string, folder strin
209207
return nil
210208
}
211209

212-
func assignDefaultBoardToPlatform(targetPlatform *types.Platform) {
213-
if targetPlatform.DefaultBoard == nil {
214-
for _, board := range targetPlatform.Boards {
215-
if targetPlatform.DefaultBoard == nil {
216-
targetPlatform.DefaultBoard = board
217-
}
218-
}
219-
}
220-
}
221-
222210
func loadBoards(boards map[string]*types.Board, packageId string, platformId string, folder string, logger i18n.Logger) error {
223211
boardsProperties, err := properties.Load(filepath.Join(folder, constants.FILE_BOARDS_TXT))
224212
if err != nil {

types/types.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,11 @@ type Package struct {
136136
}
137137

138138
type Platform struct {
139-
PlatformId string
140-
Folder string
141-
DefaultBoard *Board
142-
Boards map[string]*Board
143-
Properties properties.Map
144-
Programmers map[string]properties.Map
139+
PlatformId string
140+
Folder string
141+
Boards map[string]*Board
142+
Properties properties.Map
143+
Programmers map[string]properties.Map
145144
}
146145

147146
type Board struct {

0 commit comments

Comments
 (0)