diff --git a/check_custom_build_flags_controllino.sh b/check_custom_build_flags_controllino.sh new file mode 100755 index 0000000..c0411cc --- /dev/null +++ b/check_custom_build_flags_controllino.sh @@ -0,0 +1,8 @@ +#! /bin/bash +export FLAGS="$FLAGS -DCONTROLLINO" +export FLAGS="$FLAGS -DCUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:07" +CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_controllino.sh +if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then + source $CUSTOM_BUILD_FLAGS_FILE +fi + echo $FLAGS diff --git a/check_custom_build_flags_due-5500.sh b/check_custom_build_flags_due-5500.sh new file mode 100755 index 0000000..c03a0ac --- /dev/null +++ b/check_custom_build_flags_due-5500.sh @@ -0,0 +1,8 @@ +#! /bin/bash +export FLAGS="$FLAGS -DWiz5500" +export FLAGS="$FLAGS -DARTNET_ENABLE" +CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_due-5500.sh +if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then + source $CUSTOM_BUILD_FLAGS_FILE +fi + echo $FLAGS diff --git a/check_custom_build_flags_due.sh b/check_custom_build_flags_due.sh new file mode 100755 index 0000000..75bf199 --- /dev/null +++ b/check_custom_build_flags_due.sh @@ -0,0 +1,6 @@ +#! /bin/bash +CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_due.sh +if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then + source $CUSTOM_BUILD_FLAGS_FILE +fi + echo $FLAGS diff --git a/check_custom_build_flags_esp32.sh b/check_custom_build_flags_esp32.sh new file mode 100755 index 0000000..093eabc --- /dev/null +++ b/check_custom_build_flags_esp32.sh @@ -0,0 +1,6 @@ +#! /bin/bash +CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_esp32.sh +if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then + source $CUSTOM_BUILD_FLAGS_FILE +fi + echo $FLAGS diff --git a/check_custom_build_flags_esp8266.sh b/check_custom_build_flags_esp8266.sh new file mode 100755 index 0000000..37f2331 --- /dev/null +++ b/check_custom_build_flags_esp8266.sh @@ -0,0 +1,6 @@ +#! /bin/bash +CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_esp8266.sh +if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then + source $CUSTOM_BUILD_FLAGS_FILE +fi + echo $FLAGS diff --git a/check_custom_build_flags_mega2560-net.sh b/check_custom_build_flags_mega2560-net.sh new file mode 100755 index 0000000..af70285 --- /dev/null +++ b/check_custom_build_flags_mega2560-net.sh @@ -0,0 +1,6 @@ +#! /bin/bash +CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_mega2560-net.sh +if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then + source $CUSTOM_BUILD_FLAGS_FILE +fi + echo $FLAGS diff --git a/check_custom_build_flags_mega2560.sh b/check_custom_build_flags_mega2560.sh new file mode 100755 index 0000000..acfe945 --- /dev/null +++ b/check_custom_build_flags_mega2560.sh @@ -0,0 +1,9 @@ +#! /bin/bash +CUSTOM_BUILD_FLAGS_FILE="custom-build-flags/build_flags_mega2560.sh" +#CUSTOM_BUILD_FLAGS_FILE="custom-build-flags/build_flags_$PIOENV.sh" +#echo $PIOENV > custom-build-flags/1.txt +#TODO: make one file for all envs +if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then + source $CUSTOM_BUILD_FLAGS_FILE +fi + echo $FLAGS diff --git a/check_custom_build_flags_stm32.sh b/check_custom_build_flags_stm32.sh new file mode 100755 index 0000000..6f9d7c2 --- /dev/null +++ b/check_custom_build_flags_stm32.sh @@ -0,0 +1,6 @@ +#! /bin/bash +CUSTOM_BUILD_FLAGS_FILE=custom-build-flags/build_flags_stm32.sh +if [ -f $CUSTOM_BUILD_FLAGS_FILE ]; then + source $CUSTOM_BUILD_FLAGS_FILE +fi + echo $FLAGS diff --git a/build_flags_template.sh b/custom-build-flags/build_flags_template.sh similarity index 100% rename from build_flags_template.sh rename to custom-build-flags/build_flags_template.sh diff --git a/platformio.ini b/platformio.ini index d4bb7b5..7a4e33c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,14 +10,14 @@ [platformio] src_dir = lighthub env_default = - megaatmega2560 +; megaatmega2560 ; megaatmega2560-net ; due ; esp8266 ; esp32 ; megaatmega2560-5500 ; due-5500 -; controllino + controllino ; stm32 ;build_dir = !sh pioenvs.sh ${platformio.env_default} @@ -30,7 +30,7 @@ platform = espressif32 framework = arduino board = pico32 lib_ldf_mode = chain+ -build_flags = !sh build_flags_esp32.sh +build_flags = !bash check_custom_build_flags_esp32.sh lib_deps = https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/DS2482_OneWire @@ -55,7 +55,7 @@ upload_protocol = stlink debug_tool = stlink extra_scripts = pre:!pre_stm32.sh ;lib_ldf_mode = chain+ -build_flags = !sh build_flags_stm32.sh +build_flags = !bash check_custom_build_flags_stm32.sh lib_deps = DallasTemperature https://github.com/anklimov/aJson @@ -78,7 +78,7 @@ platform = atmelsam framework = arduino board = due lib_ldf_mode = chain+ -build_flags = !sh build_flags_due.sh +build_flags = !bash check_custom_build_flags_due.sh lib_deps = https://github.com/sebnil/DueFlashStorage https://github.com/anklimov/Arduino-Temperature-Control-Library.git @@ -97,6 +97,7 @@ lib_deps = Adafruit Unified Sensor DHT sensor library https://github.com/arcao/Syslog.git + Streaming [env:megaatmega2560] @@ -105,8 +106,10 @@ board = megaatmega2560 ;upload_port = net:192.168.88.31:23 framework = arduino ;lib_ldf_mode = chain+ -build_flags = !sh build_flags_mega2560.sh +build_flags = !bash check_custom_build_flags_mega2560.sh lib_deps = + https://github.com/anklimov/Arduino-Temperature-Control-Library.git + https://github.com/anklimov/DS2482_OneWire https://github.com/anklimov/DmxSimple https://github.com/anklimov/httpClient https://github.com/anklimov/aJson @@ -129,7 +132,7 @@ platform = espressif8266 framework = arduino board = nodemcuv2 lib_ldf_mode = chain+ -build_flags = !sh build_flags_esp8266.sh +build_flags = !bash check_custom_build_flags_esp8266.sh lib_deps = https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/DS2482_OneWire @@ -153,7 +156,7 @@ platform = atmelavr board = megaatmega2560 framework = arduino upload_port = net:192.168.88.2:23000 -build_flags = !sh build_flags_mega2560-net.sh +build_flags = !bash check_custom_build_flags_mega2560-net.sh ;lib_ldf_mode = chain+ lib_deps = https://github.com/anklimov/Arduino-Temperature-Control-Library.git @@ -180,8 +183,7 @@ platform = atmelsam framework = arduino board = due ;lib_ldf_mode = chain+ -build_flags = -D Wiz5500 -D ARTNET_ENABLE -build_flags = !sh build_flags_due-5500.sh +build_flags = !bash check_custom_build_flags_due-5500.sh lib_deps = https://github.com/sebnil/DueFlashStorage https://github.com/anklimov/Arduino-Temperature-Control-Library.git @@ -207,8 +209,7 @@ platform = atmelavr board = megaatmega2560 framework = arduino ;lib_ldf_mode = chain+ -build_flags = !echo -n "-DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short) -build_flags = -D CONTROLLINO -D CUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:07 +build_flags = !bash check_custom_build_flags_controllino.sh lib_deps = https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/DS2482_OneWire