From b9edc7563b55fb6c9fff8a0ae00e1539f5bf803d Mon Sep 17 00:00:00 2001 From: "Aaron.Lee" <32860565+Heltec-Aaron-Lee@users.noreply.github.com> Date: Fri, 31 May 2024 23:55:05 +0800 Subject: [PATCH 1/5] Update the Heltec board battery level read accuracy. (#3955) * Update variant.h Update the Heltec board battery voltage read parameter. * Update variant.h Update the Heltec board battery voltage read parameter. * Update variant.h Update the Heltec board battery voltage read parameter. * Update variant.h Update the Heltec board battery voltage read parameter. --- variants/heltec_v3/variant.h | 2 +- variants/heltec_wireless_tracker/variant.h | 2 +- variants/heltec_wireless_tracker_V1_0/variant.h | 2 +- variants/heltec_wsl_v3/variant.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/variants/heltec_v3/variant.h b/variants/heltec_v3/variant.h index 70b122f584..0c22ea1a74 100644 --- a/variants/heltec_v3/variant.h +++ b/variants/heltec_v3/variant.h @@ -16,7 +16,7 @@ #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define ADC_CHANNEL ADC1_GPIO1_CHANNEL #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider -#define ADC_MULTIPLIER 4.9 +#define ADC_MULTIPLIER 4.9*1.045 #define USE_SX1262 diff --git a/variants/heltec_wireless_tracker/variant.h b/variants/heltec_wireless_tracker/variant.h index 167345e1a9..0f632a33cc 100644 --- a/variants/heltec_wireless_tracker/variant.h +++ b/variants/heltec_wireless_tracker/variant.h @@ -33,7 +33,7 @@ #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define ADC_CHANNEL ADC1_GPIO1_CHANNEL #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider -#define ADC_MULTIPLIER 4.9 +#define ADC_MULTIPLIER 4.9*1.045 #define ADC_CTRL 2 // active HIGH, powers the voltage divider. Only on 1.1 #define ADC_CTRL_ENABLED HIGH diff --git a/variants/heltec_wireless_tracker_V1_0/variant.h b/variants/heltec_wireless_tracker_V1_0/variant.h index 84e77a6b95..2b521f249b 100644 --- a/variants/heltec_wireless_tracker_V1_0/variant.h +++ b/variants/heltec_wireless_tracker_V1_0/variant.h @@ -34,7 +34,7 @@ #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define ADC_CHANNEL ADC1_GPIO1_CHANNEL #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider -#define ADC_MULTIPLIER 4.9 +#define ADC_MULTIPLIER 4.9*1.045 #undef GPS_RX_PIN #undef GPS_TX_PIN diff --git a/variants/heltec_wsl_v3/variant.h b/variants/heltec_wsl_v3/variant.h index 917ea7fb9e..37cef09c6e 100644 --- a/variants/heltec_wsl_v3/variant.h +++ b/variants/heltec_wsl_v3/variant.h @@ -11,7 +11,7 @@ #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define ADC_CHANNEL ADC1_GPIO1_CHANNEL #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider -#define ADC_MULTIPLIER 4.9 +#define ADC_MULTIPLIER 4.9*1.045 #define USE_SX1262 From 953aa4d0915f8652b14e7734acc1e1f2ac5210fa Mon Sep 17 00:00:00 2001 From: jonagnew Date: Fri, 31 May 2024 11:55:20 -0400 Subject: [PATCH 2/5] Tracker v1.1 - fix pin 3 description in variant.h (#3990) Schematic shows the following: Pin 3 is Vext on v1.1 - HIGH enables LDO for Vext rail which goes to: GPS UC6580: GPS V_DET(8), VDD_IO(7), DCDC_IN(21), pulls up RESETN(17), D_SEL(33) and BOOT_MODE(34) through 10kR GPS LNA SW7125DE: VCC(4), pulls up SHDN(5) through 10kR OLED: VDD, LEDA (through diode) Co-authored-by: Ben Meadors --- variants/heltec_wireless_tracker/variant.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/variants/heltec_wireless_tracker/variant.h b/variants/heltec_wireless_tracker/variant.h index 0f632a33cc..d496a8d6f4 100644 --- a/variants/heltec_wireless_tracker/variant.h +++ b/variants/heltec_wireless_tracker/variant.h @@ -27,7 +27,11 @@ #define SCREEN_TRANSITION_FRAMERATE 3 // fps #define DISPLAY_FORCE_SMALL_FONTS -#define VEXT_ENABLE_V05 3 // active HIGH, powers the lora antenna boost + // pin 3 is Vext on v1.1 - HIGH enables LDO for Vext rail which goes to: + // GPS UC6580: GPS V_DET(8), VDD_IO(7), DCDC_IN(21), pulls up RESETN(17), D_SEL(33) and BOOT_MODE(34) through 10kR + // GPS LNA SW7125DE: VCC(4), pulls up SHDN(5) through 10kR + // LED: VDD, LEDA (through diode) +#define VEXT_ENABLE_V05 3 // active HIGH - powers the GPS, GPS LNA and OLED VDD/anode #define BUTTON_PIN 0 #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage @@ -43,6 +47,7 @@ #define GPS_TX_PIN 34 #define PIN_GPS_RESET 35 #define PIN_GPS_PPS 36 +// #define PIN_GPS_EN 3 // Uncomment to power off the GPS with triple-click on Tracker v1.1, though we'll also lose the display. #define GPS_RESET_MODE LOW #define GPS_UC6580 From 17142f87782ad9bff0bc66e9b4937018adfb3bb1 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 31 May 2024 10:56:04 -0500 Subject: [PATCH 3/5] Add support for RadioMaster Bandit Nano (#4005) * Add support for RadioMaster Bandit Nano * Add fan to init and sleep --- src/mesh/NodeDB.cpp | 3 + src/mesh/RF95Interface.cpp | 33 ++++++-- src/mesh/RadioLibRF95.cpp | 4 + src/platform/esp32/architecture.h | 2 + .../platformio.ini | 15 ++++ .../radiomaster_900_bandit_nano/variant.h | 84 +++++++++++++++++++ 6 files changed, 136 insertions(+), 5 deletions(-) create mode 100644 variants/radiomaster_900_bandit_nano/platformio.ini create mode 100644 variants/radiomaster_900_bandit_nano/variant.h diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index b79911a3e1..9473df8c51 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -292,6 +292,9 @@ void NodeDB::installDefaultConfig() meshtastic_Config_PositionConfig_PositionFlags_SPEED | meshtastic_Config_PositionConfig_PositionFlags_HEADING | meshtastic_Config_PositionConfig_PositionFlags_DOP | meshtastic_Config_PositionConfig_PositionFlags_SATINVIEW); +#ifdef RADIOMASTER_900_BANDIT_NANO + config.display.flip_screen = true; +#endif #ifdef T_WATCH_S3 config.display.screen_on_secs = 30; config.display.wake_on_tap_or_motion = true; diff --git a/src/mesh/RF95Interface.cpp b/src/mesh/RF95Interface.cpp index 8c6c349fdd..5677e6edad 100644 --- a/src/mesh/RF95Interface.cpp +++ b/src/mesh/RF95Interface.cpp @@ -8,7 +8,10 @@ #include "PortduinoGlue.h" #endif -#define MAX_POWER 20 +#ifndef RF95_MAX_POWER +#define RF95_MAX_POWER 20 +#endif + // if we use 20 we are limited to 1% duty cycle or hw might overheat. For continuous operation set a limit of 17 // In theory up to 27 dBm is possible, but the modules installed in most radios can cope with a max of 20. So BIG WARNING // if you set power to something higher than 17 or 20 you might fry your board. @@ -49,8 +52,8 @@ bool RF95Interface::init() { RadioLibInterface::init(); - if (power > MAX_POWER) // This chip has lower power limits than some - power = MAX_POWER; + if (power > RF95_MAX_POWER) // This chip has lower power limits than some + power = RF95_MAX_POWER; limitPower(); @@ -61,6 +64,13 @@ bool RF95Interface::init() digitalWrite(RF95_TCXO, 1); #endif + // enable PA +#ifdef RF95_PA_EN +#if defined(RF95_PA_DAC_EN) + dacWrite(RF95_PA_EN, RF95_PA_LEVEL); +#endif +#endif + /* #define RF95_TXEN (22) // If defined, this pin should be set high prior to transmit (controls an external analog switch) #define RF95_RXEN (23) // If defined, this pin should be set high prior to receive (controls an external analog switch) @@ -71,6 +81,11 @@ bool RF95Interface::init() digitalWrite(RF95_TXEN, 0); #endif +#ifdef RF95_FAN_EN + pinMode(RF95_FAN_EN, OUTPUT); + digitalWrite(RF95_FAN_EN, 1); +#endif + #ifdef RF95_RXEN pinMode(RF95_RXEN, OUTPUT); digitalWrite(RF95_RXEN, 1); @@ -146,10 +161,14 @@ bool RF95Interface::reconfigure() if (err != RADIOLIB_ERR_NONE) RECORD_CRITICALERROR(meshtastic_CriticalErrorCode_INVALID_RADIO_SETTING); - if (power > MAX_POWER) // This chip has lower power limits than some - power = MAX_POWER; + if (power > RF95_MAX_POWER) // This chip has lower power limits than some + power = RF95_MAX_POWER; +#ifdef USE_RF95_RFO + err = lora->setOutputPower(power, true); +#else err = lora->setOutputPower(power); +#endif if (err != RADIOLIB_ERR_NONE) RECORD_CRITICALERROR(meshtastic_CriticalErrorCode_INVALID_RADIO_SETTING); @@ -235,5 +254,9 @@ bool RF95Interface::sleep() setStandby(); // First cancel any active receiving/sending lora->sleep(); +#ifdef RF95_FAN_EN + digitalWrite(RF95_FAN_EN, 0); +#endif + return true; } \ No newline at end of file diff --git a/src/mesh/RadioLibRF95.cpp b/src/mesh/RadioLibRF95.cpp index 1fe7869a37..a202d4f4d9 100644 --- a/src/mesh/RadioLibRF95.cpp +++ b/src/mesh/RadioLibRF95.cpp @@ -42,7 +42,11 @@ int16_t RadioLibRF95::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_ state = setCodingRate(cr); RADIOLIB_ASSERT(state); +#ifdef USE_RF95_RFO + state = setOutputPower(power, true); +#else state = setOutputPower(power); +#endif RADIOLIB_ASSERT(state); state = setGain(gain); diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index 45d533a760..824c11bdd3 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -145,6 +145,8 @@ #define HW_VENDOR meshtastic_HardwareModel_UNPHONE #elif defined(WIPHONE) #define HW_VENDOR meshtastic_HardwareModel_WIPHONE +#elif defined(RADIOMASTER_900_BANDIT_NANO) +#define HW_VENDOR meshtastic_HardwareModel_RADIOMASTER_900_BANDIT_NANO #endif // ----------------------------------------------------------------------------- diff --git a/variants/radiomaster_900_bandit_nano/platformio.ini b/variants/radiomaster_900_bandit_nano/platformio.ini new file mode 100644 index 0000000000..d83c14de23 --- /dev/null +++ b/variants/radiomaster_900_bandit_nano/platformio.ini @@ -0,0 +1,15 @@ +[env:radiomaster_900_bandit_nano] +extends = esp32_base +board = esp32doit-devkit-v1 +board_level = extra +build_flags = + ${esp32_base.build_flags} + -DRADIOMASTER_900_BANDIT_NANO + -DVTABLES_IN_FLASH=1 + -DCONFIG_DISABLE_HAL_LOCKS=1 + -O2 + -Ivariants/radiomaster_900_bandit_nano +board_build.f_cpu = 240000000L +upload_protocol = esptool +lib_deps = + ${esp32_base.lib_deps} \ No newline at end of file diff --git a/variants/radiomaster_900_bandit_nano/variant.h b/variants/radiomaster_900_bandit_nano/variant.h new file mode 100644 index 0000000000..bd66877333 --- /dev/null +++ b/variants/radiomaster_900_bandit_nano/variant.h @@ -0,0 +1,84 @@ +/* + Initial settings and work by https://github.com/uberhalit and re-work by https://github.com/gjelsoe + Unit provided by Radio Master RC + https://radiomasterrc.com/products/bandit-nano-expresslrs-rf-module with 0.96" OLED display +*/ + +/* + I2C SDA and SCL. +*/ +#define I2C_SDA 14 +#define I2C_SCL 12 + +/* + No GPS - but free solder pads are available inside the case. +*/ +#undef GPS_RX_PIN +#undef GPS_TX_PIN + +/* + Pin connections from ESP32-D0WDQ6 to SX1276. +*/ +#define LORA_DIO0 22 +#define LORA_DIO1 21 +#define LORA_SCK 18 +#define LORA_MISO 19 +#define LORA_MOSI 23 +#define LORA_CS 4 +#define LORA_RESET 5 +#define LORA_TXEN 33 + +/* + This unit has a FAN built-in. + FAN is active at 250mW on it's ExpressLRS Firmware. +*/ +#define RF95_FAN_EN 2 + +/* + LED PIN setup. +*/ +#define LED_PIN 15 + +/* + Five way button when using ADC. + 2.632V, 2.177V, 1.598V, 1.055V, 0V + + Possible ADC Values: + { UP, DOWN, LEFT, RIGHT, ENTER, IDLE } + 3227, 0 ,1961, 2668, 1290, 4095 +*/ +#define BUTTON_PIN 39 +#define BUTTON_NEED_PULLUP + +#define SCREEN_ROTATE + +/* + No External notification. +*/ +#undef EXT_NOTIFY_OUT + +/* + Remapping PIN Names. + Note, that this unit uses RFO +*/ +#define USE_RF95 +#define USE_RF95_RFO +#define RF95_CS LORA_CS +#define RF95_DIO1 LORA_DIO1 +#define RF95_TXEN LORA_TXEN +#define RF95_RESET LORA_RESET +#define RF95_MAX_POWER 12 + +/* + This module has Skyworks SKY66122 controlled by dacWrite + power rangeing from 100mW to 1000mW. + + Mapping of PA_LEVEL to Power output: GPIO26/dacWrite + 168 -> 100mW -> 2.11v + 148 -> 250mW -> 1.87v + 128 -> 500mW -> 1.63v + 90 -> 1000mW -> 1.16v +*/ +#define RF95_PA_EN 26 +#define RF95_PA_DAC_EN +#define RF95_PA_LEVEL 90 \ No newline at end of file From eddda3ca43304357b7f130afe980091176814c05 Mon Sep 17 00:00:00 2001 From: fzellini Date: Fri, 31 May 2024 18:17:53 +0200 Subject: [PATCH 4/5] added AHTx0 sensor (#3977) * added AHTx0 sensor * AHT10 definition in protobuf * AHT10 definition in protobuf * protobufs * Management of AHT20+BMP280 module * missing newline in log * missing newline in log * reverted * reverted .gitignore --------- Co-authored-by: Ben Meadors --- platformio.ini | 1 + src/configuration.h | 1 + src/detect/ScanI2C.h | 1 + src/detect/ScanI2CTwoWire.cpp | 9 +++-- src/main.cpp | 1 + .../Telemetry/EnvironmentTelemetry.cpp | 17 +++++++++ src/modules/Telemetry/Sensor/AHT10.cpp | 35 +++++++++++++++++++ src/modules/Telemetry/Sensor/AHT10.h | 17 +++++++++ 8 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 src/modules/Telemetry/Sensor/AHT10.cpp create mode 100644 src/modules/Telemetry/Sensor/AHT10.h diff --git a/platformio.ini b/platformio.ini index c6efc740da..ca41a8021c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -130,6 +130,7 @@ lib_deps = adafruit/Adafruit PM25 AQI Sensor@^1.0.6 adafruit/Adafruit MPU6050@^2.2.4 adafruit/Adafruit LIS3DH@^1.2.4 + adafruit/Adafruit AHTX0@^2.0.5 lewisxhe/SensorLib@^0.2.0 adafruit/Adafruit LSM6DS@^4.7.2 mprograms/QMC5883LCompass@^1.2.0 diff --git a/src/configuration.h b/src/configuration.h index 858f3167e7..daaf1a720f 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -128,6 +128,7 @@ along with this program. If not, see . #define LPS22HB_ADDR_ALT 0x5D #define SHT31_4x_ADDR 0x44 #define PMSA0031_ADDR 0x12 +#define AHT10_ADDR 0x38 #define RCWL9620_ADDR 0x57 #define VEML7700_ADDR 0x10 diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index 6c01b91000..67e2287917 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -45,6 +45,7 @@ class ScanI2C VEML7700, RCWL9620, NCP5623, + AHT10 } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 7828dfb586..d46497d093 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -256,7 +256,12 @@ void ScanI2CTwoWire::scanPort(I2CPort port) type = BMP_280; } break; - +#ifndef HAS_NCP5623 + case AHT10_ADDR: + LOG_INFO("AHT10 sensor found at address 0x%x\n", (uint8_t)addr.address); + type = AHT10; + break; +#endif case INA_ADDR: case INA_ADDR_ALTERNATE: case INA_ADDR_WAVESHARE_UPS: @@ -369,4 +374,4 @@ TwoWire *ScanI2CTwoWire::fetchI2CBus(ScanI2C::DeviceAddress address) const size_t ScanI2CTwoWire::countDevices() const { return foundDevices.size(); -} +} \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 4a9fef5d08..f0564ea367 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -534,6 +534,7 @@ void setup() SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::RCWL9620, meshtastic_TelemetrySensorType_RCWL9620) SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::VEML7700, meshtastic_TelemetrySensorType_VEML7700) SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::SHT4X, meshtastic_TelemetrySensorType_SHT4X) + SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::AHT10, meshtastic_TelemetrySensorType_AHT10) i2cScanner.reset(); diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index a3f63b0aac..6d58460f49 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -18,6 +18,7 @@ #include // Sensors +#include "Sensor/AHT10.h" #include "Sensor/BME280Sensor.h" #include "Sensor/BME680Sensor.h" #include "Sensor/BMP085Sensor.h" @@ -41,6 +42,7 @@ SHT31Sensor sht31Sensor; VEML7700Sensor veml7700Sensor; SHT4XSensor sht4xSensor; RCWL9620Sensor rcwl9620Sensor; +AHT10Sensor aht10Sensor; #define FAILED_STATE_SENSOR_READ_MULTIPLIER 10 #define DISPLAY_RECEIVEID_MEASUREMENTS_ON_SCREEN true @@ -105,6 +107,8 @@ int32_t EnvironmentTelemetryModule::runOnce() result = veml7700Sensor.runOnce(); if (rcwl9620Sensor.hasSensor()) result = rcwl9620Sensor.runOnce(); + if (aht10Sensor.hasSensor()) + result = aht10Sensor.runOnce(); } return result; } else { @@ -291,6 +295,19 @@ bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly) valid = valid && rcwl9620Sensor.getMetrics(&m); hasSensor = true; } + if (aht10Sensor.hasSensor()) { + if (!bmp280Sensor.hasSensor()) { + valid = valid && aht10Sensor.getMetrics(&m); + hasSensor = true; + } else { + // prefer bmp280 temp if both sensors are present, fetch only humidity + meshtastic_Telemetry m_ahtx; + LOG_INFO("AHTX0+BMP280 module detected: using temp from BMP280 and humy from AHTX0\n"); + aht10Sensor.getMetrics(&m_ahtx); + m.variant.environment_metrics.relative_humidity = m_ahtx.variant.environment_metrics.relative_humidity; + } + } + valid = valid && hasSensor; if (valid) { diff --git a/src/modules/Telemetry/Sensor/AHT10.cpp b/src/modules/Telemetry/Sensor/AHT10.cpp new file mode 100644 index 0000000000..985515bb6a --- /dev/null +++ b/src/modules/Telemetry/Sensor/AHT10.cpp @@ -0,0 +1,35 @@ +#include "AHT10.h" +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" +#include "configuration.h" +#include +#include + +AHT10Sensor::AHT10Sensor() : TelemetrySensor(meshtastic_TelemetrySensorType_AHT10, "AHT10") {} + +int32_t AHT10Sensor::runOnce() +{ + LOG_INFO("Init sensor: %s\n", sensorName); + if (!hasSensor()) { + return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS; + } + aht10 = Adafruit_AHTX0(); + status = aht10.begin(nodeTelemetrySensorsMap[sensorType].second, 0, nodeTelemetrySensorsMap[sensorType].first); + + return initI2CSensor(); +} + +void AHT10Sensor::setup() {} + +bool AHT10Sensor::getMetrics(meshtastic_Telemetry *measurement) +{ + LOG_DEBUG("AHT10Sensor::getMetrics\n"); + + sensors_event_t humidity, temp; + aht10.getEvent(&humidity, &temp); + + measurement->variant.environment_metrics.temperature = temp.temperature; + measurement->variant.environment_metrics.relative_humidity = humidity.relative_humidity; + + return true; +} diff --git a/src/modules/Telemetry/Sensor/AHT10.h b/src/modules/Telemetry/Sensor/AHT10.h new file mode 100644 index 0000000000..b2b7b47f36 --- /dev/null +++ b/src/modules/Telemetry/Sensor/AHT10.h @@ -0,0 +1,17 @@ +#include "../mesh/generated/meshtastic/telemetry.pb.h" +#include "TelemetrySensor.h" +#include + +class AHT10Sensor : public TelemetrySensor +{ + private: + Adafruit_AHTX0 aht10; + + protected: + virtual void setup() override; + + public: + AHT10Sensor(); + virtual int32_t runOnce() override; + virtual bool getMetrics(meshtastic_Telemetry *measurement) override; +}; From 4fa2427b8cf91b0e68c2a724e57066a789bdc5de Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 31 May 2024 11:18:06 -0500 Subject: [PATCH 5/5] Trunk variants --- variants/heltec_v3/variant.h | 2 +- variants/heltec_wireless_tracker/variant.h | 13 +++++++------ variants/heltec_wireless_tracker_V1_0/variant.h | 2 +- variants/heltec_wsl_v3/variant.h | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/variants/heltec_v3/variant.h b/variants/heltec_v3/variant.h index 0c22ea1a74..2417b873d8 100644 --- a/variants/heltec_v3/variant.h +++ b/variants/heltec_v3/variant.h @@ -16,7 +16,7 @@ #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define ADC_CHANNEL ADC1_GPIO1_CHANNEL #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider -#define ADC_MULTIPLIER 4.9*1.045 +#define ADC_MULTIPLIER 4.9 * 1.045 #define USE_SX1262 diff --git a/variants/heltec_wireless_tracker/variant.h b/variants/heltec_wireless_tracker/variant.h index d496a8d6f4..f0ee0631d0 100644 --- a/variants/heltec_wireless_tracker/variant.h +++ b/variants/heltec_wireless_tracker/variant.h @@ -27,17 +27,17 @@ #define SCREEN_TRANSITION_FRAMERATE 3 // fps #define DISPLAY_FORCE_SMALL_FONTS - // pin 3 is Vext on v1.1 - HIGH enables LDO for Vext rail which goes to: - // GPS UC6580: GPS V_DET(8), VDD_IO(7), DCDC_IN(21), pulls up RESETN(17), D_SEL(33) and BOOT_MODE(34) through 10kR - // GPS LNA SW7125DE: VCC(4), pulls up SHDN(5) through 10kR - // LED: VDD, LEDA (through diode) +// pin 3 is Vext on v1.1 - HIGH enables LDO for Vext rail which goes to: +// GPS UC6580: GPS V_DET(8), VDD_IO(7), DCDC_IN(21), pulls up RESETN(17), D_SEL(33) and BOOT_MODE(34) through 10kR +// GPS LNA SW7125DE: VCC(4), pulls up SHDN(5) through 10kR +// LED: VDD, LEDA (through diode) #define VEXT_ENABLE_V05 3 // active HIGH - powers the GPS, GPS LNA and OLED VDD/anode #define BUTTON_PIN 0 #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define ADC_CHANNEL ADC1_GPIO1_CHANNEL #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider -#define ADC_MULTIPLIER 4.9*1.045 +#define ADC_MULTIPLIER 4.9 * 1.045 #define ADC_CTRL 2 // active HIGH, powers the voltage divider. Only on 1.1 #define ADC_CTRL_ENABLED HIGH @@ -47,7 +47,8 @@ #define GPS_TX_PIN 34 #define PIN_GPS_RESET 35 #define PIN_GPS_PPS 36 -// #define PIN_GPS_EN 3 // Uncomment to power off the GPS with triple-click on Tracker v1.1, though we'll also lose the display. +// #define PIN_GPS_EN 3 // Uncomment to power off the GPS with triple-click on Tracker v1.1, though we'll also lose the +// display. #define GPS_RESET_MODE LOW #define GPS_UC6580 diff --git a/variants/heltec_wireless_tracker_V1_0/variant.h b/variants/heltec_wireless_tracker_V1_0/variant.h index 2b521f249b..1b4751a576 100644 --- a/variants/heltec_wireless_tracker_V1_0/variant.h +++ b/variants/heltec_wireless_tracker_V1_0/variant.h @@ -34,7 +34,7 @@ #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define ADC_CHANNEL ADC1_GPIO1_CHANNEL #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider -#define ADC_MULTIPLIER 4.9*1.045 +#define ADC_MULTIPLIER 4.9 * 1.045 #undef GPS_RX_PIN #undef GPS_TX_PIN diff --git a/variants/heltec_wsl_v3/variant.h b/variants/heltec_wsl_v3/variant.h index 37cef09c6e..75cea538d0 100644 --- a/variants/heltec_wsl_v3/variant.h +++ b/variants/heltec_wsl_v3/variant.h @@ -11,7 +11,7 @@ #define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage #define ADC_CHANNEL ADC1_GPIO1_CHANNEL #define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider -#define ADC_MULTIPLIER 4.9*1.045 +#define ADC_MULTIPLIER 4.9 * 1.045 #define USE_SX1262