diff options
author | Steven <steven.vasilogianis@gmail.com> | 2021-10-06 00:52:14 -0400 |
---|---|---|
committer | Steven <steven.vasilogianis@gmail.com> | 2021-10-06 01:01:49 -0400 |
commit | 3e5e8480f3f2f0af56731471cc967404efe0c921 (patch) | |
tree | ab9f2fcaa2cb2e76f9045b5ae094ebeeb1f582e6 | |
parent | e4393cc86c106096e85c8c6d1fa9f1be324cda22 (diff) |
andy cleanup
-rw-r--r-- | CCS811.cpp (renamed from src/main/CCS811.cpp) | 0 | ||||
-rw-r--r-- | CCS811.h (renamed from src/main/CCS811.h) | 0 | ||||
-rw-r--r-- | Makefile (renamed from src/main/Makefile) | 22 | ||||
-rw-r--r-- | mush.ino (renamed from src/main/main.ino) | 0 | ||||
-rw-r--r-- | ota.h (renamed from src/main/ota.h) | 0 | ||||
-rw-r--r-- | wifiinfo.h (renamed from src/main/wifiinfo.h) | 0 |
6 files changed, 12 insertions, 10 deletions
diff --git a/src/main/CCS811.cpp b/CCS811.cpp index 05b71c0..05b71c0 100644 --- a/src/main/CCS811.cpp +++ b/CCS811.cpp | |||
diff --git a/src/main/CCS811.h b/CCS811.h index 2640535..2640535 100644 --- a/src/main/CCS811.h +++ b/CCS811.h | |||
diff --git a/src/main/Makefile b/Makefile index 2000b24..481382a 100644 --- a/src/main/Makefile +++ b/Makefile | |||
@@ -9,9 +9,9 @@ | |||
9 | # /dev/ttyACM0 if it exists, or | 9 | # /dev/ttyACM0 if it exists, or |
10 | # unknown | 10 | # unknown |
11 | # | 11 | # |
12 | # IOT_NAME Name of the IOT device; if not set in the environment | 12 | # MDNS_NAME Hostname of the Arduino; if not set in the environment |
13 | # it will be assigned a value in this makefile. This is | 13 | # it will be assigned a value in this makefile. This is |
14 | # very useful for OTA update, the device will be searched | 14 | # needed for OTA update, the device will be searched |
15 | # on the local subnet using this name | 15 | # on the local subnet using this name |
16 | # | 16 | # |
17 | # OTA_PORT Port used by OTA update; if not set in the environment | 17 | # OTA_PORT Port used by OTA update; if not set in the environment |
@@ -21,8 +21,10 @@ | |||
21 | # OTA_PASS Password used for OTA update; if not set in the environment | 21 | # OTA_PASS Password used for OTA update; if not set in the environment |
22 | # it will be assigned the default value of an empty string | 22 | # it will be assigned the default value of an empty string |
23 | 23 | ||
24 | PROGNAME = mush | ||
25 | |||
24 | FQBN = esp8266:esp8266:espmxdevkit | 26 | FQBN = esp8266:esp8266:espmxdevkit |
25 | IOT_NAME = mush | 27 | MDNS_NAME = $(PROGNAME) |
26 | OTA_PORT = 8266 | 28 | OTA_PORT = 8266 |
27 | OTA_PASS = | 29 | OTA_PASS = |
28 | 30 | ||
@@ -32,10 +34,10 @@ cli = arduino-cli -b "$(FQBN)" | |||
32 | 34 | ||
33 | BUILD_DIR != $(cli) compile --show-properties | sed -ne 's/^build.path=//p' | 35 | BUILD_DIR != $(cli) compile --show-properties | sed -ne 's/^build.path=//p' |
34 | 36 | ||
35 | SRC := main.ino | 37 | SRC := CCS811.cpp $(PROGNAME).ino |
36 | HDRS := $(wildcard *.h) | 38 | HDRS := CCS811.h ota.h wifiinfo.h |
37 | BIN := $(BUILD_DIR)/main.ino.bin | 39 | BIN := $(BUILD_DIR)/$(PROGNAME).ino.bin |
38 | ELF := $(BUILD_DIR)/main.ino.elf | 40 | ELF := $(BUILD_DIR)/$(PROGNAME).ino.elf |
39 | 41 | ||
40 | all: $(ELF) | 42 | all: $(ELF) |
41 | .PHONY: all | 43 | .PHONY: all |
@@ -44,15 +46,15 @@ compile: $(ELF) | |||
44 | .PHONY: compile | 46 | .PHONY: compile |
45 | 47 | ||
46 | $(BIN) $(ELF): $(SRC) $(HDRS) | 48 | $(BIN) $(ELF): $(SRC) $(HDRS) |
47 | $(cli) compile | 49 | $(cli) compile --warnings all |
48 | 50 | ||
49 | upload: | 51 | upload: |
50 | $(cli) upload -p "$(SERIAL_DEV)" | 52 | $(cli) upload -p "$(SERIAL_DEV)" |
51 | 53 | ||
52 | PLAT_PATH != $(cli) compile --show-properties | sed -ne 's/^runtime.platform.path=//p' | 54 | PLAT_PATH != $(cli) compile --show-properties | sed -ne 's/^runtime.platform.path=//p' |
53 | PY_PATH != $(cli) compile --show-properties | sed -ne 's/^runtime.tools.python3.path=//p' | 55 | PY_PATH != $(cli) compile --show-properties | sed -ne 's/^runtime.tools.python3.path=//p' |
54 | IOT_IP != getent ahostsv4 mush.local | (read ip _; echo $$ip) | 56 | MDNS_IP != getent ahostsv4 $(MDNS_NAME).local | (read ip _; echo $$ip) |
55 | 57 | ||
56 | ota: $(BIN) | 58 | ota: $(BIN) |
57 | "$(PY_PATH)/python3" "$(PLAT_PATH)/tools/espota.py" -i "$(IOT_IP)" -p "$(OTA_PORT)" --auth="$(OTA_PASS)" -f "$(BIN)" | 59 | "$(PY_PATH)/python3" "$(PLAT_PATH)/tools/espota.py" -i "$(MDNS_IP)" -p "$(OTA_PORT)" --auth="$(OTA_PASS)" -f "$(BIN)" |
58 | 60 | ||
diff --git a/src/main/main.ino b/mush.ino index 6c2688f..6c2688f 100644 --- a/src/main/main.ino +++ b/mush.ino | |||
diff --git a/src/main/wifiinfo.h b/wifiinfo.h index fb94cdd..fb94cdd 100644 --- a/src/main/wifiinfo.h +++ b/wifiinfo.h | |||