summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven <steven.vasilogianis@gmail.com>2021-10-06 00:52:14 -0400
committerSteven <steven.vasilogianis@gmail.com>2021-10-06 01:01:49 -0400
commit3e5e8480f3f2f0af56731471cc967404efe0c921 (patch)
treeab9f2fcaa2cb2e76f9045b5ae094ebeeb1f582e6
parente4393cc86c106096e85c8c6d1fa9f1be324cda22 (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
24PROGNAME = mush
25
24FQBN = esp8266:esp8266:espmxdevkit 26FQBN = esp8266:esp8266:espmxdevkit
25IOT_NAME = mush 27MDNS_NAME = $(PROGNAME)
26OTA_PORT = 8266 28OTA_PORT = 8266
27OTA_PASS = 29OTA_PASS =
28 30
@@ -32,10 +34,10 @@ cli = arduino-cli -b "$(FQBN)"
32 34
33BUILD_DIR != $(cli) compile --show-properties | sed -ne 's/^build.path=//p' 35BUILD_DIR != $(cli) compile --show-properties | sed -ne 's/^build.path=//p'
34 36
35SRC := main.ino 37SRC := CCS811.cpp $(PROGNAME).ino
36HDRS := $(wildcard *.h) 38HDRS := CCS811.h ota.h wifiinfo.h
37BIN := $(BUILD_DIR)/main.ino.bin 39BIN := $(BUILD_DIR)/$(PROGNAME).ino.bin
38ELF := $(BUILD_DIR)/main.ino.elf 40ELF := $(BUILD_DIR)/$(PROGNAME).ino.elf
39 41
40all: $(ELF) 42all: $(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
49upload: 51upload:
50 $(cli) upload -p "$(SERIAL_DEV)" 52 $(cli) upload -p "$(SERIAL_DEV)"
51 53
52PLAT_PATH != $(cli) compile --show-properties | sed -ne 's/^runtime.platform.path=//p' 54PLAT_PATH != $(cli) compile --show-properties | sed -ne 's/^runtime.platform.path=//p'
53PY_PATH != $(cli) compile --show-properties | sed -ne 's/^runtime.tools.python3.path=//p' 55PY_PATH != $(cli) compile --show-properties | sed -ne 's/^runtime.tools.python3.path=//p'
54IOT_IP != getent ahostsv4 mush.local | (read ip _; echo $$ip) 56MDNS_IP != getent ahostsv4 $(MDNS_NAME).local | (read ip _; echo $$ip)
55 57
56ota: $(BIN) 58ota: $(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/ota.h b/ota.h
index 28fb37b..28fb37b 100644
--- a/src/main/ota.h
+++ b/ota.h
diff --git a/src/main/wifiinfo.h b/wifiinfo.h
index fb94cdd..fb94cdd 100644
--- a/src/main/wifiinfo.h
+++ b/wifiinfo.h