This commit is contained in:
Glyn Hudson 2016-09-24 19:26:30 +01:00
parent e35a4f96e5
commit 98ec91b7a3
4 changed files with 95 additions and 29 deletions

10
.gitignore vendored
View File

@ -1,19 +1,15 @@
.pioenvs
.clang_complete
.gcc-flags.json
.piolibdeps
*~
# Ignore list for Eagle, a PCB layout tool
# Backup files
*.s#?
*.b#?
*.l#?
# file locks introduced since 7.x
*.lck
# OS generated files #
######################
.DS_Store
@ -21,5 +17,3 @@ ehthumbs.db
Icon?
Thumbs.db
*/overlays
*~

36
lib/readme.txt Normal file
View File

@ -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/en/stable/librarymanager/ldf.html

View File

@ -18,15 +18,51 @@
# targets = upload
[platformio]
src_dir = src
env_default = emonth2
[common]
lib_deps_external =
DHT sensor library @1.2.3
DallasTemperature @3.7.7
JeeLib @c057b5f4c0
SI7021 @c5ce0922ef
[env:emonth2]
platform = atmelavr
framework = arduino
board = uno
lib_install = 19, 54, 252, 536
lib_deps = ${common.lib_deps_external}
# [ 19 ] Adafruit-DHT
# [ 54 ] DallasTemperature
# [ 252 ] JeeLib
# [ 536 ] https://github.com/LowPowerLab/SI7021
[env:isp]
# upload using isp
# $ pio run -t program -e isp
platform = atmelavr
framework = arduino
board = uno
lib_deps = ${common.lib_deps_external}
upload_protocol = stk500v2
upload_flags = -Pusb
[common]
build_flags = -D BUILD_TAG=2.5.0
# http://docs.platformio.org/en/stable/projectconf.html#lib-deps
lib_deps_external =
DallasTemperature @3.7.7
EmonLib
JeeLib@c057b5f4c0
[env:emontx]
platform = atmelavr
framework = arduino
board = uno
build_flags = ${common.build_flags}
[env:emontx_deploy]
platform = atmelavr
framework = arduino
board = uno
lib_deps = ${common.lib_deps_external}
build_flags = !echo '-DBUILD_TAG='$TRAVIS_TAG

View File

@ -175,7 +175,7 @@ void setup() {
rf12_sleep(RF12_SLEEP);
if (debug==1)
{
Serial.begin(9600);
Serial.begin(115200);
Serial.print(DIP1); Serial.println(DIP2);
Serial.println("OpenEnergyMonitor.org");
Serial.print("emonTH - Firmware V"); Serial.println(version*0.1);