mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-03-30 21:25:46 +00:00
* some HT-CT62 fixes
This commit is contained in:
33
variants/heltec_ct62/HT-CT62Board.h
Normal file
33
variants/heltec_ct62/HT-CT62Board.h
Normal 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
|
||||
@@ -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}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
Reference in New Issue
Block a user