moved IDE to platform.io, fixed library conflict with HardwareSerial.h

wifitest
phail 2018-08-25 01:10:44 +02:00
parent e55e582535
commit 7f7961948c
4 changed files with 59 additions and 3 deletions

41
lib/readme.txt Normal file
View File

@ -0,0 +1,41 @@
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
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
| |
| |--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
- https://docs.platformio.org/page/librarymanager/ldf.html

14
platformio.ini Normal file
View File

@ -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
; https://docs.platformio.org/page/projectconf.html
[env:nodemcu-32s]
platform = espressif32
board = nodemcu-32s
framework = arduino

View File

@ -6,6 +6,7 @@
// or any other situations where system failure may affect
// user or environmental safety.
#include <Arduino.h>
#include "config.h"
#include <esp_wifi.h>
#include <WiFi.h>
@ -23,8 +24,8 @@ BluetoothSerial SerialBT;
#endif // OTA_HANDLER
HardwareSerial Serial1(1);
HardwareSerial Serial2(2);
//HardwareSerial Serial1(1); // already defined in HardwareSerial.h - Hardware serial library for Wiring
//HardwareSerial Serial2(2); // already defined in HardwareSerial.h - Hardware serial library for Wiring
HardwareSerial* COM[NUM_COM] = {&Serial, &Serial1 , &Serial2};
#define MAX_NMEA_CLIENTS 4
@ -239,4 +240,4 @@ void loop()
}
}
}