From b6e197371d122edc0d3d5da744ca905913a61d29 Mon Sep 17 00:00:00 2001 From: Vadim Furman Date: Fri, 19 Mar 2021 18:30:00 -0700 Subject: [PATCH 1/2] Removed SX1262_USE_DIO3_FOR_TCXO --- src/mesh/SX1262Interface.cpp | 2 +- variants/lora_isp4520/variant.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mesh/SX1262Interface.cpp b/src/mesh/SX1262Interface.cpp index a99787475..7d4046731 100644 --- a/src/mesh/SX1262Interface.cpp +++ b/src/mesh/SX1262Interface.cpp @@ -34,7 +34,7 @@ bool SX1262Interface::init() pinMode(SX1262_TXEN, OUTPUT); #endif -#if !defined(SX1262_E22) && !defined(SX1262_USE_DIO3_FOR_TCXO) +#ifndef SX1262_E22 float tcxoVoltage = 0; // None - we use an XTAL #else // Use DIO3 to power tcxo per https://github.com/jgromes/RadioLib/issues/12#issuecomment-520695575 diff --git a/variants/lora_isp4520/variant.h b/variants/lora_isp4520/variant.h index fbc0b0d96..e5711e8cb 100644 --- a/variants/lora_isp4520/variant.h +++ b/variants/lora_isp4520/variant.h @@ -91,7 +91,8 @@ #define BATTERY_PIN 3 #define ADC_MULTIPLIER 1.436 -#define SX1262_USE_DIO3_FOR_TCXO +#define SX1262_E22 // Not really an E22 but this board clones using DIO3 for tcxo control + #define NO_GPS #define NO_SCREEN #endif From d3cbc8ea78f07680f68cc52fe124e1cb479715e6 Mon Sep 17 00:00:00 2001 From: Vadim Furman Date: Fri, 19 Mar 2021 18:46:11 -0700 Subject: [PATCH 2/2] WIRE_INTERFACES_COUNT -> NO_WIRE --- src/main.cpp | 4 ++-- src/nrf52/main-nrf52.cpp | 2 +- variants/lora_isp4520/variant.h | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 9ee098d68..6a4caf330 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -67,7 +67,7 @@ Router *router = NULL; // Users of router don't care what sort of subclass imple // ----------------------------------------------------------------------------- // Application // ----------------------------------------------------------------------------- -#if WIRE_INTERFACES_COUNT > 0 +#ifndef NO_WIRE void scanI2Cdevice(void) { byte err, addr; @@ -364,7 +364,7 @@ void setup() #ifdef I2C_SDA Wire.begin(I2C_SDA, I2C_SCL); -#elif WIRE_INTERFACES_COUNT > 0 +#elif !defined(NO_WIRE) Wire.begin(); #endif diff --git a/src/nrf52/main-nrf52.cpp b/src/nrf52/main-nrf52.cpp index b948d20a1..e5a4aadf7 100644 --- a/src/nrf52/main-nrf52.cpp +++ b/src/nrf52/main-nrf52.cpp @@ -155,7 +155,7 @@ void nrf52Setup() { void cpuDeepSleep(uint64_t msecToWake) { // FIXME, configure RTC or button press to wake us // FIXME, power down SPI, I2C, RAMs -#if WIRE_INTERFACES_COUNT > 0 +#ifndef NO_WIRE Wire.end(); #endif SPI.end(); diff --git a/variants/lora_isp4520/variant.h b/variants/lora_isp4520/variant.h index e5711e8cb..9bf5cd502 100644 --- a/variants/lora_isp4520/variant.h +++ b/variants/lora_isp4520/variant.h @@ -93,6 +93,7 @@ #define SX1262_E22 // Not really an E22 but this board clones using DIO3 for tcxo control +#define NO_WIRE #define NO_GPS #define NO_SCREEN #endif