* some HT-CT62 fixes

This commit is contained in:
Scott Powell
2025-06-09 17:34:04 +10:00
parent c5869c78a2
commit c6f6e088fc
4 changed files with 43 additions and 13 deletions

View File

@@ -0,0 +1,33 @@
#pragma once
#include <MeshCore.h>
#include <Arduino.h>
#if defined(ESP_PLATFORM)
#include <helpers/ESP32Board.h>
class Heltec_CT62_Board : public ESP32Board {
public:
uint16_t getBattMilliVolts() override {
#ifdef PIN_VBAT_READ
analogReadResolution(12); // ESP32-C3 ADC is 12-bit - 3.3/4096 (ref voltage/max counts)
uint32_t raw = 0;
for (int i = 0; i < 8; i++) {
raw += analogRead(PIN_VBAT_READ);
}
raw = raw / 8;
return ((6.52 * raw) / 1024.0) * 1000;
#else
return 0; // not supported
#endif
}
const char* getManufacturerName() const override {
return "Heltec CT62";
}
};
#endif

View File

@@ -12,12 +12,13 @@ build_flags =
-D P_LORA_TX_LED=18
-D PIN_BOARD_SDA=0
-D PIN_BOARD_SCL=1
-D PIN_USER_BTN=9
;-D PIN_USER_BTN=9
-D PIN_VBAT_READ=2
-D P_LORA_DIO_1=3
-D P_LORA_NSS=8
-D P_LORA_RESET=5
-D P_LORA_RESET=RADIOLIB_NC
-D P_LORA_DIO_0=RADIOLIB_NC
-D P_LORA_DIO_2=RADIOLIB_NC
-D P_LORA_BUSY=4
-D P_LORA_SCLK=10
-D P_LORA_MISO=6
@@ -80,6 +81,7 @@ build_flags =
; -D MESH_DEBUG=1
build_src_filter = ${Heltec_ct62.build_src_filter}
+<../examples/companion_radio>
+<helpers/esp32/SerialBLEInterface.cpp>
lib_deps =
${Heltec_ct62.lib_deps}
${esp32_ota.lib_deps}

View File

@@ -1,14 +1,9 @@
#include <Arduino.h>
#include "target.h"
ESP32Board board;
#if defined(P_LORA_SCLK)
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY);
#else
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY);
#endif
Heltec_CT62_Board board;
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY);
WRAPPER_CLASS radio_driver(radio, board);
ESP32RTCClock fallback_clock;
@@ -72,4 +67,4 @@ void radio_set_tx_power(uint8_t dbm) {
mesh::LocalIdentity radio_new_identity() {
RadioNoiseListener rng(radio);
return mesh::LocalIdentity(&rng); // create new random identity
}
}

View File

@@ -3,12 +3,12 @@
#define RADIOLIB_STATIC_ONLY 1
#include <RadioLib.h>
#include <helpers/RadioLibWrappers.h>
#include <helpers/ESP32Board.h>
#include "HT-CT62Board.h"
#include <helpers/CustomSX1262Wrapper.h>
#include <helpers/AutoDiscoverRTCClock.h>
#include <helpers/SensorManager.h>
extern ESP32Board board;
extern Heltec_CT62_Board board;
extern WRAPPER_CLASS radio_driver;
extern AutoDiscoverRTCClock rtc_clock;
extern SensorManager sensors;
@@ -17,4 +17,4 @@ bool radio_init();
uint32_t radio_get_rng_seed();
void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr);
void radio_set_tx_power(uint8_t dbm);
mesh::LocalIdentity radio_new_identity();
mesh::LocalIdentity radio_new_identity();