From f17d85780881f3319cb255f61069898b691dd75a Mon Sep 17 00:00:00 2001 From: livello Date: Tue, 15 May 2018 12:46:25 +0300 Subject: [PATCH] revert --- README.md | 5 ++++- build_flags_template.sh | 26 ++++++++++++++++++++++++++ custom_build_flags_template.py | 25 ------------------------- platformio.ini | 5 +---- 4 files changed, 31 insertions(+), 30 deletions(-) create mode 100644 build_flags_template.sh delete mode 100644 custom_build_flags_template.py diff --git a/README.md b/README.md index 2be4eed..7c245fa 100644 --- a/README.md +++ b/README.md @@ -110,9 +110,12 @@ pio init --ide [atom|clion|codeblocks|eclipse|emacs|netbeans|qtcreator|sublimete ``` Set custom build flags. first make your own copy of template ```bash -cp custom_build_flags_template.py my_custom_build_flags.py +cp build_flags_template.sh my_build_flags.sh ``` then edit, change or comment unnecessary sections and source it +```bash +source my_build_flags.sh +``` build and upload firmware for due|megaatmega2560|esp8266 board ```bash pio run -e due|megaatmega2560|esp8266 -t upload diff --git a/build_flags_template.sh b/build_flags_template.sh new file mode 100644 index 0000000..da7f737 --- /dev/null +++ b/build_flags_template.sh @@ -0,0 +1,26 @@ +#! /bin/bash +# usage: +# first make your own copy of template +# cp build_flags_template.sh my_build_flags.sh +# then edit, change or comment something +# nano my_build_flags.sh +# and source it +# source my_build_flags.sh + echo "\n==============================================Custom build flags are:=====================================================\n" + export FLAGS="-DMY_CONFIG_SERVER=lazyhome.ru" + export FLAGS="$FLAGS -DWATCH_DOG_TICKER_DISABLE" + export FLAGS="$FLAGS -DUSE_1W_PIN=12" + export FLAGS="$FLAGS -DSD_CARD_INSERTED" + export FLAGS="$FLAGS -DSERIAL_BAUD=115200" + export FLAGS="$FLAGS -DWiz5500" + export FLAGS="$FLAGS -DDISABLE_FREERAM_PRINT" + export FLAGS="$FLAGS -DCUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:00" + export FLAGS="$FLAGS -DDMX_DISABLE" + export FLAGS="$FLAGS -DMODBUS_DISABLE" + export FLAGS="$FLAGS -DOWIRE_DISABLE" + export FLAGS="$FLAGS -DAVR_DMXOUT_PIN=18" + export FLAGS="$FLAGS -DCONTROLLINO" + export PLATFORMIO_BUILD_FLAGS="$FLAGS" + echo PLATFORMIO_BUILD_FLAGS=$PLATFORMIO_BUILD_FLAGS + echo "\n==============================================Custom build flags END=====================================================\n" + unset FLAGS \ No newline at end of file diff --git a/custom_build_flags_template.py b/custom_build_flags_template.py deleted file mode 100644 index c8d2f5a..0000000 --- a/custom_build_flags_template.py +++ /dev/null @@ -1,25 +0,0 @@ -# usage: -# first make your own copy of template -# cp custom_build_flags_template.py my_custom_build_flags.py -# then edit, change or comment something - -import os -print("==============================================Custom build flags are:=====================================================") -FLAGS="-DMY_CONFIG_SERVER=lazyhome.ru" -FLAGS+=" -DWATCH_DOG_TICKER_DISABLE" -FLAGS+=" -DUSE_1W_PIN=12" -FLAGS+=" -DSD_CARD_INSERTED" -FLAGS+=" -DSERIAL_BAUD=115200" -FLAGS+=" -DWiz5500" -FLAGS+=" -DDISABLE_FREERAM_PRINT" -FLAGS+=" -DCUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:00" -FLAGS+=" -DDMX_DISABLE" -FLAGS+=" -DMODBUS_DISABLE" -FLAGS+=" -DOWIRE_DISABLE" -FLAGS+=" -DARTNET_ENABLE" -FLAGS+=" -DCONTROLLINO" -FLAGS+=" -DAVR_DMXOUT_PIN=18" - -print(FLAGS) -print("==============================================Custom build flags END=====================================================") -os.environ["PLATFORMIO_BUILD_FLAGS"] = FLAGS \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 5e45e25..7782715 100644 --- a/platformio.ini +++ b/platformio.ini @@ -19,7 +19,6 @@ framework = arduino board = due lib_ldf_mode = chain+ build_flags = !echo -n "-DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short) -extra_scripts = pre:my_custom_build_flags.py lib_deps = https://github.com/sebnil/DueFlashStorage https://github.com/anklimov/Arduino-Temperature-Control-Library.git @@ -44,7 +43,6 @@ board = megaatmega2560 framework = arduino ;lib_ldf_mode = chain+ build_flags = !echo -n "-DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short) -extra_scripts = pre:my_custom_build_flags.py lib_deps = https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/DS2482_OneWire @@ -62,14 +60,13 @@ lib_deps = FastLED EEPROM -extra_scripts = pre:my_custom_build_flags.py [env:esp8266] platform = espressif8266 framework = arduino board = nodemcuv2 lib_ldf_mode = chain+ -extra_scripts = pre:my_custom_build_flags.py +build_flags = !echo -n "-DPIO_SRC_REV="$(git log --pretty=format:%h_%ad -1 --date=short) lib_deps = https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/DS2482_OneWire