Usually I work with the Arduino MEGA2560. Therefore I have my standard platformIO.ini file where I can switch the build options between release and debug. For debugging I’m using the avr8-stub debugger of Jan Dolinay. The library of the debugger is located in "lib_extra_dirs ". It’s working fine. Now I was testing a new Arduino nano board with the same project but neither release- nore debug-build can be compiled successfully.
In debug mode it is correct. But in release mode the code where the error occures should not be compiled because it is excluded by a ‘#if SW_DEBUG == true’ statement. This seams to be ignored even it is shown in hover:
My platformIO.ini file looks like this:
[env]
platform = atmelavr
;board = megaatmega2560
;board_build.mcu = atmega2560
board = nanoatmega328
board_build.mcu = atmega328p
framework = arduino
lib_extra_dirs =
C:\Users\heinz\Documents\PlatformIO\Projects\myLibs
[env:debug]
build_type = debug
debug_tool = avr-stub
build_flags =
-DSW_DEBUG=true
:
:
[env:release]
build_type = release
build_flags =
-DSW_DEBUG=false
:
:
Can anybody give any advise or is it a bug in platformIO?