Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Lukas committed Dec 14, 2021
2 parents 210ba7a + 6e17530 commit f1a352b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PROJECT = CO2-Ampel_Plus
BOARD_TYPE = co2ampel:samd:sb
ARDUINO_CLI = arduino-cli
ARDUINO_CLI_DIR = /usr/bin
CONFIG_FILE = config.yaml
SERIAL_PORT = COM18
VERBOSE = 1

Expand All @@ -19,13 +19,18 @@ endif

.PHONY: all example program clean

all: example
all: prepare build

prepare:
$(ARDUINO_CLI) --config-file $(CONFIG_FILE) core install co2ampel:samd
$(ARDUINO_CLI) --config-file $(CONFIG_FILE) core install arduino:samd
$(ARDUINO_CLI) --config-file $(CONFIG_FILE) lib install ArduinoJson

build:
$(ARDUINO_CLI_DIR)/$(ARDUINO_CLI) compile $(VERBOSE_FLAG) --build-path=$(BUILD_PATH) --build-cache-path=$(BUILD_CACHE_PATH) -b $(BOARD_TYPE) $(PROJECT)
$(ARDUINO_CLI) --config-file $(CONFIG_FILE) compile $(VERBOSE_FLAG) --build-path=$(BUILD_PATH) --build-cache-path=$(BUILD_CACHE_PATH) -b $(BOARD_TYPE) $(PROJECT)

program:
$(ARDUINO_CLI_DIR)/$(ARDUINO_CLI) upload $(VERBOSE_FLAG) -p $(SERIAL_PORT) --fqbn $(BOARD_TYPE) $(PROJECT)
$(ARDUINO_CLI) --config-file $(CONFIG_FILE) upload $(VERBOSE_FLAG) -p $(SERIAL_PORT) --fqbn $(BOARD_TYPE) $(PROJECT)

clean:
-@rm -rf $(BUILD_PATH)
3 changes: 3 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
board_manager:
additional_urls:
- https://github.com/watterott/CO2-Ampel/raw/master/package_co2ampel_index.json

0 comments on commit f1a352b

Please sign in to comment.