Skip to content

Commit

Permalink
Fixed an issue when env.BoardConfig() does not work for custom bo…
Browse files Browse the repository at this point in the history
…ards in extra scripts of libraries // Resolve #3264
  • Loading branch information
ivankravets committed Nov 12, 2019
1 parent 15f142f commit a9f9f4e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions platformio/builder/tools/pioplatform.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,15 @@ def PioPlatform(env):


def BoardConfig(env, board=None):
p = env.PioPlatform()
try:
board = board or env.get("BOARD")
assert board, "BoardConfig: Board is not defined"
with fs.cd(env.subst("$PROJECT_DIR")):
config = p.board_config(board)
except (AssertionError, exception.UnknownBoard) as e:
sys.stderr.write("Error: %s\n" % str(e))
env.Exit(1)
return config
with fs.cd(env.subst("$PROJECT_DIR")):
try:
p = env.PioPlatform()
board = board or env.get("BOARD")
assert board, "BoardConfig: Board is not defined"
return p.board_config(board)
except (AssertionError, exception.UnknownBoard) as e:
sys.stderr.write("Error: %s\n" % str(e))
env.Exit(1)


def GetFrameworkScript(env, framework):
Expand Down

0 comments on commit a9f9f4e

Please sign in to comment.