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