From c4a2b139308ecd3a03028fb2083a159311624b2e Mon Sep 17 00:00:00 2001 From: recrof Date: Sat, 11 Oct 2025 21:52:48 +0200 Subject: [PATCH] moved HeltecV3Board.h to variant folder --- .../heltec_v3}/HeltecV3Board.h | 18 +++--------------- variants/heltec_v3/platformio.ini | 7 +++++++ variants/heltec_v3/target.h | 2 +- 3 files changed, 11 insertions(+), 16 deletions(-) rename {src/helpers => variants/heltec_v3}/HeltecV3Board.h (88%) diff --git a/src/helpers/HeltecV3Board.h b/variants/heltec_v3/HeltecV3Board.h similarity index 88% rename from src/helpers/HeltecV3Board.h rename to variants/heltec_v3/HeltecV3Board.h index c63ed2d8..afdaf639 100644 --- a/src/helpers/HeltecV3Board.h +++ b/variants/heltec_v3/HeltecV3Board.h @@ -2,16 +2,7 @@ #include #include - -// LoRa radio module pins for Heltec V3 -// Also for Heltec Wireless Tracker/Paper -#define P_LORA_DIO_1 14 -#define P_LORA_NSS 8 -#define P_LORA_RESET RADIOLIB_NC -#define P_LORA_BUSY 13 -#define P_LORA_SCLK 9 -#define P_LORA_MISO 11 -#define P_LORA_MOSI 10 +#include // built-ins #ifndef PIN_VBAT_READ // set in platformio.ini for boards like Heltec Wireless Paper (20) @@ -22,9 +13,6 @@ #endif #define PIN_ADC_CTRL_ACTIVE LOW #define PIN_ADC_CTRL_INACTIVE HIGH -//#define PIN_LED_BUILTIN 35 - -#include "ESP32Board.h" #include @@ -43,7 +31,7 @@ public: // Auto-detect correct ADC_CTRL pin polarity (different for boards >3.2) pinMode(PIN_ADC_CTRL, INPUT); adc_active_state = !digitalRead(PIN_ADC_CTRL); - + pinMode(PIN_ADC_CTRL, OUTPUT); digitalWrite(PIN_ADC_CTRL, !adc_active_state); // Initially inactive @@ -64,7 +52,7 @@ public: void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1) { esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); - // Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep + // Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep rtc_gpio_set_direction((gpio_num_t)P_LORA_DIO_1, RTC_GPIO_MODE_INPUT_ONLY); rtc_gpio_pulldown_en((gpio_num_t)P_LORA_DIO_1); diff --git a/variants/heltec_v3/platformio.ini b/variants/heltec_v3/platformio.ini index b43c0870..dcf566b3 100644 --- a/variants/heltec_v3/platformio.ini +++ b/variants/heltec_v3/platformio.ini @@ -7,6 +7,13 @@ build_flags = -I variants/heltec_v3 -D HELTEC_LORA_V3 -D ESP32_CPU_FREQ=80 + -D P_LORA_DIO_1=14 + -D P_LORA_NSS=8 + -D P_LORA_RESET=RADIOLIB_NC + -D P_LORA_BUSY=13 + -D P_LORA_SCLK=9 + -D P_LORA_MISO=11 + -D P_LORA_MOSI=10 -D RADIO_CLASS=CustomSX1262 -D WRAPPER_CLASS=CustomSX1262Wrapper -D LORA_TX_POWER=22 diff --git a/variants/heltec_v3/target.h b/variants/heltec_v3/target.h index b2125664..739aecfe 100644 --- a/variants/heltec_v3/target.h +++ b/variants/heltec_v3/target.h @@ -3,7 +3,7 @@ #define RADIOLIB_STATIC_ONLY 1 #include #include -#include +#include #include #include #include