diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index d35c1a7d98..960719bb4f 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -295,12 +295,6 @@ Please use a replacement build as follows: ''' % ctx.env.BOARD) boards = _board_classes.keys() - if not ctx.env.BOARD in boards: - # try case-insensitive match - for b in boards: - if b.upper() == ctx.env.BOARD.upper(): - ctx.env.BOARD = b - break if not ctx.env.BOARD in boards: ctx.fatal("Invalid board '%s': choices are %s" % (ctx.env.BOARD, ', '.join(boards))) _board = _board_classes[ctx.env.BOARD]() diff --git a/wscript b/wscript index 86599fadf5..523ff79796 100644 --- a/wscript +++ b/wscript @@ -325,6 +325,13 @@ def configure(cfg): if cfg.options.board is None: cfg.options.board = 'sitl' + boards_names = boards.get_boards_names() + if not cfg.options.board in boards_names: + for b in boards_names: + if b.upper() == cfg.options.board.upper(): + cfg.options.board = b + break + cfg.env.BOARD = cfg.options.board cfg.env.DEBUG = cfg.options.debug cfg.env.AUTOCONFIG = cfg.options.autoconfig