Created
July 11, 2020 03:08
-
-
Save cluelessperson/f6556fa0f924315e06b44095b1988129 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Arduino.h" | |
#include "common/common.h" | |
void setup() { | |
leds_setup(); | |
Task wifi_task = wifi_setup(ts); | |
} | |
void loop() { | |
ts.execute(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "wifi.h" | |
#include <ESP8266WiFi.h> | |
#include "TaskScheduler.h" | |
Task wifi_setup(Scheduler s) { | |
WiFi.mode(WIFI_STA); | |
WiFi.setAutoReconnect(true); | |
WiFi.begin(WIFI_SSID, WIFI_PASS); | |
#ifdef WIFI_HOST | |
WiFi.hostname(WIFI_HOST); | |
#endif | |
Task wifi_task(TASK_SECOND, TASK_FOREVER, [](){WiFi.waitForConnectResult();}, &s, true); | |
return wifi_task; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment