From 632ace5350fe38dd8e1090de2ae06b6d139ee61a Mon Sep 17 00:00:00 2001 From: ralphwetzel Date: Tue, 26 Sep 2023 10:10:46 +0200 Subject: [PATCH] Nordic nRF52 support (proposal by @NextWorldLab) --- mcu_plugin.html | 5 ++++- mcu_plugin.js | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/mcu_plugin.html b/mcu_plugin.html index 9e81699..893a9b8 100644 --- a/mcu_plugin.html +++ b/mcu_plugin.html @@ -1092,8 +1092,9 @@ { value: "sim", label: "Simulator" }, { value: "esp", label: "ESP8266 | Espressif" }, { value: "esp32", label: "ESP32 | Espressif" }, - { value: "pico", label: "Pico | Raspberry Pi" }, { value: "gecko", label: "Gecko | Silicon Labs" }, + { value: "nrf52", label: "nRF52 | Nordic" }, + { value: "pico", label: "Pico | Raspberry Pi" }, { value: "qca4020", label: "QCA4020 | Qualcomm" }, ], }], @@ -1124,6 +1125,8 @@ } else if (value == "pico") { row2.hide(500); + } else if (value == "nrf52") { + row2.hide(500); } else { row2.show(500); } diff --git a/mcu_plugin.js b/mcu_plugin.js index a6e51bd..45d7101 100644 --- a/mcu_plugin.js +++ b/mcu_plugin.js @@ -1899,6 +1899,17 @@ module.exports = function(RED) { // if (platform[1]?.length > 0) // env.SUBPLATFORM = platform[1] break; + case "nrf52": + switch (os.platform()) { + case "win32": + env.NRF52_SDK_PATH = ensure_env_path("NRF52_SDK_PATH", [`${HOME}/nrf5/nRF5_SDK_17.0.2_d674dde`]); + break; + case "linux": + case "darwin": + env.NRF_SDK_DIR = ensure_env_path("NRF_SDK_DIR", [`${HOME}/nrf5/nRF5_SDK_17.0.2_d674dde`]); + break; + } + break; case "sim": break; default: @@ -1983,6 +1994,7 @@ module.exports = function(RED) { case "qca4020": /* Not tested! */ + case "nrf52": case "sim": bcmds.push(`runthis ${cmd}`);