-
-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
167 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Release History | ||
=============== | ||
|
||
0.2.0 (2014-06-15) | ||
------------------ | ||
|
||
* Resolved `issue #1 "Build referred libraries" <https://github.com/ivankravets/platformio/issues/1>`_ | ||
* Renamed project's "libs" directory to "lib" | ||
* Added `arduino-internal-library <https://github.com/ivankravets/platformio/tree/develop/examples/arduino-internal-library>`_ example | ||
* Changed to beta status | ||
|
||
|
||
0.1.0 (2014-06-13) | ||
------------------ | ||
|
||
* Birth! First alpha release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Arduino Example: Build code with internal library | ||
================================================= | ||
|
||
1. Download ``platformio`` | ||
`sources <https://github.com/ivankravets/platformio/archive/develop.zip>`_ | ||
2. Extract ZIP archive | ||
3. Then run these commands: | ||
|
||
.. code-block:: bash | ||
# Change directory to example | ||
$ cd platformio-develop/examples/arduino-internal-library/ | ||
# Install Atmel AVR development platform with Arduino Framework | ||
$ platformio install atmelavr | ||
# Process example project | ||
$ platformio run | ||
.. image:: console-result.png |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright (C) Ivan Kravets <[email protected]> | ||
# See LICENSE for details. | ||
|
||
[env:arduino_pro5v] | ||
platform = atmelavr | ||
framework = arduino | ||
board = pro16MHzatmega168 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Copyright (C) Ivan Kravets <[email protected]> | ||
* See LICENSE for details. | ||
*/ | ||
|
||
/* | ||
* EEPROM Read | ||
* | ||
* Reads the value of each byte of the EEPROM and prints it | ||
* to the computer. | ||
* This example code is in the public domain. | ||
* | ||
* https://github.com/arduino/Arduino/blob/master/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino | ||
*/ | ||
|
||
#include <Arduino.h> | ||
#include <EEPROM.h> | ||
|
||
// start reading from the first byte (address 0) of the EEPROM | ||
int address = 0; | ||
byte value; | ||
|
||
void setup() | ||
{ | ||
// initialize serial and wait for port to open: | ||
Serial.begin(9600); | ||
while (!Serial) { | ||
; // wait for serial port to connect. Needed for Leonardo only | ||
} | ||
} | ||
|
||
void loop() | ||
{ | ||
// read a byte from the current address of the EEPROM | ||
value = EEPROM.read(address); | ||
|
||
Serial.print(address); | ||
Serial.print("\t"); | ||
Serial.print(value, DEC); | ||
Serial.println(); | ||
|
||
// advance to the next address of the EEPROM | ||
address = address + 1; | ||
|
||
// there are only 512 bytes of EEPROM, from 0 to 511, so if we're | ||
// on address 512, wrap around to address 0 | ||
if (address == 512) | ||
address = 0; | ||
|
||
delay(500); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Copyright (C) Ivan Kravets <[email protected]> | ||
# See LICENSE for details. | ||
|
||
VERSION = (0, 1, 0) | ||
VERSION = (0, 2, 0) | ||
__version__ = ".".join([str(s) for s in VERSION]) | ||
|
||
__title__ = "platformio" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
# Copyright (C) Ivan Kravets <[email protected]> | ||
# See LICENSE for details. | ||
|
||
from os import walk | ||
from os.path import isfile, join | ||
import re | ||
from os import listdir, walk | ||
from os.path import isdir, isfile, join | ||
from time import sleep | ||
|
||
from serial import Serial | ||
|
@@ -17,10 +18,34 @@ def BuildLibrary(env, variant_dir, library_dir): | |
) | ||
|
||
|
||
def BuildDependentLibraries(env, src_dir): | ||
libs = [] | ||
for deplibfile in env.GetDependentLibraries(src_dir): | ||
for lsd_dir in env['LIBSOURCE_DIRS']: | ||
lsd_dir = env.subst(lsd_dir) | ||
if not isdir(lsd_dir): | ||
continue | ||
for libname in listdir(lsd_dir): | ||
if not isfile(join(lsd_dir, libname, deplibfile)): | ||
continue | ||
_libbuild_dir = join("$BUILD_DIR", libname) | ||
env.Append(CPPPATH=[_libbuild_dir]) | ||
libs.append( | ||
env.BuildLibrary(_libbuild_dir, join(lsd_dir, libname))) | ||
return libs | ||
|
||
|
||
def BuildFirmware(env, libslist): | ||
src = env.Clone() | ||
vdirs = src.VariantDirRecursive(join("$BUILD_DIR", "src"), | ||
join("$PROJECT_DIR", "src")) | ||
vdirs = src.VariantDirRecursive( | ||
join("$BUILD_DIR", "src"), join("$PROJECT_DIR", "src")) | ||
|
||
# build source's dependent libs | ||
for vdir in vdirs: | ||
_libs = src.BuildDependentLibraries(vdir) | ||
if _libs: | ||
libslist += _libs | ||
|
||
return src.Program( | ||
join("$BUILD_DIR", "firmware"), | ||
[src.GlobCXXFiles(vdir) for vdir in vdirs], | ||
|
@@ -38,6 +63,14 @@ def GlobCXXFiles(env, path): | |
return files | ||
|
||
|
||
def GetDependentLibraries(env, src_dir): | ||
deplibs = [] | ||
regexp = re.compile(r"^#include\s+<([^>]+)>", re.M) | ||
for node in env.GlobCXXFiles(src_dir): | ||
deplibs += regexp.findall(node.get_text_contents()) | ||
return deplibs | ||
|
||
|
||
def VariantDirRecursive(env, variant_dir, src_dir, duplicate=True): | ||
# add root dir by default | ||
variants = [variant_dir] | ||
|
@@ -101,8 +134,10 @@ def exists(_): | |
|
||
def generate(env): | ||
env.AddMethod(BuildLibrary) | ||
env.AddMethod(BuildDependentLibraries) | ||
env.AddMethod(BuildFirmware) | ||
env.AddMethod(GlobCXXFiles) | ||
env.AddMethod(GetDependentLibraries) | ||
env.AddMethod(VariantDirRecursive) | ||
env.AddMethod(ParseBoardOptions) | ||
env.AddMethod(ResetDevice) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
click==2.0 | ||
click==2.1 | ||
colorama==0.3.1 | ||
pyserial==2.7 | ||
requests=2.3.0 | ||
scons=2.3.0 | ||
requests==2.3.0 | ||
scons==2.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters