From 85b541bfd93c4397201070efb3a3053a41d132d4 Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Wed, 2 Nov 2022 12:58:14 +0100 Subject: [PATCH 1/3] Portduino only: don't continue to try rebooting (#1887) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Thomas Göttgens --- src/shutdown.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shutdown.h b/src/shutdown.h index 678a1401c..3927825fb 100644 --- a/src/shutdown.h +++ b/src/shutdown.h @@ -13,7 +13,8 @@ void powerCommandsCheck() #elif defined(ARCH_NRF52) NVIC_SystemReset(); #else - DEBUG_MSG("FIXME implement reboot for this platform"); + rebootAtMsec = -1; + DEBUG_MSG("FIXME implement reboot for this platform. Skipping for now.\n"); #endif } From b2969b2faf8f07df2f3856b6e3f0572a05c9bbfa Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Wed, 2 Nov 2022 13:18:15 +0100 Subject: [PATCH 2/3] Don't allow arbitrary channel name for admin (#1886) Co-authored-by: Ben Meadors --- src/mesh/MeshModule.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/mesh/MeshModule.cpp b/src/mesh/MeshModule.cpp index 7b204ae49..ca1fb5b50 100644 --- a/src/mesh/MeshModule.cpp +++ b/src/mesh/MeshModule.cpp @@ -109,10 +109,7 @@ void MeshModule::callPlugins(const MeshPacket &mp, RxSource src) /// Also: if a packet comes in on the local PC interface, we don't check for bound channels, because it is TRUSTED and it needs to /// to be able to fetch the initial admin packets without yet knowing any channels. - bool rxChannelOk = !pi.boundChannel || (mp.from == 0) || - !ch || - strlen(ch->settings.name) > 0 || - (strcasecmp(ch->settings.name, pi.boundChannel) == 0); + bool rxChannelOk = !pi.boundChannel || (mp.from == 0) || (strcasecmp(ch->settings.name, pi.boundChannel) == 0); if (!rxChannelOk) { // no one should have already replied! From 39c1637030da260eeefe30eba3f32f53d987af36 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 2 Nov 2022 07:48:14 -0500 Subject: [PATCH 3/3] Experimental DIY nrf52840 feather support (#1884) * Experimental DIY nrf52840 feather support * Fix target * sx1262 wiring * Remove lib --- .github/workflows/main_matrix.yml | 2 ++ src/platform/nrf52/architecture.h | 2 +- variants/feather_diy/platformio.ini | 11 ++++++++++ variants/feather_diy/variant.h | 33 +++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 variants/feather_diy/platformio.ini create mode 100644 variants/feather_diy/variant.h diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 06a229312..66bf7539c 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -42,6 +42,7 @@ jobs: - board: m5stack-core - board: m5stack-coreink - board: tbeam-s3-core + - board: feather_diy # - board: pico runs-on: ubuntu-latest @@ -181,6 +182,7 @@ jobs: - board: rak4631_eink - board: t-echo - board: pca10059_diy_eink + - board: feather_diy runs-on: ubuntu-latest steps: diff --git a/src/platform/nrf52/architecture.h b/src/platform/nrf52/architecture.h index 47d95c92d..986a864c9 100644 --- a/src/platform/nrf52/architecture.h +++ b/src/platform/nrf52/architecture.h @@ -45,7 +45,7 @@ #define HW_VENDOR HardwareModel_T_ECHO #elif defined(NORDIC_PCA10059) #define HW_VENDOR HardwareModel_NRF52840_PCA10059 -#elif defined(PRIVATE_HW) +#elif defined(PRIVATE_HW) || defined(FEATHER_DIY) #define HW_VENDOR HardwareModel_PRIVATE_HW #else #define HW_VENDOR HardwareModel_NRF52_UNKNOWN diff --git a/variants/feather_diy/platformio.ini b/variants/feather_diy/platformio.ini new file mode 100644 index 000000000..446011cb9 --- /dev/null +++ b/variants/feather_diy/platformio.ini @@ -0,0 +1,11 @@ +; The very slick RAK wireless RAK 4631 / 4630 board - Unified firmware for 5005/19003, with or without OLED RAK 1921 +[env:feather_diy] +extends = nrf52840_base +board = adafruit_feather_nrf52840 +build_flags = ${nrf52840_base.build_flags} -Ivariants/feather_diy -D feather_diy +build_src_filter = ${nrf52_base.build_src_filter} +<../variants/feather_diy> +lib_deps = + ${nrf52840_base.lib_deps} +debug_tool = jlink +; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) +;upload_protocol = jlink \ No newline at end of file diff --git a/variants/feather_diy/variant.h b/variants/feather_diy/variant.h new file mode 100644 index 000000000..8327e6050 --- /dev/null +++ b/variants/feather_diy/variant.h @@ -0,0 +1,33 @@ +// For OLED LCD +#define I2C_SDA 22 +#define I2C_SCL 23 + +#define BUTTON_PIN 7 + +#define LORA_DIO0 -1 // a No connect on the SX1262/SX1268 module +#define LORA_RESET 13 // RST for SX1276, and for SX1262/SX1268 +#define LORA_DIO1 11 // IRQ for SX1262/SX1268 +#define LORA_DIO2 12 // BUSY for SX1262/SX1268 +#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262/SX1268, if DIO3 is high the TXCO is enabled + +#define RF95_SCK SCK +#define RF95_MISO MI +#define RF95_MOSI MO +#define RF95_NSS D2 + +// supported modules list +#define USE_SX1262 + +// common pinouts for SX126X modules +#define SX126X_CS RF95_NSS // NSS for SX126X +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY LORA_DIO2 +#define SX126X_RESET LORA_RESET +#define SX126X_RXEN 10 +#define SX126X_TXEN 9 + +#ifdef EBYTE_E22 +// Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch +// (which is the default for the sx1262interface code) +#define SX126X_E22 +#endif