use initial delay for wifi check test
This commit is contained in:
parent
be01072986
commit
6897fd497e
@ -49,7 +49,7 @@ namespace Ir {
|
||||
{
|
||||
case 0x9F:
|
||||
avrOn = false;
|
||||
tCheckWifi.enableDelayed(5*TASK_SECOND);
|
||||
tCheckWifi.enableDelayed();
|
||||
Display::displayText("Off");
|
||||
break;
|
||||
case 0x12:
|
||||
|
||||
@ -6,7 +6,7 @@ void onWifiConnected();
|
||||
// #define _TASK_STATUS_REQUEST
|
||||
#include <TaskScheduler.h>
|
||||
Scheduler ts;
|
||||
Task tCheckWifi(5000, TASK_FOREVER, checkWifiCallback, &ts);
|
||||
Task tCheckWifi(5*TASK_SECOND, TASK_FOREVER, checkWifiCallback, &ts);
|
||||
Task tWifiConnected(TASK_IMMEDIATE, TASK_ONCE, onWifiConnected, &ts);
|
||||
|
||||
#include "wifi.h"
|
||||
@ -17,7 +17,7 @@ Task tWifiConnected(TASK_IMMEDIATE, TASK_ONCE, onWifiConnected, &ts);
|
||||
#include "ota.h"
|
||||
#include "ir.h"
|
||||
|
||||
#define STAY_CONNECTED_AFTER_BOOT 15
|
||||
#define STAY_CONNECTED_AFTER_BOOT 5*60
|
||||
|
||||
void setup() {
|
||||
|
||||
@ -41,7 +41,7 @@ void onWifiConnected() {
|
||||
Serial.println("Wifi connected event");
|
||||
Wifi::printStatus();
|
||||
Ota::tLoop.enable();
|
||||
if (!Ir::avrOn) tCheckWifi.enable();
|
||||
if (!Ir::avrOn) tCheckWifi.enableDelayed();
|
||||
Mqtt::client.connect();
|
||||
if (time_t newTime = Ntp::updateTime()) {
|
||||
Serial.println(asctime(localtime(&newTime)));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user