I had 3 build environments (nanoatmega328, megaatmega2560, due) but for now I don’t want to build for the due. So, I commented out that environment section in platformio.ini
e.g.
> [env:nanoatmega328]
> build_flags = -D DEBUG_MODE=1 -D USE_NEOPIXEL_LEDS -D USE_U8GLIB_GRAPHICS -Wno-unknown-pragmas
> lib_ldf_mode = chain+
> platform = atmelavr
> board = nanoatmega328
> framework = arduino
> upload_port = /dev/tty.usbserial-A6YHB9OW
[env:megaatmega2560]
build_flags = -D DEBUG_MODE=1 -D USE_NEOPIXEL_LEDS -D USE_U8GLIB_GRAPHICS -Wno-unknown-pragmas
lib_ldf_mode = chain+
platform = atmelavr
board = megaatmega2560
framework = arduino
upload_port = /dev/tty.usbmodem14141
;[env:due]
;build_flags = -D DEBUG_MODE=1 -D USE_NEOPIXEL_LEDS -D USE_U8GLIB_GRAPHICS -Wno-unknown-pragmas
;lib_ldf_mode = chain+
;platform = atmelsam
;board = due
;framework = arduino
;upload_port = /dev/cu.usbmodem1421
;lib_ignore = EEPROM
When I go to build, I get the success on the first two
========================= [SUCCESS] Took 6.41 seconds =========================
================================== [SUMMARY] ================================== Environment nanoatmega328 [SUCCESS] Environment megaatmega2560 [SUCCESS] ========================= [SUCCESS] Took 13.05 seconds ========================= Built target PLATFORMIO_BUILD
But then the build keeps going and generates a hundred warnings that look like:
Scanning dependencies of target PixelPacerController_v0.6 [ 12%] Building CXX object CMakeFiles/PixelPacerController_v0.6.dir/src/PPC_ColorUtilities.cpp.o [ 25%] Building CXX object CMakeFiles/PixelPacerController_v0.6.dir/src/PPC_Displays_u8glib.cpp.o [ 37%] Building CXX object CMakeFiles/PixelPacerController_v0.6.dir/src/PPC_FreeRAM.cpp.o [ 50%] Building CXX object CMakeFiles/PixelPacerController_v0.6.dir/src/PPC_GeneralUtilities.cpp.o [ 62%] Building CXX object CMakeFiles/PixelPacerController_v0.6.dir/src/PPC_Modes.cpp.o [ 75%] Building CXX object CMakeFiles/PixelPacerController_v0.6.dir/src/PPC_Settings.cpp.o [ 87%] Building CXX object CMakeFiles/PixelPacerController_v0.6.dir/src/PixelPacerController.cpp.o In file included from /Users/red/.platformio/packages/framework-arduinoavr/cores/arduino/USBAPI.h:27:0, from /Users/red/.platformio/packages/framework-arduinoavr/cores/arduino/Arduino.h:233, from /Users/red/Documents/Computer_Science/ARDUINO_DEVELOPMENT/PixelPacer/PixelPacerController_v0.6/src/PPC_ColorUtilities.h:11, from /Users/red/Documents/Computer_Science/ARDUINO_DEVELOPMENT/PixelPacer/PixelPacerController_v0.6/src/PPC_ColorUtilities.cpp:8: /Users/red/.platformio/packages/toolchain-atmelavr/avr/include/util/delay.h:112:3: warning: #warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed" [-Wcpp] # warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"
Uncommenting that section stops all the errors. This is repeatable in my environment (CLion).
Note, I also tried:
[platformio] env_default = nanoatmega328, megaatmega2560
Which generates the following:
========================= [SUCCESS] Took 6.54 seconds =========================
================================== [SUMMARY] ================================== Environment nanoatmega328 [SUCCESS] Environment megaatmega2560 [SUCCESS] Environment due [SKIP] ========================= [SUCCESS] Took 12.87 seconds ========================= Built target PLATFORMIO_BUILD
But immediately after, it still puts out hundreds of lines of errors and warnings.