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

util does not depend on wifi_util anymore

parent 8b7f81e4
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#define AMPEL_UTIL_H_INCLUDED #define AMPEL_UTIL_H_INCLUDED
#include <Arduino.h> #include <Arduino.h>
#include "config.h" #include "config.h"
#include "wifi_util.h" // To get MAC
#ifdef AMPEL_CSV #ifdef AMPEL_CSV
# include "csv_writer.h" // To close filesystem before reset # include "csv_writer.h" // To close filesystem before reset
#endif #endif
...@@ -12,9 +11,11 @@ ...@@ -12,9 +11,11 @@
#if defined(ESP8266) #if defined(ESP8266)
# define BOARD "ESP8266" # define BOARD "ESP8266"
# include <ESP8266WiFi.h>
# define get_free_heap_size() system_get_free_heap_size() # define get_free_heap_size() system_get_free_heap_size()
#elif defined(ESP32) #elif defined(ESP32)
# define BOARD "ESP32" # define BOARD "ESP32"
# include <WiFi.h>
# define get_free_heap_size() esp_get_free_heap_size() # define get_free_heap_size() esp_get_free_heap_size()
#else #else
# define BOARD "Unknown" # define BOARD "Unknown"
......
...@@ -16,7 +16,7 @@ namespace config { ...@@ -16,7 +16,7 @@ namespace config {
void WiFiConnect(const String &hostname) { void WiFiConnect(const String &hostname) {
//NOTE: WiFi Multi could allow multiple SSID and passwords. //NOTE: WiFi Multi could allow multiple SSID and passwords.
WiFi.persistent(false); // Don't write user & password to Flash. WiFi.persistent(false); // Don't write user & password to Flash.
WiFi.mode(WIFI_STA); // Set ESP8266 to be a WiFi-client only WiFi.mode(WIFI_STA); // Set ESP to be a WiFi-client only
#if defined(ESP8266) #if defined(ESP8266)
WiFi.hostname(hostname); WiFi.hostname(hostname);
#elif defined(ESP32) #elif defined(ESP32)
......
#ifndef WIFI_UTIL_H_INCLUDED #ifndef WIFI_UTIL_H_INCLUDED
# define WIFI_UTIL_H_INCLUDED #define WIFI_UTIL_H_INCLUDED
# if defined(ESP8266)
# include <ESP8266WiFi.h>
# elif defined(ESP32)
# include <WiFi.h>
# endif
#include "led_effects.h" #include "led_effects.h"
#include "config.h" #include "config.h"
......
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