Skip to content

Commit

Permalink
Merge pull request #177 from toyo/master
Browse files Browse the repository at this point in the history
  • Loading branch information
peterus authored Mar 27, 2022
2 parents 133e32e + 8277fd2 commit e0f9f1f
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions src/LoRa_APRS_iGate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "TaskWifi.h"
#include "project_configuration.h"

#define VERSION "22.12.2"
#define VERSION "22.12.3"
#define MODULE_NAME "Main"

String create_lat_aprs(double lat);
Expand Down Expand Up @@ -109,23 +109,30 @@ void setup() {
LoRaSystem.getTaskManager().addTask(&routerTask);
LoRaSystem.getTaskManager().addTask(&beaconTask);

if (userConfig.aprs_is.active) {
if (boardConfig->Type == eETH_BOARD && !userConfig.wifi.active) {
LoRaSystem.getTaskManager().addAlwaysRunTask(&ethTask);
}
if (userConfig.wifi.active) {
LoRaSystem.getTaskManager().addAlwaysRunTask(&wifiTask);
}
bool tcpip = false;

if (userConfig.wifi.active) {
LoRaSystem.getTaskManager().addAlwaysRunTask(&wifiTask);
LoRaSystem.getTaskManager().addTask(&otaTask);
tcpip = true;
} else if (boardConfig->Type == eETH_BOARD) {
LoRaSystem.getTaskManager().addAlwaysRunTask(&ethTask);
tcpip = true;
}

if (tcpip) {
LoRaSystem.getTaskManager().addTask(&ntpTask);
if (userConfig.ftp.active) {
LoRaSystem.getTaskManager().addTask(&ftpTask);
}
LoRaSystem.getTaskManager().addTask(&aprsIsTask);
}

if (userConfig.mqtt.active) {
LoRaSystem.getTaskManager().addTask(&mqttTask);
if (userConfig.aprs_is.active) {
LoRaSystem.getTaskManager().addTask(&aprsIsTask);
}

if (userConfig.mqtt.active) {
LoRaSystem.getTaskManager().addTask(&mqttTask);
}
}

LoRaSystem.getTaskManager().setup(LoRaSystem);
Expand Down

0 comments on commit e0f9f1f

Please sign in to comment.