Merge pull request #723 from recrof/heltec_t114_refactor

tidy up heltec_t114 variant
This commit is contained in:
ripplebiz
2025-09-04 13:52:23 +10:00
committed by GitHub
7 changed files with 27 additions and 42 deletions

View File

@@ -1,19 +1,17 @@
#include <Arduino.h>
#include "T114Board.h"
#include <bluefruit.h>
#include <Arduino.h>
#include <Wire.h>
#include <bluefruit.h>
static BLEDfu bledfu;
static void connect_callback(uint16_t conn_handle)
{
static void connect_callback(uint16_t conn_handle) {
(void)conn_handle;
MESH_DEBUG_PRINTLN("BLE client connected");
}
static void disconnect_callback(uint16_t conn_handle, uint8_t reason)
{
static void disconnect_callback(uint16_t conn_handle, uint8_t reason) {
(void)conn_handle;
(void)reason;
@@ -60,7 +58,7 @@ void T114Board::begin() {
// Disable unused analog peripherals
// SAADC channels - only keep what's needed for battery monitoring
NRF_SAADC->ENABLE = 0; // Re-enable only when needed for measurements
NRF_SAADC->ENABLE = 0; // Re-enable only when needed for measurements
// COMP - Comparator not used
NRF_COMP->ENABLE = 0;
@@ -78,10 +76,10 @@ void T114Board::begin() {
pinMode(SX126X_POWER_EN, OUTPUT);
digitalWrite(SX126X_POWER_EN, HIGH);
delay(10); // give sx1262 some time to power up
delay(10); // give sx1262 some time to power up
}
bool T114Board::startOTAUpdate(const char* id, char reply[]) {
bool T114Board::startOTAUpdate(const char *id, char reply[]) {
// Config the peripheral connection with maximum bandwidth
// more SRAM required by SoftDevice
// Note: All config***() function must be called before begin()

View File

@@ -3,19 +3,6 @@
#include <MeshCore.h>
#include <Arduino.h>
// LoRa radio module pins for Heltec T114
#define P_LORA_DIO_1 20
#define P_LORA_NSS 24
#define P_LORA_RESET 25
#define P_LORA_BUSY 17
#define P_LORA_SCLK 19
#define P_LORA_MISO 23
#define P_LORA_MOSI 22
#define SX126X_POWER_EN 37
#define SX126X_DIO2_AS_RF_SWITCH true
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
// built-ins
#define PIN_VBAT_READ 4
#define PIN_BAT_CTL 6

View File

@@ -1,40 +1,40 @@
[nrf52840_t114]
extends = nrf52_base
platform_packages = framework-arduinoadafruitnrf52
build_flags = ${nrf52_base.build_flags}
-I src/helpers/nrf52
-I lib/nrf52/s140_nrf52_6.1.1_API/include
-I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52
lib_deps =
${nrf52_base.lib_deps}
rweather/Crypto @ ^0.4.0
[Heltec_t114]
extends = nrf52840_t114
extends = nrf52_base
board = heltec_t114
board_build.ldscript = boards/nrf52840_s140_v6.ld
build_flags = ${nrf52840_t114.build_flags}
-I variants/t114
build_flags = ${nrf52_base.build_flags}
-I lib/nrf52/s140_nrf52_6.1.1_API/include
-I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52
-I variants/heltec_t114
-I src/helpers/ui
-DHELTEC_T114
-D HELTEC_T114
-D P_LORA_DIO_1=20
-D P_LORA_NSS=24
-D P_LORA_RESET=25
-D P_LORA_BUSY=17
-D P_LORA_SCLK=19
-D P_LORA_MISO=23
-D P_LORA_MOSI=22
-D P_LORA_TX_LED=35
-D RADIO_CLASS=CustomSX1262
-D WRAPPER_CLASS=CustomSX1262Wrapper
-D LORA_TX_POWER=22
-D SX126X_POWER_EN=37
-D SX126X_DIO2_AS_RF_SWITCH=true
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
-D SX126X_CURRENT_LIMIT=140
-D SX126X_RX_BOOSTED_GAIN=1
-D ST7789
-D DISPLAY_CLASS=ST7789Display
build_src_filter = ${nrf52840_t114.build_src_filter}
build_src_filter = ${nrf52_base.build_src_filter}
+<helpers/*.cpp>
+<helpers/nrf52/T114Board.cpp>
+<../variants/t114>
+<../variants/heltec_t114>
+<helpers/ui/ST7789Display.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<helpers/ui/OLEDDisplay.cpp>
+<helpers/ui/OLEDDisplayFonts.cpp>
lib_deps =
${nrf52840_t114.lib_deps}
${nrf52_base.lib_deps}
stevemarple/MicroNMEA @ ^2.0.6
adafruit/Adafruit GFX Library @ ^1.12.1
debug_tool = jlink

View File

@@ -3,7 +3,7 @@
#define RADIOLIB_STATIC_ONLY 1
#include <RadioLib.h>
#include <helpers/radiolib/RadioLibWrappers.h>
#include <helpers/nrf52/T114Board.h>
#include <T114Board.h>
#include <helpers/radiolib/CustomSX1262Wrapper.h>
#include <helpers/AutoDiscoverRTCClock.h>
#include <helpers/SensorManager.h>