Compare commits

..

5 Commits

Author SHA1 Message Date
Ricardo Guzman (Richonguzman)
e6d44c1b7f replaced string for hash in 25segBuffer 2026-02-23 18:59:27 -03:00
Ricardo Guzman (Richonguzman)
d4fc99466f update digi2000 2026-02-23 18:07:26 -03:00
Ricardo Guzman (Richonguzman)
41f09af7b5 digipeater logic improved 2026-02-23 17:32:52 -03:00
Ricardo Guzman (Richonguzman)
0eec028c5d update SENSOR BUS 2026-02-23 12:00:55 -03:00
Ricardo Guzman (Richonguzman)
c48dd15bd6 better ADC and VEXT control 2026-02-23 11:14:42 -03:00
23 changed files with 185 additions and 187 deletions

View File

@@ -1,17 +1,17 @@
/* Copyright (C) 2025 Ricardo Guzman - CA2RXU
*
*
* This file is part of LoRa APRS iGate.
*
*
* LoRa APRS iGate is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* LoRa APRS iGate is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with LoRa APRS iGate. If not, see <https://www.gnu.org/licenses/>.
*/
@@ -37,8 +37,7 @@ namespace STATION_Utils {
void deleteNotHeard();
void updateLastHeard(const String& station);
bool wasHeard(const String& station);
void clean25SegBuffer();
bool check25SegBuffer(const String& station, const String& textMessage);
bool isIn25SegHashBuffer(const String& station, const String& textMessage);
void processOutputPacketBufferUltraEcoMode();
void processOutputPacketBuffer();
void addToOutputPacketBuffer(const String& packet, bool flag = false);

View File

@@ -188,7 +188,6 @@ void loop() {
}
if (Config.loramodule.txActive && (Config.digi.mode == 2 || Config.digi.mode == 3 || backupDigiMode)) { // If Digi enabled
STATION_Utils::clean25SegBuffer();
DIGI_Utils::processLoRaPacket(packet); // Send received packet to Digi
}

View File

@@ -1,17 +1,17 @@
/* Copyright (C) 2025 Ricardo Guzman - CA2RXU
*
*
* This file is part of LoRa APRS iGate.
*
*
* LoRa APRS iGate is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* LoRa APRS iGate is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with LoRa APRS iGate. If not, see <https://www.gnu.org/licenses/>.
*/
@@ -105,9 +105,9 @@ namespace BATTERY_Utils {
void getI2CVoltageSensorAddress() {
uint8_t err, addr;
for(addr = 1; addr < 0x7F; addr++) {
#if defined(HELTEC_V3) || defined(HELTEC_V3_2) || defined(HELTEC_WSL_V3) || defined(HELTEC_WSL_V3_DISPLAY)
Wire1.beginTransmission(addr);
err = Wire1.endTransmission();
#ifdef SENSOR_I2C_BUS
SENSOR_I2C_BUS.beginTransmission(addr);
err = SENSOR_I2C_BUS.endTransmission();
#else
Wire.beginTransmission(addr);
err = Wire.endTransmission();
@@ -145,7 +145,7 @@ namespace BATTERY_Utils {
}
}
float checkInternalVoltage() {
float checkInternalVoltage() {
#if defined(HAS_AXP192) || defined(HAS_AXP2101)
if(POWER_Utils::isBatteryConnected()) {
return POWER_Utils::getBatteryVoltage();
@@ -153,7 +153,7 @@ namespace BATTERY_Utils {
return 0.0;
}
#else
#ifdef ADC_CTRL
POWER_Utils::adc_ctrl_ON();
#endif
@@ -177,7 +177,7 @@ namespace BATTERY_Utils {
#endif
#endif
#endif
delay(3);
delay(3);
}
#ifdef ADC_CTRL
@@ -241,7 +241,7 @@ namespace BATTERY_Utils {
#else
extVoltage = ((((sampleSum/100.0)* adcReadingTransformation) + readingCorrection) * voltageDividerTransformation) - multiplyCorrection;
#endif
return extVoltage; // raw voltage without mapping
// return mapVoltage(voltage, 5.05, 6.32, 4.5, 5.5); // mapped voltage

View File

@@ -43,24 +43,29 @@ extern bool backupDigiMode;
namespace DIGI_Utils {
String buildPacket(const String& path, const String& packet, bool thirdParty, bool crossFreq) {
String stationCallsign = (Config.tacticalCallsign == "" ? Config.callsign : Config.tacticalCallsign);
if (!crossFreq) {
String packetToRepeat = packet.substring(0, packet.indexOf(",") + 1);
String tempPath = path;
int digiMode = Config.digi.mode;
String cleanPathAsterisks(String path) {
String terms[] = {",WIDE1*", ",WIDE2*", "*"};
for (String term : terms) {
int index = path.indexOf(term);
if (index != -1) path.remove(index, term.length()); // less memory than: tempPath.replace("*", "");
}
return path;
}
if (path.indexOf("WIDE1-1") != -1 && (digiMode == 2 || digiMode == 3)) {
String buildPacket(const String& path, const String& packet, bool thirdParty, bool crossFreq) {
String stationCallsign = (Config.tacticalCallsign == "" ? Config.callsign : Config.tacticalCallsign);
String suffix = thirdParty ? ":}" : ":";
int suffixIndex = packet.indexOf(suffix);
String packetToRepeat;
if (!crossFreq) {
int digiMode = Config.digi.mode;
String tempPath = path;
if (tempPath.indexOf("WIDE1-1") != -1 && (digiMode == 2 || digiMode == 3)) { // WIDE1-1 Digipeater
if (tempPath.indexOf("*") != -1 ) return ""; // "*" shouldn't be in WIDE1-1 (only) type of packet
tempPath.replace("WIDE1-1", stationCallsign + "*");
} else if (path.indexOf("WIDE2-") != -1 && digiMode == 3) {
int wide1AsteriskIndex = path.indexOf(",WIDE1*"); // less memory than: tempPath.replace(",WIDE1*", "");
if (wide1AsteriskIndex != -1) {
tempPath.remove(wide1AsteriskIndex, 7);
}
int asteriskIndex = path.indexOf("*"); // less memory than: tempPath.replace("*", "");
if (asteriskIndex != -1) {
tempPath.remove(asteriskIndex, 1);
}
} else if (tempPath.indexOf("WIDE2-") != -1 && digiMode == 3) { // WIDE2-n Digipeater
tempPath = cleanPathAsterisks(path);
if (path.indexOf("WIDE2-1") != -1) {
tempPath.replace("WIDE2-1", stationCallsign + "*");
} else if (path.indexOf("WIDE2-2") != -1) {
@@ -69,32 +74,22 @@ namespace DIGI_Utils {
return "";
}
}
packetToRepeat = packet.substring(0, packet.indexOf(",") + 1);
packetToRepeat += tempPath;
packetToRepeat += APRS_IS_Utils::checkForStartingBytes(packet.substring(packet.indexOf(thirdParty ? ":}" : ":")));
return packetToRepeat;
} else { // CrossFreq Digipeater
String suffix = thirdParty ? ":}" : ":";
int suffixIndex = packet.indexOf(suffix);
String packetToRepeat = packet.substring(0, suffixIndex);
String terms[] = {",WIDE1*", ",WIDE2*", "*"};
for (String term : terms) {
int index = packetToRepeat.indexOf(term);
if (index != -1) {
packetToRepeat.remove(index, term.length());
}
}
packetToRepeat = cleanPathAsterisks(packet.substring(0, suffixIndex));
if (packetToRepeat.indexOf(stationCallsign) != -1) return ""; // stationCallsign shouldn't be in path
packetToRepeat += ",";
packetToRepeat += stationCallsign;
packetToRepeat += "*";
packetToRepeat += APRS_IS_Utils::checkForStartingBytes(packet.substring(suffixIndex));
return packetToRepeat;
}
packetToRepeat += APRS_IS_Utils::checkForStartingBytes(packet.substring(suffixIndex));
return packetToRepeat;
}
String generateDigipeatedPacket(const String& packet, bool thirdParty){
String temp;
if (thirdParty) { // only header is used
if (thirdParty) { // only header is used
const String& header = packet.substring(0, packet.indexOf(":}"));
temp = header.substring(header.indexOf(">") + 1);
} else {
@@ -104,7 +99,7 @@ namespace DIGI_Utils {
int digiMode = Config.digi.mode;
bool crossFreq = abs(Config.loramodule.txFreq - Config.loramodule.rxFreq) >= 125000; // CrossFreq Digi
if (commaIndex > 2) { // Packet has "path"
if (commaIndex > 2) { // "path" found
const String& path = temp.substring(commaIndex + 1);
if (digiMode == 2 || backupDigiMode) {
bool hasWide = path.indexOf("WIDE1-1") != -1;
@@ -154,28 +149,28 @@ namespace DIGI_Utils {
if (Sender == stationCallsign) return; // Avoid listening to self packets
if (!thirdPartyPacket && Config.tacticalCallsign == "" && !Utils::callsignIsValid(Sender)) return; // No thirdParty + no tactical y no valid callsign
if (STATION_Utils::check25SegBuffer(Sender, temp.substring(temp.indexOf(":") + 2))) {
STATION_Utils::updateLastHeard(Sender);
Utils::typeOfPacket(temp, 2); // Digi
bool queryMessage = false;
int doubleColonIndex = temp.indexOf("::");
if (doubleColonIndex > 10) { // it's a message
String AddresseeAndMessage = temp.substring(doubleColonIndex + 2);
String Addressee = AddresseeAndMessage.substring(0, AddresseeAndMessage.indexOf(":"));
Addressee.trim();
if (Addressee == stationCallsign) { // it's a message for me!
queryMessage = APRS_IS_Utils::processReceivedLoRaMessage(Sender, AddresseeAndMessage, thirdPartyPacket);
}
}
if (!queryMessage) {
String loraPacket = generateDigipeatedPacket(packet.substring(3), thirdPartyPacket);
if (loraPacket != "") {
STATION_Utils::addToOutputPacketBuffer(loraPacket);
if (Config.digi.ecoMode != 1) displayToggle(true);
lastScreenOn = millis();
}
if (STATION_Utils::isIn25SegHashBuffer(Sender, temp.substring(temp.indexOf(":") + 2))) return;
STATION_Utils::updateLastHeard(Sender);
Utils::typeOfPacket(temp, 2); // Digi
bool queryMessage = false;
int doubleColonIndex = temp.indexOf("::");
if (doubleColonIndex > 10) { // it's a message
String AddresseeAndMessage = temp.substring(doubleColonIndex + 2);
String Addressee = AddresseeAndMessage.substring(0, AddresseeAndMessage.indexOf(":"));
Addressee.trim();
if (Addressee == stationCallsign) { // it's a message for me!
queryMessage = APRS_IS_Utils::processReceivedLoRaMessage(Sender, AddresseeAndMessage, thirdPartyPacket);
}
}
if (queryMessage) return; // answer should not be repeated.
String loraPacket = generateDigipeatedPacket(packet.substring(3), thirdPartyPacket);
if (loraPacket != "") {
STATION_Utils::addToOutputPacketBuffer(loraPacket);
if (Config.digi.ecoMode != 1) displayToggle(true);
lastScreenOn = millis();
}
}
}

View File

@@ -49,40 +49,23 @@ extern bool stationCallsignIsValid;
namespace POWER_Utils {
#ifdef VEXT_CTRL
void vext_ctrl_ON() {
#if VEXT_CTRL_INVERTED == 1
digitalWrite(VEXT_CTRL, Config.digi.ecoMode == 1 ? HIGH : LOW);
#else
digitalWrite(VEXT_CTRL, Config.digi.ecoMode == 1 ? LOW : HIGH);
#endif
}
void vext_ctrl_OFF() {
#if VEXT_CTRL_INVERTED == 1
digitalWrite(VEXT_CTRL, Config.digi.ecoMode == 1 ? LOW : HIGH);
#else
digitalWrite(VEXT_CTRL, Config.digi.ecoMode == 1 ? HIGH : LOW);
#endif
}
#endif
#ifdef ADC_CTRL
#ifdef ADC_CTRL_PIN
void adc_ctrl_ON() {
#if ADC_CTRL_INVERTED == 1
digitalWrite(ADC_CTRL, LOW);
#else
digitalWrite(ADC_CTRL, HIGH);
#endif
digitalWrite(ADC_CTRL_PIN, ADC_CTRL_ON_STATE);
}
void adc_ctrl_OFF() {
#if ADC_CTRL_INVERTED == 1
digitalWrite(ADC_CTRL, HIGH);
#else
digitalWrite(ADC_CTRL, LOW);
#endif
digitalWrite(ADC_CTRL_PIN, !ADC_CTRL_ON_STATE);
}
#endif
#ifdef VEXT_CTRL_PIN
void vext_ctrl_ON() {
digitalWrite(VEXT_CTRL_PIN, Config.digi.ecoMode == 1 ? !VEXT_CTRL_ON_STATE : VEXT_CTRL_ON_STATE);
}
void vext_ctrl_OFF() {
digitalWrite(VEXT_CTRL_PIN, Config.digi.ecoMode == 1 ? VEXT_CTRL_ON_STATE : !VEXT_CTRL_ON_STATE);
}
#endif
@@ -313,12 +296,8 @@ namespace POWER_Utils {
Wire.begin(OLED_SDA, OLED_SCL);
#endif
#ifdef USE_WIRE_WITH_BOARD_I2C_PINS
Wire.begin(BOARD_I2C_SDA, BOARD_I2C_SCL);
#endif
#ifdef USE_WIRE1_WITH_BOARD_I2C_PINS
Wire1.begin(BOARD_I2C_SDA, BOARD_I2C_SCL);
#ifdef SENSOR_I2C_BUS
SENSOR_I2C_BUS.begin(BOARD_I2C_SDA, BOARD_I2C_SCL);
#endif
delay(1000);

View File

@@ -1,17 +1,17 @@
/* Copyright (C) 2025 Ricardo Guzman - CA2RXU
*
*
* This file is part of LoRa APRS iGate.
*
*
* LoRa APRS iGate is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* LoRa APRS iGate is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with LoRa APRS iGate. If not, see <https://www.gnu.org/licenses/>.
*/
@@ -45,12 +45,10 @@ std::vector<OutputPacketBuffer> outputPacketBuffer;
struct Packet25SegBuffer {
uint32_t receivedTime;
String station;
String payload;
uint32_t hash;
};
std::vector<Packet25SegBuffer> packet25SegBuffer;
bool saveNewDigiEcoModeConfig = false;
bool packetIsBeacon = false;
@@ -166,18 +164,33 @@ namespace STATION_Utils {
return false;
}
void clean25SegBuffer() {
if (!packet25SegBuffer.empty() && (millis() - packet25SegBuffer[0].receivedTime) > 25 * 1000) packet25SegBuffer.erase(packet25SegBuffer.begin());
}
bool check25SegBuffer(const String& station, const String& textMessage) {
if (!packet25SegBuffer.empty()) {
for (int i = 0; i < packet25SegBuffer.size(); i++) {
if (packet25SegBuffer[i].station == station && packet25SegBuffer[i].payload == textMessage) return false;
void clean25SegHashBuffer() {
uint32_t currentTime = millis();
for (int i = packet25SegBuffer.size() - 1; i >= 0; i--) {
if ((currentTime - packet25SegBuffer[i].receivedTime) > 25 * 1000) {
packet25SegBuffer.erase(packet25SegBuffer.begin() + i);
}
}
packet25SegBuffer.emplace_back(Packet25SegBuffer{millis(), station, textMessage});
return true;
}
uint32_t makeHash(const String& station, const String& payload) { // DJB2 Hash
uint32_t h = 5381;
for (size_t i = 0; i < station.length(); i++)
h = ((h << 5) + h) + station[i];
for (size_t i = 0; i < payload.length(); i++)
h = ((h << 5) + h) + payload[i];
return h;
}
bool isIn25SegHashBuffer(const String& station, const String& textMessage) {
uint32_t newHash = makeHash(station, textMessage);
uint32_t currentTime = millis();
clean25SegHashBuffer();
for (int i = 0; i < packet25SegBuffer.size(); i++) {
if (packet25SegBuffer[i].hash == newHash) return true;
}
packet25SegBuffer.push_back({currentTime, newHash});
return false;
}
void processOutputPacketBufferUltraEcoMode() {

View File

@@ -61,9 +61,9 @@ namespace WX_Utils {
void getWxModuleAddres() {
uint8_t err, addr;
for(addr = 1; addr < 0x7F; addr++) {
#if defined(HELTEC_V3) || defined(HELTEC_V3_2) || defined(HELTEC_WSL_V3) || defined(HELTEC_WSL_V3_DISPLAY)
Wire1.beginTransmission(addr);
err = Wire1.endTransmission();
#ifdef SENSOR_I2C_BUS
SENSOR_I2C_BUS.beginTransmission(addr);
err = SENSOR_I2C_BUS.endTransmission();
#else
Wire.beginTransmission(addr);
#ifdef LIGHTGATEWAY_PLUS_1_0

View File

@@ -31,7 +31,7 @@
#define GPIO_WAKEUP_PIN GPIO_SEL_38
// I2C
#define USE_WIRE_WITH_BOARD_I2C_PINS
#define SENSOR_I2C_BUS Wire
#define BOARD_I2C_SDA 11
#define BOARD_I2C_SCL 12

View File

@@ -39,8 +39,8 @@
#define INTERNAL_LED_PIN 48
// I2C
#define USE_WIRE_WITH_OLED_PINS
#define OLED_SDA 5
#define OLED_SCL 6
#define SENSOR_I2C_BUS Wire
#define BOARD_I2C_SDA 5
#define BOARD_I2C_SCL 6
#endif

View File

@@ -48,7 +48,8 @@
// Aditional Config
#define INTERNAL_LED_PIN 25
#define BATTERY_PIN 37
#define ADC_CTRL 21
#define ADC_CTRL_INVERTED 1
#define ADC_CTRL_PIN 21
#define ADC_CTRL_ON_STATE LOW
#endif

View File

@@ -48,7 +48,8 @@
// Aditional Config
#define INTERNAL_LED_PIN 25
#define BATTERY_PIN 37
#define ADC_CTRL 21
#define ADC_CTRL_INVERTED 1
#define ADC_CTRL_ON_STATE LOW
#endif

View File

@@ -33,7 +33,7 @@
#define GPIO_WAKEUP_PIN GPIO_SEL_14
// I2C
#define USE_WIRE1_WITH_BOARD_I2C_PINS
#define SENSOR_I2C_BUS Wire1
#define BOARD_I2C_SDA 39
#define BOARD_I2C_SCL 38
@@ -50,9 +50,10 @@
// Aditional Config
#define INTERNAL_LED_PIN 45
#define BATTERY_PIN 7
#define ADC_CTRL 46
#define ADC_CTRL_INVERTED 0
#define VEXT_CTRL 18
#define VEXT_CTRL_INVERTED 0
#define ADC_CTRL_PIN 46
#define ADC_CTRL_ON_STATE HIGH
#define VEXT_CTRL_PIN 18
#define VEXT_CTRL_ON_STATE HIGH
#endif

View File

@@ -34,7 +34,7 @@
// I2C
#define USE_WIRE_WITH_OLED_PINS
#define USE_WIRE1_WITH_BOARD_I2C_PINS
#define SENSOR_I2C_BUS Wire1
#define BOARD_I2C_SDA 41
#define BOARD_I2C_SCL 42
@@ -53,9 +53,10 @@
// Aditional Config
#define INTERNAL_LED_PIN 35
#define BATTERY_PIN 1
#define VEXT_CTRL 36
#define VEXT_CTRL_INVERTED 0
#define ADC_CTRL 37
#define ADC_CTRL_INVERTED 1
#define ADC_CTRL_PIN 37
#define ADC_CTRL_ON_STATE LOW
#define VEXT_CTRL_PIN 36
#define VEXT_CTRL_ON_STATE HIGH
#endif

View File

@@ -34,7 +34,7 @@
// I2C
#define USE_WIRE_WITH_OLED_PINS
#define USE_WIRE1_WITH_BOARD_I2C_PINS
#define SENSOR_I2C_BUS Wire1
#define BOARD_I2C_SDA 41
#define BOARD_I2C_SCL 42
@@ -53,9 +53,10 @@
// Aditional Config
#define INTERNAL_LED_PIN 35
#define BATTERY_PIN 1
#define VEXT_CTRL 36
#define VEXT_CTRL_INVERTED 1
#define ADC_CTRL 37
#define ADC_CTRL_INVERTED 0
#define ADC_CTRL_PIN 37
#define ADC_CTRL_ON_STATE HIGH
#define VEXT_CTRL_PIN 36
#define VEXT_CTRL_ON_STATE LOW
#endif

View File

@@ -34,7 +34,7 @@
// I2C
#define USE_WIRE_WITH_OLED_PINS
#define USE_WIRE1_WITH_BOARD_I2C_PINS
#define SENSOR_I2C_BUS Wire1
#define BOARD_I2C_SDA 41
#define BOARD_I2C_SCL 42
@@ -53,10 +53,11 @@
// Aditional Config
#define INTERNAL_LED_PIN 35
#define BATTERY_PIN 1
#define VEXT_CTRL 36
#define VEXT_CTRL_INVERTED 1
#define ADC_CTRL 37
#define ADC_CTRL_INVERTED 0
#define ADC_CTRL_PIN 37
#define ADC_CTRL_ON_STATE HIGH
#define VEXT_CTRL_PIN 36
#define VEXT_CTRL_ON_STATE LOW
// GPS ??
#define VGNS_CTRL 34 // cambiar nombre para prender GPS ?

View File

@@ -33,7 +33,7 @@
#define GPIO_WAKEUP_PIN GPIO_SEL_14
// I2C
#define USE_WIRE1_WITH_BOARD_I2C_PINS
#define SENSOR_I2C_BUS Wire1
#define BOARD_I2C_SDA 37
#define BOARD_I2C_SCL 36
@@ -50,9 +50,10 @@
// Aditional Config
#define INTERNAL_LED_PIN 18
#define BATTERY_PIN 20
#define ADC_CTRL 19
#define ADC_CTRL_INVERTED 1
#define VEXT_CTRL 45
#define VEXT_CTRL_INVERTED 1
#define ADC_CTRL_PIN 19
#define ADC_CTRL_ON_STATE LOW
#define VEXT_CTRL_PIN 45
#define VEXT_CTRL_ON_STATE LOW
#endif

View File

@@ -33,7 +33,7 @@
#define GPIO_WAKEUP_PIN GPIO_SEL_14
// I2C
#define USE_WIRE1_WITH_BOARD_I2C_PINS
#define SENSOR_I2C_BUS Wire1
#define BOARD_I2C_SDA 37
#define BOARD_I2C_SCL 36
@@ -50,9 +50,10 @@
// Aditional Config
#define INTERNAL_LED_PIN 18
#define BATTERY_PIN 20
#define ADC_CTRL 19
#define ADC_CTRL_INVERTED 1
#define VEXT_CTRL 45
#define VEXT_CTRL_INVERTED 1
#define ADC_CTRL_PIN 19
#define ADC_CTRL_ON_STATE LOW
#define VEXT_CTRL_PIN 45
#define VEXT_CTRL_ON_STATE LOW
#endif

View File

@@ -50,9 +50,11 @@
// Aditional Config
#define INTERNAL_LED_PIN 35
#define BATTERY_PIN 1
#define ADC_CTRL 37
#define VEXT_CTRL 36
#define VEXT_CTRL_INVERTED 1
#define ADC_CTRL_PIN 37
#define ADC_CTRL_ON_STATE LOW
#define VEXT_CTRL_PIN 36
#define VEXT_CTRL_ON_STATE LOW
#define BOARD_I2C_SDA 41
#define BOARD_I2C_SCL 42

View File

@@ -33,16 +33,17 @@
#define GPIO_WAKEUP_PIN GPIO_SEL_14
// I2C
#define USE_WIRE1_WITH_BOARD_I2C_PINS
#define SENSOR_I2C_BUS Wire1
#define BOARD_I2C_SDA 41
#define BOARD_I2C_SCL 42
// Aditional Config
#define INTERNAL_LED_PIN 35
#define BATTERY_PIN 1
#define ADC_CTRL 37
#define ADC_CTRL_INVERTED 1
#define VEXT_CTRL 36
#define VEXT_CTRL_INVERTED 1
#define ADC_CTRL_PIN 37
#define ADC_CTRL_ON_STATE LOW
#define VEXT_CTRL_PIN 36
#define VEXT_CTRL_ON_STATE LOW
#endif

View File

@@ -33,7 +33,7 @@
#define GPIO_WAKEUP_PIN GPIO_SEL_14
// I2C
#define USE_WIRE1_WITH_BOARD_I2C_PINS
#define SENSOR_I2C_BUS Wire1
#define BOARD_I2C_SDA 41
#define BOARD_I2C_SCL 42
@@ -44,9 +44,10 @@
// Aditional Config
#define INTERNAL_LED_PIN 35
#define BATTERY_PIN 1
#define ADC_CTRL 37
#define ADC_CTRL_INVERTED 1
#define VEXT_CTRL 36
#define VEXT_CTRL_INVERTED 1
#define ADC_CTRL_PIN 37
#define ADC_CTRL_ON_STATE LOW
#define VEXT_CTRL_PIN 36
#define VEXT_CTRL_ON_STATE LOW
#endif

View File

@@ -33,7 +33,7 @@
#define GPIO_WAKEUP_PIN GPIO_SEL_14
// I2C
#define USE_WIRE_WITH_BOARD_I2C_PINS
#define SENSOR_I2C_BUS Wire
#define BOARD_I2C_SDA 7
#define BOARD_I2C_SCL 6
@@ -44,10 +44,11 @@
// Aditional Config
#define INTERNAL_LED_PIN 18
#define BATTERY_PIN 1
#define VEXT_CTRL 3 // To turn on GPS and TFT
#define VEXT_CTRL_INVERTED 0
#define ADC_CTRL 2 // HELTEC Wireless Tracker ADC_CTRL = HIGH powers the voltage divider to read BatteryPin. Only on V05 = V1.1
#define ADC_CTRL_INVERTED 0
#define ADC_CTRL_PIN 2 // HELTEC Wireless Tracker ADC_CTRL = HIGH powers the voltage divider to read BatteryPin. Only on V05 = V1.1
#define ADC_CTRL_ON_STATE HIGH
#define VEXT_CTRL_PIN 3 // To turn on GPS and TFT
#define VEXT_CTRL_ON_STATE HIGH
// GPS
#define HAS_GPS

View File

@@ -33,7 +33,7 @@
#define GPIO_WAKEUP_PIN GPIO_SEL_45
// I2C
#define USE_WIRE_WITH_BOARD_I2C_PINS
#define SENSOR_I2C_BUS Wire
#define BOARD_I2C_SDA 18
#define BOARD_I2C_SCL 8

View File

@@ -33,7 +33,7 @@
#define GPIO_WAKEUP_PIN GPIO_SEL_45
// I2C
#define USE_WIRE_WITH_BOARD_I2C_PINS
#define SENSOR_I2C_BUS Wire
#define BOARD_I2C_SDA 18
#define BOARD_I2C_SCL 8