Добавлена переменная конфига для подключения к Wifi сразу при включении
Этот коммит содержится в:
родитель
222e044bc1
коммит
a5b21a7697
3 изменённых файлов: 14 добавлений и 3 удалений
1
config.h
1
config.h
|
@ -5,6 +5,7 @@
|
|||
#include "_config.priv.h"
|
||||
|
||||
#define UPDATES_ENABLED 1
|
||||
#define WIFI_INITIALLY_STARTED 0
|
||||
#define DEBUG 0
|
||||
|
||||
// Prod
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
#include "config.h"
|
||||
|
||||
void setup_dvizh();
|
||||
|
||||
void setup_BLE();
|
||||
void setup_Wifi();
|
||||
bool isWifiEnabled();
|
||||
void handleWifi();
|
||||
extern bool wifiEnabled;
|
||||
|
||||
SET_LOOP_TASK_STACK_SIZE(16 * 1024);
|
||||
|
||||
|
@ -14,6 +14,7 @@ void setup() {
|
|||
if (DEBUG)
|
||||
Serial.begin(115200);
|
||||
#if UPDATES_ENABLED
|
||||
setup_Wifi();
|
||||
setup_BLE();
|
||||
#endif
|
||||
}
|
||||
|
@ -23,7 +24,7 @@ void loop() {
|
|||
handleWifi();
|
||||
#endif
|
||||
|
||||
if (!wifiEnabled) {
|
||||
if (!isWifiEnabled()) {
|
||||
delay(60000);
|
||||
} else {
|
||||
delay(1000);
|
||||
|
|
9
wifi.cpp
9
wifi.cpp
|
@ -75,4 +75,13 @@ void handleWifi() {
|
|||
}
|
||||
|
||||
ArduinoOTA.handle();
|
||||
}
|
||||
|
||||
bool isWifiEnabled() {
|
||||
return wifiEnabled;
|
||||
}
|
||||
|
||||
void setup_Wifi() {
|
||||
if (WIFI_INITIALLY_STARTED)
|
||||
startWifi();
|
||||
}
|
Загрузка…
Создание таблицы
Сослаться в новой задаче