Browse Source

new platformio project

main
Hendrik Langer 8 years ago
parent
commit
4d5107f9fd
  1. 4
      .gitignore
  2. 12
      .gitlab-ci.yml
  3. 36
      lib/readme.txt
  4. 14
      platformio.ini
  5. 32
      src/main.cpp

4
.gitignore

@ -0,0 +1,4 @@
.pioenvs
.piolibdeps
.clang_complete
.gcc-flags.json

12
.gitlab-ci.yml

@ -0,0 +1,12 @@
build:
image: eclipse/platformio
script:
# - platformio lib -g install 1
# - platformio ci --board=esp32thing
- platformio run
- cp /home/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader.bin .pioenvs/esp32thing/
- cp /home/user/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin .pioenvs/esp32thing/
# to flash: esptool.py --before default_reset --after hard_reset --chip esp32 --port "/dev/ttyUSB0" --baud 115200 write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 "/home/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader.bin" 0x8000 ".pioenvs/esp32thing/partitions.bin" 0xe000 "/home/user/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin" 0x10000 .pioenvs/esp32thing/firmware.bin
artifacts:
paths:
- ".pioenvs/esp32thing/*.bin"

36
lib/readme.txt

@ -0,0 +1,36 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organized `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
More information about PlatformIO Library Dependency Finder
- http://docs.platformio.org/page/librarymanager/ldf.html

14
platformio.ini

@ -0,0 +1,14 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html
[env:esp32thing]
platform = espressif32
board = esp32thing
framework = arduino

32
src/main.cpp

@ -0,0 +1,32 @@
/**
* Blink
*
* Turns on an LED on for one second,
* then off for one second, repeatedly.
*
* https://github.com/platformio/platformio-examples/tree/develop/espressif
*/
#include "Arduino.h"
#define LED_PIN 5
void setup()
{
// initialize LED digital pin as an output.
pinMode(LED_PIN, OUTPUT);
}
void loop()
{
// turn the LED on (HIGH is the voltage level)
digitalWrite(LED_PIN, HIGH);
// wait for a second
delay(1000);
// turn the LED off by making the voltage LOW
digitalWrite(LED_PIN, LOW);
// wait for a second
delay(1000);
}
Loading…
Cancel
Save