From 15cb599cd1a52e9992fed2d396b8cc79e518dc08 Mon Sep 17 00:00:00 2001 From: geeksville Date: Mon, 27 Apr 2020 07:39:50 -0700 Subject: [PATCH] move nrf52 stuff to correct directory name --- .vscode/launch.json | 4 ++-- platformio.ini | 11 +++++------ src/configuration.h | 18 +++++++++++------- src/{bare => nrf52}/FS.h | 0 src/{bare => nrf52}/NRF52Bluetooth.cpp | 0 src/{bare => nrf52}/NRF52Bluetooth.h | 0 src/{bare => nrf52}/PmuBQ25703A.cpp | 0 src/{bare => nrf52}/PmuBQ25703A.h | 0 src/{bare => nrf52}/SPIFFS.h | 0 src/{bare => nrf52}/main-bare.cpp | 0 src/{bare => nrf52}/main-nrf52.cpp | 0 11 files changed, 18 insertions(+), 15 deletions(-) rename src/{bare => nrf52}/FS.h (100%) rename src/{bare => nrf52}/NRF52Bluetooth.cpp (100%) rename src/{bare => nrf52}/NRF52Bluetooth.h (100%) rename src/{bare => nrf52}/PmuBQ25703A.cpp (100%) rename src/{bare => nrf52}/PmuBQ25703A.h (100%) rename src/{bare => nrf52}/SPIFFS.h (100%) rename src/{bare => nrf52}/main-bare.cpp (100%) rename src/{bare => nrf52}/main-nrf52.cpp (100%) diff --git a/.vscode/launch.json b/.vscode/launch.json index 77b1fb36..68cb8d52 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,7 +12,7 @@ "type": "platformio-debug", "request": "launch", "name": "PIO Debug", - "executable": "/home/kevinh/development/meshtastic/meshtastic-esp32/.pio/build/bare/firmware.elf", + "executable": "/home/kevinh/development/meshtastic/meshtastic-esp32/.pio/build/nrf52dk/firmware.elf", "toolchainBinDir": "/home/kevinh/.platformio/packages/toolchain-gccarmnoneeabi/bin", "svdPath": "/home/kevinh/.platformio/platforms/nordicnrf52/misc/svd/nrf52840.svd", "preLaunchTask": { @@ -25,7 +25,7 @@ "type": "platformio-debug", "request": "launch", "name": "PIO Debug (skip Pre-Debug)", - "executable": "/home/kevinh/development/meshtastic/meshtastic-esp32/.pio/build/bare/firmware.elf", + "executable": "/home/kevinh/development/meshtastic/meshtastic-esp32/.pio/build/nrf52dk/firmware.elf", "toolchainBinDir": "/home/kevinh/.platformio/packages/toolchain-gccarmnoneeabi/bin", "svdPath": "/home/kevinh/.platformio/platforms/nordicnrf52/misc/svd/nrf52840.svd", "internalConsoleOptions": "openOnSessionStart" diff --git a/platformio.ini b/platformio.ini index 37ae10d3..430e7b0d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html [platformio] -default_envs = bare +default_envs = nrf52dk [common] ; common is not currently used @@ -79,7 +79,7 @@ lib_deps = ; Common settings for ESP targes, mixin with extends = esp32_base [esp32_base] src_filter = - ${env.src_filter} - + ${env.src_filter} - upload_speed = 921600 debug_init_break = tbreak setup build_flags = @@ -123,15 +123,14 @@ build_flags = ${esp32_base.build_flags} -D TTGO_LORA_V2 -; This is a temporary build target to test turning off particular hardare bits in the build (to improve modularity) -[env:bare] +; The NRF52840-dk development board +[env:nrf52dk] platform = nordicnrf52 -; board = nrf52840_dk_adafruit ; nicer than nrf52840_dk - more full gpio mappings board = ppr framework = arduino debug_tool = jlink build_flags = - ${env.build_flags} -D BARE_BOARD -Wno-unused-variable -Isrc/bare + ${env.build_flags} -Wno-unused-variable -Isrc/nrf52 src_filter = ${env.src_filter} - lib_ignore = diff --git a/src/configuration.h b/src/configuration.h index 7f89b08c..a47148ce 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -188,13 +188,17 @@ along with this program. If not, see . 0 // If defined, this will be used for user button presses, if your board doesn't have a physical switch, you can wire one // between this pin and ground -#define RESET_GPIO 14 // If defined, this pin will be used to reset the LORA radio -#define RF95_IRQ_GPIO 26 // IRQ line for the LORA radio -#define DIO1_GPIO 35 // DIO1 & DIO2 are not currently used, but they must be assigned to a pin number -#define DIO2_GPIO 34 // DIO1 & DIO2 are not currently used, but they must be assigned to a pin number -#elif defined(BARE_BOARD) +#define RESET_GPIO 14 // If defined, this pin will be used to reset the LORA radio +#define RF95_IRQ_GPIO 26 // IRQ line for the LORA radio +#define DIO1_GPIO 35 // DIO1 & DIO2 are not currently used, but they must be assigned to a pin number +#define DIO2_GPIO 34 // DIO1 & DIO2 are not currently used, but they must be assigned to a pin number +#elif defined(NRF52840_XXAA) // All of the NRF52 targets are configured using variant.h, so this section shouldn't need to be + // board specific + +// FIXME, use variant.h defs for all of this!!! + // This string must exactly match the case used in release file names or the android updater won't work -#define HW_VENDOR "bare" +#define HW_VENDOR "nrf52" #define NO_ESP32 // Don't use ESP32 libs (mainly bluetooth) @@ -233,7 +237,7 @@ along with this program. If not, see . #include "SEGGER_RTT.h" #define DEBUG_MSG(...) SEGGER_RTT_printf(0, __VA_ARGS__) #else -#define DEBUG_PORT Serial // Serial debug port +#define DEBUG_PORT Serial // Serial debug port #ifdef DEBUG_PORT #define DEBUG_MSG(...) DEBUG_PORT.printf(__VA_ARGS__) diff --git a/src/bare/FS.h b/src/nrf52/FS.h similarity index 100% rename from src/bare/FS.h rename to src/nrf52/FS.h diff --git a/src/bare/NRF52Bluetooth.cpp b/src/nrf52/NRF52Bluetooth.cpp similarity index 100% rename from src/bare/NRF52Bluetooth.cpp rename to src/nrf52/NRF52Bluetooth.cpp diff --git a/src/bare/NRF52Bluetooth.h b/src/nrf52/NRF52Bluetooth.h similarity index 100% rename from src/bare/NRF52Bluetooth.h rename to src/nrf52/NRF52Bluetooth.h diff --git a/src/bare/PmuBQ25703A.cpp b/src/nrf52/PmuBQ25703A.cpp similarity index 100% rename from src/bare/PmuBQ25703A.cpp rename to src/nrf52/PmuBQ25703A.cpp diff --git a/src/bare/PmuBQ25703A.h b/src/nrf52/PmuBQ25703A.h similarity index 100% rename from src/bare/PmuBQ25703A.h rename to src/nrf52/PmuBQ25703A.h diff --git a/src/bare/SPIFFS.h b/src/nrf52/SPIFFS.h similarity index 100% rename from src/bare/SPIFFS.h rename to src/nrf52/SPIFFS.h diff --git a/src/bare/main-bare.cpp b/src/nrf52/main-bare.cpp similarity index 100% rename from src/bare/main-bare.cpp rename to src/nrf52/main-bare.cpp diff --git a/src/bare/main-nrf52.cpp b/src/nrf52/main-nrf52.cpp similarity index 100% rename from src/bare/main-nrf52.cpp rename to src/nrf52/main-nrf52.cpp