diff --git a/etc/makefiles/sketch.mk b/etc/makefiles/sketch.mk index caa2af6c12..16acb7edcc 100644 --- a/etc/makefiles/sketch.mk +++ b/etc/makefiles/sketch.mk @@ -161,12 +161,20 @@ ifneq ($(KALEIDOSCOPE_LOCAL_LIB_DIR),) _arduino_local_libraries_prop = --libraries "${KALEIDOSCOPE_LOCAL_LIB_DIR}" endif -compile: kaleidoscope-hardware-configured +# Check if the .kaleidoscope_board file exists +ifneq ("$(wildcard ${SKETCH_DIR}/.kaleidoscope_board)","") + # Read the content of the file + KALEIDOSCOPE_BOARD_CONTENT := $(shell cat ${SKETCH_DIR}/.kaleidoscope_board) + + # Set the kaleidoscope_board_config variable + kaleidoscope_board_config := --build-property compiler.cpp.extra_flags=-DKALEIDOSCOPE_HARDWARE_H=\"$(KALEIDOSCOPE_BOARD_CONTENT)\" +endif +compile: kaleidoscope-hardware-configured -$(QUIET) install -d "${OUTPUT_PATH}" $(QUIET) $(ARDUINO_CLI) compile --fqbn "${FQBN}" ${ARDUINO_VERBOSE} ${ccache_wrapper_property} ${local_cflags_property} \ - ${_arduino_local_libraries_prop} ${_ARDUINO_CLI_COMPILE_CUSTOM_FLAGS} \ + ${_arduino_local_libraries_prop} ${_ARDUINO_CLI_COMPILE_CUSTOM_FLAGS} ${kaleidoscope_board_config}\ --library "${KALEIDOSCOPE_DIR}" \ --libraries "${KALEIDOSCOPE_DIR}/plugins/" \ --build-path "${BUILD_PATH}" \ diff --git a/examples/Devices/Keyboardio/Model101/.kaleidoscope_board b/examples/Devices/Keyboardio/Model101/.kaleidoscope_board new file mode 100644 index 0000000000..185bbd8b0d --- /dev/null +++ b/examples/Devices/Keyboardio/Model101/.kaleidoscope_board @@ -0,0 +1 @@ +Kaleidoscope-Hardware-Keyboardio-Model101.h diff --git a/examples/Devices/Keyboardio/Model101/Model101.ino b/examples/Devices/Keyboardio/Model101/Model101.ino index 247fe330d0..9129f0bcb2 100644 --- a/examples/Devices/Keyboardio/Model101/Model101.ino +++ b/examples/Devices/Keyboardio/Model101/Model101.ino @@ -7,7 +7,9 @@ * as well as the Kaleidoscope plugins we use in the Model 100's firmware */ + // The Kaleidoscope core + #include "Kaleidoscope.h" // Support for storing the keymap in EEPROM