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,