@@ -103,16 +103,24 @@ function install_ide()
103103{
104104 local ide_path=$1
105105 local core_path=$2
106+ local debug=$3
106107 wget -O arduino.tar.xz https://www.arduino.cc/download.php? f=/arduino-nightly-linux64.tar.xz
107108 tar xf arduino.tar.xz
108109 mv arduino-nightly $ide_path
109110 cd $ide_path /hardware
110111 mkdir esp8266com
111112 cd esp8266com
112113 ln -s $core_path esp8266
114+ local debug_flags=" "
115+ if [ " $debug " = " debug" ]; then
116+ debug_flags=" -DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM"
117+ fi
113118 # Set custom warnings for all builds (i.e. could add -Wextra at some point)
114- echo " compiler.c.extra_flags=-Wall -Werror" > esp8266/platform.local.txt
115- echo " compiler.cpp.extra_flags=-Wall -Werror" >> esp8266/platform.local.txt
119+ echo " compiler.c.extra_flags=-Wall -Wextra -Werror $debug_flags " > esp8266/platform.local.txt
120+ echo " compiler.cpp.extra_flags=-Wall -Wextra -Werror $debug_flags " >> esp8266/platform.local.txt
121+ echo -e " \n----platform.local.txt----"
122+ cat esp8266/platform.local.txt
123+ echo -e " \n----\n"
116124 cd esp8266/tools
117125 python get.py
118126 export PATH=" $ide_path :$core_path /tools/xtensa-lx106-elf/bin:$PATH "
@@ -197,10 +205,11 @@ function build_sketches_with_platformio()
197205
198206function install_arduino()
199207{
208+ local debug=$1
200209 # Install Arduino IDE and required libraries
201210 echo -e " travis_fold:start:sketch_test_env_prepare"
202211 cd $TRAVIS_BUILD_DIR
203- install_ide $HOME /arduino_ide $TRAVIS_BUILD_DIR
212+ install_ide $HOME /arduino_ide $TRAVIS_BUILD_DIR $debug
204213 which arduino
205214 cd $TRAVIS_BUILD_DIR
206215 install_libraries
@@ -248,13 +257,19 @@ if [ -z "$TRAVIS_BUILD_DIR" ]; then
248257fi
249258
250259if [ " $BUILD_TYPE " = " build" ]; then
251- install_arduino
260+ install_arduino nodebug
252261 build_sketches_with_arduino 1 0
253262elif [ " $BUILD_TYPE " = " build_even" ]; then
254- install_arduino
263+ install_arduino nodebug
255264 build_sketches_with_arduino 2 0
256265elif [ " $BUILD_TYPE " = " build_odd" ]; then
257- install_arduino
266+ install_arduino nodebug
267+ build_sketches_with_arduino 2 1
268+ elif [ " $BUILD_TYPE " = " debug_even" ]; then
269+ install_arduino debug
270+ build_sketches_with_arduino 2 0
271+ elif [ " $BUILD_TYPE " = " debug_odd" ]; then
272+ install_arduino debug
258273 build_sketches_with_arduino 2 1
259274elif [ " $BUILD_TYPE " = " platformio" ]; then
260275 # PlatformIO
0 commit comments