diff --git a/libraries/AP_Common/Arduino.mk b/libraries/AP_Common/Arduino.mk index 3485b2b763..497b68b22d 100644 --- a/libraries/AP_Common/Arduino.mk +++ b/libraries/AP_Common/Arduino.mk @@ -27,16 +27,6 @@ # Build an Arduino sketch. # -################################################################################ -# Config options -# -# The Makefile calling us must specify BOARD -# -HARDWARE ?= arduino -ifeq ($(BOARD),) -$(error ERROR: must set BOARD before including this file) -endif - ################################################################################ # Paths # @@ -82,6 +72,18 @@ SKETCH := $(lastword $(subst /, ,$(SRCROOT))) TMPDIR ?= /tmp BUILDROOT := $(abspath $(TMPDIR)/$(SKETCH).build) + +################################################################################ +# Config options +# +# The Makefile calling us must specify BOARD +# +include $(TMPDIR)/config.mk +HARDWARE ?= arduino +ifeq ($(BOARD),) +$(error ERROR: must set BOARD before including this file) +endif + # # Find Arduino, if not explicitly specified #