Closed frazar closed 5 years ago
Sorry, I don't support platformio -- I couldn't make it work at all for me. I know others like it, but... my focus in this platform is on the Arduino environment. I believe that @frankleonrose made PlatformIO work by doing all the -D's from the comand line. one will prevent the lmic_project_config.h from being included. But we can't change lmic_project_config.h at this time.
While investigating the problem, I found that the library already supports a ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS
flag which prevents lmic_project_config.h
from being included!
@frazar With current version (2.3.1) you can set a build flag in platformio.ini
pointing Platformio to a user specific lmic_project_config.h
file:
build_flags = '-DARDUINO_LMIC_PROJECT_CONFIG_H=../../../src/lmic_config.h'
When using mcci lmic as a platformio library, the above path points to a lmic_config.h
file which resides in /src directory of the project.
Thanks for your comments. Please study the flag -D ARDUINO_LMIC_PROJECT_CONFIG_H_SUPPRESS, which is intended for use with PlatformIO, and which causes all definitions to come from the command line.
I'm trying to use the
arduino-lmic
library within a PlatformIO project.My
platformio.ini
looks like this:The
LMIC_DEBUG_LEVEL
andLMIC_PRINTF_TO
flags work as expected. However, the code fails to compile because theCFG_eu868
flag clashes with theCFG_us915
flag defined bylmic_project_config.h
.The complete error message is the following:
I see a number of possible solutions:
src
dir of the project. However, this is tedious, error-prone and prevents the user from taking advantage of the extremely rich dependency management that is provided by PlatformIO.lmic_project_config.h
from defining theCFG_us915
if other flag is already specified.#define
s fromlmic_project_config.h
, and expect the user uncomment the desired flags.