Moved platform-specific code related to WiFi and services to my_wifi.h. Also, made the HTTP server stuff compatible to ESP32.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -5,7 +5,11 @@
|
||||
#include "http_server.h"
|
||||
#include "effects.h"
|
||||
|
||||
#if defined( ESP8266 )
|
||||
ESP8266WebServer http_server(HTTP_SERVER_PORT);
|
||||
#elif defined( ESP32 )
|
||||
ESP32WebServer http_server(HTTP_SERVER_PORT);
|
||||
#endif
|
||||
|
||||
void http_server_400() {
|
||||
http_server.send(400);
|
||||
|
@ -5,13 +5,7 @@
|
||||
#pragma message "MQTT_ENABLE is false. Skipping MQTT."
|
||||
#else
|
||||
|
||||
#if defined( ESP8266 )
|
||||
#include <ESP8266WiFi.h>
|
||||
#elif defined( ESP32 )
|
||||
#include <WiFi.h>
|
||||
#else
|
||||
#error "Neither ESP32 nor ESP8266 set..."
|
||||
#endif
|
||||
#include "my_wifi.h"
|
||||
#include <PubSubClient.h>
|
||||
#include "EffectEntry.h"
|
||||
#include "Effect.h"
|
||||
|
@ -1,12 +1,6 @@
|
||||
#include <ArduinoOTA.h>
|
||||
|
||||
#if defined( ESP8266 )
|
||||
#include <ESP8266mDNS.h>
|
||||
#elif defined( ESP32 )
|
||||
#include <ESPmDNS.h>
|
||||
#else
|
||||
#error Neither ESP32 nor ESP8266 set!
|
||||
#endif
|
||||
#include "my_wifi.h"
|
||||
|
||||
#include <ArduinoOTA.h>
|
||||
#include "config.h"
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "ntp.h"
|
||||
#include "config.h"
|
||||
#include "animations.h"
|
||||
#include "wifi.h"
|
||||
#include "my_wifi.h"
|
||||
#include "ota.h"
|
||||
#include "my_fastled.h"
|
||||
#include "EffectEntry.h"
|
||||
|
@ -1,12 +1,8 @@
|
||||
#include <Arduino.h>
|
||||
#if defined( ESP8266 )
|
||||
#include <ESP8266WiFi.h>
|
||||
#elif defined( ESP32 )
|
||||
#include <WiFi.h>
|
||||
#endif
|
||||
#include "wifi.h"
|
||||
#include "my_wifi.h"
|
||||
#include "config.h"
|
||||
|
||||
|
||||
void wifi_setup() {
|
||||
WiFi.mode(WIFI_STA);
|
||||
WiFi.begin(WIFI_SSID, WIFI_PASS);
|
||||
|
Reference in New Issue
Block a user