Skip to content

Commit 6b9b780

Browse files
committed
Merge branch 'release/v0.2.0'
2 parents c0dd80e + 8949d43 commit 6b9b780

File tree

16 files changed

+167
-19
lines changed

16 files changed

+167
-19
lines changed

HISTORY.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Release History
2+
===============
3+
4+
0.2.0 (2014-06-15)
5+
------------------
6+
7+
* Resolved `issue #1 "Build referred libraries" <https://github.com/ivankravets/platformio/issues/1>`_
8+
* Renamed project's "libs" directory to "lib"
9+
* Added `arduino-internal-library <https://github.com/ivankravets/platformio/tree/develop/examples/arduino-internal-library>`_ example
10+
* Changed to beta status
11+
12+
13+
0.1.0 (2014-06-13)
14+
------------------
15+
16+
* Birth! First alpha release

README.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ instruments.
3535

3636
**Platformio** is well suited for **embedded development**. It can:
3737

38-
* Compile frameworks and libraries sources to static libraries
38+
* Automatically analyse dependency
39+
* Reliably detect build changes
40+
* Build framework or library source code to static library
3941
* Build *ELF* (executable and linkable firmware)
4042
* Convert *ELF* to *HEX* or *BIN* file
4143
* Extract *EEPROM* data
@@ -285,14 +287,14 @@ Initialize new platformio based project.
285287
# Example
286288
$ platformio init
287289
Project successfully initialized.
288-
Please put your source code to `src` directory, external libraries to `libs`
290+
Please put your source code to `src` directory, external libraries to `lib`
289291
and setup environments in `platformio.ini` file.
290292
Then process project with `platformio run` command.
291293
292294
After this command ``platformio`` will create:
293295
294296
* ``.pioenvs`` - a temporary working directory.
295-
* ``libs`` - a directory for project specific libraries. Platformio will
297+
* ``lib`` - a directory for project specific libraries. Platformio will
296298
compile their to static libraries and link to executable file
297299
* ``src`` - a source directory. Put code here.
298300
* ``platformio.ini`` - a configuration file for project
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Arduino Example: Build code with internal library
2+
=================================================
3+
4+
1. Download ``platformio``
5+
`sources <https://github.com/ivankravets/platformio/archive/develop.zip>`_
6+
2. Extract ZIP archive
7+
3. Then run these commands:
8+
9+
.. code-block:: bash
10+
11+
# Change directory to example
12+
$ cd platformio-develop/examples/arduino-internal-library/
13+
14+
# Install Atmel AVR development platform with Arduino Framework
15+
$ platformio install atmelavr
16+
17+
# Process example project
18+
$ platformio run
19+
20+
.. image:: console-result.png
Loading
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (C) Ivan Kravets <[email protected]>
2+
# See LICENSE for details.
3+
4+
[env:arduino_pro5v]
5+
platform = atmelavr
6+
framework = arduino
7+
board = pro16MHzatmega168
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* Copyright (C) Ivan Kravets <[email protected]>
3+
* See LICENSE for details.
4+
*/
5+
6+
/*
7+
* EEPROM Read
8+
*
9+
* Reads the value of each byte of the EEPROM and prints it
10+
* to the computer.
11+
* This example code is in the public domain.
12+
*
13+
* https://github.com/arduino/Arduino/blob/master/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino
14+
*/
15+
16+
#include <Arduino.h>
17+
#include <EEPROM.h>
18+
19+
// start reading from the first byte (address 0) of the EEPROM
20+
int address = 0;
21+
byte value;
22+
23+
void setup()
24+
{
25+
// initialize serial and wait for port to open:
26+
Serial.begin(9600);
27+
while (!Serial) {
28+
; // wait for serial port to connect. Needed for Leonardo only
29+
}
30+
}
31+
32+
void loop()
33+
{
34+
// read a byte from the current address of the EEPROM
35+
value = EEPROM.read(address);
36+
37+
Serial.print(address);
38+
Serial.print("\t");
39+
Serial.print(value, DEC);
40+
Serial.println();
41+
42+
// advance to the next address of the EEPROM
43+
address = address + 1;
44+
45+
// there are only 512 bytes of EEPROM, from 0 to 511, so if we're
46+
// on address 512, wrap around to address 0
47+
if (address == 512)
48+
address = 0;
49+
50+
delay(500);
51+
}

platformio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (C) Ivan Kravets <[email protected]>
22
# See LICENSE for details.
33

4-
VERSION = (0, 1, 0)
4+
VERSION = (0, 2, 0)
55
__version__ = ".".join([str(s) for s in VERSION])
66

77
__title__ = "platformio"

platformio/builder/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@
4141
PLATFORMFW_DIR=join("$PLATFORM_DIR", "frameworks", "$FRAMEWORK"),
4242
PLATFORMTOOLS_DIR=join("$PLATFORM_DIR", "tools"),
4343

44-
BUILD_DIR=join("$PROJECT_DIR", ".pioenvs", "$PIOENV")
44+
BUILD_DIR=join("$PROJECT_DIR", ".pioenvs", "$PIOENV"),
45+
LIBSOURCE_DIRS=[
46+
join("$PROJECT_DIR", "lib"),
47+
join("$PLATFORMFW_DIR", "libraries"),
48+
]
4549
)
4650

4751
env = DefaultEnvironment()

platformio/builder/scripts/frameworks/arduino.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"-DARDUINO=%d" % ARDUINO_VERSION,
2424
"-DARDUINO_%s" % BOARD_OPTIONS['build.board']
2525
]
26+
2627
# usb flags
2728
if "build.usb_product" in BOARD_OPTIONS:
2829
ARDUINO_FLAGS += [
@@ -32,12 +33,18 @@
3233
'"', "")
3334
]
3435

36+
# include board variant
37+
env.VariantDir(
38+
join("$BUILD_DIR", "variant"),
39+
join("$PLATFORMFW_DIR", "variants", BOARD_OPTIONS['build.variant'])
40+
)
41+
3542
env.Append(
3643
ASFLAGS=ARDUINO_FLAGS,
3744
CCFLAGS=ARDUINO_FLAGS,
3845
CPPPATH=[
3946
join("$BUILD_DIR", "core"),
40-
join("$PLATFORMFW_DIR", "variants", BOARD_OPTIONS['build.variant'])
47+
join("$BUILD_DIR", "variant")
4148
]
4249
)
4350

platformio/builder/scripts/frameworks/energia.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,18 @@
2424
"-DENERGIA=%d" % ENERGIA_VERSION
2525
]
2626

27+
# include board variant
28+
env.VariantDir(
29+
join("$BUILD_DIR", "variant"),
30+
join("$PLATFORMFW_DIR", "variants", BOARD_OPTIONS['build.variant'])
31+
)
32+
2733
env.Append(
2834
ASFLAGS=ENERGIA_FLAGS,
2935
CCFLAGS=ENERGIA_FLAGS,
3036
CPPPATH=[
3137
join("$BUILD_DIR", "core"),
32-
join("$PLATFORMFW_DIR", "variants", BOARD_OPTIONS['build.variant'])
38+
join("$BUILD_DIR", "variant")
3339
]
3440
)
3541

0 commit comments

Comments
 (0)