Skip to content

Commit

Permalink
Merge branch 'release/v1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Oct 12, 2018
2 parents 81a8f17 + 8cd61d3 commit ad22b5a
Show file tree
Hide file tree
Showing 29 changed files with 4,351 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ python:

env:
- PLATFORMIO_PROJECT_DIR=examples/native-blink
- PLATFORMIO_PROJECT_DIR=examples/stc-blink
- PLATFORMIO_PROJECT_DIR=examples/stc-header

install:
- pip install -U https://github.com/platformio/platformio/archive/develop.zip
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ environment:

matrix:
- PLATFORMIO_PROJECT_DIR: "examples/native-blink"
- PLATFORMIO_PROJECT_DIR: "examples/stc-blink"
- PLATFORMIO_PROJECT_DIR: "examples/stc-header"

install:
- cmd: git submodule update --init --recursive
Expand Down
23 changes: 23 additions & 0 deletions boards/stc15w204s.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"build": {
"f_cpu": "11059200",
"size_iram": 256,
"size_xram": 0,
"size_code": 4096,
"size_heap": 64,
"mcu": "stc15w204s",
"cpu": "mcs51"
},
"frameworks": [],
"upload": {
"maximum_ram_size": 256,
"maximum_size": 4096,
"protocol": "stcgal",
"protocols": [
"stcgal"
]
},
"name": "Generic STC15W204S",
"url": "https://www.stcmicro.com/STC/STC15W204S.html",
"vendor": "STC"
}
3 changes: 2 additions & 1 deletion builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,14 @@ def _parseSdccFlags(flags):

if upload_protocol == "stcgal":
f_cpu_khz = int(board_config.get("build.f_cpu")) / 1000
stcgal = join(env.PioPlatform().get_package_dir("tool-stcgal") or "", "stcgal.py")
env.Replace(
UPLOADERFLAGS=[
"-p", "$UPLOAD_PORT",
"-t", int(f_cpu_khz),
"-a"
],
UPLOADCMD="python3 stcgal.py $UPLOADERFLAGS $SOURCE")
UPLOADCMD="python3 %s $UPLOADERFLAGS $SOURCE" % stcgal )

upload_actions = [
env.VerboseAction(env.AutodetectUploadPort,
Expand Down
5 changes: 5 additions & 0 deletions examples/stc-blink/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pioenvs
.piolibdeps
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
67 changes: 67 additions & 0 deletions examples/stc-blink/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Continuous Integration (CI) is the practice, in software
# engineering, of merging all developer working copies with a shared mainline
# several times a day < https://docs.platformio.org/page/ci/index.html >
#
# Documentation:
#
# * Travis CI Embedded Builds with PlatformIO
# < https://docs.travis-ci.com/user/integration/platformio/ >
#
# * PlatformIO integration with Travis CI
# < https://docs.platformio.org/page/ci/travis.html >
#
# * User Guide for `platformio ci` command
# < https://docs.platformio.org/page/userguide/cmd_ci.html >
#
#
# Please choice 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
# - platformio update
#
# 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
# - platformio update
#
# script:
# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
38 changes: 38 additions & 0 deletions examples/stc-blink/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.. Copyright 2014-present PlatformIO <contact@platformio.org>
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 Core <http://docs.platformio.org/page/core.html>`_
2. Download `development platform with examples <https://github.com/platformio/platform-intel_mcs51/archive/develop.zip>`_
3. Extract ZIP archive
4. Run these commands:

.. code-block:: bash
# Change directory to example
> cd platform-intel_mcs51/examples/stc-blink
# Build project
> platformio run
# Upload firmware
> platformio run --target upload
# Build specific environment
> platformio run -e stc15w408as
# Upload firmware for the specific environment
> platformio run -e stc15w408as --target upload
# Clean build files
> platformio run --target clean
41 changes: 41 additions & 0 deletions examples/stc-blink/lib/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.

The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".

For example, see how can be organized `Foo` and `Bar` libraries:

|--lib
| |
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
| |
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |
| |- readme.txt --> THIS FILE
|
|- platformio.ini
|--src
|- main.c

Then in `src/main.c` you should use:

#include <Foo.h>
#include <Bar.h>

// rest H/C/CPP code

PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.

More information about PlatformIO Library Dependency Finder
- https://docs.platformio.org/page/librarymanager/ldf.html
25 changes: 25 additions & 0 deletions examples/stc-blink/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:stc15f204ea]
platform = intel_mcs51
board = stc15f204ea

[env:stc15w204s]
platform = intel_mcs51
board = stc15w204s

[env:stc15w404as]
platform = intel_mcs51
board = stc15w404as

[env:stc15w408as]
platform = intel_mcs51
board = stc15w408as
Loading

0 comments on commit ad22b5a

Please sign in to comment.