-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
installation in platform.io #6
Comments
Hey there! I'm sure it can be, but to be honest I've really only used other people's board setups in PlatformIO and never been customizing much there. It's on my list to figure that out and make it just as nice and "works out of the box" there as it is in the Arduino IDE. Tomorrow I'm getting the 2 x Wireless Stick Lite I ordered, but that should be minimal work, mostly just verifying that it's like I expect it is and adding a |
My (humble) answer is Yes, but.... I've only been playing with PlatformIO/C++/VScode for a few months. Even though I sport old gray hairs, I don't consider myself an expert at this new fangled (and wonderful) stuff. The library installs and is easily usable in single file projects. However, I had duplicated code blocks causing linker problems (even with the no instance macros) with includes in multiple cpp files. For me, it was easiest to duplicate the heltec.h file as a pure include (heltec_api.h) that just references/externs much of the original work. While not pure, this worked for me. I mention it only as an additional include file (and minor refactoring) may keep with the original intent (it just works), while providing api definitions for old foggies that need to include the library definitions throughout multiple files within a project. Again, my thanks for the library. It saved me a lot of work doing exactly the same on my own.
And my heltec_api.h : (essentially just function prototypes and defines). Worthy as a discussion, but not worthy as a solution.
|
Hello, My platformio.ini is pretty simple :
In main.cpp :
heltec_api.h is a simple copy/paste of file in previous comment in the same dir of main.cpp. So as my understanding, heltec_api.h is included with functions definitions but not the function code itself. Could you point me out what I missed please ? Thanks ! |
What I do is include heltec_unofficial.h (once, in main.c). From there, I call heltec_setup() (in setup()). Everywhere else (any other .c/.cpp files) I include heltec_api.h; but NOT heltec_unofficial.h. Yes, heltec_api.h is really a cut and paste (hack) of the original heltec_unofficial.h to avoid duplicate code definitions. Sorry for any confusion. I wish my documentation skills were 1/4 as good as @ropg. |
Wow, that's exactly the point I was missing ! Thanks a lot ! |
PlatformIO is much better than the Arduino IDE. How To: The platfomio.ini looks then like this:
I you create a new PlatformIO project from the wizard
Copy all from the example *.ino to the main.cpp (if you have a main.c rename it to main.cpp) If you facing errors like this: .pio/libdeps/heltec_wifi_lora_32_V3/Heltec_ESP32_LoRa_v3/src/heltec_unofficial.h:33:19: error: 'const uint8_t GPIO_NUM_8' redeclared as different kind of symbol The change all these lines in the .pio/libdeps/heltec_wifi_lora_32_V3/Heltec_ESP32_LoRa_v3/src/heltec_unofficial.h
to:
This is necessary due to the fact that these are already defined in the If you face issues like this:
then just move the function
higher or even on top of the file before the first usage. |
There is a neat project on GitHub which abuses the bootloader: |
Hi! This may be me because I'm fairly new to IOT development, but I wanted to use this library on Platform.io instead of the arduino IDE, but it's not clear to me how to add it unofficial boards (if at all possible).
Can this library be installed on Platform.io?
The text was updated successfully, but these errors were encountered: