From fb28f76d59f30ba326703c8c3cc4cac259956e46 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 31 Mar 2022 14:22:43 +0300 Subject: [PATCH 01/10] Switch docs to HTTP --- README.md | 8 ++++---- examples/arduino-ble-led/README.md | 2 +- examples/arduino-ble-led/platformio.ini | 2 +- examples/arduino-blink/README.md | 2 +- examples/arduino-blink/platformio.ini | 2 +- examples/arduino-internal-libs/README.md | 2 +- examples/arduino-internal-libs/platformio.ini | 2 +- examples/mbed-ble-thermometer/README.md | 2 +- examples/mbed-ble-thermometer/platformio.ini | 4 ++-- examples/mbed-blink/README.md | 2 +- examples/mbed-blink/platformio.ini | 2 +- examples/mbed-events/README.md | 2 +- examples/mbed-events/platformio.ini | 2 +- examples/mbed-serial/README.md | 2 +- examples/mbed-serial/platformio.ini | 2 +- examples/zephyr-ble-eddystone/README.md | 2 +- examples/zephyr-ble-eddystone/platformio.ini | 2 +- examples/zephyr-blink/README.md | 2 +- examples/zephyr-blink/platformio.ini | 2 +- examples/zephyr-drivers-entropy/README.md | 2 +- examples/zephyr-drivers-entropy/platformio.ini | 2 +- 21 files changed, 25 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 9642306..b747666 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ The Nordic nRF51 Series is a family of highly flexible, multi-protocol, system-on-chip (SoC) devices for ultra-low power wireless applications. nRF51 Series devices support a range of protocol stacks including Bluetooth Smart (previously called Bluetooth low energy), ANT and proprietary 2.4GHz protocols such as Gazell. -* [Home](http://platformio.org/platforms/nordicnrf51) (home page in PlatformIO Platform Registry) -* [Documentation](http://docs.platformio.org/page/platforms/nordicnrf51.html) (advanced usage, packages, boards, frameworks, etc.) +* [Home](https://registry.platformio.org/platforms/platformio/nordicnrf51) (home page in the PlatformIO Registry) +* [Documentation](https://docs.platformio.org/page/platforms/nordicnrf51.html) (advanced usage, packages, boards, frameworks, etc.) # Usage 1. [Install PlatformIO](http://platformio.org) -2. Create PlatformIO project and configure a platform option in [platformio.ini](http://docs.platformio.org/page/projectconf.html) file: +2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file: ## Stable version @@ -32,4 +32,4 @@ board = ... # Configuration -Please navigate to [documentation](http://docs.platformio.org/page/platforms/nordicnrf51.html). +Please navigate to [documentation](https://docs.platformio.org/page/platforms/nordicnrf51.html). diff --git a/examples/arduino-ble-led/README.md b/examples/arduino-ble-led/README.md index 5493f17..c2f14c5 100644 --- a/examples/arduino-ble-led/README.md +++ b/examples/arduino-ble-led/README.md @@ -1,7 +1,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf51/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/arduino-ble-led/platformio.ini b/examples/arduino-ble-led/platformio.ini index 87e12c4..73b298a 100644 --- a/examples/arduino-ble-led/platformio.ini +++ b/examples/arduino-ble-led/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [common] lib_deps = BLEPeripheral diff --git a/examples/arduino-blink/README.md b/examples/arduino-blink/README.md index 68a9b4d..25578a3 100644 --- a/examples/arduino-blink/README.md +++ b/examples/arduino-blink/README.md @@ -1,7 +1,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf51/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/arduino-blink/platformio.ini b/examples/arduino-blink/platformio.ini index 7474f07..bedf8e9 100644 --- a/examples/arduino-blink/platformio.ini +++ b/examples/arduino-blink/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:bbcmicrobit] platform = nordicnrf51 diff --git a/examples/arduino-internal-libs/README.md b/examples/arduino-internal-libs/README.md index 97bee15..90106d3 100644 --- a/examples/arduino-internal-libs/README.md +++ b/examples/arduino-internal-libs/README.md @@ -1,7 +1,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf51/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/arduino-internal-libs/platformio.ini b/examples/arduino-internal-libs/platformio.ini index 704ccb8..aa15655 100644 --- a/examples/arduino-internal-libs/platformio.ini +++ b/examples/arduino-internal-libs/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:bbcmicrobit] platform = nordicnrf51 diff --git a/examples/mbed-ble-thermometer/README.md b/examples/mbed-ble-thermometer/README.md index fe79feb..9e77dd8 100644 --- a/examples/mbed-ble-thermometer/README.md +++ b/examples/mbed-ble-thermometer/README.md @@ -1,7 +1,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf51/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/mbed-ble-thermometer/platformio.ini b/examples/mbed-ble-thermometer/platformio.ini index ecf0716..d58240f 100644 --- a/examples/mbed-ble-thermometer/platformio.ini +++ b/examples/mbed-ble-thermometer/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:nrf51_dk] platform = nordicnrf51 @@ -16,5 +16,5 @@ build_flags = -DPIO_FRAMEWORK_MBED_RTOS_PRESENT [env:nrf51_dongle] platform = nordicnrf51 framework = mbed -board = nrf51_dongle +board = nrf51_dongle build_flags = -DPIO_FRAMEWORK_MBED_RTOS_PRESENT \ No newline at end of file diff --git a/examples/mbed-blink/README.md b/examples/mbed-blink/README.md index 042bf3a..4dcca2e 100644 --- a/examples/mbed-blink/README.md +++ b/examples/mbed-blink/README.md @@ -1,7 +1,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf51/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/mbed-blink/platformio.ini b/examples/mbed-blink/platformio.ini index 3b60c85..bfc59f0 100644 --- a/examples/mbed-blink/platformio.ini +++ b/examples/mbed-blink/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:nrf51 mkit] platform = nordicnrf51 diff --git a/examples/mbed-events/README.md b/examples/mbed-events/README.md index 7e02cd9..60165f3 100644 --- a/examples/mbed-events/README.md +++ b/examples/mbed-events/README.md @@ -1,7 +1,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf51/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/mbed-events/platformio.ini b/examples/mbed-events/platformio.ini index a5bc1d0..a1a2342 100644 --- a/examples/mbed-events/platformio.ini +++ b/examples/mbed-events/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:nrf51_mkit] platform = nordicnrf51 diff --git a/examples/mbed-serial/README.md b/examples/mbed-serial/README.md index f8ad650..7c6dc02 100644 --- a/examples/mbed-serial/README.md +++ b/examples/mbed-serial/README.md @@ -1,7 +1,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf51/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/mbed-serial/platformio.ini b/examples/mbed-serial/platformio.ini index 7438c31..a6a8548 100644 --- a/examples/mbed-serial/platformio.ini +++ b/examples/mbed-serial/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:nrf51_mkit] platform = nordicnrf51 diff --git a/examples/zephyr-ble-eddystone/README.md b/examples/zephyr-ble-eddystone/README.md index 618e576..04fa677 100644 --- a/examples/zephyr-ble-eddystone/README.md +++ b/examples/zephyr-ble-eddystone/README.md @@ -1,7 +1,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf51/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/zephyr-ble-eddystone/platformio.ini b/examples/zephyr-ble-eddystone/platformio.ini index ee12a17..697d9de 100644 --- a/examples/zephyr-ble-eddystone/platformio.ini +++ b/examples/zephyr-ble-eddystone/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:nrf51_dongle] platform = nordicnrf51 diff --git a/examples/zephyr-blink/README.md b/examples/zephyr-blink/README.md index 96f6a5c..95152d8 100644 --- a/examples/zephyr-blink/README.md +++ b/examples/zephyr-blink/README.md @@ -1,7 +1,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf51/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/zephyr-blink/platformio.ini b/examples/zephyr-blink/platformio.ini index 8c89844..873648a 100644 --- a/examples/zephyr-blink/platformio.ini +++ b/examples/zephyr-blink/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:vbluno51] platform = nordicnrf51 diff --git a/examples/zephyr-drivers-entropy/README.md b/examples/zephyr-drivers-entropy/README.md index 9a19b5e..e8b2f20 100644 --- a/examples/zephyr-drivers-entropy/README.md +++ b/examples/zephyr-drivers-entropy/README.md @@ -1,7 +1,7 @@ How to build PlatformIO based project ===================================== -1. [Install PlatformIO Core](http://docs.platformio.org/page/core.html) +1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) 2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf51/archive/develop.zip) 3. Extract ZIP archive 4. Run these commands: diff --git a/examples/zephyr-drivers-entropy/platformio.ini b/examples/zephyr-drivers-entropy/platformio.ini index 032e763..f99c26b 100644 --- a/examples/zephyr-drivers-entropy/platformio.ini +++ b/examples/zephyr-drivers-entropy/platformio.ini @@ -5,7 +5,7 @@ ; Library options: dependencies, extra library storages ; ; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html +; https://docs.platformio.org/page/projectconf.html [env:nrf51_dk] From 3eedd3e3074d9eb98d52b91a63298ef7a38e2aaa Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 4 Apr 2022 12:04:48 +0300 Subject: [PATCH 02/10] Use the latest Github OS images --- .github/workflows/examples.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index fa565ed..8453b34 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -7,7 +7,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-18.04, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest, macos-latest] python-version: [3.7] example: - "examples/arduino-blink" @@ -19,10 +19,6 @@ jobs: - "examples/zephyr-ble-eddystone" - "examples/zephyr-blink" - "examples/zephyr-drivers-entropy" - exclude: - - {python-version: 2.7, example: "examples/zephyr-ble-eddystone"} - - {python-version: 2.7, example: "examples/zephyr-blink"} - - {python-version: 2.7, example: "examples/zephyr-drivers-entropy"} runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 From 9066d4c1b80b88ff79823d3d7b49ee707d65ac3f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 8 Apr 2022 12:16:21 +0300 Subject: [PATCH 03/10] Symlink dev-platform --- .github/workflows/examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 8453b34..e89fea9 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -32,7 +32,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -U https://github.com/platformio/platformio/archive/develop.zip - platformio platform install file://. + pio pkg install --global --platform symlink://. - name: Build examples run: | platformio run -d ${{ matrix.example }} From b9f88849565ae898087aa9c491fa99df76a67a9e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 27 May 2022 22:29:52 +0300 Subject: [PATCH 04/10] Remove unnecessary files --- builder/compat.py | 38 ------------ builder/main.py | 1 - examples/arduino-ble-led/.travis.yml | 67 --------------------- examples/arduino-blink/.travis.yml | 67 --------------------- examples/arduino-internal-libs/.travis.yml | 67 --------------------- examples/mbed-ble-thermometer/.travis.yml | 67 --------------------- examples/mbed-blink/.travis.yml | 67 --------------------- examples/mbed-events/.travis.yml | 67 --------------------- examples/mbed-serial/.travis.yml | 67 --------------------- examples/zephyr-ble-eddystone/.travis.yml | 67 --------------------- examples/zephyr-blink/.travis.yml | 67 --------------------- examples/zephyr-drivers-entropy/.travis.yml | 67 --------------------- 12 files changed, 709 deletions(-) delete mode 100644 builder/compat.py delete mode 100644 examples/arduino-ble-led/.travis.yml delete mode 100644 examples/arduino-blink/.travis.yml delete mode 100644 examples/arduino-internal-libs/.travis.yml delete mode 100644 examples/mbed-ble-thermometer/.travis.yml delete mode 100644 examples/mbed-blink/.travis.yml delete mode 100644 examples/mbed-events/.travis.yml delete mode 100644 examples/mbed-serial/.travis.yml delete mode 100644 examples/zephyr-ble-eddystone/.travis.yml delete mode 100644 examples/zephyr-blink/.travis.yml delete mode 100644 examples/zephyr-drivers-entropy/.travis.yml diff --git a/builder/compat.py b/builder/compat.py deleted file mode 100644 index b8dfe3d..0000000 --- a/builder/compat.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2014-present PlatformIO -# -# 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. - -from SCons.Script import AlwaysBuild, Import - - -Import("env") - - -# Added in PIO Core 4.4.0 -if not hasattr(env, "AddPlatformTarget"): - - def AddPlatformTarget( - env, - name, - dependencies, - actions, - title=None, - description=None, - always_build=True, - ): - target = env.Alias(name, dependencies, actions) - if always_build: - AlwaysBuild(target) - return target - - env.AddMethod(AddPlatformTarget) diff --git a/builder/main.py b/builder/main.py index 523daf2..8a19c97 100644 --- a/builder/main.py +++ b/builder/main.py @@ -21,7 +21,6 @@ Builder, Default, DefaultEnvironment) env = DefaultEnvironment() -env.SConscript("compat.py", exports="env") platform = env.PioPlatform() board = env.BoardConfig() diff --git a/examples/arduino-ble-led/.travis.yml b/examples/arduino-ble-led/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/arduino-ble-led/.travis.yml +++ /dev/null @@ -1,67 +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 < 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 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 -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be 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 diff --git a/examples/arduino-blink/.travis.yml b/examples/arduino-blink/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/arduino-blink/.travis.yml +++ /dev/null @@ -1,67 +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 < 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 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 -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be 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 diff --git a/examples/arduino-internal-libs/.travis.yml b/examples/arduino-internal-libs/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/arduino-internal-libs/.travis.yml +++ /dev/null @@ -1,67 +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 < 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 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 -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be 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 diff --git a/examples/mbed-ble-thermometer/.travis.yml b/examples/mbed-ble-thermometer/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/mbed-ble-thermometer/.travis.yml +++ /dev/null @@ -1,67 +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 < 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 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 -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be 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 diff --git a/examples/mbed-blink/.travis.yml b/examples/mbed-blink/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/mbed-blink/.travis.yml +++ /dev/null @@ -1,67 +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 < 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 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 -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be 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 diff --git a/examples/mbed-events/.travis.yml b/examples/mbed-events/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/mbed-events/.travis.yml +++ /dev/null @@ -1,67 +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 < 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 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 -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be 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 diff --git a/examples/mbed-serial/.travis.yml b/examples/mbed-serial/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/mbed-serial/.travis.yml +++ /dev/null @@ -1,67 +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 < 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 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 -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be 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 diff --git a/examples/zephyr-ble-eddystone/.travis.yml b/examples/zephyr-ble-eddystone/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/zephyr-ble-eddystone/.travis.yml +++ /dev/null @@ -1,67 +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 < 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 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 -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be 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 diff --git a/examples/zephyr-blink/.travis.yml b/examples/zephyr-blink/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/zephyr-blink/.travis.yml +++ /dev/null @@ -1,67 +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 < 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 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 -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be 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 diff --git a/examples/zephyr-drivers-entropy/.travis.yml b/examples/zephyr-drivers-entropy/.travis.yml deleted file mode 100644 index 7c486f1..0000000 --- a/examples/zephyr-drivers-entropy/.travis.yml +++ /dev/null @@ -1,67 +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 < 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 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 -# - platformio update -# -# script: -# - platformio run - - -# -# Template #2: The project is intended to be 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 From edd8c5b1cd2d0d7559a7f131b80efbc0e0ef1d5a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 27 May 2022 22:36:45 +0300 Subject: [PATCH 05/10] Improve support for hand-written asm source files --- builder/frameworks/_bare.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/builder/frameworks/_bare.py b/builder/frameworks/_bare.py index 4fd489e..a083fa9 100644 --- a/builder/frameworks/_bare.py +++ b/builder/frameworks/_bare.py @@ -21,7 +21,12 @@ env = DefaultEnvironment() env.Append( - ASFLAGS=["-x", "assembler-with-cpp"], + ASFLAGS=[ + "-mthumb", + ], + ASPPFLAGS=[ + "-x", "assembler-with-cpp", + ], CCFLAGS=[ "-Os", # optimize for size @@ -54,6 +59,9 @@ if "BOARD" in env: env.Append( + ASFLAGS=[ + "-mcpu=%s" % env.BoardConfig().get("build.cpu") + ], CCFLAGS=[ "-mcpu=%s" % env.BoardConfig().get("build.cpu") ], @@ -61,6 +69,3 @@ "-mcpu=%s" % env.BoardConfig().get("build.cpu") ] ) - -# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode) -env.Append(ASFLAGS=env.get("CCFLAGS", [])[:]) From b1f6649a59a230c3ed1a4a62e967cc61d2192de3 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 27 May 2022 22:37:07 +0300 Subject: [PATCH 06/10] Add compatibility with PIO Core 6.0 --- .github/workflows/examples.yml | 12 +++++------- README.md | 4 ++-- platform.json | 2 +- platform.py | 18 +++++++++--------- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index e89fea9..d34e1b1 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -8,7 +8,6 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: [3.7] example: - "examples/arduino-blink" - "examples/arduino-ble-led" @@ -21,18 +20,17 @@ jobs: - "examples/zephyr-drivers-entropy" runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: "recursive" - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + - name: Set up Python + uses: actions/setup-python@v3 with: - python-version: ${{ matrix.python-version }} + python-version: "3.9" - name: Install dependencies run: | - python -m pip install --upgrade pip pip install -U https://github.com/platformio/platformio/archive/develop.zip pio pkg install --global --platform symlink://. - name: Build examples run: | - platformio run -d ${{ matrix.example }} + pio run -d ${{ matrix.example }} diff --git a/README.md b/README.md index b747666..3a19af7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Nordic nRF51: development platform for [PlatformIO](http://platformio.org) +# Nordic nRF51: development platform for [PlatformIO](https://platformio.org) [![Build Status](https://github.com/platformio/platform-nordicnrf51/workflows/Examples/badge.svg)](https://github.com/platformio/platform-nordicnrf51/actions) @@ -9,7 +9,7 @@ The Nordic nRF51 Series is a family of highly flexible, multi-protocol, system-o # Usage -1. [Install PlatformIO](http://platformio.org) +1. [Install PlatformIO](https://platformio.org) 2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file: ## Stable version diff --git a/platform.json b/platform.json index 1526c4b..199f850 100644 --- a/platform.json +++ b/platform.json @@ -12,7 +12,7 @@ "nRF51" ], "engines": { - "platformio": "^5" + "platformio": "^6" }, "repository": { "type": "git", diff --git a/platform.py b/platform.py index 805918d..132cf9f 100644 --- a/platform.py +++ b/platform.py @@ -13,12 +13,13 @@ # limitations under the License. import copy -import platform +import sys -from platformio.managers.platform import PlatformBase -from platformio.util import get_systype +from platformio.public import PlatformBase +IS_WINDOWS = sys.platform.startswith("win") + class Nordicnrf51Platform(PlatformBase): def is_embedded(self): @@ -32,7 +33,7 @@ def configure_default_packages(self, variables, targets): if p in ("tool-cmake", "tool-dtc", "tool-ninja"): self.packages[p]["optional"] = False self.packages["toolchain-gccarmnoneeabi"]["version"] = "~1.80201.0" - if "windows" not in get_systype(): + if not IS_WINDOWS: self.packages["tool-gperf"]["optional"] = False # configure J-LINK tool @@ -50,17 +51,16 @@ def configure_default_packages(self, variables, targets): if not any(jlink_conds) and jlink_pkgname in self.packages: del self.packages[jlink_pkgname] - return PlatformBase.configure_default_packages(self, variables, - targets) + return super().configure_default_packages(variables, targets) def get_boards(self, id_=None): - result = PlatformBase.get_boards(self, id_) + result = super().get_boards(id_) if not result: return result if id_: return self._add_default_debug_tools(result) else: - for key, value in result.items(): + for key in result: result[key] = self._add_default_debug_tools(result[key]) return result @@ -96,7 +96,7 @@ def _add_default_debug_tools(self, board): "-port", "2331" ], "executable": ("JLinkGDBServerCL.exe" - if platform.system() == "Windows" else + if IS_WINDOWS else "JLinkGDBServer") } } From 25e42c0ca99560dcfd442d6ab12394c4cdac1b38 Mon Sep 17 00:00:00 2001 From: Valerii Koval Date: Mon, 30 May 2022 11:52:11 +0300 Subject: [PATCH 07/10] Properly configure custom debug speed --- platform.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/platform.py b/platform.py index 132cf9f..c25cecd 100644 --- a/platform.py +++ b/platform.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import copy import sys from platformio.public import PlatformBase @@ -20,6 +19,7 @@ IS_WINDOWS = sys.platform.startswith("win") + class Nordicnrf51Platform(PlatformBase): def is_embedded(self): @@ -126,19 +126,14 @@ def _add_default_debug_tools(self, board): board.manifest['debug'] = debug return board - def configure_debug_options(self, initial_debug_options, ide_data): - debug_options = copy.deepcopy(initial_debug_options) - adapter_speed = initial_debug_options.get("speed") - if adapter_speed: - server_options = debug_options.get("server") or {} - server_executable = server_options.get("executable", "").lower() + def configure_debug_session(self, debug_config): + if debug_config.speed: + server_executable = (debug_config.server or {}).get("executable", "").lower() if "openocd" in server_executable: - debug_options["server"]["arguments"].extend( - ["-c", "adapter speed %s" % adapter_speed] + debug_config.server["arguments"].extend( + ["-c", "adapter speed %s" % debug_config.speed] ) elif "jlink" in server_executable: - debug_options["server"]["arguments"].extend( - ["-speed", adapter_speed] + debug_config.server["arguments"].extend( + ["-speed", debug_config.speed] ) - - return debug_options From 97aac7122e41908c735c5b0403e4c1def009646d Mon Sep 17 00:00:00 2001 From: Valerii Koval Date: Mon, 30 May 2022 13:28:52 +0300 Subject: [PATCH 08/10] Sync Arduino build scripts --- builder/frameworks/arduino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/frameworks/arduino b/builder/frameworks/arduino index 809d928..8521ae7 160000 --- a/builder/frameworks/arduino +++ b/builder/frameworks/arduino @@ -1 +1 @@ -Subproject commit 809d9285bb81decabfce64c080a45a917e647f70 +Subproject commit 8521ae7e008ef66bebfc9e813630f89e3fb894a0 From 7f347df3fdbb2a9ee4391dd724faa1de7874c7cf Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 30 May 2022 15:13:05 +0300 Subject: [PATCH 09/10] Drop support for mbed framework --- .github/workflows/examples.yml | 3 - boards/bbcmicrobit.json | 4 +- boards/calliope_mini.json | 1 - boards/delta_dfcm_nnn50.json | 31 ------ boards/dfcm_nnn40.json | 32 ------ boards/hrm1017.json | 31 ------ boards/nrf51822_y5_mbug.json | 36 ------- boards/nrf51_dk.json | 4 +- boards/nrf51_dongle.json | 6 +- boards/nrf51_mkit.json | 31 ------ boards/redBearLab.json | 8 +- boards/redBearLabBLENano.json | 6 +- boards/seeedArchBLE.json | 36 ------- boards/seeedArchLink.json | 36 ------- boards/seeedTinyBLE.json | 8 +- boards/ty51822r3.json | 31 ------ boards/vbluno51.json | 6 +- boards/wallbot_ble.json | 31 ------ builder/frameworks/mbed.py | 37 ------- builder/main.py | 8 +- examples/mbed-ble-thermometer/.gitignore | 2 - examples/mbed-ble-thermometer/README.md | 27 ----- examples/mbed-ble-thermometer/include/README | 39 ------- examples/mbed-ble-thermometer/lib/README | 46 -------- examples/mbed-ble-thermometer/platformio.ini | 20 ---- examples/mbed-ble-thermometer/src/main.cpp | 105 ------------------- examples/mbed-ble-thermometer/test/README | 11 -- examples/mbed-blink/.gitignore | 2 - examples/mbed-blink/README.md | 27 ----- examples/mbed-blink/include/README | 39 ------- examples/mbed-blink/lib/README | 46 -------- examples/mbed-blink/platformio.ini | 28 ----- examples/mbed-blink/src/main.cpp | 12 --- examples/mbed-blink/test/README | 11 -- examples/mbed-events/.gitignore | 2 - examples/mbed-events/README.md | 27 ----- examples/mbed-events/include/README | 39 ------- examples/mbed-events/lib/README | 46 -------- examples/mbed-events/platformio.ini | 30 ------ examples/mbed-events/src/main.cpp | 15 --- examples/mbed-events/test/README | 11 -- examples/mbed-serial/.gitignore | 2 - examples/mbed-serial/README.md | 27 ----- examples/mbed-serial/include/README | 39 ------- examples/mbed-serial/lib/README | 46 -------- examples/mbed-serial/platformio.ini | 28 ----- examples/mbed-serial/src/main.cpp | 10 -- examples/mbed-serial/test/README | 11 -- platform.json | 12 +-- 49 files changed, 16 insertions(+), 1130 deletions(-) delete mode 100644 boards/delta_dfcm_nnn50.json delete mode 100644 boards/dfcm_nnn40.json delete mode 100644 boards/hrm1017.json delete mode 100644 boards/nrf51822_y5_mbug.json delete mode 100644 boards/nrf51_mkit.json delete mode 100644 boards/seeedArchBLE.json delete mode 100644 boards/seeedArchLink.json delete mode 100644 boards/ty51822r3.json delete mode 100644 boards/wallbot_ble.json delete mode 100644 builder/frameworks/mbed.py delete mode 100644 examples/mbed-ble-thermometer/.gitignore delete mode 100644 examples/mbed-ble-thermometer/README.md delete mode 100644 examples/mbed-ble-thermometer/include/README delete mode 100644 examples/mbed-ble-thermometer/lib/README delete mode 100644 examples/mbed-ble-thermometer/platformio.ini delete mode 100644 examples/mbed-ble-thermometer/src/main.cpp delete mode 100644 examples/mbed-ble-thermometer/test/README delete mode 100644 examples/mbed-blink/.gitignore delete mode 100644 examples/mbed-blink/README.md delete mode 100644 examples/mbed-blink/include/README delete mode 100644 examples/mbed-blink/lib/README delete mode 100644 examples/mbed-blink/platformio.ini delete mode 100644 examples/mbed-blink/src/main.cpp delete mode 100644 examples/mbed-blink/test/README delete mode 100644 examples/mbed-events/.gitignore delete mode 100644 examples/mbed-events/README.md delete mode 100644 examples/mbed-events/include/README delete mode 100644 examples/mbed-events/lib/README delete mode 100644 examples/mbed-events/platformio.ini delete mode 100644 examples/mbed-events/src/main.cpp delete mode 100644 examples/mbed-events/test/README delete mode 100644 examples/mbed-serial/.gitignore delete mode 100644 examples/mbed-serial/README.md delete mode 100644 examples/mbed-serial/include/README delete mode 100644 examples/mbed-serial/lib/README delete mode 100644 examples/mbed-serial/platformio.ini delete mode 100644 examples/mbed-serial/src/main.cpp delete mode 100644 examples/mbed-serial/test/README diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index d34e1b1..e7016bd 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -12,9 +12,6 @@ jobs: - "examples/arduino-blink" - "examples/arduino-ble-led" - "examples/arduino-internal-libs" - - "examples/mbed-ble-thermometer" - - "examples/mbed-blink" - - "examples/mbed-serial" - "examples/zephyr-ble-eddystone" - "examples/zephyr-blink" - "examples/zephyr-drivers-entropy" diff --git a/boards/bbcmicrobit.json b/boards/bbcmicrobit.json index 721f973..dde1d2a 100644 --- a/boards/bbcmicrobit.json +++ b/boards/bbcmicrobit.json @@ -25,7 +25,6 @@ }, "frameworks": [ "arduino", - "mbed", "zephyr" ], "name": "BBC micro:bit", @@ -35,10 +34,9 @@ "protocol": "cmsis-dap", "protocols": [ "cmsis-dap", - "mbed", "jlink" ] }, - "url": "https://developer.mbed.org/platforms/Microbit/", + "url": "https://microbit.org/", "vendor": "BBC" } diff --git a/boards/calliope_mini.json b/boards/calliope_mini.json index d151892..6da59ee 100644 --- a/boards/calliope_mini.json +++ b/boards/calliope_mini.json @@ -30,7 +30,6 @@ "protocol": "cmsis-dap", "protocols": [ "cmsis-dap", - "mbed", "jlink" ] }, diff --git a/boards/delta_dfcm_nnn50.json b/boards/delta_dfcm_nnn50.json deleted file mode 100644 index 86a1203..0000000 --- a/boards/delta_dfcm_nnn50.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "build": { - "cpu": "cortex-m0", - "f_cpu": "32000000L", - "mcu": "nrf51822" - }, - "connectivity": [ - "bluetooth" - ], - "debug": { - "onboard_tools": [ - "cmsis-dap" - ], - "svd_path": "nrf51.svd" - }, - "frameworks": [ - "mbed" - ], - "name": "Delta DFCM-NNN50", - "upload": { - "maximum_ram_size": 16384, - "maximum_size": 262144, - "protocol": "cmsis-dap", - "protocols": [ - "cmsis-dap", - "mbed" - ] - }, - "url": "https://os.mbed.com/platforms/Delta-DFCM-NNN50/", - "vendor": "Delta" -} diff --git a/boards/dfcm_nnn40.json b/boards/dfcm_nnn40.json deleted file mode 100644 index f845fda..0000000 --- a/boards/dfcm_nnn40.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "build": { - "cpu": "cortex-m0", - "f_cpu": "32000000L", - "mcu": "nrf51822" - }, - "connectivity": [ - "bluetooth", - "wifi" - ], - "debug": { - "onboard_tools": [ - "cmsis-dap" - ], - "svd_path": "nrf51.svd" - }, - "frameworks": [ - "mbed" - ], - "name": "Delta DFCM-NNN40", - "upload": { - "maximum_ram_size": 32768, - "maximum_size": 262144, - "protocol": "cmsis-dap", - "protocols": [ - "cmsis-dap", - "mbed" - ] - }, - "url": "https://developer.mbed.org/platforms/Delta-DFCM-NNN40/", - "vendor": "Delta" -} diff --git a/boards/hrm1017.json b/boards/hrm1017.json deleted file mode 100644 index 74a4e63..0000000 --- a/boards/hrm1017.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "build": { - "cpu": "cortex-m0", - "f_cpu": "16000000L", - "mcu": "nrf51822" - }, - "connectivity": [ - "bluetooth" - ], - "debug": { - "onboard_tools": [ - "cmsis-dap" - ], - "svd_path": "nrf51.svd" - }, - "frameworks": [ - "mbed" - ], - "name": "Switch Science mbed HRM1017", - "upload": { - "maximum_ram_size": 16384, - "maximum_size": 262144, - "protocol": "cmsis-dap", - "protocols": [ - "cmsis-dap", - "mbed" - ] - }, - "url": "https://developer.mbed.org/platforms/mbed-HRM1017/", - "vendor": "Switch Science" -} diff --git a/boards/nrf51822_y5_mbug.json b/boards/nrf51822_y5_mbug.json deleted file mode 100644 index 3d84813..0000000 --- a/boards/nrf51822_y5_mbug.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "build": { - "cpu": "cortex-m0", - "f_cpu": "16000000L", - "mcu": "nrf51822" - }, - "connectivity": [ - "bluetooth" - ], - "debug": { - "jlink_device": "nRF51802_xxAA", - "onboard_tools": [ - "cmsis-dap" - ], - "svd_path": "nrf51.svd" - }, - "frameworks": [ - "mbed" - ], - "name": "y5 nRF51822 mbug", - "upload": { - "maximum_ram_size": 16384, - "maximum_size": 262144, - "protocol": "cmsis-dap", - "protocols": [ - "cmsis-dap", - "blackmagic", - "jlink", - "nrfjprog", - "stlink", - "mbed" - ] - }, - "url": "https://developer.mbed.org/platforms/Y5-NRF51822-MBUG/", - "vendor": "y5 design" -} diff --git a/boards/nrf51_dk.json b/boards/nrf51_dk.json index b138b79..5866bd1 100644 --- a/boards/nrf51_dk.json +++ b/boards/nrf51_dk.json @@ -29,7 +29,6 @@ }, "frameworks": [ "arduino", - "mbed", "zephyr" ], "name": "Nordic nRF51X22 Development Kit(PCA1000X)", @@ -42,8 +41,7 @@ "blackmagic", "jlink", "nrfjprog", - "stlink", - "mbed" + "stlink" ] }, "url": "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF51-DK", diff --git a/boards/nrf51_dongle.json b/boards/nrf51_dongle.json index f7fe651..1566dad 100644 --- a/boards/nrf51_dongle.json +++ b/boards/nrf51_dongle.json @@ -29,7 +29,6 @@ }, "frameworks": [ "arduino", - "mbed", "zephyr" ], "name": "Nordic nRF51 Dongle (PCA10031)", @@ -40,10 +39,9 @@ "protocols": [ "cmsis-dap", "jlink", - "nrfjprog", - "mbed" + "nrfjprog" ] }, - "url": "https://developer.mbed.org/platforms/Nordic-nRF51-Dongle/", + "url": "https://www.nordicsemi.com/Products/Development-hardware/nRF51-Dongle", "vendor": "Nordic" } diff --git a/boards/nrf51_mkit.json b/boards/nrf51_mkit.json deleted file mode 100644 index 7b6088a..0000000 --- a/boards/nrf51_mkit.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "build": { - "cpu": "cortex-m0", - "f_cpu": "16000000L", - "mcu": "nrf51822" - }, - "connectivity": [ - "bluetooth" - ], - "debug": { - "onboard_tools": [ - "cmsis-dap" - ], - "svd_path": "nrf51.svd" - }, - "frameworks": [ - "mbed" - ], - "name": "Nordic nRF51822-mKIT", - "upload": { - "maximum_ram_size": 16384, - "maximum_size": 131072, - "protocol": "cmsis-dap", - "protocols": [ - "cmsis-dap", - "mbed" - ] - }, - "url": "http://developer.mbed.org/platforms/Nordic-nRF51822/", - "vendor": "Nordic" -} diff --git a/boards/redBearLab.json b/boards/redBearLab.json index ad37d22..4cf99e4 100644 --- a/boards/redBearLab.json +++ b/boards/redBearLab.json @@ -21,8 +21,7 @@ "svd_path": "nrf51.svd" }, "frameworks": [ - "arduino", - "mbed" + "arduino" ], "name": "RedBearLab nRF51822", "upload": { @@ -34,10 +33,9 @@ "blackmagic", "jlink", "stlink", - "nrfjprog", - "mbed" + "nrfjprog" ] }, - "url": "https://developer.mbed.org/platforms/RedBearLab-nRF51822/", + "url": "https://www.seeedstudio.com/RedBearLab-nRF51822-p-2126.html", "vendor": "RedBearLab" } diff --git a/boards/redBearLabBLENano.json b/boards/redBearLabBLENano.json index 565ab1a..48cc35c 100644 --- a/boards/redBearLabBLENano.json +++ b/boards/redBearLabBLENano.json @@ -25,7 +25,6 @@ }, "frameworks": [ "arduino", - "mbed", "zephyr" ], "name": "RedBearLab BLE Nano 1.5", @@ -38,10 +37,9 @@ "blackmagic", "jlink", "stlink", - "nrfjprog", - "mbed" + "nrfjprog" ] }, - "url": "https://developer.mbed.org/platforms/RedBearLab-BLE-Nano/", + "url": "https://www.sparkfun.com/products/retired/13730", "vendor": "RedBearLab" } diff --git a/boards/seeedArchBLE.json b/boards/seeedArchBLE.json deleted file mode 100644 index afe7cd8..0000000 --- a/boards/seeedArchBLE.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "build": { - "cpu": "cortex-m0", - "f_cpu": "16000000L", - "mcu": "nrf51822" - }, - "connectivity": [ - "bluetooth" - ], - "debug": { - "jlink_device": "nRF51802_xxAA", - "onboard_tools": [ - "cmsis-dap" - ], - "svd_path": "nrf51.svd" - }, - "frameworks": [ - "mbed" - ], - "name": "Seeed Arch BLE", - "upload": { - "maximum_ram_size": 16384, - "maximum_size": 131072, - "protocol": "cmsis-dap", - "protocols": [ - "cmsis-dap", - "blackmagic", - "jlink", - "nrfjprog", - "stlink", - "mbed" - ] - }, - "url": "https://developer.mbed.org/platforms/Seeed-Arch-BLE/", - "vendor": "SeeedStudio" -} diff --git a/boards/seeedArchLink.json b/boards/seeedArchLink.json deleted file mode 100644 index 41f75ac..0000000 --- a/boards/seeedArchLink.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "build": { - "cpu": "cortex-m0", - "f_cpu": "16000000L", - "mcu": "nrf51822" - }, - "connectivity": [ - "bluetooth" - ], - "debug": { - "jlink_device": "nRF51802_xxAA", - "onboard_tools": [ - "cmsis-dap" - ], - "svd_path": "nrf51.svd" - }, - "frameworks": [ - "mbed" - ], - "name": "Seeed Arch Link", - "upload": { - "maximum_ram_size": 16384, - "maximum_size": 262144, - "protocol": "cmsis-dap", - "protocols": [ - "cmsis-dap", - "blackmagic", - "jlink", - "nrfjprog", - "stlink", - "mbed" - ] - }, - "url": "https://developer.mbed.org/platforms/Seeed-Arch-Link/", - "vendor": "SeeedStudio" -} diff --git a/boards/seeedTinyBLE.json b/boards/seeedTinyBLE.json index 45ffd8e..6bf485d 100644 --- a/boards/seeedTinyBLE.json +++ b/boards/seeedTinyBLE.json @@ -21,8 +21,7 @@ "svd_path": "nrf51.svd" }, "frameworks": [ - "arduino", - "mbed" + "arduino" ], "name": "Seeed Tiny BLE", "upload": { @@ -34,10 +33,9 @@ "blackmagic", "jlink", "nrfjprog", - "stlink", - "mbed" + "stlink" ] }, - "url": "http://developer.mbed.org/platforms/Seeed-Tiny-BLE/", + "url": "https://www.seeedstudio.com/Seeed-Tiny-BLE-BLE-6DOF-Mbed-Platform-p-2268.html", "vendor": "SeeedStudio" } diff --git a/boards/ty51822r3.json b/boards/ty51822r3.json deleted file mode 100644 index c506e8e..0000000 --- a/boards/ty51822r3.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "build": { - "cpu": "cortex-m0", - "f_cpu": "32000000L", - "mcu": "nrf51822" - }, - "connectivity": [ - "bluetooth" - ], - "debug": { - "onboard_tools": [ - "cmsis-dap" - ], - "svd_path": "nrf51.svd" - }, - "frameworks": [ - "mbed" - ], - "name": "Switch Science mbed TY51822r3", - "upload": { - "maximum_ram_size": 32768, - "maximum_size": 262144, - "protocol": "cmsis-dap", - "protocols": [ - "cmsis-dap", - "mbed" - ] - }, - "url": "https://developer.mbed.org/platforms/Switch-Science-mbed-TY51822r3/", - "vendor": "Switch Science" -} diff --git a/boards/vbluno51.json b/boards/vbluno51.json index 7989b49..31b48fa 100644 --- a/boards/vbluno51.json +++ b/boards/vbluno51.json @@ -17,7 +17,6 @@ "svd_path": "nrf51.svd" }, "frameworks": [ - "mbed", "zephyr" ], "name": "VNG VBLUNO51", @@ -26,10 +25,9 @@ "maximum_size": 131072, "protocol": "cmsis-dap", "protocols": [ - "cmsis-dap", - "mbed" + "cmsis-dap" ] }, - "url": "https://os.mbed.com/platforms/VBLUNO51/", + "url": "https://vngiotlab.github.io/vbluno/mydoc_introduction.html", "vendor": "VNG" } diff --git a/boards/wallbot_ble.json b/boards/wallbot_ble.json deleted file mode 100644 index 18f8693..0000000 --- a/boards/wallbot_ble.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "build": { - "cpu": "cortex-m0", - "f_cpu": "16000000L", - "mcu": "nrf51822" - }, - "connectivity": [ - "bluetooth" - ], - "debug": { - "onboard_tools": [ - "cmsis-dap" - ], - "svd_path": "nrf51.svd" - }, - "frameworks": [ - "mbed" - ], - "name": "JKSoft Wallbot BLE", - "upload": { - "maximum_ram_size": 16384, - "maximum_size": 131072, - "protocol": "cmsis-dap", - "protocols": [ - "cmsis-dap", - "mbed" - ] - }, - "url": "https://developer.mbed.org/platforms/JKSoft-Wallbot-BLE/", - "vendor": "JKSoft" -} diff --git a/builder/frameworks/mbed.py b/builder/frameworks/mbed.py deleted file mode 100644 index 85e77bf..0000000 --- a/builder/frameworks/mbed.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2014-present PlatformIO -# -# 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. -""" -mbed - -The mbed framework The mbed SDK has been designed to provide enough -hardware abstraction to be intuitive and concise, yet powerful enough to -build complex projects. It is built on the low-level ARM CMSIS APIs, -allowing you to code down to the metal if needed. In addition to RTOS, -USB and Networking libraries, a cookbook of hundreds of reusable -peripheral and module libraries have been built on top of the SDK by -the mbed Developer Community. - -http://mbed.org/ -""" - -from os.path import join - -from SCons.Script import Import, SConscript - -Import("env") - -# https://github.com/platformio/builder-framework-mbed.git -SConscript( - join(env.PioPlatform().get_package_dir("framework-mbed"), "platformio", - "platformio-build.py")) diff --git a/builder/main.py b/builder/main.py index 8a19c97..d41b2a3 100644 --- a/builder/main.py +++ b/builder/main.py @@ -145,13 +145,7 @@ debug_tools = board.get("debug.tools", {}) upload_actions = [] -if upload_protocol == "mbed": - upload_actions = [ - env.VerboseAction(env.AutodetectUploadPort, "Looking for upload disk..."), - env.VerboseAction(env.UploadToDisk, "Uploading $SOURCE") - ] - -elif upload_protocol.startswith("blackmagic"): +if upload_protocol.startswith("blackmagic"): env.Replace( UPLOADER="$GDB", UPLOADERFLAGS=[ diff --git a/examples/mbed-ble-thermometer/.gitignore b/examples/mbed-ble-thermometer/.gitignore deleted file mode 100644 index 6c69f4c..0000000 --- a/examples/mbed-ble-thermometer/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.pioenvs -.piolibdeps diff --git a/examples/mbed-ble-thermometer/README.md b/examples/mbed-ble-thermometer/README.md deleted file mode 100644 index 9e77dd8..0000000 --- a/examples/mbed-ble-thermometer/README.md +++ /dev/null @@ -1,27 +0,0 @@ -How to build PlatformIO based project -===================================== - -1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) -2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf51/archive/develop.zip) -3. Extract ZIP archive -4. Run these commands: - -```shell -# Change directory to example -$ cd platform-nordicnrf51/examples/mbed-ble-thermometer - -# Build project -$ pio run - -# Upload firmware -$ pio run --target upload - -# Build specific environment -$ pio run -e nrf51_dk - -# Upload firmware for the specific environment -$ pio run -e nrf51_dk --target upload - -# Clean build files -$ pio run --target clean -``` diff --git a/examples/mbed-ble-thermometer/include/README b/examples/mbed-ble-thermometer/include/README deleted file mode 100644 index 194dcd4..0000000 --- a/examples/mbed-ble-thermometer/include/README +++ /dev/null @@ -1,39 +0,0 @@ - -This directory is intended for project header files. - -A header file is a file containing C declarations and macro definitions -to be shared between several project source files. You request the use of a -header file in your project source file (C, C++, etc) located in `src` folder -by including it, with the C preprocessing directive `#include'. - -```src/main.c - -#include "header.h" - -int main (void) -{ - ... -} -``` - -Including a header file produces the same results as copying the header file -into each source file that needs it. Such copying would be time-consuming -and error-prone. With a header file, the related declarations appear -in only one place. If they need to be changed, they can be changed in one -place, and programs that include the header file will automatically use the -new version when next recompiled. The header file eliminates the labor of -finding and changing all the copies as well as the risk that a failure to -find one copy will result in inconsistencies within a program. - -In C, the usual convention is to give header files names that end with `.h'. -It is most portable to use only letters, digits, dashes, and underscores in -header file names, and at most one dot. - -Read more about using header files in official GCC documentation: - -* Include Syntax -* Include Operation -* Once-Only Headers -* Computed Includes - -https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/examples/mbed-ble-thermometer/lib/README b/examples/mbed-ble-thermometer/lib/README deleted file mode 100644 index 6debab1..0000000 --- a/examples/mbed-ble-thermometer/lib/README +++ /dev/null @@ -1,46 +0,0 @@ - -This directory is intended for project specific (private) libraries. -PlatformIO will compile them to static libraries and link into executable file. - -The source code of each library should be placed in a an own separate directory -("lib/your_library_name/[here are source files]"). - -For example, see a structure of the following two libraries `Foo` and `Bar`: - -|--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 --> THIS FILE -| -|- platformio.ini -|--src - |- main.c - -and a contents of `src/main.c`: -``` -#include -#include - -int main (void) -{ - ... -} - -``` - -PlatformIO Library Dependency Finder will find automatically dependent -libraries scanning project source files. - -More information about PlatformIO Library Dependency Finder -- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/mbed-ble-thermometer/platformio.ini b/examples/mbed-ble-thermometer/platformio.ini deleted file mode 100644 index d58240f..0000000 --- a/examples/mbed-ble-thermometer/platformio.ini +++ /dev/null @@ -1,20 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter, extra scripting -; Upload options: custom port, speed and extra flags -; Library options: dependencies, extra library storages -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[env:nrf51_dk] -platform = nordicnrf51 -framework = mbed -board = nrf51_dk -build_flags = -DPIO_FRAMEWORK_MBED_RTOS_PRESENT - -[env:nrf51_dongle] -platform = nordicnrf51 -framework = mbed -board = nrf51_dongle -build_flags = -DPIO_FRAMEWORK_MBED_RTOS_PRESENT \ No newline at end of file diff --git a/examples/mbed-ble-thermometer/src/main.cpp b/examples/mbed-ble-thermometer/src/main.cpp deleted file mode 100644 index 48c3b76..0000000 --- a/examples/mbed-ble-thermometer/src/main.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited - * - * 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. - */ - -#include -#include -#include "mbed.h" -#include "ble/BLE.h" -#include "ble/services/HealthThermometerService.h" - -DigitalOut led1(LED1, 1); - -const static char DEVICE_NAME[] = "PIOTherm"; -static const uint16_t uuid16_list[] = {GattService::UUID_HEALTH_THERMOMETER_SERVICE}; - -static float currentTemperature = 39.6; -static HealthThermometerService *thermometerServicePtr; - -static EventQueue eventQueue(/* event count */ 16 * EVENTS_EVENT_SIZE); - -/* Restart Advertising on disconnection*/ -void disconnectionCallback(const Gap::DisconnectionCallbackParams_t *) -{ - BLE::Instance().gap().startAdvertising(); -} - -void updateSensorValue(void) { - /* Do blocking calls or whatever is necessary for sensor polling. - In our case, we simply update the Temperature measurement. */ - currentTemperature = (currentTemperature + 0.1 > 43.0) ? 39.6 : currentTemperature + 0.1; - thermometerServicePtr->updateTemperature(currentTemperature); -} - -void periodicCallback(void) -{ - led1 = !led1; /* Do blinky on LED1 while we're waiting for BLE events */ - - if (BLE::Instance().gap().getState().connected) { - eventQueue.call(updateSensorValue); - } -} - -void onBleInitError(BLE &ble, ble_error_t error) -{ - /* Initialization error handling should go here */ -} - -void bleInitComplete(BLE::InitializationCompleteCallbackContext *params) -{ - BLE& ble = params->ble; - ble_error_t error = params->error; - - if (error != BLE_ERROR_NONE) { - onBleInitError(ble, error); - return; - } - - if (ble.getInstanceID() != BLE::DEFAULT_INSTANCE) { - return; - } - - ble.gap().onDisconnection(disconnectionCallback); - - /* Setup primary service. */ - thermometerServicePtr = new HealthThermometerService(ble, currentTemperature, HealthThermometerService::LOCATION_EAR); - - /* setup advertising */ - ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE); - ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_16BIT_SERVICE_IDS, (uint8_t *)uuid16_list, sizeof(uuid16_list)); - ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::THERMOMETER_EAR); - ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)DEVICE_NAME, sizeof(DEVICE_NAME)); - ble.gap().setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED); - ble.gap().setAdvertisingInterval(1000); /* 1000ms */ - ble.gap().startAdvertising(); -} - -void scheduleBleEventsProcessing(BLE::OnEventsToProcessCallbackContext* context) { - BLE &ble = BLE::Instance(); - eventQueue.call(Callback(&ble, &BLE::processEvents)); -} - -int main() -{ - eventQueue.call_every(500, periodicCallback); - - BLE &ble = BLE::Instance(); - ble.onEventsToProcess(scheduleBleEventsProcessing); - ble.init(bleInitComplete); - - eventQueue.dispatch_forever(); - - return 0; -} diff --git a/examples/mbed-ble-thermometer/test/README b/examples/mbed-ble-thermometer/test/README deleted file mode 100644 index df5066e..0000000 --- a/examples/mbed-ble-thermometer/test/README +++ /dev/null @@ -1,11 +0,0 @@ - -This directory is intended for PIO Unit Testing and project tests. - -Unit Testing is a software testing method by which individual units of -source code, sets of one or more MCU program modules together with associated -control data, usage procedures, and operating procedures, are tested to -determine whether they are fit for use. Unit testing finds problems early -in the development cycle. - -More information about PIO Unit Testing: -- https://docs.platformio.org/page/plus/unit-testing.html diff --git a/examples/mbed-blink/.gitignore b/examples/mbed-blink/.gitignore deleted file mode 100644 index 6c69f4c..0000000 --- a/examples/mbed-blink/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.pioenvs -.piolibdeps diff --git a/examples/mbed-blink/README.md b/examples/mbed-blink/README.md deleted file mode 100644 index 4dcca2e..0000000 --- a/examples/mbed-blink/README.md +++ /dev/null @@ -1,27 +0,0 @@ -How to build PlatformIO based project -===================================== - -1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) -2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf51/archive/develop.zip) -3. Extract ZIP archive -4. Run these commands: - -```shell -# Change directory to example -$ cd platform-nordicnrf51/examples/mbed-blink - -# Build project -$ pio run - -# Upload firmware -$ pio run --target upload - -# Build specific environment -$ pio run -e nrf51_mkit - -# Upload firmware for the specific environment -$ pio run -e nrf51_mkit --target upload - -# Clean build files -$ pio run --target clean -``` diff --git a/examples/mbed-blink/include/README b/examples/mbed-blink/include/README deleted file mode 100644 index 194dcd4..0000000 --- a/examples/mbed-blink/include/README +++ /dev/null @@ -1,39 +0,0 @@ - -This directory is intended for project header files. - -A header file is a file containing C declarations and macro definitions -to be shared between several project source files. You request the use of a -header file in your project source file (C, C++, etc) located in `src` folder -by including it, with the C preprocessing directive `#include'. - -```src/main.c - -#include "header.h" - -int main (void) -{ - ... -} -``` - -Including a header file produces the same results as copying the header file -into each source file that needs it. Such copying would be time-consuming -and error-prone. With a header file, the related declarations appear -in only one place. If they need to be changed, they can be changed in one -place, and programs that include the header file will automatically use the -new version when next recompiled. The header file eliminates the labor of -finding and changing all the copies as well as the risk that a failure to -find one copy will result in inconsistencies within a program. - -In C, the usual convention is to give header files names that end with `.h'. -It is most portable to use only letters, digits, dashes, and underscores in -header file names, and at most one dot. - -Read more about using header files in official GCC documentation: - -* Include Syntax -* Include Operation -* Once-Only Headers -* Computed Includes - -https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/examples/mbed-blink/lib/README b/examples/mbed-blink/lib/README deleted file mode 100644 index 6debab1..0000000 --- a/examples/mbed-blink/lib/README +++ /dev/null @@ -1,46 +0,0 @@ - -This directory is intended for project specific (private) libraries. -PlatformIO will compile them to static libraries and link into executable file. - -The source code of each library should be placed in a an own separate directory -("lib/your_library_name/[here are source files]"). - -For example, see a structure of the following two libraries `Foo` and `Bar`: - -|--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 --> THIS FILE -| -|- platformio.ini -|--src - |- main.c - -and a contents of `src/main.c`: -``` -#include -#include - -int main (void) -{ - ... -} - -``` - -PlatformIO Library Dependency Finder will find automatically dependent -libraries scanning project source files. - -More information about PlatformIO Library Dependency Finder -- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/mbed-blink/platformio.ini b/examples/mbed-blink/platformio.ini deleted file mode 100644 index bfc59f0..0000000 --- a/examples/mbed-blink/platformio.ini +++ /dev/null @@ -1,28 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter, extra scripting -; Upload options: custom port, speed and extra flags -; Library options: dependencies, extra library storages -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[env:nrf51 mkit] -platform = nordicnrf51 -framework = mbed -board = nrf51_mkit - -[env:redBearLab] -platform = nordicnrf51 -framework = mbed -board = redBearLab - -[env:redBearLabBLENano] -platform = nordicnrf51 -framework = mbed -board = redBearLabBLENano - -[env:seeedTinyBLE] -platform = nordicnrf51 -framework = mbed -board = seeedTinyBLE diff --git a/examples/mbed-blink/src/main.cpp b/examples/mbed-blink/src/main.cpp deleted file mode 100644 index 8247a2e..0000000 --- a/examples/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-blink/test/README b/examples/mbed-blink/test/README deleted file mode 100644 index df5066e..0000000 --- a/examples/mbed-blink/test/README +++ /dev/null @@ -1,11 +0,0 @@ - -This directory is intended for PIO Unit Testing and project tests. - -Unit Testing is a software testing method by which individual units of -source code, sets of one or more MCU program modules together with associated -control data, usage procedures, and operating procedures, are tested to -determine whether they are fit for use. Unit testing finds problems early -in the development cycle. - -More information about PIO Unit Testing: -- https://docs.platformio.org/page/plus/unit-testing.html diff --git a/examples/mbed-events/.gitignore b/examples/mbed-events/.gitignore deleted file mode 100644 index 6c69f4c..0000000 --- a/examples/mbed-events/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.pioenvs -.piolibdeps diff --git a/examples/mbed-events/README.md b/examples/mbed-events/README.md deleted file mode 100644 index 60165f3..0000000 --- a/examples/mbed-events/README.md +++ /dev/null @@ -1,27 +0,0 @@ -How to build PlatformIO based project -===================================== - -1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) -2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf51/archive/develop.zip) -3. Extract ZIP archive -4. Run these commands: - -```shell -# Change directory to example -$ cd platform-nordicnrf51/examples/mbed-events - -# Build project -$ pio run - -# Upload firmware -$ pio run --target upload - -# Build specific environment -$ pio run -e nrf51_mkit - -# Upload firmware for the specific environment -$ pio run -e nrf51_mkit --target upload - -# Clean build files -$ pio run --target clean -``` diff --git a/examples/mbed-events/include/README b/examples/mbed-events/include/README deleted file mode 100644 index 194dcd4..0000000 --- a/examples/mbed-events/include/README +++ /dev/null @@ -1,39 +0,0 @@ - -This directory is intended for project header files. - -A header file is a file containing C declarations and macro definitions -to be shared between several project source files. You request the use of a -header file in your project source file (C, C++, etc) located in `src` folder -by including it, with the C preprocessing directive `#include'. - -```src/main.c - -#include "header.h" - -int main (void) -{ - ... -} -``` - -Including a header file produces the same results as copying the header file -into each source file that needs it. Such copying would be time-consuming -and error-prone. With a header file, the related declarations appear -in only one place. If they need to be changed, they can be changed in one -place, and programs that include the header file will automatically use the -new version when next recompiled. The header file eliminates the labor of -finding and changing all the copies as well as the risk that a failure to -find one copy will result in inconsistencies within a program. - -In C, the usual convention is to give header files names that end with `.h'. -It is most portable to use only letters, digits, dashes, and underscores in -header file names, and at most one dot. - -Read more about using header files in official GCC documentation: - -* Include Syntax -* Include Operation -* Once-Only Headers -* Computed Includes - -https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/examples/mbed-events/lib/README b/examples/mbed-events/lib/README deleted file mode 100644 index 6debab1..0000000 --- a/examples/mbed-events/lib/README +++ /dev/null @@ -1,46 +0,0 @@ - -This directory is intended for project specific (private) libraries. -PlatformIO will compile them to static libraries and link into executable file. - -The source code of each library should be placed in a an own separate directory -("lib/your_library_name/[here are source files]"). - -For example, see a structure of the following two libraries `Foo` and `Bar`: - -|--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 --> THIS FILE -| -|- platformio.ini -|--src - |- main.c - -and a contents of `src/main.c`: -``` -#include -#include - -int main (void) -{ - ... -} - -``` - -PlatformIO Library Dependency Finder will find automatically dependent -libraries scanning project source files. - -More information about PlatformIO Library Dependency Finder -- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/mbed-events/platformio.ini b/examples/mbed-events/platformio.ini deleted file mode 100644 index a1a2342..0000000 --- a/examples/mbed-events/platformio.ini +++ /dev/null @@ -1,30 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter, extra scripting -; Upload options: custom port, speed and extra flags -; Library options: dependencies, extra library storages -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[env:nrf51_mkit] -platform = nordicnrf51 -framework = mbed -board = nrf51_mkit -; build_flags = -DPIO_FRAMEWORK_MBED_RTOS_PRESENT - -[env:redBearLab] -platform = nordicnrf51 -framework = mbed -board = redBearLab -; build_flags = -DPIO_FRAMEWORK_MBED_RTOS_PRESENT - -[env:redBearLabBLENano] -platform = nordicnrf51 -framework = mbed -board = redBearLabBLENano - -[env:seeedTinyBLE] -platform = nordicnrf51 -framework = mbed -board = seeedTinyBLE diff --git a/examples/mbed-events/src/main.cpp b/examples/mbed-events/src/main.cpp deleted file mode 100644 index 8762cd4..0000000 --- a/examples/mbed-events/src/main.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "mbed_events.h" -#include - -int main() { - // creates a queue with the default size - EventQueue queue; - - // events are simple callbacks - queue.call(printf, "called immediately\n"); - queue.call_in(2000, printf, "called in 2 seconds\n"); - queue.call_every(1000, printf, "called every 1 seconds\n"); - - // events are executed by the dispatch method - queue.dispatch(); -} diff --git a/examples/mbed-events/test/README b/examples/mbed-events/test/README deleted file mode 100644 index df5066e..0000000 --- a/examples/mbed-events/test/README +++ /dev/null @@ -1,11 +0,0 @@ - -This directory is intended for PIO Unit Testing and project tests. - -Unit Testing is a software testing method by which individual units of -source code, sets of one or more MCU program modules together with associated -control data, usage procedures, and operating procedures, are tested to -determine whether they are fit for use. Unit testing finds problems early -in the development cycle. - -More information about PIO Unit Testing: -- https://docs.platformio.org/page/plus/unit-testing.html diff --git a/examples/mbed-serial/.gitignore b/examples/mbed-serial/.gitignore deleted file mode 100644 index 6c69f4c..0000000 --- a/examples/mbed-serial/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.pioenvs -.piolibdeps diff --git a/examples/mbed-serial/README.md b/examples/mbed-serial/README.md deleted file mode 100644 index 7c6dc02..0000000 --- a/examples/mbed-serial/README.md +++ /dev/null @@ -1,27 +0,0 @@ -How to build PlatformIO based project -===================================== - -1. [Install PlatformIO Core](https://docs.platformio.org/page/core.html) -2. Download [development platform with examples](https://github.com/platformio/platform-nordicnrf51/archive/develop.zip) -3. Extract ZIP archive -4. Run these commands: - -```shell -# Change directory to example -$ cd platform-nordicnrf51/examples/mbed-serial - -# Build project -$ pio run - -# Upload firmware -$ pio run --target upload - -# Build specific environment -$ pio run -e nrf51_mkit - -# Upload firmware for the specific environment -$ pio run -e nrf51_mkit --target upload - -# Clean build files -$ pio run --target clean -``` diff --git a/examples/mbed-serial/include/README b/examples/mbed-serial/include/README deleted file mode 100644 index 194dcd4..0000000 --- a/examples/mbed-serial/include/README +++ /dev/null @@ -1,39 +0,0 @@ - -This directory is intended for project header files. - -A header file is a file containing C declarations and macro definitions -to be shared between several project source files. You request the use of a -header file in your project source file (C, C++, etc) located in `src` folder -by including it, with the C preprocessing directive `#include'. - -```src/main.c - -#include "header.h" - -int main (void) -{ - ... -} -``` - -Including a header file produces the same results as copying the header file -into each source file that needs it. Such copying would be time-consuming -and error-prone. With a header file, the related declarations appear -in only one place. If they need to be changed, they can be changed in one -place, and programs that include the header file will automatically use the -new version when next recompiled. The header file eliminates the labor of -finding and changing all the copies as well as the risk that a failure to -find one copy will result in inconsistencies within a program. - -In C, the usual convention is to give header files names that end with `.h'. -It is most portable to use only letters, digits, dashes, and underscores in -header file names, and at most one dot. - -Read more about using header files in official GCC documentation: - -* Include Syntax -* Include Operation -* Once-Only Headers -* Computed Includes - -https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/examples/mbed-serial/lib/README b/examples/mbed-serial/lib/README deleted file mode 100644 index 6debab1..0000000 --- a/examples/mbed-serial/lib/README +++ /dev/null @@ -1,46 +0,0 @@ - -This directory is intended for project specific (private) libraries. -PlatformIO will compile them to static libraries and link into executable file. - -The source code of each library should be placed in a an own separate directory -("lib/your_library_name/[here are source files]"). - -For example, see a structure of the following two libraries `Foo` and `Bar`: - -|--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 --> THIS FILE -| -|- platformio.ini -|--src - |- main.c - -and a contents of `src/main.c`: -``` -#include -#include - -int main (void) -{ - ... -} - -``` - -PlatformIO Library Dependency Finder will find automatically dependent -libraries scanning project source files. - -More information about PlatformIO Library Dependency Finder -- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/mbed-serial/platformio.ini b/examples/mbed-serial/platformio.ini deleted file mode 100644 index a6a8548..0000000 --- a/examples/mbed-serial/platformio.ini +++ /dev/null @@ -1,28 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter, extra scripting -; Upload options: custom port, speed and extra flags -; Library options: dependencies, extra library storages -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[env:nrf51_mkit] -platform = nordicnrf51 -framework = mbed -board = nrf51_mkit - -[env:redBearLab] -platform = nordicnrf51 -framework = mbed -board = redBearLab - -[env:redBearLabBLENano] -platform = nordicnrf51 -framework = mbed -board = redBearLabBLENano - -[env:seeedTinyBLE] -platform = nordicnrf51 -framework = mbed -board = seeedTinyBLE diff --git a/examples/mbed-serial/src/main.cpp b/examples/mbed-serial/src/main.cpp deleted file mode 100644 index 132ba17..0000000 --- a/examples/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/mbed-serial/test/README b/examples/mbed-serial/test/README deleted file mode 100644 index df5066e..0000000 --- a/examples/mbed-serial/test/README +++ /dev/null @@ -1,11 +0,0 @@ - -This directory is intended for PIO Unit Testing and project tests. - -Unit Testing is a software testing method by which individual units of -source code, sets of one or more MCU program modules together with associated -control data, usage procedures, and operating procedures, are tested to -determine whether they are fit for use. Unit testing finds problems early -in the development cycle. - -More information about PIO Unit Testing: -- https://docs.platformio.org/page/plus/unit-testing.html diff --git a/platform.json b/platform.json index 199f850..b285c80 100644 --- a/platform.json +++ b/platform.json @@ -18,16 +18,12 @@ "type": "git", "url": "https://github.com/platformio/platform-nordicnrf51.git" }, - "version": "8.1.0", + "version": "9.0.0-beta.1", "frameworks": { "arduino": { "package": "framework-arduinonordicnrf5", "script": "builder/frameworks/arduino/nrf5.py" }, - "mbed": { - "package": "framework-mbed", - "script": "builder/frameworks/mbed.py" - }, "zephyr": { "package": "framework-zephyr", "script": "builder/frameworks/zephyr.py" @@ -48,12 +44,6 @@ "owner": "platformio", "version": "~1.700.0" }, - "framework-mbed": { - "type": "framework", - "optional": true, - "owner": "platformio", - "version": "~5.51105.190304" - }, "framework-zephyr": { "type": "framework", "optional": true, From 64b0a7a00077738293cb14b82fafb81e73f22702 Mon Sep 17 00:00:00 2001 From: Valerii Koval Date: Mon, 30 May 2022 18:23:13 +0300 Subject: [PATCH 10/10] Bump version to 9.0.0 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index b285c80..0c7c43a 100644 --- a/platform.json +++ b/platform.json @@ -18,7 +18,7 @@ "type": "git", "url": "https://github.com/platformio/platform-nordicnrf51.git" }, - "version": "9.0.0-beta.1", + "version": "9.0.0", "frameworks": { "arduino": { "package": "framework-arduinonordicnrf5",