Commit 96666137 authored by Eric Duminil's avatar Eric Duminil
Browse files

Checking if AP mode, for ESP8266 and ESP32

parent 16536c99
Pipeline #5806 passed with stage
in 3 minutes and 2 seconds
......@@ -230,7 +230,7 @@ namespace sensor {
delay(100);
} else {
// Display a flashing led ring, if concentration exceeds a specific value
led_effects::redAlert();
led_effects::alert(color::red);
}
}
......
......@@ -244,7 +244,7 @@ namespace led_effects {
}
}
void redAlert() {
void alert(uint32_t color) {
if (!config::display_led) {
onBoardLEDOn();
delay(500);
......@@ -255,7 +255,7 @@ namespace led_effects {
for (int i = 0; i < 10; i++) {
pixels.setBrightness(static_cast<int>(config::max_brightness * (1 - i * 0.1)));
delay(50);
pixels.fill(color::red);
pixels.fill(color);
pixels.show();
}
}
......
......@@ -20,7 +20,7 @@ namespace led_effects {
void LEDsOff();
void setupRing();
void redAlert();
void alert(uint32_t color);
bool countdownToZero();
void showWaitingLED(uint32_t color);
void showKITTWheel(uint32_t color, uint16_t duration_s = 2);
......
......@@ -23,17 +23,16 @@ namespace wifi {
//TODO: configurable timeout
for (int i = 0; i <= 30; i++) {
web_config::update();
if (connected()) {
if (WiFi.getMode() == WIFI_AP){
led_effects::alert(0x1cff68);
} else if (connected()) {
break;
} else if (WiFi.status() == WL_NO_SHIELD) { // Access point, apparently FIXME: This doesn'T work for ESP826clipse6
led_effects::showKITTWheel(0xFF0015, 1);
} else {
led_effects::showRainbowWheel();
}
Serial.print("Status : ");
Serial.println(WiFi.status());
// Serial.print(".");
Serial.print(".");
}
Serial.println();
}
void scanNetworks() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment