Skip to content

Commit

Permalink
Merge branch 'main' into issue_56_auto_power_off
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/LoRa_APRS_Tracker.cpp
  • Loading branch information
valentintintin committed Apr 4, 2024
2 parents d40f17b + 9c8333a commit a718ddb
Show file tree
Hide file tree
Showing 16 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -34,7 +34,7 @@ ____________________________________________________

# WIKI (English / Español en camino...)

### 0. FAQ: Frequently Asked Question --> <a href="https://github.com/richonguzman/LoRa_APRS_Tracker/wiki/00.-FAQ:-frequently-asked-question-%E2%80%90-preguntas-frecuentes-respondidas" target="_blank">here</a>
### Supported Boards and buying links --> <a href="https://github.com/richonguzman/LoRa_APRS_Tracker/wiki/Z.-------Supported-Boards-and-Buying-Links" target="_blank">here</a>

### 1. Installation Guide --> <a href="https://github.com/richonguzman/LoRa_APRS_Tracker/wiki/01.-Installation-Guide-%23-Guia-de-Instalacion" target="_blank">here</a>

Expand Down
26 changes: 13 additions & 13 deletions src/LoRa_APRS_Tracker.cpp
@@ -1,15 +1,15 @@
/*__________________________________________________________________________________________________________________________________
██╗ ██████╗ ██████╗ █████╗ █████╗ ██████╗ ██████╗ ███████╗ ████████╗██████╗ █████╗ ██████╗██╗ ██╗███████╗██████╗
██╗ ██████╗ ██████╗ █████╗ █████╗ ██████╗ ██████╗ ███████╗ ████████╗██████╗ █████╗ ██████╗██╗ ██╗███████╗██████╗
██║ ██╔═══██╗██╔══██╗██╔══██╗ ██╔══██╗██╔══██╗██╔══██╗██╔════╝ ╚══██╔══╝██╔══██╗██╔══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
██║ ██║ ██║██████╔╝███████║ ███████║██████╔╝██████╔╝███████╗ ██║ ██████╔╝███████║██║ █████╔╝ █████╗ ██████╔╝
██║ ██║ ██║██╔══██╗██╔══██║ ██╔══██║██╔═══╝ ██╔══██╗╚════██║ ██║ ██╔══██╗██╔══██║██║ ██╔═██╗ ██╔══╝ ██╔══██╗
███████╗╚██████╔╝██║ ██║██║ ██║ ██║ ██║██║ ██║ ██║███████║ ██║ ██║ ██║██║ ██║╚██████╗██║ ██╗███████╗██║ ██║
╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
Ricardo Guzman - CA2RXU
Ricardo Guzman - CA2RXU
https://github.com/richonguzman/LoRa_APRS_Tracker
(donations : http://paypal.me/richonguzman)
(donations : http://paypal.me/richonguzman)
__________________________________________________________________________________________________________________________________*/

#include <BluetoothSerial.h>
Expand Down Expand Up @@ -49,12 +49,12 @@ BluetoothSerial SerialBT;
OneButton userButton = OneButton(BUTTON_PIN, true, true);
#endif

String versionDate = "2024.03.22-F4HVV";
String versionDate = "2024.03.28-F4HVV";

int myBeaconsIndex = 0;
uint8_t myBeaconsIndex = 0;
int myBeaconsSize = Config.beacons.size();
Beacon *currentBeacon = &Config.beacons[myBeaconsIndex];
int loraIndex = 0;
uint8_t loraIndex = 0;
int loraIndexSize = Config.loraTypes.size();
LoraType *currentLoRaType = &Config.loraTypes[loraIndex];

Expand All @@ -71,7 +71,7 @@ uint32_t displayTime = millis();
uint32_t refreshDisplayTime = millis();

bool sendUpdate = true;
int updateCounter = Config.sendCommentAfterXBeacons;
uint8_t updateCounter = Config.sendCommentAfterXBeacons;
bool sendStandingUpdate = false;
bool statusState = true;
uint32_t statusTime = millis();
Expand All @@ -82,7 +82,7 @@ String BLEToLoRaPacket = "";

bool messageLed = false;
uint32_t messageLedTime = millis();
int lowBatteryPercent = 21;
uint8_t lowBatteryPercent = 21;

uint32_t lastTelemetryTx = millis();
uint32_t telemetryTx = millis();
Expand All @@ -101,7 +101,7 @@ bool symbolAvailable = true;

uint32_t bmeLastReading = -60000;

int screenBrightness = 1;
uint8_t screenBrightness = 1;
bool keyboardConnected = false;
bool keyDetected = false;
uint32_t keyboardTime = millis();
Expand All @@ -120,7 +120,7 @@ bool smartBeaconValue = true;
int ackNumberSend;
uint32_t ackTime = millis();

int winlinkStatus = 0;
uint8_t winlinkStatus = 0;
String winlinkMailNumber = "_?";
String winlinkAddressee = "";
String winlinkSubject = "";
Expand Down Expand Up @@ -152,7 +152,7 @@ void setup() {
if (Config.notification.ledTx) pinMode(Config.notification.ledTxPin, OUTPUT);
if (Config.notification.ledMessage) pinMode(Config.notification.ledMessagePin, OUTPUT);
if (Config.notification.ledFlashlight) pinMode(Config.notification.ledFlashlightPin, OUTPUT);

STATION_Utils::loadIndex(0);
STATION_Utils::loadIndex(1);
String workingFreq = " LoRa Freq [";
Expand All @@ -178,7 +178,7 @@ void setup() {
currentLoRaType = &Config.loraTypes[loraIndex];
LoRa_Utils::setup();
BME_Utils::setup();

ackNumberSend = random(1,999);

WiFi.mode(WIFI_OFF);
Expand Down Expand Up @@ -214,7 +214,7 @@ void loop() {
miceActive = Config.validateMicE(currentBeacon->micE);
}
STATION_Utils::checkSmartBeaconValue();

if (ackNumberSend >= 999) ackNumberSend = 1;

POWER_Utils::batteryManager();
Expand Down
4 changes: 2 additions & 2 deletions src/ax25_utils.cpp
Expand Up @@ -85,7 +85,7 @@ namespace AX25_Utils {
return result;
}

String encodeAX25Address(String frame, int type, bool lastAddress) {
String encodeAX25Address(String frame, uint8_t type, bool lastAddress) {
String packet = "";
String address;
std::string concatenatedBinary;
Expand All @@ -104,7 +104,7 @@ namespace AX25_Utils {
char c = address[j];
packet += char(c<<1);
}
std::string firstSSIDBit = std::to_string(type); //type=0 (sender or path not repeated) type=1 (tocall or path bein repeated)
std::string firstSSIDBit = std::to_string(type); //type=0 (sender or path not repeated) type=1 (tocall or path being repeated)
std::string lastSSIDBit = "0";
if (lastAddress) {
lastSSIDBit = "1"; // address is the last from AX.25 Frame
Expand Down
2 changes: 1 addition & 1 deletion src/ax25_utils.h
Expand Up @@ -40,7 +40,7 @@ namespace AX25_Utils {
String AX25FrameToLoRaPacket(String frame);
String frameCleaning(String frame);
std::string intToBinaryString(int value, int bitLength);
String encodeAX25Address(String frame, int type, bool lastAddress);
String encodeAX25Address(String frame, uint8_t type, bool lastAddress);
String LoRaPacketToAX25Frame(String packet);

}
Expand Down
2 changes: 1 addition & 1 deletion src/bme_utils.cpp
Expand Up @@ -177,7 +177,7 @@ namespace BME_Utils {
String wx, tempStr, humStr, presStr;

uint32_t lastReading = millis() - bmeLastReading;
if (lastReading > 60*1000) {
if (lastReading > 60 * 1000) {
#if defined(BME280Sensor) || defined(BMP280Sensor)
bme.takeForcedMeasurement();
newTemp = bme.readTemperature();
Expand Down
2 changes: 1 addition & 1 deletion src/display.cpp
Expand Up @@ -30,7 +30,7 @@ extern Beacon *currentBeacon;
extern int menuDisplay;
extern bool symbolAvailable;
extern bool bluetoothConnected;
extern int screenBrightness; //from 1 to 255 to regulate brightness of oled scren
extern uint8_t screenBrightness; //from 1 to 255 to regulate brightness of oled scren

const char* symbolArray[] = { "[", ">", "j", "b", "<", "s", "u", "R", "v", "(", ";", "-", "k",
"C", "a", "Y", "O", "'", "=", "y"};
Expand Down
4 changes: 2 additions & 2 deletions src/gps_utils.cpp
Expand Up @@ -74,11 +74,11 @@ namespace GPS_Utils {
}

void calculateHeadingDelta(int speed) {
int TurnMinAngle;
uint8_t TurnMinAngle;
double headingDelta = abs(previousHeading - currentHeading);
if (lastTx > currentBeacon->minDeltaBeacon * 1000) {
if (speed == 0) {
TurnMinAngle = currentBeacon->turnMinDeg + (currentBeacon->turnSlope/(speed+1));
TurnMinAngle = currentBeacon->turnMinDeg + (currentBeacon->turnSlope/(speed + 1));
} else {
TurnMinAngle = currentBeacon->turnMinDeg + (currentBeacon->turnSlope/speed);
}
Expand Down
8 changes: 4 additions & 4 deletions src/keyboard_utils.cpp
Expand Up @@ -21,16 +21,16 @@ extern logging::Logger logger;
extern bool sendUpdate;
extern int menuDisplay;
extern uint32_t menuTime;
extern int myBeaconsIndex;
extern uint8_t myBeaconsIndex;
extern int myBeaconsSize;
extern int loraIndex;
extern uint8_t loraIndex;
extern bool keyboardConnected;
extern bool keyDetected;
extern uint32_t keyboardTime;
extern bool displayState;
extern uint32_t displayTime;
extern bool displayEcoMode;
extern int screenBrightness;
extern uint8_t screenBrightness;
extern bool statusState;
extern uint32_t statusTime;
extern int messagesIterator;
Expand All @@ -41,7 +41,7 @@ extern bool sendStandingUpdate;
extern bool flashlight;
extern bool digirepeaterActive;
extern bool sosActive;
extern int winlinkStatus;
extern uint8_t winlinkStatus;
extern String winlinkMailNumber;
extern String winlinkAddressee;
extern String winlinkSubject;
Expand Down
2 changes: 1 addition & 1 deletion src/lora_utils.cpp
Expand Up @@ -11,7 +11,7 @@
extern logging::Logger logger;
extern Configuration Config;
extern LoraType *currentLoRaType;
extern int loraIndex;
extern uint8_t loraIndex;
extern int loraIndexSize;


Expand Down
8 changes: 4 additions & 4 deletions src/menu_utils.cpp
Expand Up @@ -19,10 +19,10 @@ extern TinyGPSPlus gps;
extern std::vector<String> loadedAPRSMessages;
extern std::vector<String> loadedWLNKMails;
extern int messagesIterator;
extern int loraIndex;
extern uint8_t loraIndex;
extern uint32_t menuTime;
extern bool symbolAvailable;
extern int lowBatteryPercent;
extern uint8_t lowBatteryPercent;
extern bool keyDetected;
extern String messageCallsign;
extern String messageText;
Expand All @@ -35,7 +35,7 @@ extern bool screenBrightness;
extern bool disableGPS;
extern APRSPacket lastReceivedPacket;

extern int winlinkStatus;
extern uint8_t winlinkStatus;
extern String winlinkMailNumber;
extern String winlinkAddressee;
extern String winlinkSubject;
Expand Down Expand Up @@ -63,7 +63,7 @@ namespace MENU_Utils {
}
}

String checkScreenBrightness(int bright) {
String checkScreenBrightness(uint8_t bright) {
if (bright == 255) {
return "MAX";
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/menu_utils.h
Expand Up @@ -7,7 +7,7 @@ namespace MENU_Utils {

String checkBTType();
String checkProcessActive(bool process);
String checkScreenBrightness(int bright);
String checkScreenBrightness(uint8_t bright);
void showOnScreen();

}
Expand Down
4 changes: 2 additions & 2 deletions src/msg_utils.cpp
Expand Up @@ -29,7 +29,7 @@ extern uint32_t messageLedTime;
extern bool digirepeaterActive;

extern int ackNumberSend;
extern int winlinkStatus;
extern uint8_t winlinkStatus;

extern APRSPacket lastReceivedPacket;
extern uint32_t ackTime;
Expand Down Expand Up @@ -218,7 +218,7 @@ namespace MSG_Utils {
}
}

void sendMessage(int typeOfMessage, String station, String textMessage) {
void sendMessage(uint8_t typeOfMessage, String station, String textMessage) {
String newPacket = APRSPacketLib::generateMessagePacket(currentBeacon->callsign, "APLRT1", Config.path, station, textMessage);
if (textMessage.indexOf("ack") == 0) {
if (station != "WLNK-1") { // don't show Winlink ACK
Expand Down
2 changes: 1 addition & 1 deletion src/msg_utils.h
Expand Up @@ -16,7 +16,7 @@ namespace MSG_Utils {
void ledNotification();
void deleteFile(String typeOfFile);
void saveNewMessage(String typeMessage, String station, String newMessage);
void sendMessage(int typeOfMessage, String station, String textMessage);
void sendMessage(uint8_t typeOfMessage, String station, String textMessage);
void processOutputBuffer();
void checkReceivedMessage(ReceivedLoRaPacket packetReceived);

Expand Down
12 changes: 6 additions & 6 deletions src/station_utils.cpp
Expand Up @@ -15,8 +15,8 @@ extern Configuration Config;
extern Beacon *currentBeacon;
extern logging::Logger logger;
extern TinyGPSPlus gps;
extern int myBeaconsIndex;
extern int loraIndex;
extern uint8_t myBeaconsIndex;
extern uint8_t loraIndex;

extern uint32_t lastTx;
extern uint32_t lastTxTime;
Expand All @@ -25,7 +25,7 @@ extern uint32_t telemetryTx;
extern uint32_t lastTelemetryTx;

extern bool sendUpdate;
extern int updateCounter;
extern uint8_t updateCounter;
extern bool sendStandingUpdate;

extern uint32_t txInterval;
Expand All @@ -40,7 +40,7 @@ extern double lastTxDistance;

extern bool miceActive;
extern bool smartBeaconValue;
extern int winlinkStatus;
extern uint8_t winlinkStatus;

String firstNearTracker;
String secondNearTracker;
Expand Down Expand Up @@ -445,7 +445,7 @@ namespace STATION_Utils {
}
}

void saveIndex(int type, int index) {
void saveIndex(uint8_t type, uint8_t index) {
String filePath;
if (type == 0) {
filePath = "/callsignIndex.txt";
Expand All @@ -467,7 +467,7 @@ namespace STATION_Utils {
fileIndex.close();
}

void loadIndex(int type) {
void loadIndex(uint8_t type) {
String filePath;
if (type == 0) {
filePath = "/callsignIndex.txt";
Expand Down
4 changes: 2 additions & 2 deletions src/station_utils.h
Expand Up @@ -19,8 +19,8 @@ namespace STATION_Utils {
void checkSmartBeaconState();
void sendBeacon(String type);
void checkTelemetryTx();
void saveIndex(int type, int index);
void loadIndex(int type);
void saveIndex(uint8_t type, uint8_t index);
void loadIndex(uint8_t type);

}

Expand Down
2 changes: 1 addition & 1 deletion src/winlink_utils.cpp
Expand Up @@ -5,7 +5,7 @@
#include "logger.h"

extern Configuration Config;
extern int winlinkStatus;
extern uint8_t winlinkStatus;
extern int menuDisplay;
extern logging::Logger logger;

Expand Down

0 comments on commit a718ddb

Please sign in to comment.