From 402de8726523bc59ca8c9f4f523f5f61c3076b1e Mon Sep 17 00:00:00 2001 From: gmag11 Date: Thu, 26 Nov 2020 17:39:05 +0100 Subject: [PATCH] Add platformio ini file to examples --- examples/advancedExample/platformio.ini | 36 +++++++++++++++++++++++++ examples/basicExample/platformio.ini | 6 ++--- examples/ledFlasher/platformio.ini | 36 +++++++++++++++++++++++++ library.json | 24 ++++++++++++++++- 4 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 examples/advancedExample/platformio.ini create mode 100644 examples/ledFlasher/platformio.ini diff --git a/examples/advancedExample/platformio.ini b/examples/advancedExample/platformio.ini new file mode 100644 index 0000000..edc51d1 --- /dev/null +++ b/examples/advancedExample/platformio.ini @@ -0,0 +1,36 @@ +; 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 +; https://docs.platformio.org/page/projectconf.html + +[platformio] +src_dir = . +;lib_dir = ../.. + +[debug] +debug = ;-D DEBUG_NTPCLIENT + +[env] +upload_speed = 921600 +monitor_speed = 115200 +lib_deps = + ESPNtpClient + +[env:esp32] +platform = espressif32 +board = esp32dev +build_flags = -std=c++11 ${debug.debug} +framework = arduino + +[env:esp8266] +platform = espressif8266 +board = esp12e +build_flags = -std=c++11 -D PIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191122 ${debug.debug} +framework = arduino + + diff --git a/examples/basicExample/platformio.ini b/examples/basicExample/platformio.ini index 551922d..edc51d1 100644 --- a/examples/basicExample/platformio.ini +++ b/examples/basicExample/platformio.ini @@ -10,7 +10,7 @@ [platformio] src_dir = . -lib_dir = ../.. +;lib_dir = ../.. [debug] debug = ;-D DEBUG_NTPCLIENT @@ -18,8 +18,8 @@ debug = ;-D DEBUG_NTPCLIENT [env] upload_speed = 921600 monitor_speed = 115200 -;lib_deps = -; ESPNtpClient +lib_deps = + ESPNtpClient [env:esp32] platform = espressif32 diff --git a/examples/ledFlasher/platformio.ini b/examples/ledFlasher/platformio.ini new file mode 100644 index 0000000..edc51d1 --- /dev/null +++ b/examples/ledFlasher/platformio.ini @@ -0,0 +1,36 @@ +; 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 +; https://docs.platformio.org/page/projectconf.html + +[platformio] +src_dir = . +;lib_dir = ../.. + +[debug] +debug = ;-D DEBUG_NTPCLIENT + +[env] +upload_speed = 921600 +monitor_speed = 115200 +lib_deps = + ESPNtpClient + +[env:esp32] +platform = espressif32 +board = esp32dev +build_flags = -std=c++11 ${debug.debug} +framework = arduino + +[env:esp8266] +platform = espressif8266 +board = esp12e +build_flags = -std=c++11 -D PIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191122 ${debug.debug} +framework = arduino + + diff --git a/library.json b/library.json index 81595eb..cb217d5 100644 --- a/library.json +++ b/library.json @@ -16,6 +16,28 @@ "type": "git", "url": "https://github.com/gmag11/ESPNtpClient.git" }, - "examples": ["examples/basicExample/basicExample.ino", "examples/advancedExample/advancedExample.ino"] + "examples": [{ + "name": "Basic example", + "base": "examples/basicExample", + "files": [ + "platformio.ini", + "basicExample.ino" + ] + },{ + "name": "Advanced example", + "base": "examples/advancedExample", + "files": [ + "platformio.ini", + "advancedExample.ino" + ] + }, + { + "name": "LED Flasher", + "base": "examples/ledFlasher", + "files": [ + "platformio.ini", + "ledFlasher.ino" + ] + }] }