Open
Description
@joaopedrotaveira provided instructions in #441 on how to setup a platformio project. These projects work in the classic CDT Editor, but run into a few problems for CDT LSP, at least out of the box.
Here are the instructions from #441, slightly modified.
- Install platformio as instructed here. Quick version is:
$ curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
# review what was downloaded
$ python3 get-platformio.py
$ export PATH=$PWD/.platformio/penv/bin:$PATH
- create project folder:
$ mkdir -p /tmp/platformio-blink-test-1
- Initialize a new project with some board, but specify
eclipse
as IDE
$ cd /tmp/platformio-blink-test-1
$ platformio project init --board esp32-s3-devkitc-1 --ide eclipse
- add basic example of code to
src
, exampleblink.cpp
:
/**
* Blink
* Turns on an LED on for one second,
* then off for one second, repeatedly.
*/
#include "Arduino.h"
void setup()
{
// initialize LED digital pin as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
void loop()
{
// turn the LED on (HIGH is the voltage level)
digitalWrite(LED_BUILTIN, HIGH);
// wait for a second
delay(1000);
// turn the LED off by making the voltage LOW
digitalWrite(LED_BUILTIN, LOW);
// wait for a second
delay(1000);
}
- one can see that eclipse project files are in the folder
$ ls -a
.
..
.cproject
.gitignore
.pio
.project
.settings
include
lib
platformio.ini
src
test
- open Eclipse for C/C++ Developers and import the project folder
- Build the project
- Open blink.cpp in the CDT Editor - observe everything works
- Click "try the new c/c++ editing experience" and reopen editors in CDT LSP Editor - observe many error and warning markers
Metadata
Metadata
Assignees
Labels
No labels