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 { ...@@ -230,7 +230,7 @@ namespace sensor {
delay(100); delay(100);
} else { } else {
// Display a flashing led ring, if concentration exceeds a specific value // 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 { ...@@ -244,7 +244,7 @@ namespace led_effects {
} }
} }
void redAlert() { void alert(uint32_t color) {
if (!config::display_led) { if (!config::display_led) {
onBoardLEDOn(); onBoardLEDOn();
delay(500); delay(500);
...@@ -255,7 +255,7 @@ namespace led_effects { ...@@ -255,7 +255,7 @@ namespace led_effects {
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
pixels.setBrightness(static_cast<int>(config::max_brightness * (1 - i * 0.1))); pixels.setBrightness(static_cast<int>(config::max_brightness * (1 - i * 0.1)));
delay(50); delay(50);
pixels.fill(color::red); pixels.fill(color);
pixels.show(); pixels.show();
} }
} }
......
...@@ -20,7 +20,7 @@ namespace led_effects { ...@@ -20,7 +20,7 @@ namespace led_effects {
void LEDsOff(); void LEDsOff();
void setupRing(); void setupRing();
void redAlert(); void alert(uint32_t color);
bool countdownToZero(); bool countdownToZero();
void showWaitingLED(uint32_t color); void showWaitingLED(uint32_t color);
void showKITTWheel(uint32_t color, uint16_t duration_s = 2); void showKITTWheel(uint32_t color, uint16_t duration_s = 2);
......
...@@ -23,17 +23,16 @@ namespace wifi { ...@@ -23,17 +23,16 @@ namespace wifi {
//TODO: configurable timeout //TODO: configurable timeout
for (int i = 0; i <= 30; i++) { for (int i = 0; i <= 30; i++) {
web_config::update(); web_config::update();
if (connected()) { if (WiFi.getMode() == WIFI_AP){
led_effects::alert(0x1cff68);
} else if (connected()) {
break; break;
} else if (WiFi.status() == WL_NO_SHIELD) { // Access point, apparently FIXME: This doesn'T work for ESP826clipse6
led_effects::showKITTWheel(0xFF0015, 1);
} else { } else {
led_effects::showRainbowWheel(); led_effects::showRainbowWheel();
} }
Serial.print("Status : "); Serial.print(".");
Serial.println(WiFi.status());
// Serial.print(".");
} }
Serial.println();
} }
void scanNetworks() { void scanNetworks() {
......
Markdown is supported
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