Skip to content

Commit a222578

Browse files
authored
Merge pull request #921 from recrof/heltec_v2_cleanup
heltec v2 cleanup
2 parents ebf4599 + 1979517 commit a222578

File tree

3 files changed

+37
-17
lines changed

3 files changed

+37
-17
lines changed
Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
#pragma once
22

33
#include <Arduino.h>
4-
5-
// LoRa radio module pins for Heltec V2
6-
#define P_LORA_DIO_1 26 // DIO0
7-
#define P_LORA_NSS 18
8-
#define P_LORA_RESET RADIOLIB_NC // 14
9-
#define P_LORA_BUSY RADIOLIB_NC
10-
#define P_LORA_SCLK 5
11-
#define P_LORA_MISO 19
12-
#define P_LORA_MOSI 27
4+
#include <helpers/ESP32Board.h>
135

146
// built-ins
157
#define PIN_VBAT_READ 37
168
#define PIN_LED_BUILTIN 25
179

18-
#include "ESP32Board.h"
19-
2010
#include <driver/rtc_io.h>
2111

2212
class HeltecV2Board : public ESP32Board {
@@ -39,7 +29,7 @@ class HeltecV2Board : public ESP32Board {
3929
void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1) {
4030
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
4131

42-
// Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep
32+
// Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep
4333
rtc_gpio_set_direction((gpio_num_t)P_LORA_DIO_1, RTC_GPIO_MODE_INPUT_ONLY);
4434
rtc_gpio_pulldown_en((gpio_num_t)P_LORA_DIO_1);
4535

variants/heltec_v2/platformio.ini

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@ build_flags =
77
-D HELTEC_LORA_V2
88
-D RADIO_CLASS=CustomSX1276
99
-D WRAPPER_CLASS=CustomSX1276Wrapper
10+
-D P_LORA_DIO_1=26
11+
-D P_LORA_NSS=18
12+
-D P_LORA_RESET=RADIOLIB_NC
13+
-D P_LORA_BUSY=RADIOLIB_NC
14+
-D P_LORA_SCLK=5
15+
-D P_LORA_MISO=19
16+
-D P_LORA_MOSI=27
17+
-D P_LORA_TX_LED=25
1018
-D SX127X_CURRENT_LIMIT=120
1119
-D LORA_TX_POWER=20
1220
-D PIN_BOARD_SDA=4
1321
-D PIN_BOARD_SCL=15
1422
-D PIN_USER_BTN=0
1523
-D PIN_OLED_RESET=16
16-
-D P_LORA_TX_LED=25
1724
build_src_filter = ${esp32_base.build_src_filter}
1825
+<../variants/heltec_v2>
1926
lib_deps =
@@ -112,7 +119,7 @@ lib_deps =
112119
extends = Heltec_lora32_v2
113120
build_flags =
114121
${Heltec_lora32_v2.build_flags}
115-
-D MAX_CONTACTS=170
122+
-D MAX_CONTACTS=160
116123
-D MAX_GROUP_CHANNELS=1
117124
; -D MESH_PACKET_LOGGING=1
118125
; -D MESH_DEBUG=1
@@ -128,7 +135,7 @@ build_flags =
128135
${Heltec_lora32_v2.build_flags}
129136
-I examples/companion_radio/ui-new
130137
-D DISPLAY_CLASS=SSD1306Display
131-
-D MAX_CONTACTS=170
138+
-D MAX_CONTACTS=160
132139
-D MAX_GROUP_CHANNELS=8
133140
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
134141
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
@@ -148,7 +155,7 @@ build_flags =
148155
${Heltec_lora32_v2.build_flags}
149156
-I examples/companion_radio/ui-new
150157
-D DISPLAY_CLASS=SSD1306Display
151-
-D MAX_CONTACTS=170
158+
-D MAX_CONTACTS=160
152159
-D MAX_GROUP_CHANNELS=8
153160
-D BLE_PIN_CODE=123456
154161
-D BLE_DEBUG_LOGGING=1
@@ -164,3 +171,26 @@ build_src_filter = ${Heltec_lora32_v2.build_src_filter}
164171
lib_deps =
165172
${Heltec_lora32_v2.lib_deps}
166173
densaugeo/base64 @ ~1.4.0
174+
175+
[env:Heltec_v2_companion_radio_wifi]
176+
extends = Heltec_lora32_v2
177+
build_flags =
178+
${Heltec_lora32_v2.build_flags}
179+
-I examples/companion_radio/ui-new
180+
-D DISPLAY_CLASS=SSD1306Display
181+
-D MAX_CONTACTS=160
182+
-D MAX_GROUP_CHANNELS=8
183+
-D WIFI_DEBUG_LOGGING=1
184+
-D WIFI_SSID='"myssid"'
185+
-D WIFI_PWD='"mypwd"'
186+
; -D MESH_PACKET_LOGGING=1
187+
; -D MESH_DEBUG=1
188+
build_src_filter = ${Heltec_lora32_v2.build_src_filter}
189+
+<helpers/esp32/*.cpp>
190+
+<helpers/ui/SSD1306Display.cpp>
191+
+<helpers/ui/MomentaryButton.cpp>
192+
+<../examples/companion_radio/*.cpp>
193+
+<../examples/companion_radio/ui-new/*.cpp>
194+
lib_deps =
195+
${Heltec_lora32_v2.lib_deps}
196+
densaugeo/base64 @ ~1.4.0

variants/heltec_v2/target.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#define RADIOLIB_STATIC_ONLY 1
44
#include <RadioLib.h>
55
#include <helpers/radiolib/RadioLibWrappers.h>
6-
#include <helpers/HeltecV2Board.h>
6+
#include <HeltecV2Board.h>
77
#include <helpers/radiolib/CustomSX1276Wrapper.h>
88
#include <helpers/AutoDiscoverRTCClock.h>
99
#include <helpers/SensorManager.h>

0 commit comments

Comments
 (0)