diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 73c2c24d..00000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-PCD8544-Nokia-5110-LCD-library"] - path = examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-PCD8544-Nokia-5110-LCD-library - url = https://github.com/adafruit/Adafruit-PCD8544-Nokia-5110-LCD-library.git -[submodule "examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-GFX-Library"] - path = examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-GFX-Library - url = https://github.com/adafruit/Adafruit-GFX-Library.git diff --git a/examples/atmelavr-and-arduino/adafruit-blink/.gitignore b/examples/atmelavr-and-arduino/adafruit-blink/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/atmelavr-and-arduino/adafruit-blink/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/atmelavr-and-arduino/adafruit-blink/.travis.yml b/examples/atmelavr-and-arduino/adafruit-blink/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/atmelavr-and-arduino/adafruit-blink/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/atmelavr-and-arduino/adafruit-blink/README.rst b/examples/atmelavr-and-arduino/adafruit-blink/README.rst deleted file mode 100644 index 4467e460..00000000 --- a/examples/atmelavr-and-arduino/adafruit-blink/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/atmelavr-and-arduino/adafruit-blink - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/atmelavr-and-arduino/adafruit-blink/lib/readme.txt b/examples/atmelavr-and-arduino/adafruit-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/atmelavr-and-arduino/adafruit-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/atmelavr-and-arduino/adafruit-blink/platformio.ini b/examples/atmelavr-and-arduino/adafruit-blink/platformio.ini deleted file mode 100644 index d5377cb8..00000000 --- a/examples/atmelavr-and-arduino/adafruit-blink/platformio.ini +++ /dev/null @@ -1,33 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:flora8] -platform = atmelavr -framework = arduino -board = flora8 - -[env:trinket3] -platform = atmelavr -framework = arduino -board = trinket3 - -[env:protrinket5] -platform = atmelavr -framework = arduino -board = protrinket5 diff --git a/examples/atmelavr-and-arduino/adafruit-blink/src/Blink.pde b/examples/atmelavr-and-arduino/adafruit-blink/src/Blink.pde deleted file mode 100644 index a4282d6b..00000000 --- a/examples/atmelavr-and-arduino/adafruit-blink/src/Blink.pde +++ /dev/null @@ -1,24 +0,0 @@ -/* - Blink - Turns on an LED on for one second, then off for one second, repeatedly. - - This example code is in the public domain. -*/ - -int led = 1; // blink 'digital' pin 1 - AKA the built in red LED - -// the setup routine runs once when you press reset: -void setup() { - // initialize the digital pin as an output. - pinMode(led, OUTPUT); - -} - -// the loop routine runs over and over again forever: -void loop() { - digitalWrite(led, HIGH); - delay(1000); - digitalWrite(led, LOW); - delay(1000); -} - diff --git a/examples/atmelavr-and-arduino/arduino-external-libs/.gitignore b/examples/atmelavr-and-arduino/arduino-external-libs/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/atmelavr-and-arduino/arduino-external-libs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/atmelavr-and-arduino/arduino-external-libs/.travis.yml b/examples/atmelavr-and-arduino/arduino-external-libs/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/atmelavr-and-arduino/arduino-external-libs/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/atmelavr-and-arduino/arduino-external-libs/README.rst b/examples/atmelavr-and-arduino/arduino-external-libs/README.rst deleted file mode 100644 index 75b55161..00000000 --- a/examples/atmelavr-and-arduino/arduino-external-libs/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/atmelavr-and-arduino/arduino-external-libs - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-GFX-Library b/examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-GFX-Library deleted file mode 160000 index 6d40eb34..00000000 --- a/examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-GFX-Library +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6d40eb3423c4245bf5725dbf1c65d33057c08579 diff --git a/examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-PCD8544-Nokia-5110-LCD-library b/examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-PCD8544-Nokia-5110-LCD-library deleted file mode 160000 index 065c2999..00000000 --- a/examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-PCD8544-Nokia-5110-LCD-library +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 065c29997b151429f33f0802b8efcb97ec6b7519 diff --git a/examples/atmelavr-and-arduino/arduino-external-libs/lib/readme.txt b/examples/atmelavr-and-arduino/arduino-external-libs/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/atmelavr-and-arduino/arduino-external-libs/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/atmelavr-and-arduino/arduino-external-libs/platformio.ini b/examples/atmelavr-and-arduino/arduino-external-libs/platformio.ini deleted file mode 100644 index c6541c34..00000000 --- a/examples/atmelavr-and-arduino/arduino-external-libs/platformio.ini +++ /dev/null @@ -1,23 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:arduino_uno] -platform = atmelavr -framework = arduino -board = uno diff --git a/examples/atmelavr-and-arduino/arduino-external-libs/src/pcdtest.ino b/examples/atmelavr-and-arduino/arduino-external-libs/src/pcdtest.ino deleted file mode 100644 index 2fa0ce22..00000000 --- a/examples/atmelavr-and-arduino/arduino-external-libs/src/pcdtest.ino +++ /dev/null @@ -1,350 +0,0 @@ -/********************************************************************* -This is an example sketch for our Monochrome Nokia 5110 LCD Displays - - Pick one up today in the adafruit shop! - ------> http://www.adafruit.com/products/338 - -These displays use SPI to communicate, 4 or 5 pins are required to -interface - -Adafruit invests time and resources providing this open source code, -please support Adafruit and open-source hardware by purchasing -products from Adafruit! - -Written by Limor Fried/Ladyada for Adafruit Industries. -BSD license, check license.txt for more information -All text above, and the splash screen must be included in any redistribution -*********************************************************************/ - -#include -#include -#include - -// Software SPI (slower updates, more flexible pin options): -// pin 7 - Serial clock out (SCLK) -// pin 6 - Serial data out (DIN) -// pin 5 - Data/Command select (D/C) -// pin 4 - LCD chip select (CS) -// pin 3 - LCD reset (RST) -Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3); - -// Hardware SPI (faster, but must use certain hardware pins): -// SCK is LCD serial clock (SCLK) - this is pin 13 on Arduino Uno -// MOSI is LCD DIN - this is pin 11 on an Arduino Uno -// pin 5 - Data/Command select (D/C) -// pin 4 - LCD chip select (CS) -// pin 3 - LCD reset (RST) -// Adafruit_PCD8544 display = Adafruit_PCD8544(5, 4, 3); -// Note with hardware SPI MISO and SS pins aren't used but will still be read -// and written to during SPI transfer. Be careful sharing these pins! - -#define NUMFLAKES 10 -#define XPOS 0 -#define YPOS 1 -#define DELTAY 2 - - -#define LOGO16_GLCD_HEIGHT 16 -#define LOGO16_GLCD_WIDTH 16 - -static const unsigned char PROGMEM logo16_glcd_bmp[] = -{ B00000000, B11000000, - B00000001, B11000000, - B00000001, B11000000, - B00000011, B11100000, - B11110011, B11100000, - B11111110, B11111000, - B01111110, B11111111, - B00110011, B10011111, - B00011111, B11111100, - B00001101, B01110000, - B00011011, B10100000, - B00111111, B11100000, - B00111111, B11110000, - B01111100, B11110000, - B01110000, B01110000, - B00000000, B00110000 }; - -void setup() { - Serial.begin(9600); - - display.begin(); - // init done - - // you can change the contrast around to adapt the display - // for the best viewing! - display.setContrast(50); - - display.display(); // show splashscreen - delay(2000); - display.clearDisplay(); // clears the screen and buffer - - // draw a single pixel - display.drawPixel(10, 10, BLACK); - display.display(); - delay(2000); - display.clearDisplay(); - - // draw many lines - testdrawline(); - display.display(); - delay(2000); - display.clearDisplay(); - - // draw rectangles - testdrawrect(); - display.display(); - delay(2000); - display.clearDisplay(); - - // draw multiple rectangles - testfillrect(); - display.display(); - delay(2000); - display.clearDisplay(); - - // draw mulitple circles - testdrawcircle(); - display.display(); - delay(2000); - display.clearDisplay(); - - // draw a circle, 10 pixel radius - display.fillCircle(display.width()/2, display.height()/2, 10, BLACK); - display.display(); - delay(2000); - display.clearDisplay(); - - testdrawroundrect(); - delay(2000); - display.clearDisplay(); - - testfillroundrect(); - delay(2000); - display.clearDisplay(); - - testdrawtriangle(); - delay(2000); - display.clearDisplay(); - - testfilltriangle(); - delay(2000); - display.clearDisplay(); - - // draw the first ~12 characters in the font - testdrawchar(); - display.display(); - delay(2000); - display.clearDisplay(); - - // text display tests - display.setTextSize(1); - display.setTextColor(BLACK); - display.setCursor(0,0); - display.println("Hello, world!"); - display.setTextColor(WHITE, BLACK); // 'inverted' text - display.println(3.141592); - display.setTextSize(2); - display.setTextColor(BLACK); - display.print("0x"); display.println(0xDEADBEEF, HEX); - display.display(); - delay(2000); - - // rotation example - display.clearDisplay(); - display.setRotation(1); // rotate 90 degrees counter clockwise, can also use values of 2 and 3 to go further. - display.setTextSize(1); - display.setTextColor(BLACK); - display.setCursor(0,0); - display.println("Rotation"); - display.setTextSize(2); - display.println("Example!"); - display.display(); - delay(2000); - - // revert back to no rotation - display.setRotation(0); - - // miniature bitmap display - display.clearDisplay(); - display.drawBitmap(30, 16, logo16_glcd_bmp, 16, 16, 1); - display.display(); - - // invert the display - display.invertDisplay(true); - delay(1000); - display.invertDisplay(false); - delay(1000); - - // draw a bitmap icon and 'animate' movement - testdrawbitmap(logo16_glcd_bmp, LOGO16_GLCD_WIDTH, LOGO16_GLCD_HEIGHT); -} - - -void loop() { - -} - - -void testdrawbitmap(const uint8_t *bitmap, uint8_t w, uint8_t h) { - uint8_t icons[NUMFLAKES][3]; - srandom(666); // whatever seed - - // initialize - for (uint8_t f=0; f< NUMFLAKES; f++) { - icons[f][XPOS] = random() % display.width(); - icons[f][YPOS] = 0; - icons[f][DELTAY] = random() % 5 + 1; - - Serial.print("x: "); - Serial.print(icons[f][XPOS], DEC); - Serial.print(" y: "); - Serial.print(icons[f][YPOS], DEC); - Serial.print(" dy: "); - Serial.println(icons[f][DELTAY], DEC); - } - - while (1) { - // draw each icon - for (uint8_t f=0; f< NUMFLAKES; f++) { - display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, BLACK); - } - display.display(); - delay(200); - - // then erase it + move it - for (uint8_t f=0; f< NUMFLAKES; f++) { - display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, WHITE); - // move it - icons[f][YPOS] += icons[f][DELTAY]; - // if its gone, reinit - if (icons[f][YPOS] > display.height()) { - icons[f][XPOS] = random() % display.width(); - icons[f][YPOS] = 0; - icons[f][DELTAY] = random() % 5 + 1; - } - } - } -} - - -void testdrawchar(void) { - display.setTextSize(1); - display.setTextColor(BLACK); - display.setCursor(0,0); - - for (uint8_t i=0; i < 168; i++) { - if (i == '\n') continue; - display.write(i); - //if ((i > 0) && (i % 14 == 0)) - //display.println(); - } - display.display(); -} - -void testdrawcircle(void) { - for (int16_t i=0; i0; i-=5) { - display.fillTriangle(display.width()/2, display.height()/2-i, - display.width()/2-i, display.height()/2+i, - display.width()/2+i, display.height()/2+i, color); - if (color == WHITE) color = BLACK; - else color = WHITE; - display.display(); - } -} - -void testdrawroundrect(void) { - for (int16_t i=0; i=0; i-=4) { - display.drawLine(0, display.height()-1, display.width()-1, i, BLACK); - display.display(); - } - delay(250); - - display.clearDisplay(); - for (int16_t i=display.width()-1; i>=0; i-=4) { - display.drawLine(display.width()-1, display.height()-1, i, 0, BLACK); - display.display(); - } - for (int16_t i=display.height()-1; i>=0; i-=4) { - display.drawLine(display.width()-1, display.height()-1, 0, i, BLACK); - display.display(); - } - delay(250); - - display.clearDisplay(); - for (int16_t i=0; i -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/atmelavr-and-arduino/arduino-internal-libs/README.rst b/examples/atmelavr-and-arduino/arduino-internal-libs/README.rst deleted file mode 100644 index 079d728b..00000000 --- a/examples/atmelavr-and-arduino/arduino-internal-libs/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/atmelavr-and-arduino/arduino-internal-libs - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/atmelavr-and-arduino/arduino-internal-libs/lib/readme.txt b/examples/atmelavr-and-arduino/arduino-internal-libs/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/atmelavr-and-arduino/arduino-internal-libs/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/atmelavr-and-arduino/arduino-internal-libs/platformio.ini b/examples/atmelavr-and-arduino/arduino-internal-libs/platformio.ini deleted file mode 100644 index 1a14ca5e..00000000 --- a/examples/atmelavr-and-arduino/arduino-internal-libs/platformio.ini +++ /dev/null @@ -1,58 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:arduino_uno] -platform = atmelavr -framework = arduino -board = uno - -[env:arduino_ethernet] -platform = atmelavr -framework = arduino -board = ethernet - -[env:arduino_leonardo] -platform = atmelavr -framework = arduino -board = leonardo - -[env:arduino_pro16MHzatmega328] -platform = atmelavr -framework = arduino -board = pro16MHzatmega328 - -[env:arduino_megaatmega1280] -platform = atmelavr -framework = arduino -board = megaatmega1280 - -[env:arduino_micro] -platform = atmelavr -framework = arduino -board = micro - -[env:arduino_robotControl] -platform = atmelavr -framework = arduino -board = robotControl - -[env:arduino_yun] -platform = atmelavr -framework = arduino -board = yun diff --git a/examples/atmelavr-and-arduino/arduino-internal-libs/src/ChatServer.ino b/examples/atmelavr-and-arduino/arduino-internal-libs/src/ChatServer.ino deleted file mode 100644 index 927a60e1..00000000 --- a/examples/atmelavr-and-arduino/arduino-internal-libs/src/ChatServer.ino +++ /dev/null @@ -1,80 +0,0 @@ -/* - Chat Server - - A simple server that distributes any incoming messages to all - connected clients. To use telnet to your device's IP address and type. - You can see the client's input in the serial monitor as well. - Using an Arduino Wiznet Ethernet shield. - - Circuit: - * Ethernet shield attached to pins 10, 11, 12, 13 - * Analog inputs attached to pins A0 through A5 (optional) - - created 18 Dec 2009 - by David A. Mellis - modified 9 Apr 2012 - by Tom Igoe - - */ - -#include -#include - -// Enter a MAC address and IP address for your controller below. -// The IP address will be dependent on your local network. -// gateway and subnet are optional: -byte mac[] = { - 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED -}; -IPAddress ip(192, 168, 1, 177); -IPAddress gateway(192, 168, 1, 1); -IPAddress subnet(255, 255, 0, 0); - - -// telnet defaults to port 23 -EthernetServer server(23); -boolean alreadyConnected = false; // whether or not the client was connected previously - -void setup() { - // initialize the ethernet device - Ethernet.begin(mac, ip, gateway, subnet); - // start listening for clients - server.begin(); - // Open serial communications and wait for port to open: - Serial.begin(9600); - while (!Serial) { - ; // wait for serial port to connect. Needed for Leonardo only - } - - - Serial.print("Chat server address:"); - Serial.println(Ethernet.localIP()); -} - -void loop() { - // wait for a new client: - EthernetClient client = server.available(); - - // when the client sends the first byte, say hello: - if (client) { - if (!alreadyConnected) { - // clead out the input buffer: - client.flush(); - Serial.println("We have a new client"); - client.println("Hello, client!"); - alreadyConnected = true; - } - - if (client.available() > 0) { - // read the bytes incoming from the client: - char thisChar = client.read(); - // echo the bytes back to the client: - server.write(thisChar); - // echo the bytes to the server as well: - Serial.write(thisChar); - } - } -} - - - diff --git a/examples/atmelavr-and-arduino/arduino-own-src_dir/.gitignore b/examples/atmelavr-and-arduino/arduino-own-src_dir/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/atmelavr-and-arduino/arduino-own-src_dir/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/atmelavr-and-arduino/arduino-own-src_dir/.travis.yml b/examples/atmelavr-and-arduino/arduino-own-src_dir/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/atmelavr-and-arduino/arduino-own-src_dir/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/atmelavr-and-arduino/arduino-own-src_dir/Blink/Blink.ino b/examples/atmelavr-and-arduino/arduino-own-src_dir/Blink/Blink.ino deleted file mode 100644 index 5408ce67..00000000 --- a/examples/atmelavr-and-arduino/arduino-own-src_dir/Blink/Blink.ino +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (C) Ivan Kravets - * See LICENSE for details. - */ - -#ifndef LED_PIN -#define LED_PIN 13 // Most Arduino boards already have a LED attached to pin 13 on the board itself -#endif - - -void setup() -{ - pinMode(LED_PIN, OUTPUT); // set pin as output -} - -void loop() -{ - digitalWrite(LED_PIN, HIGH); // set the LED on - delay(1000); // wait for a second - digitalWrite(LED_PIN, LOW); // set the LED off - delay(1000); // wait for a second -} diff --git a/examples/atmelavr-and-arduino/arduino-own-src_dir/README.rst b/examples/atmelavr-and-arduino/arduino-own-src_dir/README.rst deleted file mode 100644 index e940bc78..00000000 --- a/examples/atmelavr-and-arduino/arduino-own-src_dir/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/arduino-own-src_dir - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/atmelavr-and-arduino/arduino-own-src_dir/lib/readme.txt b/examples/atmelavr-and-arduino/arduino-own-src_dir/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/atmelavr-and-arduino/arduino-own-src_dir/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/atmelavr-and-arduino/arduino-own-src_dir/platformio.ini b/examples/atmelavr-and-arduino/arduino-own-src_dir/platformio.ini deleted file mode 100644 index 6a2952f0..00000000 --- a/examples/atmelavr-and-arduino/arduino-own-src_dir/platformio.ini +++ /dev/null @@ -1,26 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[platformio] -src_dir = Blink - -[env:arduino_uno] -platform = atmelavr -framework = arduino -board = uno diff --git a/examples/atmelavr-and-arduino/atmelavr-native-blink/README.rst b/examples/atmelavr-and-arduino/atmelavr-native-blink/README.rst deleted file mode 100644 index ee837b21..00000000 --- a/examples/atmelavr-and-arduino/atmelavr-native-blink/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/atmelavr-and-arduino/atmelavr-native-blink - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/atmelavr-and-arduino/atmelavr-native-blink/lib/readme.txt b/examples/atmelavr-and-arduino/atmelavr-native-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/atmelavr-and-arduino/atmelavr-native-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/atmelavr-and-arduino/atmelavr-native-blink/platformio.ini b/examples/atmelavr-and-arduino/atmelavr-native-blink/platformio.ini deleted file mode 100644 index bffef15b..00000000 --- a/examples/atmelavr-and-arduino/atmelavr-native-blink/platformio.ini +++ /dev/null @@ -1,28 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:arduino_pro5v] -platform = atmelavr -board_mcu = atmega168 -board_f_cpu = 16000000L - -upload_protocol = arduino -upload_speed = 19200 - -# targets = upload diff --git a/examples/atmelavr-and-arduino/atmelavr-native-blink/src/main.c b/examples/atmelavr-and-arduino/atmelavr-native-blink/src/main.c deleted file mode 100644 index 757d3c5f..00000000 --- a/examples/atmelavr-and-arduino/atmelavr-native-blink/src/main.c +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (C) Ivan Kravets - * See LICENSE for details. - */ - -#include -#include - -int main(void) -{ - // make the LED pin an output for PORTB5 - DDRB = 1 << 5; - - while (1) - { - _delay_ms(500); - - // toggle the LED - PORTB ^= 1 << 5; - } - - return 0; -} diff --git a/examples/atmelavr-and-arduino/digitstump-mouse/.gitignore b/examples/atmelavr-and-arduino/digitstump-mouse/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/atmelavr-and-arduino/digitstump-mouse/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/atmelavr-and-arduino/digitstump-mouse/.travis.yml b/examples/atmelavr-and-arduino/digitstump-mouse/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/atmelavr-and-arduino/digitstump-mouse/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/atmelavr-and-arduino/digitstump-mouse/README.rst b/examples/atmelavr-and-arduino/digitstump-mouse/README.rst deleted file mode 100644 index f5e407dd..00000000 --- a/examples/atmelavr-and-arduino/digitstump-mouse/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/atmelavr-and-arduino/digitstump-mouse - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/atmelavr-and-arduino/digitstump-mouse/lib/readme.txt b/examples/atmelavr-and-arduino/digitstump-mouse/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/atmelavr-and-arduino/digitstump-mouse/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/atmelavr-and-arduino/digitstump-mouse/platformio.ini b/examples/atmelavr-and-arduino/digitstump-mouse/platformio.ini deleted file mode 100644 index 00f36aae..00000000 --- a/examples/atmelavr-and-arduino/digitstump-mouse/platformio.ini +++ /dev/null @@ -1,28 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:digispark-tiny] -platform = atmelavr -framework = arduino -board = digispark-tiny - -[env:digispark-pro32] -platform = atmelavr -framework = arduino -board = digispark-pro32 diff --git a/examples/atmelavr-and-arduino/digitstump-mouse/src/Mouse.ino b/examples/atmelavr-and-arduino/digitstump-mouse/src/Mouse.ino deleted file mode 100644 index 17f14ff9..00000000 --- a/examples/atmelavr-and-arduino/digitstump-mouse/src/Mouse.ino +++ /dev/null @@ -1,41 +0,0 @@ -// DigiMouse test and usage documentation -// CAUTION!!!! This does click things!!!!!!!! -// Originally created by Sean Murphy (duckythescientist) - -#include - -void setup() { - DigiMouse.begin(); //start or reenumerate USB - BREAKING CHANGE from old versions that didn't require this -} - -void loop() { - // If not using plentiful DigiMouse.delay(), make sure to call - // DigiMouse.update() at least every 50ms - - // move across the screen - // these are signed chars - DigiMouse.moveY(10); //down 10 - DigiMouse.delay(500); - DigiMouse.moveX(20); //right 20 - DigiMouse.delay(500); - DigiMouse.scroll(5); - DigiMouse.delay(500); - - // or DigiMouse.move(X, Y, scroll) works - - // three buttons are the three LSBs of an unsigned char - DigiMouse.setButtons(1<<0); //left click - DigiMouse.delay(500); - DigiMouse.setButtons(0); //unclick all - DigiMouse.delay(500); - - //or you can use these functions to click - DigiMouse.rightClick(); - DigiMouse.delay(500); - DigiMouse.leftClick(); - DigiMouse.delay(500); - DigiMouse.middleClick(); - DigiMouse.delay(500); - - //for compatability with other libraries you can also use DigiMouse.move(X, Y, scroll, buttons) -} diff --git a/examples/atmelavr-and-arduino/engduino-magnetometer/.gitignore b/examples/atmelavr-and-arduino/engduino-magnetometer/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/atmelavr-and-arduino/engduino-magnetometer/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/atmelavr-and-arduino/engduino-magnetometer/.travis.yml b/examples/atmelavr-and-arduino/engduino-magnetometer/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/atmelavr-and-arduino/engduino-magnetometer/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/atmelavr-and-arduino/engduino-magnetometer/README.rst b/examples/atmelavr-and-arduino/engduino-magnetometer/README.rst deleted file mode 100644 index ab083841..00000000 --- a/examples/atmelavr-and-arduino/engduino-magnetometer/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/atmelavr-and-arduino/engduino-magnetometer - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/atmelavr-and-arduino/engduino-magnetometer/lib/readme.txt b/examples/atmelavr-and-arduino/engduino-magnetometer/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/atmelavr-and-arduino/engduino-magnetometer/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/atmelavr-and-arduino/engduino-magnetometer/platformio.ini b/examples/atmelavr-and-arduino/engduino-magnetometer/platformio.ini deleted file mode 100644 index c75d3321..00000000 --- a/examples/atmelavr-and-arduino/engduino-magnetometer/platformio.ini +++ /dev/null @@ -1,24 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:engduinov3] -platform = atmelavr -framework = arduino -board = engduinov3 -lib_install = 574 diff --git a/examples/atmelavr-and-arduino/engduino-magnetometer/src/Magnetometer.ino b/examples/atmelavr-and-arduino/engduino-magnetometer/src/Magnetometer.ino deleted file mode 100644 index ccd284d5..00000000 --- a/examples/atmelavr-and-arduino/engduino-magnetometer/src/Magnetometer.ino +++ /dev/null @@ -1,44 +0,0 @@ -#include -#include - -// Magnetometer demo -// -// Print the field strength values -// - -void setup() -{ - EngduinoMagnetometer.begin(); -} - -void loop() -{ - float magneticField[3]; - - // Read magnetic field strength. The values range from -20000 - // to +20000 counts and are based on internal calibration - // values - // - EngduinoMagnetometer.xyz(magneticField); - - float x = magneticField[0]; - float y = magneticField[1]; - float z = magneticField[2]; - Serial.print("Magnetic field strength: x = "); - Serial.print(x); - Serial.print(" counts y = "); - Serial.print(y); - Serial.print(" counts z = "); - Serial.print(z); - Serial.println(" counts"); - - // Note that this is an uncalibrated temperature - // of the die itself. Whilst it should be a value - // in degrees C, the lack of calibration could mean - // that it's anything. - int8_t t = EngduinoMagnetometer.temperature(); - Serial.print("Temperature: "); - Serial.println(t); - - delay(1000); -} \ No newline at end of file diff --git a/examples/atmelavr-and-arduino/panstamp-blink/.gitignore b/examples/atmelavr-and-arduino/panstamp-blink/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/atmelavr-and-arduino/panstamp-blink/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/atmelavr-and-arduino/panstamp-blink/.travis.yml b/examples/atmelavr-and-arduino/panstamp-blink/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/atmelavr-and-arduino/panstamp-blink/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/atmelavr-and-arduino/panstamp-blink/README.rst b/examples/atmelavr-and-arduino/panstamp-blink/README.rst deleted file mode 100644 index 7f7b0b89..00000000 --- a/examples/atmelavr-and-arduino/panstamp-blink/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/atmelavr-and-arduino/panstamp-blink - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/atmelavr-and-arduino/panstamp-blink/lib/readme.txt b/examples/atmelavr-and-arduino/panstamp-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/atmelavr-and-arduino/panstamp-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/atmelavr-and-arduino/panstamp-blink/platformio.ini b/examples/atmelavr-and-arduino/panstamp-blink/platformio.ini deleted file mode 100644 index fa51205f..00000000 --- a/examples/atmelavr-and-arduino/panstamp-blink/platformio.ini +++ /dev/null @@ -1,23 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:panStampAVR] -platform = atmelavr -framework = arduino -board = panStampAVR diff --git a/examples/atmelavr-and-arduino/panstamp-blink/src/Blink.ino b/examples/atmelavr-and-arduino/panstamp-blink/src/Blink.ino deleted file mode 100644 index b0db92b8..00000000 --- a/examples/atmelavr-and-arduino/panstamp-blink/src/Blink.ino +++ /dev/null @@ -1,29 +0,0 @@ -/* - Blink - Turns on an LED on for one second, then off for one second, repeatedly. - - Most Arduinos have an on-board LED you can control. On the Uno and - Leonardo, it is attached to digital pin 13. If you're unsure what - pin the on-board LED is connected to on your Arduino model, check - the documentation at http://arduino.cc - - This example code is in the public domain. - - modified 8 May 2014 - by Scott Fitzgerald - */ - - -// the setup function runs once when you press reset or power the board -void setup() { - // initialize digital pin 13 as an output. - pinMode(13, OUTPUT); -} - -// the loop function runs over and over again forever -void loop() { - digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) - delay(1000); // wait for a second - digitalWrite(13, LOW); // turn the LED off by making the voltage LOW - delay(1000); // wait for a second -} diff --git a/examples/atmelsam-and-arduino/arduino-external-libs/.gitignore b/examples/atmelsam-and-arduino/arduino-external-libs/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/atmelsam-and-arduino/arduino-external-libs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/atmelsam-and-arduino/arduino-external-libs/.travis.yml b/examples/atmelsam-and-arduino/arduino-external-libs/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/atmelsam-and-arduino/arduino-external-libs/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/atmelsam-and-arduino/arduino-external-libs/README.rst b/examples/atmelsam-and-arduino/arduino-external-libs/README.rst deleted file mode 100644 index e527a82b..00000000 --- a/examples/atmelsam-and-arduino/arduino-external-libs/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/atmelsam-and-arduino/arduino-external-libs - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/atmelsam-and-arduino/arduino-external-libs/lib/BMP180/SFE_BMP180.cpp b/examples/atmelsam-and-arduino/arduino-external-libs/lib/BMP180/SFE_BMP180.cpp deleted file mode 100644 index 4383fc55..00000000 --- a/examples/atmelsam-and-arduino/arduino-external-libs/lib/BMP180/SFE_BMP180.cpp +++ /dev/null @@ -1,387 +0,0 @@ -/* - SFE_BMP180.cpp - Bosch BMP180 pressure sensor library for the Arduino microcontroller - Mike Grusin, SparkFun Electronics - - Uses floating-point equations from the Weather Station Data Logger project - http://wmrx00.sourceforge.net/ - http://wmrx00.sourceforge.net/Arduino/BMP085-Calcs.pdf - - Forked from BMP085 library by M.Grusin - - version 1.0 2013/09/20 initial version - - Our example code uses the "beerware" license. You can do anything - you like with this code. No really, anything. If you find it useful, - buy me a (root) beer someday. -*/ - -#include -#include -#include -#include - - -SFE_BMP180::SFE_BMP180() -// Base library type -{ -} - - -char SFE_BMP180::begin() -// Initialize library for subsequent pressure measurements -{ - double c3,c4,b1; - - // Start up the Arduino's "wire" (I2C) library: - - Wire.begin(); - - // The BMP180 includes factory calibration data stored on the device. - // Each device has different numbers, these must be retrieved and - // used in the calculations when taking pressure measurements. - - // Retrieve calibration data from device: - - if (readInt(0xAA,AC1) && - readInt(0xAC,AC2) && - readInt(0xAE,AC3) && - readUInt(0xB0,AC4) && - readUInt(0xB2,AC5) && - readUInt(0xB4,AC6) && - readInt(0xB6,VB1) && - readInt(0xB8,VB2) && - readInt(0xBA,MB) && - readInt(0xBC,MC) && - readInt(0xBE,MD)) - { - - // All reads completed successfully! - - // If you need to check your math using known numbers, - // you can uncomment one of these examples. - // (The correct results are commented in the below functions.) - - // Example from Bosch datasheet - // AC1 = 408; AC2 = -72; AC3 = -14383; AC4 = 32741; AC5 = 32757; AC6 = 23153; - // B1 = 6190; B2 = 4; MB = -32768; MC = -8711; MD = 2868; - - // Example from http://wmrx00.sourceforge.net/Arduino/BMP180-Calcs.pdf - // AC1 = 7911; AC2 = -934; AC3 = -14306; AC4 = 31567; AC5 = 25671; AC6 = 18974; - // VB1 = 5498; VB2 = 46; MB = -32768; MC = -11075; MD = 2432; - - /* - Serial.print("AC1: "); Serial.println(AC1); - Serial.print("AC2: "); Serial.println(AC2); - Serial.print("AC3: "); Serial.println(AC3); - Serial.print("AC4: "); Serial.println(AC4); - Serial.print("AC5: "); Serial.println(AC5); - Serial.print("AC6: "); Serial.println(AC6); - Serial.print("VB1: "); Serial.println(VB1); - Serial.print("VB2: "); Serial.println(VB2); - Serial.print("MB: "); Serial.println(MB); - Serial.print("MC: "); Serial.println(MC); - Serial.print("MD: "); Serial.println(MD); - */ - - // Compute floating-point polynominals: - - c3 = 160.0 * pow(2,-15) * AC3; - c4 = pow(10,-3) * pow(2,-15) * AC4; - b1 = pow(160,2) * pow(2,-30) * VB1; - c5 = (pow(2,-15) / 160) * AC5; - c6 = AC6; - mc = (pow(2,11) / pow(160,2)) * MC; - md = MD / 160.0; - x0 = AC1; - x1 = 160.0 * pow(2,-13) * AC2; - x2 = pow(160,2) * pow(2,-25) * VB2; - y0 = c4 * pow(2,15); - y1 = c4 * c3; - y2 = c4 * b1; - p0 = (3791.0 - 8.0) / 1600.0; - p1 = 1.0 - 7357.0 * pow(2,-20); - p2 = 3038.0 * 100.0 * pow(2,-36); - - /* - Serial.println(); - Serial.print("c3: "); Serial.println(c3); - Serial.print("c4: "); Serial.println(c4); - Serial.print("c5: "); Serial.println(c5); - Serial.print("c6: "); Serial.println(c6); - Serial.print("b1: "); Serial.println(b1); - Serial.print("mc: "); Serial.println(mc); - Serial.print("md: "); Serial.println(md); - Serial.print("x0: "); Serial.println(x0); - Serial.print("x1: "); Serial.println(x1); - Serial.print("x2: "); Serial.println(x2); - Serial.print("y0: "); Serial.println(y0); - Serial.print("y1: "); Serial.println(y1); - Serial.print("y2: "); Serial.println(y2); - Serial.print("p0: "); Serial.println(p0); - Serial.print("p1: "); Serial.println(p1); - Serial.print("p2: "); Serial.println(p2); - */ - - // Success! - return(1); - } - else - { - // Error reading calibration data; bad component or connection? - return(0); - } -} - - -char SFE_BMP180::readInt(char address, int &value) -// Read a signed integer (two bytes) from device -// address: register to start reading (plus subsequent register) -// value: external variable to store data (function modifies value) -{ - unsigned char data[2]; - - data[0] = address; - if (readBytes(data,2)) - { - value = (((int)data[0]<<8)|(int)data[1]); - //if (*value & 0x8000) *value |= 0xFFFF0000; // sign extend if negative - return(1); - } - value = 0; - return(0); -} - - -char SFE_BMP180::readUInt(char address, unsigned int &value) -// Read an unsigned integer (two bytes) from device -// address: register to start reading (plus subsequent register) -// value: external variable to store data (function modifies value) -{ - unsigned char data[2]; - - data[0] = address; - if (readBytes(data,2)) - { - value = (((unsigned int)data[0]<<8)|(unsigned int)data[1]); - return(1); - } - value = 0; - return(0); -} - - -char SFE_BMP180::readBytes(unsigned char *values, char length) -// Read an array of bytes from device -// values: external array to hold data. Put starting register in values[0]. -// length: number of bytes to read -{ - char x; - - Wire.beginTransmission(BMP180_ADDR); - Wire.write(values[0]); - _error = Wire.endTransmission(); - if (_error == 0) - { - Wire.requestFrom(BMP180_ADDR,length); - while(Wire.available() != length) ; // wait until bytes are ready - for(x=0;x= 100 -#include "Arduino.h" -#else -#include "WProgram.h" -#endif - -class SFE_BMP180 -{ - public: - SFE_BMP180(); // base type - - char begin(); - // call pressure.begin() to initialize BMP180 before use - // returns 1 if success, 0 if failure (bad component or I2C bus shorted?) - - char startTemperature(void); - // command BMP180 to start a temperature measurement - // returns (number of ms to wait) for success, 0 for fail - - char getTemperature(double &T); - // return temperature measurement from previous startTemperature command - // places returned value in T variable (deg C) - // returns 1 for success, 0 for fail - - char startPressure(char oversampling); - // command BMP180 to start a pressure measurement - // oversampling: 0 - 3 for oversampling value - // returns (number of ms to wait) for success, 0 for fail - - char getPressure(double &P, double &T); - // return absolute pressure measurement from previous startPressure command - // note: requires previous temperature measurement in variable T - // places returned value in P variable (mbar) - // returns 1 for success, 0 for fail - - double sealevel(double P, double A); - // convert absolute pressure to sea-level pressure (as used in weather data) - // P: absolute pressure (mbar) - // A: current altitude (meters) - // returns sealevel pressure in mbar - - double altitude(double P, double P0); - // convert absolute pressure to altitude (given baseline pressure; sea-level, runway, etc.) - // P: absolute pressure (mbar) - // P0: fixed baseline pressure (mbar) - // returns signed altitude in meters - - char getError(void); - // If any library command fails, you can retrieve an extended - // error code using this command. Errors are from the wire library: - // 0 = Success - // 1 = Data too long to fit in transmit buffer - // 2 = Received NACK on transmit of address - // 3 = Received NACK on transmit of data - // 4 = Other error - - private: - - char readInt(char address, int &value); - // read an signed int (16 bits) from a BMP180 register - // address: BMP180 register address - // value: external signed int for returned value (16 bits) - // returns 1 for success, 0 for fail, with result in value - - char readUInt(char address, unsigned int &value); - // read an unsigned int (16 bits) from a BMP180 register - // address: BMP180 register address - // value: external unsigned int for returned value (16 bits) - // returns 1 for success, 0 for fail, with result in value - - char readBytes(unsigned char *values, char length); - // read a number of bytes from a BMP180 register - // values: array of char with register address in first location [0] - // length: number of bytes to read back - // returns 1 for success, 0 for fail, with read bytes in values[] array - - char writeBytes(unsigned char *values, char length); - // write a number of bytes to a BMP180 register (and consecutive subsequent registers) - // values: array of char with register address in first location [0] - // length: number of bytes to write - // returns 1 for success, 0 for fail - - int AC1,AC2,AC3,VB1,VB2,MB,MC,MD; - unsigned int AC4,AC5,AC6; - double c5,c6,mc,md,x0,x1,x2,y0,y1,y2,p0,p1,p2; - char _error; -}; - -#define BMP180_ADDR 0x77 // 7-bit address - -#define BMP180_REG_CONTROL 0xF4 -#define BMP180_REG_RESULT 0xF6 - -#define BMP180_COMMAND_TEMPERATURE 0x2E -#define BMP180_COMMAND_PRESSURE0 0x34 -#define BMP180_COMMAND_PRESSURE1 0x74 -#define BMP180_COMMAND_PRESSURE2 0xB4 -#define BMP180_COMMAND_PRESSURE3 0xF4 - -#endif diff --git a/examples/atmelsam-and-arduino/arduino-external-libs/lib/readme.txt b/examples/atmelsam-and-arduino/arduino-external-libs/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/atmelsam-and-arduino/arduino-external-libs/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/atmelsam-and-arduino/arduino-external-libs/platformio.ini b/examples/atmelsam-and-arduino/arduino-external-libs/platformio.ini deleted file mode 100644 index 664674c0..00000000 --- a/examples/atmelsam-and-arduino/arduino-external-libs/platformio.ini +++ /dev/null @@ -1,33 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:arduino_due] -platform = atmelsam -framework = arduino -board = dueUSB - -[env:arduino_digix] -platform = atmelsam -framework = arduino -board = digix - -[env:arduino_zero] -platform = atmelsam -framework = arduino -board = zeroUSB diff --git a/examples/atmelsam-and-arduino/arduino-external-libs/src/BMP180_altitude_example.ino b/examples/atmelsam-and-arduino/arduino-external-libs/src/BMP180_altitude_example.ino deleted file mode 100644 index fdb83582..00000000 --- a/examples/atmelsam-and-arduino/arduino-external-libs/src/BMP180_altitude_example.ino +++ /dev/null @@ -1,168 +0,0 @@ -/* SFE_BMP180 altitude example sketch - -This sketch shows how to use the Bosch BMP180 pressure sensor -as an altimiter. -https://www.sparkfun.com/products/11824 - -Like most pressure sensors, the BMP180 measures absolute pressure. -Since absolute pressure varies with altitude, you can use the pressure -to determine your altitude. - -Because pressure also varies with weather, you must first take a pressure -reading at a known baseline altitude. Then you can measure variations -from that pressure - -Hardware connections: - -- (GND) to GND -+ (VDD) to 3.3V - -(WARNING: do not connect + to 5V or the sensor will be damaged!) - -You will also need to connect the I2C pins (SCL and SDA) to your -Arduino. The pins are different on different Arduinos: - -Any Arduino pins labeled: SDA SCL -Uno, Redboard, Pro: A4 A5 -Mega2560, Due: 20 21 -Leonardo: 2 3 - -Leave the IO (VDDIO) pin unconnected. This pin is for connecting -the BMP180 to systems with lower logic levels such as 1.8V - -Have fun! -Your friends at SparkFun. - -The SFE_BMP180 library uses floating-point equations developed by the -Weather Station Data Logger project: http://wmrx00.sourceforge.net/ - -Our example code uses the "beerware" license. You can do anything -you like with this code. No really, anything. If you find it useful, -buy me a beer someday. - -V10 Mike Grusin, SparkFun Electronics 10/24/2013 -*/ - -// Your sketch must #include this library, and the Wire library. -// (Wire is a standard library included with Arduino.): - -#include -#include - -// You will need to create an SFE_BMP180 object, here called "pressure": - -SFE_BMP180 pressure; - -double baseline; // baseline pressure - -void setup() -{ - Serial.begin(9600); - Serial.println("REBOOT"); - - // Initialize the sensor (it is important to get calibration values stored on the device). - - if (pressure.begin()) - Serial.println("BMP180 init success"); - else - { - // Oops, something went wrong, this is usually a connection problem, - // see the comments at the top of this sketch for the proper connections. - - Serial.println("BMP180 init fail (disconnected?)\n\n"); - while(1); // Pause forever. - } - - // Get the baseline pressure: - - baseline = getPressure(); - - Serial.print("baseline pressure: "); - Serial.print(baseline); - Serial.println(" mb"); -} - -void loop() -{ - double a,P; - - // Get a new pressure reading: - - P = getPressure(); - - // Show the relative altitude difference between - // the new reading and the baseline reading: - - a = pressure.altitude(P,baseline); - - Serial.print("relative altitude: "); - if (a >= 0.0) Serial.print(" "); // add a space for positive numbers - Serial.print(a,1); - Serial.print(" meters, "); - if (a >= 0.0) Serial.print(" "); // add a space for positive numbers - Serial.print(a*3.28084,0); - Serial.println(" feet"); - - delay(500); -} - - -double getPressure() -{ - char status; - double T,P,p0,a; - - // You must first get a temperature measurement to perform a pressure reading. - - // Start a temperature measurement: - // If request is successful, the number of ms to wait is returned. - // If request is unsuccessful, 0 is returned. - - status = pressure.startTemperature(); - if (status != 0) - { - // Wait for the measurement to complete: - - delay(status); - - // Retrieve the completed temperature measurement: - // Note that the measurement is stored in the variable T. - // Use '&T' to provide the address of T to the function. - // Function returns 1 if successful, 0 if failure. - - status = pressure.getTemperature(T); - if (status != 0) - { - // Start a pressure measurement: - // The parameter is the oversampling setting, from 0 to 3 (highest res, longest wait). - // If request is successful, the number of ms to wait is returned. - // If request is unsuccessful, 0 is returned. - - status = pressure.startPressure(3); - if (status != 0) - { - // Wait for the measurement to complete: - delay(status); - - // Retrieve the completed pressure measurement: - // Note that the measurement is stored in the variable P. - // Use '&P' to provide the address of P. - // Note also that the function requires the previous temperature measurement (T). - // (If temperature is stable, you can do one temperature measurement for a number of pressure measurements.) - // Function returns 1 if successful, 0 if failure. - - status = pressure.getPressure(P,T); - if (status != 0) - { - return(P); - } - else Serial.println("error retrieving pressure measurement\n"); - } - else Serial.println("error starting pressure measurement\n"); - } - else Serial.println("error retrieving temperature measurement\n"); - } - else Serial.println("error starting temperature measurement\n"); -} - - - diff --git a/examples/atmelsam-and-arduino/arduino-internal-libs/.gitignore b/examples/atmelsam-and-arduino/arduino-internal-libs/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/atmelsam-and-arduino/arduino-internal-libs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/atmelsam-and-arduino/arduino-internal-libs/.travis.yml b/examples/atmelsam-and-arduino/arduino-internal-libs/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/atmelsam-and-arduino/arduino-internal-libs/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/atmelsam-and-arduino/arduino-internal-libs/README.rst b/examples/atmelsam-and-arduino/arduino-internal-libs/README.rst deleted file mode 100644 index 703f9da9..00000000 --- a/examples/atmelsam-and-arduino/arduino-internal-libs/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/atmelsam-and-arduino/arduino-internal-libs - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/atmelsam-and-arduino/arduino-internal-libs/lib/readme.txt b/examples/atmelsam-and-arduino/arduino-internal-libs/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/atmelsam-and-arduino/arduino-internal-libs/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/atmelsam-and-arduino/arduino-internal-libs/platformio.ini b/examples/atmelsam-and-arduino/arduino-internal-libs/platformio.ini deleted file mode 100644 index 664674c0..00000000 --- a/examples/atmelsam-and-arduino/arduino-internal-libs/platformio.ini +++ /dev/null @@ -1,33 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:arduino_due] -platform = atmelsam -framework = arduino -board = dueUSB - -[env:arduino_digix] -platform = atmelsam -framework = arduino -board = digix - -[env:arduino_zero] -platform = atmelsam -framework = arduino -board = zeroUSB diff --git a/examples/atmelsam-and-arduino/arduino-internal-libs/src/BarometricPressureSensor.ino b/examples/atmelsam-and-arduino/arduino-internal-libs/src/BarometricPressureSensor.ino deleted file mode 100644 index 8104fcbc..00000000 --- a/examples/atmelsam-and-arduino/arduino-internal-libs/src/BarometricPressureSensor.ino +++ /dev/null @@ -1,143 +0,0 @@ -/* - SCP1000 Barometric Pressure Sensor Display - - Shows the output of a Barometric Pressure Sensor on a - Uses the SPI library. For details on the sensor, see: - http://www.sparkfun.com/commerce/product_info.php?products_id=8161 - http://www.vti.fi/en/support/obsolete_products/pressure_sensors/ - - This sketch adapted from Nathan Seidle's SCP1000 example for PIC: - http://www.sparkfun.com/datasheets/Sensors/SCP1000-Testing.zip - - Circuit: - SCP1000 sensor attached to pins 6, 7, 10 - 13: - DRDY: pin 6 - CSB: pin 7 - MOSI: pin 11 - MISO: pin 12 - SCK: pin 13 - - created 31 July 2010 - modified 14 August 2010 - by Tom Igoe - */ - -// the sensor communicates using SPI, so include the library: -#include - -//Sensor's memory register addresses: -const int PRESSURE = 0x1F; //3 most significant bits of pressure -const int PRESSURE_LSB = 0x20; //16 least significant bits of pressure -const int TEMPERATURE = 0x21; //16 bit temperature reading -const byte READ = 0b11111100; // SCP1000's read command -const byte WRITE = 0b00000010; // SCP1000's write command - -// pins used for the connection with the sensor -// the other you need are controlled by the SPI library): -const int dataReadyPin = 6; -const int chipSelectPin = 7; - -void setup() { - Serial.begin(9600); - - // start the SPI library: - SPI.begin(); - - // initalize the data ready and chip select pins: - pinMode(dataReadyPin, INPUT); - pinMode(chipSelectPin, OUTPUT); - - //Configure SCP1000 for low noise configuration: - writeRegister(0x02, 0x2D); - writeRegister(0x01, 0x03); - writeRegister(0x03, 0x02); - // give the sensor time to set up: - delay(100); -} - -void loop() { - //Select High Resolution Mode - writeRegister(0x03, 0x0A); - - // don't do anything until the data ready pin is high: - if (digitalRead(dataReadyPin) == HIGH) { - //Read the temperature data - int tempData = readRegister(0x21, 2); - - // convert the temperature to celsius and display it: - float realTemp = (float)tempData / 20.0; - Serial.print("Temp[C]="); - Serial.print(realTemp); - - - //Read the pressure data highest 3 bits: - byte pressure_data_high = readRegister(0x1F, 1); - pressure_data_high &= 0b00000111; //you only needs bits 2 to 0 - - //Read the pressure data lower 16 bits: - unsigned int pressure_data_low = readRegister(0x20, 2); - //combine the two parts into one 19-bit number: - long pressure = ((pressure_data_high << 16) | pressure_data_low) / 4; - - // display the temperature: - Serial.println("\tPressure [Pa]=" + String(pressure)); - } -} - -//Read from or write to register from the SCP1000: -unsigned int readRegister(byte thisRegister, int bytesToRead ) { - byte inByte = 0; // incoming byte from the SPI - unsigned int result = 0; // result to return - Serial.print(thisRegister, BIN); - Serial.print("\t"); - // SCP1000 expects the register name in the upper 6 bits - // of the byte. So shift the bits left by two bits: - thisRegister = thisRegister << 2; - // now combine the address and the command into one byte - byte dataToSend = thisRegister & READ; - Serial.println(thisRegister, BIN); - // take the chip select low to select the device: - digitalWrite(chipSelectPin, LOW); - // send the device the register you want to read: - SPI.transfer(dataToSend); - // send a value of 0 to read the first byte returned: - result = SPI.transfer(0x00); - // decrement the number of bytes left to read: - bytesToRead--; - // if you still have another byte to read: - if (bytesToRead > 0) { - // shift the first byte left, then get the second byte: - result = result << 8; - inByte = SPI.transfer(0x00); - // combine the byte you just got with the previous one: - result = result | inByte; - // decrement the number of bytes left to read: - bytesToRead--; - } - // take the chip select high to de-select: - digitalWrite(chipSelectPin, HIGH); - // return the result: - return(result); -} - - -//Sends a write command to SCP1000 - -void writeRegister(byte thisRegister, byte thisValue) { - - // SCP1000 expects the register address in the upper 6 bits - // of the byte. So shift the bits left by two bits: - thisRegister = thisRegister << 2; - // now combine the register address and the command into one byte: - byte dataToSend = thisRegister | WRITE; - - // take the chip select low to select the device: - digitalWrite(chipSelectPin, LOW); - - SPI.transfer(dataToSend); //Send register location - SPI.transfer(thisValue); //Send value to record into register - - // take the chip select high to de-select: - digitalWrite(chipSelectPin, HIGH); -} - diff --git a/examples/desktop/hello-world/.gitignore b/examples/desktop/hello-world/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/desktop/hello-world/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/desktop/hello-world/.travis.yml b/examples/desktop/hello-world/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/desktop/hello-world/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/desktop/hello-world/README.rst b/examples/desktop/hello-world/README.rst deleted file mode 100644 index c871b779..00000000 --- a/examples/desktop/hello-world/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/desktop/hello-world - - # Process example project - > platformio run - - # Run program - > .pioenvs/native/program diff --git a/examples/desktop/hello-world/lib/readme.txt b/examples/desktop/hello-world/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/desktop/hello-world/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/desktop/hello-world/platformio.ini b/examples/desktop/hello-world/platformio.ini deleted file mode 100644 index 9ab3f31f..00000000 --- a/examples/desktop/hello-world/platformio.ini +++ /dev/null @@ -1,51 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:native] -platform = native - -# -# If host OS is Mac OS X -# - -# [env:darwin_x86_64] -# platform = native - -# [env:linux_i686] -# platform = linux_i686 - -# [env:linux_x86_64] -# platform = linux_x86_64 - -# [env:windows_x86] -# platform = windows_x86 - -# [env:linux_armv6l] -# platform = linux_arm -# build_flags = -march=armv6 - -# -# If host OS is Linux -# - -# [env:linux_i686] -# platform = linux_i686 - -# [env:linux_x86_64] -# platform = linux_x86_64 diff --git a/examples/desktop/hello-world/src/main.c b/examples/desktop/hello-world/src/main.c deleted file mode 100644 index 21049ca9..00000000 --- a/examples/desktop/hello-world/src/main.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main() -{ - printf("Hello World from PlatformIO!\n"); - return 0; -} diff --git a/examples/espressif/esp8266-native/.gitignore b/examples/espressif/esp8266-native/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/espressif/esp8266-native/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/espressif/esp8266-native/.travis.yml b/examples/espressif/esp8266-native/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/espressif/esp8266-native/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/espressif/esp8266-native/README.rst b/examples/espressif/esp8266-native/README.rst deleted file mode 100644 index 78ce28da..00000000 --- a/examples/espressif/esp8266-native/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/espressif/esp8266-native - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/espressif/esp8266-native/lib/readme.txt b/examples/espressif/esp8266-native/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/espressif/esp8266-native/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/espressif/esp8266-native/platformio.ini b/examples/espressif/esp8266-native/platformio.ini deleted file mode 100644 index f2d2683f..00000000 --- a/examples/espressif/esp8266-native/platformio.ini +++ /dev/null @@ -1,23 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:esp01_8266] -platform = espressif -board = esp01 -build_flags = -Wl,-T"eagle.app.v6.ld" diff --git a/examples/espressif/esp8266-native/src/blinky.c b/examples/espressif/esp8266-native/src/blinky.c deleted file mode 100644 index 34c9380f..00000000 --- a/examples/espressif/esp8266-native/src/blinky.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "ets_sys.h" -#include "osapi.h" -#include "gpio.h" -#include "os_type.h" - -static const int pin = 1; -static volatile os_timer_t some_timer; - -void some_timerfunc(void *arg) -{ - //Do blinky stuff - if (GPIO_REG_READ(GPIO_OUT_ADDRESS) & (1 << pin)) - { - // set gpio low - gpio_output_set(0, (1 << pin), 0, 0); - } - else - { - // set gpio high - gpio_output_set((1 << pin), 0, 0, 0); - } -} - -void ICACHE_FLASH_ATTR user_init() -{ - // init gpio sussytem - gpio_init(); - - // configure UART TXD to be GPIO1, set as output - PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0TXD_U, FUNC_GPIO1); - gpio_output_set(0, 0, (1 << pin), 0); - - // setup timer (500ms, repeating) - os_timer_setfn(&some_timer, (os_timer_func_t *)some_timerfunc, NULL); - os_timer_arm(&some_timer, 1000, 1); -} diff --git a/examples/espressif/esp8266-native/src/user_config.h b/examples/espressif/esp8266-native/src/user_config.h deleted file mode 100644 index 35e838d5..00000000 --- a/examples/espressif/esp8266-native/src/user_config.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef __USER_CONFIG_H__ -#define __USER_CONFIG_H__ - -#endif - diff --git a/examples/espressif/esp8266-webserver/.gitignore b/examples/espressif/esp8266-webserver/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/espressif/esp8266-webserver/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/espressif/esp8266-webserver/.travis.yml b/examples/espressif/esp8266-webserver/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/espressif/esp8266-webserver/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/espressif/esp8266-webserver/README.rst b/examples/espressif/esp8266-webserver/README.rst deleted file mode 100644 index 62956133..00000000 --- a/examples/espressif/esp8266-webserver/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/espressif/esp8266-webserver - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/espressif/esp8266-webserver/lib/readme.txt b/examples/espressif/esp8266-webserver/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/espressif/esp8266-webserver/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/espressif/esp8266-webserver/platformio.ini b/examples/espressif/esp8266-webserver/platformio.ini deleted file mode 100644 index f25248bb..00000000 --- a/examples/espressif/esp8266-webserver/platformio.ini +++ /dev/null @@ -1,43 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:esp01] -platform = espressif -framework = arduino -board = esp01 - -[env:esp01_1m] -platform = espressif -framework = arduino -board = esp01_1m - -[env:nodemcu] -platform = espressif -framework = arduino -board = nodemcu - -[env:huzzah] -platform = espressif -framework = arduino -board = huzzah - -[env:thing] -platform = espressif -framework = arduino -board = thing diff --git a/examples/espressif/esp8266-webserver/src/HelloServer.ino b/examples/espressif/esp8266-webserver/src/HelloServer.ino deleted file mode 100644 index f996c534..00000000 --- a/examples/espressif/esp8266-webserver/src/HelloServer.ino +++ /dev/null @@ -1,73 +0,0 @@ -#include -#include -#include -#include - -const char* ssid = "******"; -const char* password = "******"; -MDNSResponder mdns; - -ESP8266WebServer server(80); - -const int led = 13; - -void handleRoot() { - digitalWrite(led, 1); - server.send(200, "text/plain", "hello from esp8266!"); - digitalWrite(led, 0); -} - -void handleNotFound(){ - digitalWrite(led, 1); - String message = "File Not Found\n\n"; - message += "URI: "; - message += server.uri(); - message += "\nMethod: "; - message += (server.method() == HTTP_GET)?"GET":"POST"; - message += "\nArguments: "; - message += server.args(); - message += "\n"; - for (uint8_t i=0; i -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/espressif/esp8266-wifiscan/README.rst b/examples/espressif/esp8266-wifiscan/README.rst deleted file mode 100644 index 5d463483..00000000 --- a/examples/espressif/esp8266-wifiscan/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/espressif/esp8266-wifiscan - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/espressif/esp8266-wifiscan/lib/readme.txt b/examples/espressif/esp8266-wifiscan/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/espressif/esp8266-wifiscan/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/espressif/esp8266-wifiscan/platformio.ini b/examples/espressif/esp8266-wifiscan/platformio.ini deleted file mode 100644 index e79ce81c..00000000 --- a/examples/espressif/esp8266-wifiscan/platformio.ini +++ /dev/null @@ -1,23 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:esp01_8266] -platform = espressif -framework = arduino -board = esp01 diff --git a/examples/espressif/esp8266-wifiscan/src/WiFiScan.ino b/examples/espressif/esp8266-wifiscan/src/WiFiScan.ino deleted file mode 100644 index 3e6ff736..00000000 --- a/examples/espressif/esp8266-wifiscan/src/WiFiScan.ino +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This sketch demonstrates how to scan WiFi networks. - * The API is almost the same as with the WiFi Shield library, - * the most obvious difference being the different file you need to include: - */ -#include "ESP8266WiFi.h" - -void setup() { - Serial.begin(115200); - - // Set WiFi to station mode and disconnect from an AP if it was previously connected - WiFi.mode(WIFI_STA); - WiFi.disconnect(); - delay(100); - - Serial.println("Setup done"); -} - -void loop() { - Serial.println("scan start"); - - // WiFi.scanNetworks will return the number of networks found - int n = WiFi.scanNetworks(); - Serial.println("scan done"); - if (n == 0) - Serial.println("no networks found"); - else - { - Serial.print(n); - Serial.println(" networks found"); - for (int i = 0; i < n; ++i) - { - // Print SSID and RSSI for each network found - Serial.print(i + 1); - Serial.print(": "); - Serial.print(WiFi.SSID(i)); - Serial.print(" ("); - Serial.print(WiFi.RSSI(i)); - Serial.print(")"); - Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE)?" ":"*"); - delay(10); - } - } - Serial.println(""); - - // Wait a bit before scanning again - delay(5000); -} diff --git a/examples/ide/clion/.gitignore b/examples/ide/clion/.gitignore deleted file mode 100644 index a9fe6864..00000000 --- a/examples/ide/clion/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.pioenvs -CMakeListsPrivate.txt diff --git a/examples/ide/clion/.idea/clion.iml b/examples/ide/clion/.idea/clion.iml deleted file mode 100644 index bc2cd874..00000000 --- a/examples/ide/clion/.idea/clion.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/examples/ide/clion/.idea/encodings.xml b/examples/ide/clion/.idea/encodings.xml deleted file mode 100644 index 97626ba4..00000000 --- a/examples/ide/clion/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/examples/ide/clion/.idea/misc.xml b/examples/ide/clion/.idea/misc.xml deleted file mode 100644 index 6b328020..00000000 --- a/examples/ide/clion/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/examples/ide/clion/.idea/modules.xml b/examples/ide/clion/.idea/modules.xml deleted file mode 100644 index 9ce81f04..00000000 --- a/examples/ide/clion/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/examples/ide/clion/.idea/platformio.iml b/examples/ide/clion/.idea/platformio.iml deleted file mode 100644 index bc2cd874..00000000 --- a/examples/ide/clion/.idea/platformio.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/examples/ide/clion/.idea/vcs.xml b/examples/ide/clion/.idea/vcs.xml deleted file mode 100644 index 6564d52d..00000000 --- a/examples/ide/clion/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/examples/ide/clion/.idea/workspace.xml b/examples/ide/clion/.idea/workspace.xml deleted file mode 100644 index a4c03d98..00000000 --- a/examples/ide/clion/.idea/workspace.xml +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - C/C++ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1435919971910 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/ide/clion/.travis.yml b/examples/ide/clion/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/ide/clion/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/ide/clion/CMakeLists.txt b/examples/ide/clion/CMakeLists.txt deleted file mode 100644 index b70e0173..00000000 --- a/examples/ide/clion/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -cmake_minimum_required(VERSION 3.2) -project(clion) - -include(CMakeListsPrivate.txt) - -add_definitions(-DF_CPU=16000000L) -add_definitions(-DARDUINO_ARCH_AVR) -add_definitions(-DARDUINO_AVR_UNO) -add_definitions(-DARDUINO=10607) -add_definitions(-DPLATFORMIO=020805) -add_definitions(-D__AVR_ATmega328P__) - -add_custom_target( - PLATFORMIO_BUILD ALL - COMMAND ${PLATFORMIO_CMD} -f -c clion run - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -) - -add_custom_target( - PLATFORMIO_UPLOAD ALL - COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -) - -add_custom_target( - PLATFORMIO_CLEAN ALL - COMMAND ${PLATFORMIO_CMD} -f -c clion run --target clean - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -) - -add_custom_target( - PLATFORMIO_PROGRAM ALL - COMMAND ${PLATFORMIO_CMD} -f -c clion run --target program - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -) - -add_custom_target( - PLATFORMIO_UPLOADFS ALL - COMMAND ${PLATFORMIO_CMD} -f -c clion run --target uploadfs - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -) - -add_custom_target( - PLATFORMIO_UPDATE_ALL ALL - COMMAND ${PLATFORMIO_CMD} -f -c clion update - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -) - -add_executable(clion - src/blink.cpp -) diff --git a/examples/ide/clion/README.rst b/examples/ide/clion/README.rst deleted file mode 100644 index 73698c03..00000000 --- a/examples/ide/clion/README.rst +++ /dev/null @@ -1,8 +0,0 @@ -CLion IDE Integration -===================== - -The detailed information and steps are described in the main documentation: -`PlatformIO integration with CLion IDE `_. - -.. image:: http://docs.platformio.org/en/latest/_images/ide-platformio-clion.png - :target: http://docs.platformio.org/en/latest/ide/clion.html diff --git a/examples/ide/clion/lib/readme.txt b/examples/ide/clion/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/ide/clion/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/ide/clion/platformio.ini b/examples/ide/clion/platformio.ini deleted file mode 100644 index 7e183bf7..00000000 --- a/examples/ide/clion/platformio.ini +++ /dev/null @@ -1,24 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:uno] -platform = atmelavr -framework = arduino -board = uno -# targets = upload diff --git a/examples/ide/clion/src/blink.cpp b/examples/ide/clion/src/blink.cpp deleted file mode 100644 index 262a6310..00000000 --- a/examples/ide/clion/src/blink.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "Arduino.h" - -// Most Arduino boards already have a LED attached to pin 13 on the board itself -#define LED_PIN 13 - -void setup() { - pinMode(LED_PIN, OUTPUT); // set pin as output -} - -void loop() { - digitalWrite(LED_PIN, HIGH); // set the LED on - delay(1000); // wait for a second - digitalWrite(LED_PIN, LOW); // set the LED off - delay(1000); // wait for a second -} diff --git a/examples/ide/eclipse/.cproject b/examples/ide/eclipse/.cproject deleted file mode 100644 index 496ac80b..00000000 --- a/examples/ide/eclipse/.cproject +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - platformio - -f -c eclipse - run -t program - true - true - false - - - platformio - -f -c eclipse - run -t uploadfs - true - true - false - - - platformio - -f -c eclipse - run - true - true - false - - - platformio - -f -c eclipse - run -t upload - true - true - false - - - platformio - -f -c eclipse - run -t clean - true - true - false - - - platformio - -f -c eclipse - update - true - true - false - - - - diff --git a/examples/ide/eclipse/.gitignore b/examples/ide/eclipse/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/ide/eclipse/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/ide/eclipse/.project b/examples/ide/eclipse/.project deleted file mode 100644 index 7d8cd85e..00000000 --- a/examples/ide/eclipse/.project +++ /dev/null @@ -1,27 +0,0 @@ - - - PlatformIO - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/examples/ide/eclipse/.settings/language.settings.xml b/examples/ide/eclipse/.settings/language.settings.xml deleted file mode 100644 index 2135df98..00000000 --- a/examples/ide/eclipse/.settings/language.settings.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/examples/ide/eclipse/.travis.yml b/examples/ide/eclipse/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/ide/eclipse/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/ide/eclipse/README.rst b/examples/ide/eclipse/README.rst deleted file mode 100644 index bb4bfbe6..00000000 --- a/examples/ide/eclipse/README.rst +++ /dev/null @@ -1,8 +0,0 @@ -Eclipse IDE Integration -======================= - -The detailed information and steps are described in the main documentation: -`PlatformIO integration with Eclipse IDE `_. - -.. image:: http://docs.platformio.org/en/latest/_images/ide-platformio-eclipse.png - :target: http://docs.platformio.org/en/latest/ide/eclipse.html diff --git a/examples/ide/eclipse/lib/readme.txt b/examples/ide/eclipse/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/ide/eclipse/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/ide/eclipse/platformio.ini b/examples/ide/eclipse/platformio.ini deleted file mode 100644 index 7e183bf7..00000000 --- a/examples/ide/eclipse/platformio.ini +++ /dev/null @@ -1,24 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:uno] -platform = atmelavr -framework = arduino -board = uno -# targets = upload diff --git a/examples/ide/eclipse/src/blink.cpp b/examples/ide/eclipse/src/blink.cpp deleted file mode 100644 index 262a6310..00000000 --- a/examples/ide/eclipse/src/blink.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "Arduino.h" - -// Most Arduino boards already have a LED attached to pin 13 on the board itself -#define LED_PIN 13 - -void setup() { - pinMode(LED_PIN, OUTPUT); // set pin as output -} - -void loop() { - digitalWrite(LED_PIN, HIGH); // set the LED on - delay(1000); // wait for a second - digitalWrite(LED_PIN, LOW); // set the LED off - delay(1000); // wait for a second -} diff --git a/examples/ide/qtcreator/.gitignore b/examples/ide/qtcreator/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/ide/qtcreator/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/ide/qtcreator/.travis.yml b/examples/ide/qtcreator/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/ide/qtcreator/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/ide/qtcreator/README.rst b/examples/ide/qtcreator/README.rst deleted file mode 100644 index 6136828a..00000000 --- a/examples/ide/qtcreator/README.rst +++ /dev/null @@ -1,8 +0,0 @@ -Qt Creator IDE Integration -========================== - -The detailed information and steps are described in the main documentation: -`PlatformIO integration with Qt Creator `_. - -.. image:: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-7.png - :target: http://docs.platformio.org/en/latest/ide/qtcreator.html diff --git a/examples/ide/qtcreator/lib/readme.txt b/examples/ide/qtcreator/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/ide/qtcreator/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/ide/qtcreator/platformio.ini b/examples/ide/qtcreator/platformio.ini deleted file mode 100644 index 7e183bf7..00000000 --- a/examples/ide/qtcreator/platformio.ini +++ /dev/null @@ -1,24 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:uno] -platform = atmelavr -framework = arduino -board = uno -# targets = upload diff --git a/examples/ide/qtcreator/platformio.pro b/examples/ide/qtcreator/platformio.pro deleted file mode 100644 index 19dedbdf..00000000 --- a/examples/ide/qtcreator/platformio.pro +++ /dev/null @@ -1,26 +0,0 @@ -win32 { - HOMEDIR += $$(USERPROFILE) -} -else { - HOMEDIR += $$(HOME) -} - -INCLUDEPATH += "$${HOMEDIR}/.platformio/packages/framework-arduinoavr/variants/standard" -INCLUDEPATH += "$${HOMEDIR}/.platformio/packages/framework-arduinoavr/cores/arduino" -INCLUDEPATH += "$${HOMEDIR}/.platformio/packages/toolchain-atmelavr/avr/include" -INCLUDEPATH += "$${HOMEDIR}/.platformio/packages/toolchain-atmelavr/bfd/include" -INCLUDEPATH += "$${HOMEDIR}/.platformio/packages/toolchain-atmelavr/lib/gcc/avr/4.8.1/include" -INCLUDEPATH += "$${HOMEDIR}/.platformio/packages/toolchain-atmelavr/lib/gcc/avr/4.8.1/include-fixed" - -DEFINES += "F_CPU=16000000L" -DEFINES += "ARDUINO_ARCH_AVR" -DEFINES += "ARDUINO_AVR_UNO" -DEFINES += "ARDUINO=10605" -DEFINES += "PLATFORMIO=020300" -DEFINES += "__AVR_ATmega328P__" - -OTHER_FILES += \ - platformio.ini - -SOURCES += \ - src/blink.cpp diff --git a/examples/ide/qtcreator/src/blink.cpp b/examples/ide/qtcreator/src/blink.cpp deleted file mode 100644 index 262a6310..00000000 --- a/examples/ide/qtcreator/src/blink.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "Arduino.h" - -// Most Arduino boards already have a LED attached to pin 13 on the board itself -#define LED_PIN 13 - -void setup() { - pinMode(LED_PIN, OUTPUT); // set pin as output -} - -void loop() { - digitalWrite(LED_PIN, HIGH); // set the LED on - delay(1000); // wait for a second - digitalWrite(LED_PIN, LOW); // set the LED off - delay(1000); // wait for a second -} diff --git a/examples/ide/sublimetext/.gitignore b/examples/ide/sublimetext/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/ide/sublimetext/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/ide/sublimetext/.travis.yml b/examples/ide/sublimetext/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/ide/sublimetext/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/ide/sublimetext/README.rst b/examples/ide/sublimetext/README.rst deleted file mode 100644 index 78da7c22..00000000 --- a/examples/ide/sublimetext/README.rst +++ /dev/null @@ -1,8 +0,0 @@ -Sublime Text Integration -======================== - -The detailed information and steps are described in the main documentation: -`PlatformIO integration with Sublime Text `_. - -.. image:: http://docs.platformio.org/en/latest/_images/ide-sublime-text-platformio-newproject-5.png - :target: http://docs.platformio.org/en/latest/ide/sublimetext.html diff --git a/examples/ide/sublimetext/lib/readme.txt b/examples/ide/sublimetext/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/ide/sublimetext/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/ide/sublimetext/platformio.ini b/examples/ide/sublimetext/platformio.ini deleted file mode 100644 index 7e183bf7..00000000 --- a/examples/ide/sublimetext/platformio.ini +++ /dev/null @@ -1,24 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:uno] -platform = atmelavr -framework = arduino -board = uno -# targets = upload diff --git a/examples/ide/sublimetext/platformio.sublime-project b/examples/ide/sublimetext/platformio.sublime-project deleted file mode 100644 index d6dca18f..00000000 --- a/examples/ide/sublimetext/platformio.sublime-project +++ /dev/null @@ -1,78 +0,0 @@ -{ - "build_systems": - [ - { - "cmd": - [ - "platformio", - "-f", "-c", "sublimetext", - "run" - ], - "name": "PlatformIO", - "variants": - [ - { - "cmd": - [ - "platformio", - "-f", "-c", "sublimetext", - "run", - "--target", - "clean" - ], - "name": "Clean" - }, - { - "cmd": - [ - "platformio", - "-f", "-c", "sublimetext", - "run", - "--target", - "upload" - ], - "name": "Upload" - }, - { - "cmd": - [ - "platformio", - "-f", "-c", "sublimetext", - "run", - "--target", - "program" - ], - "name": "Upload using Programmer" - }, - { - "cmd": - [ - "platformio", - "-f", "-c", "sublimetext", - "run", - "--target", - "uploadfs" - ], - "name": "Upload SPIFFS image" - }, - { - "cmd": - [ - "platformio", - "-f", "-c", "sublimetext", - "update" - ], - "name": "Update platforms and libraries" - } - ], - "working_dir": "${project_path:${folder}}", - "selector": "source.c, source.c++" - } - ], - "folders": - [ - { - "path": "." - } - ] -} diff --git a/examples/ide/sublimetext/src/blink.cpp b/examples/ide/sublimetext/src/blink.cpp deleted file mode 100644 index 262a6310..00000000 --- a/examples/ide/sublimetext/src/blink.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "Arduino.h" - -// Most Arduino boards already have a LED attached to pin 13 on the board itself -#define LED_PIN 13 - -void setup() { - pinMode(LED_PIN, OUTPUT); // set pin as output -} - -void loop() { - digitalWrite(LED_PIN, HIGH); // set the LED on - delay(1000); // wait for a second - digitalWrite(LED_PIN, LOW); // set the LED off - delay(1000); // wait for a second -} diff --git a/examples/ide/visualstudio/.gitignore b/examples/ide/visualstudio/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/ide/visualstudio/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/ide/visualstudio/.travis.yml b/examples/ide/visualstudio/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/ide/visualstudio/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/ide/visualstudio/README.rst b/examples/ide/visualstudio/README.rst deleted file mode 100644 index 683412ba..00000000 --- a/examples/ide/visualstudio/README.rst +++ /dev/null @@ -1,8 +0,0 @@ -Visual Studio Integration -========================= - -The detailed information and steps are described in the main documentation: -`PlatformIO integration with Visual Studio `_. - -.. image:: http://docs.platformio.org/en/latest/_images/ide-vs-platformio-newproject-8.png - :target: http://docs.platformio.org/en/latest/ide/visualstudio.html diff --git a/examples/ide/visualstudio/lib/readme.txt b/examples/ide/visualstudio/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/ide/visualstudio/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/ide/visualstudio/platformio.ini b/examples/ide/visualstudio/platformio.ini deleted file mode 100644 index 829194f0..00000000 --- a/examples/ide/visualstudio/platformio.ini +++ /dev/null @@ -1,24 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:uno] -platform = atmelavr -framework = arduino -board = uno -# targets = upload diff --git a/examples/ide/visualstudio/platformio.vcxproj b/examples/ide/visualstudio/platformio.vcxproj deleted file mode 100644 index 36707b41..00000000 --- a/examples/ide/visualstudio/platformio.vcxproj +++ /dev/null @@ -1,63 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {0FA9C3A8-452B-41EF-A418-9102B170F49F} - MakeFileProj - - - - Makefile - true - v120 - - - Makefile - false - v120 - - - - - - - - - - - - - platformio -f -c visualstudio run - platformio -f -c visualstudio run --target clean - F_CPU=16000000L;ARDUINO_ARCH_AVR;ARDUINO_AVR_UNO;ARDUINO=10605;PLATFORMIO=020300;__AVR_ATmega328P__ - $(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\framework-arduinoavr\variants\standard;$(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\framework-arduinoavr\cores\arduino;$(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\toolchain-atmelavr\avr\include;$(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\toolchain-atmelavr\lib\gcc\avr\4.8.1\include;$(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\toolchain-atmelavr\lib\gcc\avr\4.8.1\include-fixed - - - platformio run - platformio run --target clean - {";".join(defines)}} - $(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\framework-arduinoavr\variants\standard;$(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\framework-arduinoavr\cores\arduino;$(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\toolchain-atmelavr\avr\include;$(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\toolchain-atmelavr\lib\gcc\avr\4.8.1\include;$(HOMEDRIVE)$(HOMEPATH)\.platformio\packages\toolchain-atmelavr\lib\gcc\avr\4.8.1\include-fixed - - - - - - - - - - - - Source Files - - - diff --git a/examples/ide/visualstudio/platformio.vcxproj.filters b/examples/ide/visualstudio/platformio.vcxproj.filters deleted file mode 100644 index a1327e90..00000000 --- a/examples/ide/visualstudio/platformio.vcxproj.filters +++ /dev/null @@ -1,21 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;ino;pde - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - - - - - - Source Files - - - diff --git a/examples/ide/visualstudio/src/blink.cpp b/examples/ide/visualstudio/src/blink.cpp deleted file mode 100644 index 262a6310..00000000 --- a/examples/ide/visualstudio/src/blink.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "Arduino.h" - -// Most Arduino boards already have a LED attached to pin 13 on the board itself -#define LED_PIN 13 - -void setup() { - pinMode(LED_PIN, OUTPUT); // set pin as output -} - -void loop() { - digitalWrite(LED_PIN, HIGH); // set the LED on - delay(1000); // wait for a second - digitalWrite(LED_PIN, LOW); // set the LED off - delay(1000); // wait for a second -} diff --git a/examples/mbed/mbed-blink/.gitignore b/examples/mbed/mbed-blink/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/mbed/mbed-blink/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/mbed/mbed-blink/.travis.yml b/examples/mbed/mbed-blink/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/mbed/mbed-blink/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/mbed/mbed-blink/README.rst b/examples/mbed/mbed-blink/README.rst deleted file mode 100644 index 908f069b..00000000 --- a/examples/mbed/mbed-blink/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/mbed/mbed-blink - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/mbed/mbed-blink/lib/readme.txt b/examples/mbed/mbed-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/mbed/mbed-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/mbed/mbed-blink/platformio.ini b/examples/mbed/mbed-blink/platformio.ini deleted file mode 100644 index 306e976c..00000000 --- a/examples/mbed/mbed-blink/platformio.ini +++ /dev/null @@ -1,55 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - - -# NXP LPC Platform -[env:lpc1768] -platform = nxplpc -framework = mbed -board = lpc1768 - -# Nordic nRF51 Platform -[env:nrf51_mkit] -platform = nordicnrf51 -framework = mbed -board = nrf51_mkit - -# Freescale FRDM Platform -[env:frdm_kl25z] -platform = freescalekinetis -framework = mbed -board = frdm_kl25z - -# ST STM32 Platform -[env:nucleo_f401re] -platform = ststm32 -framework = mbed -board = nucleo_f401re - -# Teensy Platform -[env:teensy31] -platform = teensy -framework = mbed -board = teensy31 - -# Silicon Labs EFM32 Platform -[env:siliconlabsefm32] -platform = siliconlabsefm32 -framework = mbed -board = efm32hg_stk3400 diff --git a/examples/mbed/mbed-blink/src/main.cpp b/examples/mbed/mbed-blink/src/main.cpp deleted file mode 100644 index 8247a2e9..00000000 --- a/examples/mbed/mbed-blink/src/main.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "mbed.h" - -DigitalOut myled(LED1); - -int main() { - while(1) { - myled = 1; - wait(1); - myled = 0; - wait(1); - } -} \ No newline at end of file diff --git a/examples/mbed/mbed-dsp/.gitignore b/examples/mbed/mbed-dsp/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/mbed/mbed-dsp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/mbed/mbed-dsp/.travis.yml b/examples/mbed/mbed-dsp/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/mbed/mbed-dsp/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/mbed/mbed-dsp/README.rst b/examples/mbed/mbed-dsp/README.rst deleted file mode 100644 index a829464a..00000000 --- a/examples/mbed/mbed-dsp/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/mbed/mbed-dsp - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/mbed/mbed-dsp/lib/readme.txt b/examples/mbed/mbed-dsp/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/mbed/mbed-dsp/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/mbed/mbed-dsp/platformio.ini b/examples/mbed/mbed-dsp/platformio.ini deleted file mode 100644 index f1f25ccb..00000000 --- a/examples/mbed/mbed-dsp/platformio.ini +++ /dev/null @@ -1,43 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - - -# NXP LPC Platform -[env:lpc1768] -platform = nxplpc -framework = mbed -board = lpc1768 - -# Nordic nRF51 Platform -[env:nrf51_mkit] -platform = nordicnrf51 -framework = mbed -board = nrf51_mkit - -# Freescale FRDM Platform -[env:frdm_kl25z] -platform = freescalekinetis -framework = mbed -board = frdm_kl25z - -# ST STM32 Platform -[env:nucleo_f401re] -platform = ststm32 -framework = mbed -board = nucleo_f401re diff --git a/examples/mbed/mbed-dsp/src/data.cpp b/examples/mbed/mbed-dsp/src/data.cpp deleted file mode 100644 index d946b36b..00000000 --- a/examples/mbed/mbed-dsp/src/data.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include "arm_math.h" - -/* ---------------------------------------------------------------------- -** Test input signal contains 1000Hz + 15000 Hz -** ------------------------------------------------------------------- */ - -float32_t testInput_f32_1kHz_15kHz[320] = -{ -+0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f, -+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f, -+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f, --0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f, --0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f, --0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f, -+0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f, -+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f, -+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f, -+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f, --0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f, --0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f, -+0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f, -+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f, -+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f, -+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f, --0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f, --0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f, --0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f, -+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f, -+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f, --0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f, --0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f, --0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f, -+0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f, -+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f, -+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f, -+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f, --0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f, --0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f, --0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f, -+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f, -+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f, -+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f, --0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f, --0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f, --0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f, -+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f, -+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f, -+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f, -}; - -float32_t refOutput[320] = -{ -+0.0000000000f, -0.0010797829f, -0.0007681386f, -0.0001982932f, +0.0000644313f, +0.0020854271f, +0.0036891871f, +0.0015855941f, --0.0026280805f, -0.0075907658f, -0.0119390538f, -0.0086665968f, +0.0088981202f, +0.0430539279f, +0.0974468742f, +0.1740405600f, -+0.2681416601f, +0.3747720089f, +0.4893362230f, +0.6024154672f, +0.7058740791f, +0.7968348987f, +0.8715901940f, +0.9277881093f, -+0.9682182661f, +0.9934674267f, +1.0012052245f, +0.9925859371f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f, -+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, -0.0000000000f, -0.1309866321f, --0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f, --0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f, --0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f, -+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f, -+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f, -+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, -0.0000000000f, -0.1309866321f, --0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f, --0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f, --0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f, -+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f, -+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f, -+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, -0.0000000000f, -0.1309866321f, --0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f, --0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f, --0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f, -+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f, -+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f, -+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, +0.0000000000f, -0.1309866321f, --0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f, --0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f, --0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f, -+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f, -+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f, -+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, +0.0000000000f, -0.1309866321f, --0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f, --0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f, --0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, -0.0000000000f, +0.1309866321f, -+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f, -+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f, -+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, +0.0000000000f, -0.1309866321f, --0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f, --0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f, --0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f, -+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f, -+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f -}; - diff --git a/examples/mbed/mbed-dsp/src/main.cpp b/examples/mbed/mbed-dsp/src/main.cpp deleted file mode 100644 index f6bdb4b7..00000000 --- a/examples/mbed/mbed-dsp/src/main.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "arm_math.h" -#include "math_helper.h" -#include - -#define BLOCK_SIZE 32 -#define NUM_BLOCKS 10 - -#define TEST_LENGTH_SAMPLES (BLOCK_SIZE * NUM_BLOCKS) - -#define SNR_THRESHOLD_F32 140.0f -#define NUM_TAPS 29 - -/* ------------------------------------------------------------------- - * The input signal and reference output (computed with MATLAB) - * are defined externally in arm_fir_lpf_data.c. - * ------------------------------------------------------------------- */ -extern float32_t testInput_f32_1kHz_15kHz[TEST_LENGTH_SAMPLES]; -extern float32_t refOutput[TEST_LENGTH_SAMPLES]; - -/* ------------------------------------------------------------------- - * Declare State buffer of size (numTaps + blockSize - 1) - * ------------------------------------------------------------------- */ -static float32_t firStateF32[BLOCK_SIZE + NUM_TAPS - 1]; - -/* ---------------------------------------------------------------------- - * FIR Coefficients buffer generated using fir1() MATLAB function. - * fir1(28, 6/24) - * ------------------------------------------------------------------- */ -const float32_t firCoeffs32[NUM_TAPS] = { - -0.0018225230f, -0.0015879294f, +0.0000000000f, +0.0036977508f, +0.0080754303f, - +0.0085302217f, -0.0000000000f, -0.0173976984f, -0.0341458607f, -0.0333591565f, - +0.0000000000f, +0.0676308395f, +0.1522061835f, +0.2229246956f, +0.2504960933f, - +0.2229246956f, +0.1522061835f, +0.0676308395f, +0.0000000000f, -0.0333591565f, - -0.0341458607f, -0.0173976984f, -0.0000000000f, +0.0085302217f, +0.0080754303f, - +0.0036977508f, +0.0000000000f, -0.0015879294f, -0.0018225230f -}; - -/* ---------------------------------------------------------------------- - * FIR LPF Example - * ------------------------------------------------------------------- */ -int main(void) { - /* Call FIR init function to initialize the instance structure. */ - arm_fir_instance_f32 S; - arm_fir_init_f32(&S, NUM_TAPS, (float32_t *)&firCoeffs32[0], &firStateF32[0], BLOCK_SIZE); - - /* ---------------------------------------------------------------------- - * Call the FIR process function for every blockSize samples - * ------------------------------------------------------------------- */ - for (uint32_t i=0; i < NUM_BLOCKS; i++) { - float32_t* signal = testInput_f32_1kHz_15kHz + (i * BLOCK_SIZE); - arm_fir_f32(&S, signal, signal, BLOCK_SIZE); - } - - /* ---------------------------------------------------------------------- - * Compare the generated output against the reference output computed - * in MATLAB. - * ------------------------------------------------------------------- */ - float32_t snr = arm_snr_f32(refOutput, testInput_f32_1kHz_15kHz, TEST_LENGTH_SAMPLES); - printf("snr: %f\n\r", snr); - if (snr < SNR_THRESHOLD_F32) { - printf("Failed\n\r"); - } else { - printf("Success\n\r"); - } -} diff --git a/examples/mbed/mbed-http-client/.gitignore b/examples/mbed/mbed-http-client/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/mbed/mbed-http-client/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/mbed/mbed-http-client/.travis.yml b/examples/mbed/mbed-http-client/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/mbed/mbed-http-client/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/mbed/mbed-http-client/README.rst b/examples/mbed/mbed-http-client/README.rst deleted file mode 100644 index c32602ab..00000000 --- a/examples/mbed/mbed-http-client/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/mbed/mbed-http-client - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/mbed/mbed-http-client/lib/HTTPClient/HTTPClient.cpp b/examples/mbed/mbed-http-client/lib/HTTPClient/HTTPClient.cpp deleted file mode 100644 index 0a6abd31..00000000 --- a/examples/mbed/mbed-http-client/lib/HTTPClient/HTTPClient.cpp +++ /dev/null @@ -1,739 +0,0 @@ -/* HTTPClient.cpp */ -/* Copyright (C) 2012 mbed.org, MIT License - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -//Debug is disabled by default -#if 0 -//Enable debug -#include -#define DBG(x, ...) std::printf("[HTTPClient : DBG]"x"\r\n", ##__VA_ARGS__); -#define WARN(x, ...) std::printf("[HTTPClient : WARN]"x"\r\n", ##__VA_ARGS__); -#define ERR(x, ...) std::printf("[HTTPClient : ERR]"x"\r\n", ##__VA_ARGS__); - -#else -//Disable debug -#define DBG(x, ...) -#define WARN(x, ...) -#define ERR(x, ...) - -#endif - -#define HTTP_PORT 80 - -#define OK 0 - -#define MIN(x,y) (((x)<(y))?(x):(y)) -#define MAX(x,y) (((x)>(y))?(x):(y)) - -#define CHUNK_SIZE 256 - -#include - -#include "HTTPClient.h" - -HTTPClient::HTTPClient() : -m_sock(), m_basicAuthUser(NULL), m_basicAuthPassword(NULL), m_httpResponseCode(0) -{ - -} - -HTTPClient::~HTTPClient() -{ - -} - -#if 0 -void HTTPClient::basicAuth(const char* user, const char* password) //Basic Authentification -{ - m_basicAuthUser = user; - m_basicAuthPassword = password; -} -#endif - -HTTPResult HTTPClient::get(const char* url, IHTTPDataIn* pDataIn, int timeout /*= HTTP_CLIENT_DEFAULT_TIMEOUT*/) //Blocking -{ - return connect(url, HTTP_GET, NULL, pDataIn, timeout); -} - -HTTPResult HTTPClient::get(const char* url, char* result, size_t maxResultLen, int timeout /*= HTTP_CLIENT_DEFAULT_TIMEOUT*/) //Blocking -{ - HTTPText str(result, maxResultLen); - return get(url, &str, timeout); -} - -HTTPResult HTTPClient::post(const char* url, const IHTTPDataOut& dataOut, IHTTPDataIn* pDataIn, int timeout /*= HTTP_CLIENT_DEFAULT_TIMEOUT*/) //Blocking -{ - return connect(url, HTTP_POST, (IHTTPDataOut*)&dataOut, pDataIn, timeout); -} - -HTTPResult HTTPClient::put(const char* url, const IHTTPDataOut& dataOut, IHTTPDataIn* pDataIn, int timeout /*= HTTP_CLIENT_DEFAULT_TIMEOUT*/) //Blocking -{ - return connect(url, HTTP_PUT, (IHTTPDataOut*)&dataOut, pDataIn, timeout); -} - -HTTPResult HTTPClient::del(const char* url, IHTTPDataIn* pDataIn, int timeout /*= HTTP_CLIENT_DEFAULT_TIMEOUT*/) //Blocking -{ - return connect(url, HTTP_DELETE, NULL, pDataIn, timeout); -} - - -int HTTPClient::getHTTPResponseCode() -{ - return m_httpResponseCode; -} - -#define CHECK_CONN_ERR(ret) \ - do{ \ - if(ret) { \ - m_sock.close(); \ - ERR("Connection error (%d)", ret); \ - return HTTP_CONN; \ - } \ - } while(0) - -#define PRTCL_ERR() \ - do{ \ - m_sock.close(); \ - ERR("Protocol error"); \ - return HTTP_PRTCL; \ - } while(0) - -HTTPResult HTTPClient::connect(const char* url, HTTP_METH method, IHTTPDataOut* pDataOut, IHTTPDataIn* pDataIn, int timeout) //Execute request -{ - m_httpResponseCode = 0; //Invalidate code - m_timeout = timeout; - - pDataIn->writeReset(); - if( pDataOut ) - { - pDataOut->readReset(); - } - - char scheme[8]; - uint16_t port; - char host[32]; - char path[64]; - //First we need to parse the url (http[s]://host[:port][/[path]]) -- HTTPS not supported (yet?) - HTTPResult res = parseURL(url, scheme, sizeof(scheme), host, sizeof(host), &port, path, sizeof(path)); - if(res != HTTP_OK) - { - ERR("parseURL returned %d", res); - return res; - } - - if(port == 0) //TODO do handle HTTPS->443 - { - port = 80; - } - - DBG("Scheme: %s", scheme); - DBG("Host: %s", host); - DBG("Port: %d", port); - DBG("Path: %s", path); - - //Connect - DBG("Connecting socket to server"); - int ret = m_sock.connect(host, port); - if (ret < 0) - { - m_sock.close(); - ERR("Could not connect"); - return HTTP_CONN; - } - - //Send request - DBG("Sending request"); - char buf[CHUNK_SIZE]; - const char* meth = (method==HTTP_GET)?"GET":(method==HTTP_POST)?"POST":(method==HTTP_PUT)?"PUT":(method==HTTP_DELETE)?"DELETE":""; - snprintf(buf, sizeof(buf), "%s %s HTTP/1.1\r\nHost: %s\r\n", meth, path, host); //Write request - ret = send(buf); - if(ret) - { - m_sock.close(); - ERR("Could not write request"); - return HTTP_CONN; - } - - //Send all headers - - //Send default headers - DBG("Sending headers"); - if( pDataOut != NULL ) - { - if( pDataOut->getIsChunked() ) - { - ret = send("Transfer-Encoding: chunked\r\n"); - CHECK_CONN_ERR(ret); - } - else - { - snprintf(buf, sizeof(buf), "Content-Length: %d\r\n", pDataOut->getDataLen()); - ret = send(buf); - CHECK_CONN_ERR(ret); - } - char type[48]; - if( pDataOut->getDataType(type, 48) == HTTP_OK ) - { - snprintf(buf, sizeof(buf), "Content-Type: %s\r\n", type); - ret = send(buf); - CHECK_CONN_ERR(ret); - } - - //Send specific headers - while( pDataOut->getHeader(buf, sizeof(buf) - 3) ) //must have space left for CRLF + 0 terminating char - { - size_t headerlen = strlen(buf); - snprintf(buf + headerlen, sizeof(buf) - headerlen, "\r\n"); - ret = send(buf); - CHECK_CONN_ERR(ret); - } - } - - //Send specific headers - while( pDataIn->getHeader(buf, sizeof(buf) - 3) ) - { - size_t headerlen = strlen(buf); - snprintf(buf + headerlen, sizeof(buf) - headerlen, "\r\n"); - ret = send(buf); - CHECK_CONN_ERR(ret); - } - - //Close headers - DBG("Headers sent"); - ret = send("\r\n"); - CHECK_CONN_ERR(ret); - - size_t trfLen; - - //Send data (if available) - if( pDataOut != NULL ) - { - DBG("Sending data"); - while(true) - { - size_t writtenLen = 0; - pDataOut->read(buf, CHUNK_SIZE, &trfLen); - if( pDataOut->getIsChunked() ) - { - //Write chunk header - char chunkHeader[16]; - snprintf(chunkHeader, sizeof(chunkHeader), "%X\r\n", trfLen); //In hex encoding - ret = send(chunkHeader); - CHECK_CONN_ERR(ret); - } - else if( trfLen == 0 ) - { - break; - } - if( trfLen != 0 ) - { - ret = send(buf, trfLen); - CHECK_CONN_ERR(ret); - } - - if( pDataOut->getIsChunked() ) - { - ret = send("\r\n"); //Chunk-terminating CRLF - CHECK_CONN_ERR(ret); - } - else - { - writtenLen += trfLen; - if( writtenLen >= pDataOut->getDataLen() ) - { - break; - } - } - - if( trfLen == 0 ) - { - break; - } - } - } - - //Receive response - DBG("Receiving response"); - ret = recv(buf, 1, CHUNK_SIZE - 1, &trfLen); //Read n bytes - CHECK_CONN_ERR(ret); - - buf[trfLen] = '\0'; - - //Make sure we got the first response line - char* crlfPtr = NULL; - while( true ) - { - crlfPtr = strstr(buf, "\r\n"); - if(crlfPtr == NULL) - { - if( trfLen < CHUNK_SIZE - 1 ) - { - size_t newTrfLen; - ret = recv(buf + trfLen, 1, CHUNK_SIZE - trfLen - 1, &newTrfLen); - trfLen += newTrfLen; - buf[trfLen] = '\0'; - DBG("Read %d chars; In buf: [%s]", newTrfLen, buf); - CHECK_CONN_ERR(ret); - continue; - } - else - { - PRTCL_ERR(); - } - } - break; - } - - int crlfPos = crlfPtr - buf; - buf[crlfPos] = '\0'; - - //Parse HTTP response - //if( sscanf(buf, "HTTP/%*d.%*d %d %*[^\r\n]", &m_httpResponseCode) != 1 ) - if(crlfPos > 13) - { - buf[13] = '\0'; - } - if( sscanf(buf, "HTTP/%*d.%*d %d", &m_httpResponseCode) != 1 ) //Kludge for newlib nano - { - //Cannot match string, error - ERR("Not a correct HTTP answer : %s\n", buf); - PRTCL_ERR(); - } - - if( (m_httpResponseCode < 200) || (m_httpResponseCode >= 300) ) - { - //Did not return a 2xx code; TODO fetch headers/(&data?) anyway and implement a mean of writing/reading headers - WARN("Response code %d", m_httpResponseCode); - PRTCL_ERR(); - } - - DBG("Reading headers"); - - memmove(buf, &buf[crlfPos+2], trfLen - (crlfPos + 2) + 1); //Be sure to move NULL-terminating char as well - trfLen -= (crlfPos + 2); - - size_t recvContentLength = 0; - bool recvChunked = false; - bool recvLengthUnknown = true; - //Now get headers - while( true ) - { - crlfPtr = strstr(buf, "\r\n"); - if(crlfPtr == NULL) - { - if( trfLen < CHUNK_SIZE - 1 ) - { - size_t newTrfLen; - ret = recv(buf + trfLen, 1, CHUNK_SIZE - trfLen - 1, &newTrfLen); - trfLen += newTrfLen; - buf[trfLen] = '\0'; - DBG("Read %d chars; In buf: [%s]", newTrfLen, buf); - CHECK_CONN_ERR(ret); - continue; - } - else - { - PRTCL_ERR(); - } - } - - crlfPos = crlfPtr - buf; - - if(crlfPos == 0) //End of headers - { - DBG("Headers read"); - memmove(buf, &buf[2], trfLen - 2 + 1); //Be sure to move NULL-terminating char as well - trfLen -= 2; - break; - } - - buf[crlfPos] = '\0'; - - char key[32]; - char value[32]; - - //key[31] = '\0'; - //value[31] = '\0'; - - memset(key, 0, 32); - memset(value, 0, 32); - - //int n = sscanf(buf, "%31[^:]: %31[^\r\n]", key, value); - - int n = 0; - - char* keyEnd = strchr(buf, ':'); - if(keyEnd != NULL) - { - *keyEnd = '\0'; - if(strlen(buf) < 32) - { - strcpy(key, buf); - n++; - char* valueStart = keyEnd + 2; - if( (valueStart - buf) < crlfPos ) - { - if(strlen(valueStart) < 32) - { - strcpy(value, valueStart); - n++; - } - } - } - } - if ( n == 2 ) - { - DBG("Read header : %s: %s\n", key, value); - if( !strcmp(key, "Content-Length") ) - { - sscanf(value, "%d", &recvContentLength); - recvLengthUnknown = false; - pDataIn->setDataLen(recvContentLength); - } - else if( !strcmp(key, "Transfer-Encoding") ) - { - if( !strcmp(value, "Chunked") || !strcmp(value, "chunked") ) - { - recvChunked = true; - recvLengthUnknown = false; - pDataIn->setIsChunked(true); - } - } - else if( !strcmp(key, "Content-Type") ) - { - pDataIn->setDataType(value); - } - - memmove(buf, &buf[crlfPos+2], trfLen - (crlfPos + 2) + 1); //Be sure to move NULL-terminating char as well - trfLen -= (crlfPos + 2); - - } - else - { - ERR("Could not parse header"); - PRTCL_ERR(); - } - - } - - //Receive data - DBG("Receiving data"); - while(true) - { - size_t readLen = 0; - - if( recvChunked ) - { - //Read chunk header - bool foundCrlf; - do - { - foundCrlf = false; - crlfPos=0; - buf[trfLen]=0; - if(trfLen >= 2) - { - for(; crlfPos < trfLen - 2; crlfPos++) - { - if( buf[crlfPos] == '\r' && buf[crlfPos + 1] == '\n' ) - { - foundCrlf = true; - break; - } - } - } - if(!foundCrlf) //Try to read more - { - if( trfLen < CHUNK_SIZE ) - { - size_t newTrfLen; - ret = recv(buf + trfLen, 0, CHUNK_SIZE - trfLen - 1, &newTrfLen); - trfLen += newTrfLen; - CHECK_CONN_ERR(ret); - continue; - } - else - { - PRTCL_ERR(); - } - } - } while(!foundCrlf); - buf[crlfPos] = '\0'; - int n = sscanf(buf, "%x", &readLen); - if(n!=1) - { - ERR("Could not read chunk length"); - PRTCL_ERR(); - } - - memmove(buf, &buf[crlfPos+2], trfLen - (crlfPos + 2)); //Not need to move NULL-terminating char any more - trfLen -= (crlfPos + 2); - - if( readLen == 0 ) - { - //Last chunk - break; - } - } - else - { - readLen = recvContentLength; - } - - DBG("Retrieving %d bytes (%d bytes in buffer)", readLen, trfLen); - - do - { - if(recvLengthUnknown ) - { - readLen = trfLen; - } - pDataIn->write(buf, MIN(trfLen, readLen)); - if(!recvLengthUnknown) - { - if( trfLen > readLen ) - { - memmove(buf, &buf[readLen], trfLen - readLen); - trfLen -= readLen; - readLen = 0; - } - else - { - readLen -= trfLen; - } - } - else - { - trfLen = 0; - } - - if(readLen || recvLengthUnknown) - { - ret = recv(buf, 1, CHUNK_SIZE - trfLen - 1, &trfLen); - if(recvLengthUnknown && (ret == HTTP_CLOSED)) - { - //Write and exit - pDataIn->write(buf, trfLen); - break; - } - CHECK_CONN_ERR(ret); - if(recvLengthUnknown && (trfLen == 0)) - { - break; - } - } - } while(readLen || recvLengthUnknown); - - if( recvChunked ) - { - if(trfLen < 2) - { - size_t newTrfLen; - //Read missing chars to find end of chunk - ret = recv(buf + trfLen, 2 - trfLen, CHUNK_SIZE - trfLen - 1, &newTrfLen); - CHECK_CONN_ERR(ret); - trfLen += newTrfLen; - } - if( (buf[0] != '\r') || (buf[1] != '\n') ) - { - ERR("Format error"); - PRTCL_ERR(); - } - memmove(buf, &buf[2], trfLen - 2); - trfLen -= 2; - } - else - { - break; - } - - } - - m_sock.close(); - DBG("Completed HTTP transaction"); - - return HTTP_OK; -} - -HTTPResult HTTPClient::recv(char* buf, size_t minLen, size_t maxLen, size_t* pReadLen) //0 on success, err code on failure -{ - DBG("Trying to read between %d and %d bytes", minLen, maxLen); - size_t readLen = 0; - - if(!m_sock.is_connected()) - { - WARN("Connection was closed by server"); - return HTTP_CLOSED; //Connection was closed by server - } - - int ret; - while(readLen < maxLen) - { - if(readLen < minLen) - { - DBG("Trying to read at most %d bytes [Blocking]", minLen - readLen); - m_sock.set_blocking(false, m_timeout); - ret = m_sock.receive_all(buf + readLen, minLen - readLen); - } - else - { - DBG("Trying to read at most %d bytes [Not blocking]", maxLen - readLen); - m_sock.set_blocking(false, 0); - ret = m_sock.receive(buf + readLen, maxLen - readLen); - } - - if( ret > 0) - { - readLen += ret; - } - else if( ret == 0 ) - { - break; - } - else - { - if(!m_sock.is_connected()) - { - ERR("Connection error (recv returned %d)", ret); - *pReadLen = readLen; - return HTTP_CONN; - } - else - { - break; - } - } - - if(!m_sock.is_connected()) - { - break; - } - } - DBG("Read %d bytes", readLen); - *pReadLen = readLen; - return HTTP_OK; -} - -HTTPResult HTTPClient::send(char* buf, size_t len) //0 on success, err code on failure -{ - if(len == 0) - { - len = strlen(buf); - } - DBG("Trying to write %d bytes", len); - size_t writtenLen = 0; - - if(!m_sock.is_connected()) - { - WARN("Connection was closed by server"); - return HTTP_CLOSED; //Connection was closed by server - } - - m_sock.set_blocking(false, m_timeout); - int ret = m_sock.send_all(buf, len); - if(ret > 0) - { - writtenLen += ret; - } - else if( ret == 0 ) - { - WARN("Connection was closed by server"); - return HTTP_CLOSED; //Connection was closed by server - } - else - { - ERR("Connection error (send returned %d)", ret); - return HTTP_CONN; - } - - DBG("Written %d bytes", writtenLen); - return HTTP_OK; -} - -HTTPResult HTTPClient::parseURL(const char* url, char* scheme, size_t maxSchemeLen, char* host, size_t maxHostLen, uint16_t* port, char* path, size_t maxPathLen) //Parse URL -{ - char* schemePtr = (char*) url; - char* hostPtr = (char*) strstr(url, "://"); - if(hostPtr == NULL) - { - WARN("Could not find host"); - return HTTP_PARSE; //URL is invalid - } - - if( maxSchemeLen < hostPtr - schemePtr + 1 ) //including NULL-terminating char - { - WARN("Scheme str is too small (%d >= %d)", maxSchemeLen, hostPtr - schemePtr + 1); - return HTTP_PARSE; - } - memcpy(scheme, schemePtr, hostPtr - schemePtr); - scheme[hostPtr - schemePtr] = '\0'; - - hostPtr+=3; - - size_t hostLen = 0; - - char* portPtr = strchr(hostPtr, ':'); - if( portPtr != NULL ) - { - hostLen = portPtr - hostPtr; - portPtr++; - if( sscanf(portPtr, "%hu", port) != 1) - { - WARN("Could not find port"); - return HTTP_PARSE; - } - } - else - { - *port=0; - } - char* pathPtr = strchr(hostPtr, '/'); - if( hostLen == 0 ) - { - hostLen = pathPtr - hostPtr; - } - - if( maxHostLen < hostLen + 1 ) //including NULL-terminating char - { - WARN("Host str is too small (%d >= %d)", maxHostLen, hostLen + 1); - return HTTP_PARSE; - } - memcpy(host, hostPtr, hostLen); - host[hostLen] = '\0'; - - size_t pathLen; - char* fragmentPtr = strchr(hostPtr, '#'); - if(fragmentPtr != NULL) - { - pathLen = fragmentPtr - pathPtr; - } - else - { - pathLen = strlen(pathPtr); - } - - if( maxPathLen < pathLen + 1 ) //including NULL-terminating char - { - WARN("Path str is too small (%d >= %d)", maxPathLen, pathLen + 1); - return HTTP_PARSE; - } - memcpy(path, pathPtr, pathLen); - path[pathLen] = '\0'; - - return HTTP_OK; -} diff --git a/examples/mbed/mbed-http-client/lib/HTTPClient/HTTPClient.h b/examples/mbed/mbed-http-client/lib/HTTPClient/HTTPClient.h deleted file mode 100644 index 25301c36..00000000 --- a/examples/mbed/mbed-http-client/lib/HTTPClient/HTTPClient.h +++ /dev/null @@ -1,159 +0,0 @@ -/* HTTPClient.h */ -/* Copyright (C) 2012 mbed.org, MIT License - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** \file -HTTP Client header file -*/ - -#ifndef HTTP_CLIENT_H -#define HTTP_CLIENT_H - -#include "TCPSocketConnection.h" - -#define HTTP_CLIENT_DEFAULT_TIMEOUT 15000 - -class HTTPData; - -#include "IHTTPData.h" -#include "mbed.h" - -///HTTP client results -enum HTTPResult -{ - HTTP_PROCESSING, /// - -using std::size_t; - -class IHTTPData -{ - protected: - /** Get a specific header - * - */ - virtual bool getHeader(char* header, size_t maxHeaderLen) { return false; } -}; - -///This is a simple interface for HTTP data storage (impl examples are Key/Value Pairs, File, etc...) -class IHTTPDataOut : public IHTTPData -{ -protected: - friend class HTTPClient; - - /** Reset stream to its beginning - * Called by the HTTPClient on each new request - */ - virtual void readReset() = 0; - - /** Read a piece of data to be transmitted - * @param buf Pointer to the buffer on which to copy the data - * @param len Length of the buffer - * @param pReadLen Pointer to the variable on which the actual copied data length will be stored - */ - virtual int read(char* buf, size_t len, size_t* pReadLen) = 0; - - /** Get MIME type - * @param type Internet media type from Content-Type header - */ - virtual int getDataType(char* type, size_t maxTypeLen) = 0; //Internet media type for Content-Type header - - /** Determine whether the HTTP client should chunk the data - * Used for Transfer-Encoding header - */ - virtual bool getIsChunked() = 0; - - /** If the data is not chunked, get its size - * Used for Content-Length header - */ - virtual size_t getDataLen() = 0; - -}; - -///This is a simple interface for HTTP data storage (impl examples are Key/Value Pairs, File, etc...) -class IHTTPDataIn : public IHTTPData -{ -protected: - friend class HTTPClient; - - /** Reset stream to its beginning - * Called by the HTTPClient on each new request - */ - virtual void writeReset() = 0; - - /** Write a piece of data transmitted by the server - * @param buf Pointer to the buffer from which to copy the data - * @param len Length of the buffer - */ - virtual int write(const char* buf, size_t len) = 0; - - /** Set MIME type - * @param type Internet media type from Content-Type header - */ - virtual void setDataType(const char* type) = 0; - - /** Determine whether the data is chunked - * Recovered from Transfer-Encoding header - */ - virtual void setIsChunked(bool chunked) = 0; - - /** If the data is not chunked, set its size - * From Content-Length header - */ - virtual void setDataLen(size_t len) = 0; - -}; - -#endif diff --git a/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPMap.cpp b/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPMap.cpp deleted file mode 100644 index 5eb4c52e..00000000 --- a/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPMap.cpp +++ /dev/null @@ -1,200 +0,0 @@ -/* HTTPMap.cpp */ -/* Copyright (C) 2012 mbed.org, MIT License - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#include "HTTPMap.h" - -#include - -#include - -#define OK 0 - -using std::strncpy; - -HTTPMap::HTTPMap() : m_pos(0), m_count(0) -{ - -} - -void HTTPMap::put(const char* key, const char* value) -{ - if(m_count >= HTTPMAP_TABLE_SIZE) - { - return; - } - m_keys[m_count] = key; - m_values[m_count] = value; - m_count++; -} - -void HTTPMap::clear() -{ - m_count = 0; - m_pos = 0; -} - -/*virtual*/ void HTTPMap::readReset() -{ - m_pos = 0; -} - -/*virtual*/ int HTTPMap::read(char* buf, size_t len, size_t* pReadLen) -{ - if(m_pos >= m_count) - { - *pReadLen = 0; - m_pos = 0; - return OK; - } - - //URL encode - char* out = buf; - const char* in = m_keys[m_pos]; - if( (m_pos != 0) && (out - buf < len - 1) ) - { - *out='&'; - out++; - } - - while( (*in != '\0') && (out - buf < len - 3) ) - { - if (std::isalnum(*in) || *in == '-' || *in == '_' || *in == '.' || *in == '~') - { - *out = *in; - out++; - } - else if( *in == ' ' ) - { - *out='+'; - out++; - } - else - { - char hex[] = "0123456789abcdef"; - *out='%'; - out++; - *out=hex[(*in>>4)&0xf]; - out++; - *out=hex[(*in)&0xf]; - out++; - } - in++; - } - - if( out - buf < len - 1 ) - { - *out='='; - out++; - } - - in = m_values[m_pos]; - while( (*in != '\0') && (out - buf < len - 3) ) - { - if (std::isalnum(*in) || *in == '-' || *in == '_' || *in == '.' || *in == '~') - { - *out = *in; - out++; - } - else if( *in == ' ' ) - { - *out='+'; - out++; - } - else - { - char hex[] = "0123456789abcdef"; - *out='%'; - out++; - *out=hex[(*in>>4)&0xf]; - out++; - *out=hex[(*in)&0xf]; - out++; - } - in++; - } - - *pReadLen = out - buf; - - m_pos++; - return OK; -} - -/*virtual*/ int HTTPMap::getDataType(char* type, size_t maxTypeLen) //Internet media type for Content-Type header -{ - strncpy(type, "application/x-www-form-urlencoded", maxTypeLen-1); - type[maxTypeLen-1] = '\0'; - return OK; -} - -/*virtual*/ bool HTTPMap::getIsChunked() //For Transfer-Encoding header -{ - return false; ////Data is computed one key/value pair at a time -} - -/*virtual*/ size_t HTTPMap::getDataLen() //For Content-Length header -{ - size_t count = 0; - for(size_t i = 0; i< m_count; i++) - { - //URL encode - const char* in = m_keys[i]; - if( i != 0 ) - { - count++; - } - - while( (*in != '\0') ) - { - if (std::isalnum(*in) || *in == '-' || *in == '_' || *in == '.' || *in == '~') - { - count++; - } - else if( *in == ' ' ) - { - count++; - } - else - { - count+=3; - } - in++; - } - - count ++; - - in = m_values[i]; - while( (*in != '\0') ) - { - if (std::isalnum(*in) || *in == '-' || *in == '_' || *in == '.' || *in == '~') - { - count++; - } - else if( *in == ' ' ) - { - count++; - } - else - { - count+=3; - } - in++; - } - } - return count; -} diff --git a/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPMap.h b/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPMap.h deleted file mode 100644 index c8433778..00000000 --- a/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPMap.h +++ /dev/null @@ -1,71 +0,0 @@ -/* HTTPMap.h */ -/* Copyright (C) 2012 mbed.org, MIT License - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#ifndef HTTPMAP_H_ -#define HTTPMAP_H_ - -#include "../IHTTPData.h" - -#define HTTPMAP_TABLE_SIZE 32 - -/** Map of key/value pairs - * Used to transmit POST data using the application/x-www-form-urlencoded encoding - */ -class HTTPMap: public IHTTPDataOut -{ -public: - /** - Instantiates HTTPMap - It supports at most 32 key/values pairs - */ - HTTPMap(); - - /** Put Key/Value pair - The references to the parameters must remain valid as long as the clear() function is not called - @param key The key to use - @param value The corresponding value - */ - void put(const char* key, const char* value); - - /** Clear table - */ - void clear(); - -protected: - //IHTTPDataIn - virtual void readReset(); - - virtual int read(char* buf, size_t len, size_t* pReadLen); - - virtual int getDataType(char* type, size_t maxTypeLen); //Internet media type for Content-Type header - - virtual bool getIsChunked(); //For Transfer-Encoding header - - virtual size_t getDataLen(); //For Content-Length header - -private: - const char* m_keys[HTTPMAP_TABLE_SIZE]; - const char* m_values[HTTPMAP_TABLE_SIZE]; - - size_t m_pos; - size_t m_count; -}; - -#endif /* HTTPMAP_H_ */ diff --git a/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPText.cpp b/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPText.cpp deleted file mode 100644 index 18cd4207..00000000 --- a/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPText.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* HTTPText.cpp */ -/* Copyright (C) 2012 mbed.org, MIT License - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#include "HTTPText.h" - -#include - -#define OK 0 - -using std::memcpy; -using std::strncpy; -using std::strlen; - -#define MIN(x,y) (((x)<(y))?(x):(y)) - -HTTPText::HTTPText(char* str) : m_str(str), m_pos(0) -{ - m_size = strlen(str) + 1; -} - -HTTPText::HTTPText(char* str, size_t size) : m_str(str), m_size(size), m_pos(0) -{ - -} - -//IHTTPDataIn -/*virtual*/ void HTTPText::readReset() -{ - m_pos = 0; -} - -/*virtual*/ int HTTPText::read(char* buf, size_t len, size_t* pReadLen) -{ - *pReadLen = MIN(len, m_size - 1 - m_pos); - memcpy(buf, m_str + m_pos, *pReadLen); - m_pos += *pReadLen; - return OK; -} - -/*virtual*/ int HTTPText::getDataType(char* type, size_t maxTypeLen) //Internet media type for Content-Type header -{ - strncpy(type, "text/plain", maxTypeLen-1); - type[maxTypeLen-1] = '\0'; - return OK; -} - -/*virtual*/ bool HTTPText::getIsChunked() //For Transfer-Encoding header -{ - return false; -} - -/*virtual*/ size_t HTTPText::getDataLen() //For Content-Length header -{ - return m_size - 1; -} - -//IHTTPDataOut -/*virtual*/ void HTTPText::writeReset() -{ - m_pos = 0; -} - -/*virtual*/ int HTTPText::write(const char* buf, size_t len) -{ - size_t writeLen = MIN(len, m_size - 1 - m_pos); - memcpy(m_str + m_pos, buf, writeLen); - m_pos += writeLen; - m_str[m_pos] = '\0'; - return OK; -} - -/*virtual*/ void HTTPText::setDataType(const char* type) //Internet media type from Content-Type header -{ - -} - -/*virtual*/ void HTTPText::setIsChunked(bool chunked) //From Transfer-Encoding header -{ - -} - -/*virtual*/ void HTTPText::setDataLen(size_t len) //From Content-Length header, or if the transfer is chunked, next chunk length -{ - -} - - - diff --git a/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPText.h b/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPText.h deleted file mode 100644 index f55ff762..00000000 --- a/examples/mbed/mbed-http-client/lib/HTTPClient/data/HTTPText.h +++ /dev/null @@ -1,72 +0,0 @@ -/* HTTPText.h */ -/* Copyright (C) 2012 mbed.org, MIT License - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software - * and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, - * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or - * substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#ifndef HTTPTEXT_H_ -#define HTTPTEXT_H_ - -#include "../IHTTPData.h" - -/** A data endpoint to store text -*/ -class HTTPText : public IHTTPDataIn, public IHTTPDataOut -{ -public: - /** Create an HTTPText instance for output - * @param str String to be transmitted - */ - HTTPText(char* str); - - /** Create an HTTPText instance for input - * @param str Buffer to store the incoming string - * @param size Size of the buffer - */ - HTTPText(char* str, size_t size); - -protected: - //IHTTPDataIn - virtual void readReset(); - - virtual int read(char* buf, size_t len, size_t* pReadLen); - - virtual int getDataType(char* type, size_t maxTypeLen); //Internet media type for Content-Type header - - virtual bool getIsChunked(); //For Transfer-Encoding header - - virtual size_t getDataLen(); //For Content-Length header - - //IHTTPDataOut - virtual void writeReset(); - - virtual int write(const char* buf, size_t len); - - virtual void setDataType(const char* type); //Internet media type from Content-Type header - - virtual void setIsChunked(bool chunked); //From Transfer-Encoding header - - virtual void setDataLen(size_t len); //From Content-Length header, or if the transfer is chunked, next chunk length - -private: - char* m_str; - size_t m_size; - - size_t m_pos; -}; - -#endif /* HTTPTEXT_H_ */ diff --git a/examples/mbed/mbed-http-client/lib/readme.txt b/examples/mbed/mbed-http-client/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/mbed/mbed-http-client/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/mbed/mbed-http-client/platformio.ini b/examples/mbed/mbed-http-client/platformio.ini deleted file mode 100644 index 65c87729..00000000 --- a/examples/mbed/mbed-http-client/platformio.ini +++ /dev/null @@ -1,25 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - - -# NXP LPC Platform -[env:lpc1768] -platform = nxplpc -framework = mbed -board = lpc1768 diff --git a/examples/mbed/mbed-http-client/src/main.cpp b/examples/mbed/mbed-http-client/src/main.cpp deleted file mode 100644 index 654ee36b..00000000 --- a/examples/mbed/mbed-http-client/src/main.cpp +++ /dev/null @@ -1,79 +0,0 @@ -#include "mbed.h" -#include "EthernetInterface.h" -#include "HTTPClient.h" - -EthernetInterface eth; -HTTPClient http; -char str[512]; - -int main() -{ - eth.init(); //Use DHCP - - eth.connect(); - - //GET data - printf("\nTrying to fetch page...\n"); - int ret = http.get("https://developer.mbed.org/media/uploads/donatien/hello.txt", str, 128); - if (!ret) - { - printf("Page fetched successfully - read %d characters\n", strlen(str)); - printf("Result: %s\n", str); - } - else - { - printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode()); - } - - //POST data - HTTPMap map; - HTTPText inText(str, 512); - map.put("Hello", "World"); - map.put("test", "1234"); - printf("\nTrying to post data...\n"); - ret = http.post("http://httpbin.org/post", map, &inText); - if (!ret) - { - printf("Executed POST successfully - read %d characters\n", strlen(str)); - printf("Result: %s\n", str); - } - else - { - printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode()); - } - - //PUT data - strcpy(str, "This is a PUT test!"); - HTTPText outText(str); - //HTTPText inText(str, 512); - printf("\nTrying to put resource...\n"); - ret = http.put("http://httpbin.org/put", outText, &inText); - if (!ret) - { - printf("Executed PUT successfully - read %d characters\n", strlen(str)); - printf("Result: %s\n", str); - } - else - { - printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode()); - } - - //DELETE data - //HTTPText inText(str, 512); - printf("\nTrying to delete resource...\n"); - ret = http.del("http://httpbin.org/delete", &inText); - if (!ret) - { - printf("Executed DELETE successfully - read %d characters\n", strlen(str)); - printf("Result: %s\n", str); - } - else - { - printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode()); - } - - eth.disconnect(); - - while(1) { - } -} diff --git a/examples/mbed/mbed-rtos/.gitignore b/examples/mbed/mbed-rtos/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/mbed/mbed-rtos/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/mbed/mbed-rtos/.travis.yml b/examples/mbed/mbed-rtos/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/mbed/mbed-rtos/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/mbed/mbed-rtos/README.rst b/examples/mbed/mbed-rtos/README.rst deleted file mode 100644 index ef62bf20..00000000 --- a/examples/mbed/mbed-rtos/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -==================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/mbed/mbed-rtos - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/mbed/mbed-rtos/lib/readme.txt b/examples/mbed/mbed-rtos/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/mbed/mbed-rtos/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/mbed/mbed-rtos/platformio.ini b/examples/mbed/mbed-rtos/platformio.ini deleted file mode 100644 index cb93e0e6..00000000 --- a/examples/mbed/mbed-rtos/platformio.ini +++ /dev/null @@ -1,37 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - - -# NXP LPC Platform -[env:lpc1768] -platform = nxplpc -framework = mbed -board = lpc1768 - -# Freescale FRDM Platform -[env:frdm_kl25z] -platform = freescalekinetis -framework = mbed -board = frdm_kl25z - -# ST STM32 Platform -[env:nucleo_f401re] -platform = ststm32 -framework = mbed -board = nucleo_f401re diff --git a/examples/mbed/mbed-rtos/src/main.cpp b/examples/mbed/mbed-rtos/src/main.cpp deleted file mode 100644 index a1aa46d1..00000000 --- a/examples/mbed/mbed-rtos/src/main.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include "mbed.h" -#include "rtos.h" - -/* - * The stack size is defined in cmsis_os.h mainly dependent on the underlying toolchain and - * the C standard library. For GCC, ARM_STD and IAR it is defined with a size of 2048 bytes - * and for ARM_MICRO 512. Because of reduce RAM size some targets need a reduced stacksize. - */ -#if defined(TARGET_STM32L053R8) || defined(TARGET_STM32L053C8) -#define STACK_SIZE DEFAULT_STACK_SIZE/4 -#else -#define STACK_SIZE DEFAULT_STACK_SIZE -#endif - -void print_char(char c = '*') { - printf("%c", c); - fflush(stdout); -} - -DigitalOut led1(LED1); -DigitalOut led2(LED2); - -void led2_thread(void const *argument) { - while (true) { - led2 = !led2; - Thread::wait(1000); - print_char(); - } -} - -int main() { - Thread thread(led2_thread, NULL, osPriorityNormal, STACK_SIZE); - - while (true) { - led1 = !led1; - Thread::wait(500); - } -} diff --git a/examples/mbed/mbed-serial/.gitignore b/examples/mbed/mbed-serial/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/mbed/mbed-serial/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/mbed/mbed-serial/.travis.yml b/examples/mbed/mbed-serial/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/mbed/mbed-serial/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/mbed/mbed-serial/README.rst b/examples/mbed/mbed-serial/README.rst deleted file mode 100644 index 840b9553..00000000 --- a/examples/mbed/mbed-serial/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/mbed/mbed-serial - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/mbed/mbed-serial/lib/readme.txt b/examples/mbed/mbed-serial/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/mbed/mbed-serial/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/mbed/mbed-serial/platformio.ini b/examples/mbed/mbed-serial/platformio.ini deleted file mode 100644 index f1f25ccb..00000000 --- a/examples/mbed/mbed-serial/platformio.ini +++ /dev/null @@ -1,43 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - - -# NXP LPC Platform -[env:lpc1768] -platform = nxplpc -framework = mbed -board = lpc1768 - -# Nordic nRF51 Platform -[env:nrf51_mkit] -platform = nordicnrf51 -framework = mbed -board = nrf51_mkit - -# Freescale FRDM Platform -[env:frdm_kl25z] -platform = freescalekinetis -framework = mbed -board = frdm_kl25z - -# ST STM32 Platform -[env:nucleo_f401re] -platform = ststm32 -framework = mbed -board = nucleo_f401re diff --git a/examples/mbed/mbed-serial/src/main.cpp b/examples/mbed/mbed-serial/src/main.cpp deleted file mode 100644 index 132ba174..00000000 --- a/examples/mbed/mbed-serial/src/main.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "mbed.h" - -Serial pc(USBTX, USBRX); // tx, rx - -int main() { - pc.printf("Hello World!\n\r"); - while(1) { - pc.putc(pc.getc() + 1); // echo input back to terminal - } -} \ No newline at end of file diff --git a/examples/nordicnrf51/rfduino-ibeacon/.gitignore b/examples/nordicnrf51/rfduino-ibeacon/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/nordicnrf51/rfduino-ibeacon/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/nordicnrf51/rfduino-ibeacon/.travis.yml b/examples/nordicnrf51/rfduino-ibeacon/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/nordicnrf51/rfduino-ibeacon/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/nordicnrf51/rfduino-ibeacon/README.rst b/examples/nordicnrf51/rfduino-ibeacon/README.rst deleted file mode 100644 index 06db814e..00000000 --- a/examples/nordicnrf51/rfduino-ibeacon/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/nordicnrf51/rfduino-ibeacon - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/nordicnrf51/rfduino-ibeacon/lib/readme.txt b/examples/nordicnrf51/rfduino-ibeacon/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/nordicnrf51/rfduino-ibeacon/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/nordicnrf51/rfduino-ibeacon/platformio.ini b/examples/nordicnrf51/rfduino-ibeacon/platformio.ini deleted file mode 100644 index a614db2c..00000000 --- a/examples/nordicnrf51/rfduino-ibeacon/platformio.ini +++ /dev/null @@ -1,23 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:rfduino] -platform = nordicnrf51 -framework = arduino -board = rfduino diff --git a/examples/nordicnrf51/rfduino-ibeacon/src/iBeacon.ino b/examples/nordicnrf51/rfduino-ibeacon/src/iBeacon.ino deleted file mode 100644 index d85084df..00000000 --- a/examples/nordicnrf51/rfduino-ibeacon/src/iBeacon.ino +++ /dev/null @@ -1,61 +0,0 @@ -/* -The sketch demonstrates iBecaon from an RFduino -*/ - -/* - Copyright (c) 2014 OpenSourceRF.com. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -// pin 3 on the RGB shield is the green led -int led = 3; - -void setup() { - // led used to indicate that iBeacon has started - pinMode(led, OUTPUT); - - // do iBeacon advertising - RFduinoBLE.iBeacon = true; - - // start the BLE stack - RFduinoBLE.begin(); -} - -void loop() { - // switch to lower power mode - RFduino_ULPDelay(INFINITE); -} - -void RFduinoBLE_onAdvertisement(bool start) -{ - // turn the green led on if we start advertisement, and turn it - // off if we stop advertisement - - if (start) - digitalWrite(led, HIGH); - else - digitalWrite(led, LOW); -} diff --git a/examples/platformio-examples.png b/examples/platformio-examples.png deleted file mode 100644 index 0c793f6f..00000000 Binary files a/examples/platformio-examples.png and /dev/null differ diff --git a/examples/raspberrypi/wiringpi-blink/.gitignore b/examples/raspberrypi/wiringpi-blink/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/raspberrypi/wiringpi-blink/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/raspberrypi/wiringpi-blink/.skiptest b/examples/raspberrypi/wiringpi-blink/.skiptest deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/raspberrypi/wiringpi-blink/.travis.yml b/examples/raspberrypi/wiringpi-blink/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/raspberrypi/wiringpi-blink/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/raspberrypi/wiringpi-blink/README.rst b/examples/raspberrypi/wiringpi-blink/README.rst deleted file mode 100644 index b72c7a25..00000000 --- a/examples/raspberrypi/wiringpi-blink/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/raspberrypi/wiringpi-blink - - # Process example project - > platformio run - - # Run program - > .pioenvs/raspberrypi_2b/program diff --git a/examples/raspberrypi/wiringpi-blink/lib/readme.txt b/examples/raspberrypi/wiringpi-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/raspberrypi/wiringpi-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/raspberrypi/wiringpi-blink/platformio.ini b/examples/raspberrypi/wiringpi-blink/platformio.ini deleted file mode 100644 index 201a6f35..00000000 --- a/examples/raspberrypi/wiringpi-blink/platformio.ini +++ /dev/null @@ -1,23 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:raspberrypi_2b] -platform = linux_arm -framework = wiringpi -board = raspberrypi_2b diff --git a/examples/raspberrypi/wiringpi-blink/src/blink.c b/examples/raspberrypi/wiringpi-blink/src/blink.c deleted file mode 100644 index c27a20e3..00000000 --- a/examples/raspberrypi/wiringpi-blink/src/blink.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * blink.c: - * Standard "blink" program in wiringPi. Blinks an LED connected - * to the first GPIO pin. - * - * Copyright (c) 2012-2013 Gordon Henderson. - *********************************************************************** - * This file is part of wiringPi: - * https://projects.drogon.net/raspberry-pi/wiringpi/ - * - * wiringPi is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * wiringPi is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with wiringPi. If not, see . - *********************************************************************** - */ - -#include -#include - -// LED Pin - wiringPi pin 0 is BCM_GPIO 17. - -#define LED 0 - -int main (void) -{ - printf ("Raspberry Pi blink\n") ; - - wiringPiSetup () ; - pinMode (LED, OUTPUT) ; - - for (;;) - { - digitalWrite (LED, HIGH) ; // On - delay (500) ; // mS - digitalWrite (LED, LOW) ; // Off - delay (500) ; - } - return 0 ; -} diff --git a/examples/raspberrypi/wiringpi-serial/.gitignore b/examples/raspberrypi/wiringpi-serial/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/raspberrypi/wiringpi-serial/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/raspberrypi/wiringpi-serial/.skiptest b/examples/raspberrypi/wiringpi-serial/.skiptest deleted file mode 100644 index e69de29b..00000000 diff --git a/examples/raspberrypi/wiringpi-serial/.travis.yml b/examples/raspberrypi/wiringpi-serial/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/raspberrypi/wiringpi-serial/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/raspberrypi/wiringpi-serial/README.rst b/examples/raspberrypi/wiringpi-serial/README.rst deleted file mode 100644 index 4cd75fc9..00000000 --- a/examples/raspberrypi/wiringpi-serial/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/raspberrypi/wiringpi-serial - - # Process example project - > platformio run - - # Run program - > .pioenvs/raspberrypi_2b/program diff --git a/examples/raspberrypi/wiringpi-serial/lib/readme.txt b/examples/raspberrypi/wiringpi-serial/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/raspberrypi/wiringpi-serial/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/raspberrypi/wiringpi-serial/platformio.ini b/examples/raspberrypi/wiringpi-serial/platformio.ini deleted file mode 100644 index 201a6f35..00000000 --- a/examples/raspberrypi/wiringpi-serial/platformio.ini +++ /dev/null @@ -1,23 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:raspberrypi_2b] -platform = linux_arm -framework = wiringpi -board = raspberrypi_2b diff --git a/examples/raspberrypi/wiringpi-serial/src/serialTest.c b/examples/raspberrypi/wiringpi-serial/src/serialTest.c deleted file mode 100644 index 0d6da5f0..00000000 --- a/examples/raspberrypi/wiringpi-serial/src/serialTest.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * serialTest.c: - * Very simple program to test the serial port. Expects - * the port to be looped back to itself - * - * Copyright (c) 2012-2013 Gordon Henderson. - *********************************************************************** - * This file is part of wiringPi: - * https://projects.drogon.net/raspberry-pi/wiringpi/ - * - * wiringPi is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * wiringPi is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with wiringPi. If not, see . - *********************************************************************** - */ - -#include -#include -#include - -#include -#include - -int main () -{ - int fd ; - int count ; - unsigned int nextTime ; - - if ((fd = serialOpen ("/dev/ttyAMA0", 115200)) < 0) - { - fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ; - return 1 ; - } - - if (wiringPiSetup () == -1) - { - fprintf (stdout, "Unable to start wiringPi: %s\n", strerror (errno)) ; - return 1 ; - } - - nextTime = millis () + 300 ; - - for (count = 0 ; count < 256 ; ) - { - if (millis () > nextTime) - { - printf ("\nOut: %3d: ", count) ; - fflush (stdout) ; - serialPutchar (fd, count) ; - nextTime += 300 ; - ++count ; - } - - delay (3) ; - - while (serialDataAvail (fd)) - { - printf (" -> %3d", serialGetchar (fd)) ; - fflush (stdout) ; - } - } - - printf ("\n") ; - return 0 ; -} diff --git a/examples/stm32/stm32-cmsis-blink/.gitignore b/examples/stm32/stm32-cmsis-blink/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/stm32/stm32-cmsis-blink/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/stm32/stm32-cmsis-blink/.travis.yml b/examples/stm32/stm32-cmsis-blink/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/stm32/stm32-cmsis-blink/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/stm32/stm32-cmsis-blink/README.rst b/examples/stm32/stm32-cmsis-blink/README.rst deleted file mode 100644 index c0a371bb..00000000 --- a/examples/stm32/stm32-cmsis-blink/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/stm32/stm32-cmsis-blink - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/stm32/stm32-cmsis-blink/lib/readme.txt b/examples/stm32/stm32-cmsis-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/stm32/stm32-cmsis-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/stm32/stm32-cmsis-blink/platformio.ini b/examples/stm32/stm32-cmsis-blink/platformio.ini deleted file mode 100644 index d19acf8d..00000000 --- a/examples/stm32/stm32-cmsis-blink/platformio.ini +++ /dev/null @@ -1,33 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:disco_f407vg] -platform = ststm32 -framework = cmsis -board = disco_f407vg - -[env:disco_l152rb] -platform = ststm32 -framework = cmsis -board = disco_l152rb - -[env:disco_f303vc] -platform = ststm32 -framework = cmsis -board = disco_f303vc \ No newline at end of file diff --git a/examples/stm32/stm32-cmsis-blink/src/main.c b/examples/stm32/stm32-cmsis-blink/src/main.c deleted file mode 100644 index 37757c87..00000000 --- a/examples/stm32/stm32-cmsis-blink/src/main.c +++ /dev/null @@ -1,45 +0,0 @@ -#ifdef STM32L1 - #include "stm32l1xx.h" - #define LEDPORT (GPIOB) - #define LED1 (6) - #define LED2 (7) - #define ENABLE_GPIO_CLOCK (RCC->AHBENR |= RCC_AHBENR_GPIOBEN) - #define GPIOMODER ((GPIO_MODER_MODER7_0|GPIO_MODER_MODER6_0)) -#elif STM32F3 - #include "stm32f3xx.h" - #define LEDPORT (GPIOE) - #define LED1 (8) - #define LED2 (9) - #define ENABLE_GPIO_CLOCK (RCC->AHBENR |= RCC_AHBENR_GPIOEEN) - #define GPIOMODER ((GPIO_MODER_MODER9_0|GPIO_MODER_MODER8_0)) -#elif STM32F4 - #include "stm32f4xx.h" - #define LEDPORT (GPIOD) - #define LED1 (12) - #define LED2 (13) - #define ENABLE_GPIO_CLOCK (RCC->AHB1ENR |= RCC_AHB1ENR_GPIODEN) - #define GPIOMODER ((GPIO_MODER_MODER13_0|GPIO_MODER_MODER12_0)) -#endif - - -void ms_delay(int ms) -{ - while (ms-- > 0) { - volatile int x=500; - while (x-- > 0) - __asm("nop"); - } -} - -//Alternates blue and green LEDs quickly -int main(void) -{ - ENABLE_GPIO_CLOCK; // enable the clock to GPIO - LEDPORT->MODER |= GPIOMODER; // set pins to be general purpose output - for (;;) { - ms_delay(500); - LEDPORT->ODR ^= (1< -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/stm32/stm32-opencm3-blink/README.rst b/examples/stm32/stm32-opencm3-blink/README.rst deleted file mode 100644 index 391be1e8..00000000 --- a/examples/stm32/stm32-opencm3-blink/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/stm32/stm32-opencm3-blink - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/stm32/stm32-opencm3-blink/lib/readme.txt b/examples/stm32/stm32-opencm3-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/stm32/stm32-opencm3-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/stm32/stm32-opencm3-blink/platformio.ini b/examples/stm32/stm32-opencm3-blink/platformio.ini deleted file mode 100644 index 2c04a6da..00000000 --- a/examples/stm32/stm32-opencm3-blink/platformio.ini +++ /dev/null @@ -1,33 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:disco_f407vg] -platform = ststm32 -framework = libopencm3 -board = disco_f407vg - -[env:disco_l152rb] -platform = ststm32 -framework = libopencm3 -board = disco_l152rb - -[env:disco_f303vc] -platform = ststm32 -framework = libopencm3 -board = disco_f303vc diff --git a/examples/stm32/stm32-opencm3-blink/src/main.c b/examples/stm32/stm32-opencm3-blink/src/main.c deleted file mode 100644 index aae779ba..00000000 --- a/examples/stm32/stm32-opencm3-blink/src/main.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is part of the libopencm3 project. - * - * Copyright (C) 2009 Uwe Hermann - * Copyright (C) 2011 Stephen Caudle - * Copyright (C) 2012 Karl Palsson - * - * This library is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library. If not, see . - */ - -#include -#include -#ifdef STM32L1 - #define RCCLEDPORT (RCC_GPIOB) - #define LEDPORT (GPIOB) - #define LEDPIN (GPIO6) -#elif STM32F3 - #define RCCLEDPORT (RCC_GPIOE) - #define LEDPORT (GPIOE) - #define LEDPIN (GPIO8) -#elif STM32F4 - #define RCCLEDPORT (RCC_GPIOD) - #define LEDPORT (GPIOD) - #define LEDPIN (GPIO12) -#endif - -static void gpio_setup(void) -{ - /* Enable GPIO clock. */ - /* Using API functions: */ - rcc_periph_clock_enable(RCCLEDPORT); - /* Set pin to 'output push-pull'. */ - /* Using API functions: */ - gpio_mode_setup(LEDPORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, LEDPIN); -} - -int main(void) -{ - int i; - gpio_setup(); - /* Blink the LED on the board. */ - while (1) { - /* Using API function gpio_toggle(): */ - gpio_toggle(LEDPORT, LEDPIN); /* LED on/off */ - for (i = 0; i < 1000000; i++) { /* Wait a bit. */ - __asm__("nop"); - } - } - - return 0; -} diff --git a/examples/stm32/stm32-spl-blink/.gitignore b/examples/stm32/stm32-spl-blink/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/stm32/stm32-spl-blink/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/stm32/stm32-spl-blink/.travis.yml b/examples/stm32/stm32-spl-blink/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/stm32/stm32-spl-blink/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/stm32/stm32-spl-blink/README.rst b/examples/stm32/stm32-spl-blink/README.rst deleted file mode 100644 index 55b8744d..00000000 --- a/examples/stm32/stm32-spl-blink/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/stm32/stm32-spl-blink - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/stm32/stm32-spl-blink/lib/readme.txt b/examples/stm32/stm32-spl-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/stm32/stm32-spl-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/stm32/stm32-spl-blink/platformio.ini b/examples/stm32/stm32-spl-blink/platformio.ini deleted file mode 100644 index 29d797e9..00000000 --- a/examples/stm32/stm32-spl-blink/platformio.ini +++ /dev/null @@ -1,33 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:disco_f407vg] -platform = ststm32 -framework = spl -board = disco_f407vg - -[env:disco_l152rb] -platform = ststm32 -framework = spl -board = disco_l152rb - -[env:disco_f303vc] -platform = ststm32 -framework = spl -board = disco_f303vc diff --git a/examples/stm32/stm32-spl-blink/src/main.c b/examples/stm32/stm32-spl-blink/src/main.c deleted file mode 100644 index 089cc39a..00000000 --- a/examples/stm32/stm32-spl-blink/src/main.c +++ /dev/null @@ -1,61 +0,0 @@ -#ifdef STM32L1 - #include - #include - #define LEDPORT (GPIOB) - #define LEDPIN (GPIO_Pin_7) - #define ENABLE_GPIO_CLOCK (RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE)) -#elif STM32F3 - #include - #include - #define LEDPORT (GPIOE) - #define LEDPIN (GPIO_Pin_8) - #define ENABLE_GPIO_CLOCK (RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOE, ENABLE)) -#elif STM32F4 - #include - #include - #define LEDPORT (GPIOD) - #define LEDPIN (GPIO_Pin_12) - #define ENABLE_GPIO_CLOCK (RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE)) -#endif - -/* timing is not guaranteed :) */ -void simple_delay(uint32_t us) -{ - /* simple delay loop */ - while (us--) { - asm volatile ("nop"); - } -} - -/* system entry point */ -int main(void) -{ - /* gpio init struct */ - GPIO_InitTypeDef gpio; - /* reset rcc */ - RCC_DeInit(); - /* enable clock GPIO */ - ENABLE_GPIO_CLOCK; - /* use LED pin */ - gpio.GPIO_Pin = LEDPIN; - /* mode: output */ - gpio.GPIO_Mode = GPIO_Mode_OUT; - /* output type: push-pull */ - gpio.GPIO_OType = GPIO_OType_PP; - /* apply configuration */ - GPIO_Init(LEDPORT, &gpio); - /* main program loop */ - for (;;) { - /* set led on */ - GPIO_SetBits(LEDPORT, LEDPIN); - /* delay */ - simple_delay(100000); - /* clear led */ - GPIO_ResetBits(LEDPORT, LEDPIN); - /* delay */ - simple_delay(100000); - } - - /* never reached */ - return 0; -} \ No newline at end of file diff --git a/examples/teensy/teensy-hid-usb-mouse/.gitignore b/examples/teensy/teensy-hid-usb-mouse/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/teensy/teensy-hid-usb-mouse/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/teensy/teensy-hid-usb-mouse/.travis.yml b/examples/teensy/teensy-hid-usb-mouse/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/teensy/teensy-hid-usb-mouse/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/teensy/teensy-hid-usb-mouse/README.rst b/examples/teensy/teensy-hid-usb-mouse/README.rst deleted file mode 100644 index cc22fdb3..00000000 --- a/examples/teensy/teensy-hid-usb-mouse/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/teensy/teensy-hid-usb-mouse - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/teensy/teensy-hid-usb-mouse/lib/readme.txt b/examples/teensy/teensy-hid-usb-mouse/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/teensy/teensy-hid-usb-mouse/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/teensy/teensy-hid-usb-mouse/platformio.ini b/examples/teensy/teensy-hid-usb-mouse/platformio.ini deleted file mode 100644 index 2b1c160f..00000000 --- a/examples/teensy/teensy-hid-usb-mouse/platformio.ini +++ /dev/null @@ -1,24 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:teensy31] -platform = teensy -framework = arduino -board = teensy31 -build_flags = -DTEENSY31 -UUSB_SERIAL -DUSB_SERIAL_HID diff --git a/examples/teensy/teensy-hid-usb-mouse/src/TriangleMove.ino b/examples/teensy/teensy-hid-usb-mouse/src/TriangleMove.ino deleted file mode 100644 index 9461825c..00000000 --- a/examples/teensy/teensy-hid-usb-mouse/src/TriangleMove.ino +++ /dev/null @@ -1,24 +0,0 @@ -/* Simple USB Mouse Example - Teensy becomes a USB mouse and moves the cursor in a triangle - - You must select Mouse from the "Tools > USB Type" menu - - This example code is in the public domain. -*/ - -void setup() { } // no setup needed -void loop() { - int i; - for (i=0; i<40; i++) { - Mouse.move(2, -1); - delay(25); - } - for (i=0; i<40; i++) { - Mouse.move(2, 2); - delay(25); - } - for (i=0; i<40; i++) { - Mouse.move(-4, -1); - delay(25); - } -} \ No newline at end of file diff --git a/examples/teensy/teensy-internal-libs/.gitignore b/examples/teensy/teensy-internal-libs/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/teensy/teensy-internal-libs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/teensy/teensy-internal-libs/.travis.yml b/examples/teensy/teensy-internal-libs/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/teensy/teensy-internal-libs/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/teensy/teensy-internal-libs/README.rst b/examples/teensy/teensy-internal-libs/README.rst deleted file mode 100644 index 1a739fe3..00000000 --- a/examples/teensy/teensy-internal-libs/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/teensy/teensy-internal-libs - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/teensy/teensy-internal-libs/lib/readme.txt b/examples/teensy/teensy-internal-libs/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/teensy/teensy-internal-libs/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/teensy/teensy-internal-libs/platformio.ini b/examples/teensy/teensy-internal-libs/platformio.ini deleted file mode 100644 index 18ce5b16..00000000 --- a/examples/teensy/teensy-internal-libs/platformio.ini +++ /dev/null @@ -1,48 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:teensy20] -platform = teensy -framework = arduino -board = teensy20 -build_flags = -DTEENSY20 - -[env:teensy20pp] -platform = teensy -framework = arduino -board = teensy20pp -build_flags = -DTEENSY20PP - -[env:teensy30] -platform = teensy -framework = arduino -board = teensy30 -build_flags = -DTEENSY30 - -[env:teensy31] -platform = teensy -framework = arduino -board = teensy31 -build_flags = -DTEENSY31 - -[env:teensylc] -platform = teensy -framework = arduino -board = teensylc -build_flags = -DTEENSYLC diff --git a/examples/teensy/teensy-internal-libs/src/ChatServer.ino b/examples/teensy/teensy-internal-libs/src/ChatServer.ino deleted file mode 100644 index d50e5a65..00000000 --- a/examples/teensy/teensy-internal-libs/src/ChatServer.ino +++ /dev/null @@ -1,79 +0,0 @@ -/* - Chat Server - - A simple server that distributes any incoming messages to all - connected clients. To use telnet to your device's IP address and type. - You can see the client's input in the serial monitor as well. - Using an Arduino Wiznet Ethernet shield. - - Circuit: - * Ethernet shield attached to pins 10, 11, 12, 13 - * Analog inputs attached to pins A0 through A5 (optional) - - created 18 Dec 2009 - by David A. Mellis - modified 9 Apr 2012 - by Tom Igoe - - */ - -#include -#include - -// Enter a MAC address and IP address for your controller below. -// The IP address will be dependent on your local network. -// gateway and subnet are optional: -byte mac[] = { - 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; -IPAddress ip(192,168,1, 177); -IPAddress gateway(192,168,1, 1); -IPAddress subnet(255, 255, 0, 0); - - -// telnet defaults to port 23 -EthernetServer server(23); -boolean alreadyConnected = false; // whether or not the client was connected previously - -void setup() { - // initialize the ethernet device - Ethernet.begin(mac, ip, gateway, subnet); - // start listening for clients - server.begin(); - // Open serial communications and wait for port to open: - Serial.begin(9600); - while (!Serial) { - ; // wait for serial port to connect. Needed for Leonardo only - } - - - Serial.print("Chat server address:"); - Serial.println(Ethernet.localIP()); -} - -void loop() { - // wait for a new client: - EthernetClient client = server.available(); - - // when the client sends the first byte, say hello: - if (client) { - if (!alreadyConnected) { - // clead out the input buffer: - client.flush(); - Serial.println("We have a new client"); - client.println("Hello, client!"); - alreadyConnected = true; - } - - if (client.available() > 0) { - // read the bytes incoming from the client: - char thisChar = client.read(); - // echo the bytes back to the client: - server.write(thisChar); - // echo the bytes to the server as well: - Serial.write(thisChar); - } - } -} - - - diff --git a/examples/timsp430/panstamp-blink/.gitignore b/examples/timsp430/panstamp-blink/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/timsp430/panstamp-blink/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/timsp430/panstamp-blink/.travis.yml b/examples/timsp430/panstamp-blink/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/timsp430/panstamp-blink/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/timsp430/panstamp-blink/README.rst b/examples/timsp430/panstamp-blink/README.rst deleted file mode 100644 index 4c2ee991..00000000 --- a/examples/timsp430/panstamp-blink/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/timsp430/panstamp-blink - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/timsp430/panstamp-blink/lib/readme.txt b/examples/timsp430/panstamp-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/timsp430/panstamp-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/timsp430/panstamp-blink/platformio.ini b/examples/timsp430/panstamp-blink/platformio.ini deleted file mode 100644 index c273de4a..00000000 --- a/examples/timsp430/panstamp-blink/platformio.ini +++ /dev/null @@ -1,23 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:panStampNRG] -platform = timsp430 -framework = arduino -board = panStampNRG diff --git a/examples/timsp430/panstamp-blink/src/Blink.ino b/examples/timsp430/panstamp-blink/src/Blink.ino deleted file mode 100644 index b0db92b8..00000000 --- a/examples/timsp430/panstamp-blink/src/Blink.ino +++ /dev/null @@ -1,29 +0,0 @@ -/* - Blink - Turns on an LED on for one second, then off for one second, repeatedly. - - Most Arduinos have an on-board LED you can control. On the Uno and - Leonardo, it is attached to digital pin 13. If you're unsure what - pin the on-board LED is connected to on your Arduino model, check - the documentation at http://arduino.cc - - This example code is in the public domain. - - modified 8 May 2014 - by Scott Fitzgerald - */ - - -// the setup function runs once when you press reset or power the board -void setup() { - // initialize digital pin 13 as an output. - pinMode(13, OUTPUT); -} - -// the loop function runs over and over again forever -void loop() { - digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) - delay(1000); // wait for a second - digitalWrite(13, LOW); // turn the LED off by making the voltage LOW - delay(1000); // wait for a second -} diff --git a/examples/timsp430/timsp430-energia-blink/.gitignore b/examples/timsp430/timsp430-energia-blink/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/timsp430/timsp430-energia-blink/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/timsp430/timsp430-energia-blink/.travis.yml b/examples/timsp430/timsp430-energia-blink/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/timsp430/timsp430-energia-blink/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/timsp430/timsp430-energia-blink/README.rst b/examples/timsp430/timsp430-energia-blink/README.rst deleted file mode 100644 index 4ad053bd..00000000 --- a/examples/timsp430/timsp430-energia-blink/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/timsp430/timsp430-energia-blink - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/timsp430/timsp430-energia-blink/lib/readme.txt b/examples/timsp430/timsp430-energia-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/timsp430/timsp430-energia-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/timsp430/timsp430-energia-blink/platformio.ini b/examples/timsp430/timsp430-energia-blink/platformio.ini deleted file mode 100644 index 0b536946..00000000 --- a/examples/timsp430/timsp430-energia-blink/platformio.ini +++ /dev/null @@ -1,38 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:LaunchPad_msp430f5529] -platform = timsp430 -framework = energia -board = lpmsp430f5529 - -[env:LaunchPad_msp430fr5739] -platform = timsp430 -framework = energia -board = lpmsp430fr5739 - -[env:LaunchPad_msp430fr5969] -platform = timsp430 -framework = energia -board = lpmsp430fr5969 - -[env:LaunchPad_msp430g2553] -platform = timsp430 -framework = energia -board = lpmsp430g2553 diff --git a/examples/timsp430/timsp430-energia-blink/src/main.cpp b/examples/timsp430/timsp430-energia-blink/src/main.cpp deleted file mode 100644 index 79a0de6d..00000000 --- a/examples/timsp430/timsp430-energia-blink/src/main.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (C) Ivan Kravets - * See LICENSE for details. - */ - -#include "Energia.h" - -void setup() -{ - pinMode(RED_LED, OUTPUT); // set pin as output -} - -void loop() -{ - digitalWrite(RED_LED, HIGH); // set the LED on - delay(1000); // wait for a second - digitalWrite(RED_LED, LOW); // set the LED off - delay(1000); // wait for a second -} diff --git a/examples/timsp430/timsp430-native-blink/.gitignore b/examples/timsp430/timsp430-native-blink/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/timsp430/timsp430-native-blink/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/timsp430/timsp430-native-blink/.travis.yml b/examples/timsp430/timsp430-native-blink/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/timsp430/timsp430-native-blink/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/timsp430/timsp430-native-blink/README.rst b/examples/timsp430/timsp430-native-blink/README.rst deleted file mode 100644 index bc625fd6..00000000 --- a/examples/timsp430/timsp430-native-blink/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/timsp430/timsp430-native-blink - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/timsp430/timsp430-native-blink/lib/readme.txt b/examples/timsp430/timsp430-native-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/timsp430/timsp430-native-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/timsp430/timsp430-native-blink/platformio.ini b/examples/timsp430/timsp430-native-blink/platformio.ini deleted file mode 100644 index bc6926ea..00000000 --- a/examples/timsp430/timsp430-native-blink/platformio.ini +++ /dev/null @@ -1,23 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:LaunchPad_msp430g2553] -platform = timsp430 -board_mcu = msp430g2553 -board_f_cpu = 16000000L diff --git a/examples/timsp430/timsp430-native-blink/src/main.c b/examples/timsp430/timsp430-native-blink/src/main.c deleted file mode 100644 index 38a421a5..00000000 --- a/examples/timsp430/timsp430-native-blink/src/main.c +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (C) Ivan Kravets - * See LICENSE for details. - */ - -#include - -int main(void) -{ - WDTCTL = WDTPW + WDTHOLD; - - // make the LED pin an output for P1.0 - P1DIR |= 0x01; - - volatile int i; - - while (1) - { - for (i = 0; i < 10000; i++); - - // toggle the LED - P1OUT ^= 0x01; - } - - return 0; -} diff --git a/examples/titiva/titiva-energia-blink/.gitignore b/examples/titiva/titiva-energia-blink/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/titiva/titiva-energia-blink/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/titiva/titiva-energia-blink/.travis.yml b/examples/titiva/titiva-energia-blink/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/titiva/titiva-energia-blink/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/titiva/titiva-energia-blink/README.rst b/examples/titiva/titiva-energia-blink/README.rst deleted file mode 100644 index 68cf2bc8..00000000 --- a/examples/titiva/titiva-energia-blink/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/titiva/titiva-energia-blink - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/titiva/titiva-energia-blink/lib/readme.txt b/examples/titiva/titiva-energia-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/titiva/titiva-energia-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/titiva/titiva-energia-blink/platformio.ini b/examples/titiva/titiva-energia-blink/platformio.ini deleted file mode 100644 index 4da3a335..00000000 --- a/examples/titiva/titiva-energia-blink/platformio.ini +++ /dev/null @@ -1,33 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:LaunchPad_lm4f120h5qr] -platform = titiva -framework = energia -board = lplm4f120h5qr - -[env:LaunchPad_tm4c1230c3pm] -platform = titiva -framework = energia -board = lptm4c1230c3pm - -[env:LaunchPad_tm4c1294ncpdt] -platform = titiva -framework = energia -board = lptm4c1294ncpdt diff --git a/examples/titiva/titiva-energia-blink/src/main.cpp b/examples/titiva/titiva-energia-blink/src/main.cpp deleted file mode 100644 index 8c086a4b..00000000 --- a/examples/titiva/titiva-energia-blink/src/main.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (C) Ivan Kravets - * See LICENSE for details. - */ - -#include "Energia.h" - -void setup() -{ - pinMode(GREEN_LED, OUTPUT); // set pin as output -} - -void loop() -{ - digitalWrite(GREEN_LED, HIGH); // set the LED on - delay(1000); // wait for a second - digitalWrite(GREEN_LED, LOW); // set the LED off - delay(1000); // wait for a second -} diff --git a/examples/titiva/titiva-native-blink/.gitignore b/examples/titiva/titiva-native-blink/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/titiva/titiva-native-blink/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/titiva/titiva-native-blink/.travis.yml b/examples/titiva/titiva-native-blink/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/titiva/titiva-native-blink/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/titiva/titiva-native-blink/README.rst b/examples/titiva/titiva-native-blink/README.rst deleted file mode 100644 index 16bc5296..00000000 --- a/examples/titiva/titiva-native-blink/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/titiva/titiva-native-blink - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload diff --git a/examples/titiva/titiva-native-blink/lib/readme.txt b/examples/titiva/titiva-native-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/titiva/titiva-native-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/titiva/titiva-native-blink/platformio.ini b/examples/titiva/titiva-native-blink/platformio.ini deleted file mode 100644 index 4da3a335..00000000 --- a/examples/titiva/titiva-native-blink/platformio.ini +++ /dev/null @@ -1,33 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:LaunchPad_lm4f120h5qr] -platform = titiva -framework = energia -board = lplm4f120h5qr - -[env:LaunchPad_tm4c1230c3pm] -platform = titiva -framework = energia -board = lptm4c1230c3pm - -[env:LaunchPad_tm4c1294ncpdt] -platform = titiva -framework = energia -board = lptm4c1294ncpdt diff --git a/examples/titiva/titiva-native-blink/src/main.c b/examples/titiva/titiva-native-blink/src/main.c deleted file mode 100644 index a911f9b2..00000000 --- a/examples/titiva/titiva-native-blink/src/main.c +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (C) Ivan Kravets - * See LICENSE for details. - */ - -#include -#include -#include "inc/hw_memmap.h" -#include "driverlib/gpio.h" -#include "driverlib/sysctl.h" - -#define LED_RED GPIO_PIN_1 -#define LED_BLUE GPIO_PIN_2 -#define LED_GREEN GPIO_PIN_3 - -void setup() { - SysCtlClockSet( - SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN); - - SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); - GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN); -} - -void loop() { - GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_RED); - SysCtlDelay(3000000); - GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_BLUE); - SysCtlDelay(3000000); - GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_GREEN); - SysCtlDelay(3000000); -} diff --git a/examples/titiva/titiva-opencm3-blink/.gitignore b/examples/titiva/titiva-opencm3-blink/.gitignore deleted file mode 100644 index e90612ed..00000000 --- a/examples/titiva/titiva-opencm3-blink/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.pioenvs \ No newline at end of file diff --git a/examples/titiva/titiva-opencm3-blink/.travis.yml b/examples/titiva/titiva-opencm3-blink/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/titiva/titiva-opencm3-blink/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/titiva/titiva-opencm3-blink/README.rst b/examples/titiva/titiva-opencm3-blink/README.rst deleted file mode 100644 index 4fa42655..00000000 --- a/examples/titiva/titiva-opencm3-blink/README.rst +++ /dev/null @@ -1,32 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/titiva/titiva-opencm3-blink - - # Process example project - > platformio run - - # Upload firmware - > platformio run --target upload - - # Clean build files - > platformio run --target clean diff --git a/examples/titiva/titiva-opencm3-blink/lib/readme.txt b/examples/titiva/titiva-opencm3-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/titiva/titiva-opencm3-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/titiva/titiva-opencm3-blink/platformio.ini b/examples/titiva/titiva-opencm3-blink/platformio.ini deleted file mode 100644 index 0e46c4a8..00000000 --- a/examples/titiva/titiva-opencm3-blink/platformio.ini +++ /dev/null @@ -1,33 +0,0 @@ -# -# Project Configuration File -# -# A detailed documentation with the EXAMPLES is located here: -# http://docs.platformio.org/en/latest/projectconf.html -# - -# A sign `#` at the beginning of the line indicates a comment -# Comment lines are ignored. - -# Simple and base environment -# [env:mybaseenv] -# platform = %INSTALLED_PLATFORM_NAME_HERE% -# framework = -# board = -# -# Automatic targets - enable auto-uploading -# targets = upload - -[env:LaunchPad_lm4f120h5qr] -platform = titiva -framework = libopencm3 -board = lplm4f120h5qr - -[env:LaunchPad_tm4c1230c3pm] -platform = titiva -framework = libopencm3 -board = lptm4c1230c3pm - -[env:LaunchPad_tm4c1294ncpdt] -platform = titiva -framework = libopencm3 -board = lptm4c1294ncpdt diff --git a/examples/titiva/titiva-opencm3-blink/src/main.c b/examples/titiva/titiva-opencm3-blink/src/main.c deleted file mode 100644 index dfcae8a9..00000000 --- a/examples/titiva/titiva-opencm3-blink/src/main.c +++ /dev/null @@ -1,206 +0,0 @@ -/* - * This file is part of the libopencm3 project. - * - * Copyright (C) 2011 Gareth McMullin - * Copyright (C) 2012-2013 Alexandru Gagniuc - * - * This library is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library. If not, see . - */ - -/** - * \addtogroup Examples - * - * Flashes the Red, Green and Blue diodes on the board, in order. - * - * RED controlled by PF1 - * Green controlled by PF3 - * Blue controlled by PF2 - */ -#include -#include -#include -#include -#include - -#include -#include - -/* This is how the RGB LED is connected on the stellaris launchpad */ -#define RGB_PORT GPIOF -enum { - LED_R = GPIO1, - LED_G = GPIO3, - LED_B = GPIO2, -}; - -/* This is how the user switches are connected to GPIOF */ -enum { - USR_SW1 = GPIO4, - USR_SW2 = GPIO0, -}; - -/* The divisors we loop through when the user presses SW2 */ -enum { - PLL_DIV_80MHZ = 5, - PLL_DIV_57MHZ = 7, - PLL_DIV_40MHZ = 10, - PLL_DIV_20MHZ = 20, - PLL_DIV_16MHZ = 25, -}; - -static const uint8_t plldiv[] = { - PLL_DIV_80MHZ, - PLL_DIV_57MHZ, - PLL_DIV_40MHZ, - PLL_DIV_20MHZ, - PLL_DIV_16MHZ, - 0 -}; -/* The PLL divisor we are currently on */ -static size_t ipll = 0; -/* Are we bypassing the PLL, or not? */ -static bool bypass = false; - -/* - * Clock setup: - * Take the main crystal oscillator at 16MHz, run it through the PLL, and divide - * the 400MHz PLL clock to get a system clock of 80MHz. - */ -static void clock_setup(void) -{ - rcc_sysclk_config(OSCSRC_MOSC, XTAL_16M, PLL_DIV_80MHZ); -} - -/* - * GPIO setup: - * Enable the pins driving the RGB LED as outputs. - */ -static void gpio_setup(void) -{ - /* - * Configure GPIOF - * This port is used to control the RGB LED - */ - periph_clock_enable(RCC_GPIOF); - const uint32_t outpins = (LED_R | LED_G | LED_B); - - gpio_mode_setup(RGB_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, outpins); - gpio_set_output_config(RGB_PORT, GPIO_OTYPE_PP, GPIO_DRIVE_2MA, outpins); - - /* - * Now take care of our buttons - */ - const uint32_t btnpins = USR_SW1 | USR_SW2; - - /* - * PF0 is a locked by default. We need to unlock it before we can - * re-purpose it as a GPIO pin. - */ - gpio_unlock_commit(GPIOF, USR_SW2); - /* Configure pins as inputs, with pull-up. */ - gpio_mode_setup(GPIOF, GPIO_MODE_INPUT, GPIO_PUPD_PULLUP, btnpins); -} - -/* - * IRQ setup: - * Trigger an interrupt whenever a button is depressed. - */ -static void irq_setup(void) -{ - const uint32_t btnpins = USR_SW1 | USR_SW2; - /* Trigger interrupt on rising-edge (when button is depressed) */ - gpio_configure_trigger(GPIOF, GPIO_TRIG_EDGE_RISE, btnpins); - /* Finally, Enable interrupt */ - gpio_enable_interrupts(GPIOF, btnpins); - /* Enable the interrupt in the NVIC as well */ - nvic_enable_irq(NVIC_GPIOF_IRQ); -} - -#define FLASH_DELAY 800000 -static void delay(void) -{ - int i; - for (i = 0; i < FLASH_DELAY; i++) /* Wait a bit. */ - __asm__("nop"); -} - -int main(void) -{ - gpio_enable_ahb_aperture(); - clock_setup(); - gpio_setup(); - irq_setup(); - - /* Blink each color of the RGB LED in order. */ - while (1) { - /* - * Flash the Red diode - */ - gpio_set(RGB_PORT, LED_R); - delay(); /* Wait a bit. */ - gpio_clear(RGB_PORT, LED_R); - delay(); /* Wait a bit. */ - - /* - * Flash the Green diode - */ - gpio_set(RGB_PORT, LED_G); - delay(); /* Wait a bit. */ - gpio_clear(RGB_PORT, LED_G); - delay(); /* Wait a bit. */ - - /* - * Flash the Blue diode - */ - gpio_set(RGB_PORT, LED_B); - delay(); /* Wait a bit. */ - gpio_clear(RGB_PORT, LED_B); - delay(); /* Wait a bit. */ - } - - return 0; -} - -void gpiof_isr(void) -{ - if (gpio_is_interrupt_source(GPIOF, USR_SW1)) { - /* SW1 was just depressed */ - bypass = !bypass; - if (bypass) { - rcc_pll_bypass_enable(); - /* - * The divisor is still applied to the raw clock. - * Disable the divisor, or we'll divide the raw clock. - */ - SYSCTL_RCC &= ~SYSCTL_RCC_USESYSDIV; - } - else - { - rcc_change_pll_divisor(plldiv[ipll]); - } - /* Clear interrupt source */ - gpio_clear_interrupt_flag(GPIOF, USR_SW1); - } - - if (gpio_is_interrupt_source(GPIOF, USR_SW2)) { - /* SW2 was just depressed */ - if (!bypass) { - if (plldiv[++ipll] == 0) - ipll = 0; - rcc_change_pll_divisor(plldiv[ipll]); - } - /* Clear interrupt source */ - gpio_clear_interrupt_flag(GPIOF, USR_SW2); - } -} \ No newline at end of file diff --git a/examples/wiring-blink/.gitignore b/examples/wiring-blink/.gitignore deleted file mode 100644 index 5402c188..00000000 --- a/examples/wiring-blink/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.pioenvs -.clang_complete -.gcc-flags.json diff --git a/examples/wiring-blink/.travis.yml b/examples/wiring-blink/.travis.yml deleted file mode 100644 index 93562520..00000000 --- a/examples/wiring-blink/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < http://docs.platformio.org/en/latest/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < http://docs.platformio.org/en/latest/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# install: -# - pip install -U platformio -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to by used as a library with examples -# - -# language: python -# python: -# - "2.7" -# -# sudo: false -# cache: -# directories: -# - "~/.platformio" -# -# env: -# - PLATFORMIO_CI_SRC=path/to/test/file.c -# - PLATFORMIO_CI_SRC=examples/file.ino -# - PLATFORMIO_CI_SRC=path/to/test/directory -# -# install: -# - pip install -U platformio -# -# script: -# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N diff --git a/examples/wiring-blink/README.rst b/examples/wiring-blink/README.rst deleted file mode 100644 index 2a3f5ba2..00000000 --- a/examples/wiring-blink/README.rst +++ /dev/null @@ -1,35 +0,0 @@ -.. Copyright 2014-2016 Ivan Kravets - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -How to build PlatformIO based project -===================================== - -1. `Install PlatformIO `_ -2. Download `source code with examples `_ -3. Extract ZIP archive -4. Run these commands: - -.. code-block:: bash - - # Change directory to example - > cd platformio-develop/examples/wiring-blink - - # Process example project - > platformio run - - # Upload firmware from all environments - > platformio run --target upload - - # Process specific environment - > platformio run -e uno - - # Upload firmware from specific environment - > platformio run --target upload diff --git a/examples/wiring-blink/lib/readme.txt b/examples/wiring-blink/lib/readme.txt deleted file mode 100644 index 607a92af..00000000 --- a/examples/wiring-blink/lib/readme.txt +++ /dev/null @@ -1,38 +0,0 @@ - -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 -#include - -// rest H/C/CPP code - -PlatformIO will find your libraries automatically, configure preprocessor's -include paths and build them. - -See additional options for PlatformIO Library Dependency Finder `lib_*`: - -http://docs.platformio.org/en/latest/projectconf.html#lib-install - diff --git a/examples/wiring-blink/platformio.ini b/examples/wiring-blink/platformio.ini deleted file mode 100644 index 87535386..00000000 --- a/examples/wiring-blink/platformio.ini +++ /dev/null @@ -1,23 +0,0 @@ -; Project Configuration File -; Docs: http://docs.platformio.org/en/latest/projectconf.html - -[env:uno] -platform = atmelavr -framework = arduino -board = uno - -[env:nodemcu] -platform = espressif -framework = arduino -board = nodemcu - -[env:teensy31] -platform = teensy -framework = arduino -board = teensy31 - -[env:lpmsp430g2553] -platform = timsp430 -framework = energia -board = lpmsp430g2553 -build_flags = -D LED_BUILTIN=RED_LED diff --git a/examples/wiring-blink/src/main.cpp b/examples/wiring-blink/src/main.cpp deleted file mode 100644 index ae88fcfa..00000000 --- a/examples/wiring-blink/src/main.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Blink - * Turns on an LED on for one second, - * then off for one second, repeatedly. - */ - -#include "Arduino.h" - -void setup() -{ - // initialize LED digital pin as an output. - pinMode(LED_BUILTIN, OUTPUT); -} - -void loop() -{ - // turn the LED on (HIGH is the voltage level) - digitalWrite(LED_BUILTIN, HIGH); - // wait for a second - delay(1000); - // turn the LED off by making the voltage LOW - digitalWrite(LED_BUILTIN, LOW); - // wait for a second - delay(1000); -}