forked from platformio/platformio-core
Fix issue when board is not specified and "idedata" target is called
This commit is contained in:
@ -63,9 +63,13 @@ def dump_defines(env):
|
|||||||
|
|
||||||
# special symbol for Atmel AVR MCU
|
# special symbol for Atmel AVR MCU
|
||||||
if env['PIOPLATFORM'] == "atmelavr":
|
if env['PIOPLATFORM'] == "atmelavr":
|
||||||
defines.append(
|
board_mcu = env.get("BOARD_MCU")
|
||||||
str("__AVR_%s__" % env.BoardConfig().get("build.mcu").upper()
|
if not board_mcu and "BOARD" in env:
|
||||||
.replace("ATMEGA", "ATmega").replace("ATTINY", "ATtiny")))
|
board_mcu = env.BoardConfig().get("build.mcu")
|
||||||
|
if board_mcu:
|
||||||
|
defines.append(
|
||||||
|
str("__AVR_%s__" % board_mcu.upper()
|
||||||
|
.replace("ATMEGA", "ATmega").replace("ATTINY", "ATtiny")))
|
||||||
return defines
|
return defines
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,8 +41,9 @@ def PioPlatform(env):
|
|||||||
def BoardConfig(env, board=None):
|
def BoardConfig(env, board=None):
|
||||||
p = initPioPlatform(env['PLATFORM_MANIFEST'])
|
p = initPioPlatform(env['PLATFORM_MANIFEST'])
|
||||||
try:
|
try:
|
||||||
config = p.board_config(board if board else env['BOARD'])
|
assert env.get("BOARD", board), "BoardConfig: Board is not defined"
|
||||||
except exception.UnknownBoard as e:
|
config = p.board_config(board if board else env.get("BOARD"))
|
||||||
|
except (AssertionError, exception.UnknownBoard) as e:
|
||||||
sys.stderr.write("Error: %s\n" % str(e))
|
sys.stderr.write("Error: %s\n" % str(e))
|
||||||
env.Exit(1)
|
env.Exit(1)
|
||||||
return config
|
return config
|
||||||
|
Reference in New Issue
Block a user