Build process wont differantiate env and install on both
See original GitHub issueWhat kind of issue is this?
- Development Platform or Board. All issues (building, uploading, adding new boards, etc.) related to PlatformIO development platforms should be reported to appropriate repository related to your hardware https://github.com/topics/platformio-platform
- PlatformIO Core. If you’ve found a bug, please provide an information below.
Configuration
Operating system: MacOS 10.13.6 (17G4015)
PlatformIO Version (platformio --version
):
PlatformIO, version 3.6.7
Description of problem
I wanna use analogWrite
on a ESP32 as well on a ESP8266. ESP32 needs an additional lib, because it’s (still) not implemented yet.
Steps to Reproduce
- Setup new project with
platformio.ini
- Copy/Paste this into your `main.cpp
- Compile
- you will also see, that ESP32 AnalogWrite is present in heltec_wifi_kit_8 and .piolibdeps.
Actual Results
ESP8266 is not compiling, because it’s implementing ESP32 AnalogWrite, which is NOT in the ESP8266 env.
Expected Results
ESP32 AND ESP8266 should compile without ESP32 AnalogRead
If problems with PlatformIO Build System:
The content of platformio.ini
:
[env]
monitor_speed = 115200
[env:heltec_wifi_kit_8]
platform = espressif8266
board = heltec_wifi_kit_8
framework = arduino
build_flags = -DESP8266
[env:heltec_wifi_kit_32]
platform = espressif32
board = heltec_wifi_kit_32
framework = arduino
lib_deps = ESP32 AnalogWrite
build_flags = -DESP32
Source file to reproduce issue:
#include <Arduino.h>
#ifdef ESP32
#include <analogWrite.h> // <<<<---- SHOULD ONLY BE INCLUDED ON ESP32
#endif // ESP32
int brightStep = 1;
int brightness = 0;
void setup()
{
}
void loop()
{
brightness += brightStep;
if (brightness == 0 || brightness == 255)
{
brightStep = -brightStep;
}
analogWrite(LED_BUILTIN, brightness);
delay(10);
}
Additional info
Here is a list of libs automatically implemented on build time: As you can see heltec_wifi_kit_8 also includes ESP32 AnalogWrite
which should not be there:
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Managing multiple environment configurations in React App
Install env -cmd npm: Either use the command npm install env-cmd or npm install -g env-cmd. Different scenarios in React App have been...
Read more >'virtualenv' won't activate on Windows - Stack Overflow
To install a virtual environment in Windows PowerShell only, but to activate, you'll need to run Windows PowerShell as an Administrator:.
Read more >Python Virtual Environments: A Primer
If you install two different versions of the same package into your global Python environment, the second installation overwrites the first one.
Read more >How to set up iOS environments: develop, staging ... - Sarunw
Learn how to create a separate environment for your app with the help of Configuration and Scheme. Create a different app and variables...
Read more >Python Virtual Environments tutorial using Virtualenv and Poetry
A mini-guided Python tutorial showing how to use virtual environment and why it's matters on virtualenv and poetry illustrated examples.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You do not need to fix custom path. Be sure that there are no multiple PIO Cores in a system. After that, please remove
~/.platformio/penv
and restart VSCode. If you enbaled dev/version in IDE before, installer with install the latest dev/ version autoamtically.Please re-test.
@ivankravets: YES. I only had to fix my customPATH in the settings. Hope this gets fixed in the stable version 😃