Skip to content

Commit

Permalink
Enable Async on RP2040
Browse files Browse the repository at this point in the history
  • Loading branch information
DoomHammer committed Mar 27, 2024
1 parent d4f6bcd commit 3d256c1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
Empty file.
14 changes: 14 additions & 0 deletions library.json
Expand Up @@ -15,6 +15,20 @@
"maintainer": true
}
],
"dependencies":
[
{
"owner": "esphome",
"name": "ESPAsyncWebServer-esphome",
"version": "^3.0.0",
"platforms": ["espressif8266", "espressif32"]
},
{
"name": "ESPAsyncWebServer",
"version": "https://github.com/doomhammer/ESPAsyncWebServer#more-rp2040-fixes",
"platforms": ["raspberrypi"]
}
],
"version": "3.1.1",
"frameworks": "arduino",
"platforms": ["espressif8266", "espressif32", "raspberrypi"]
Expand Down
18 changes: 10 additions & 8 deletions src/ElegantOTA.h
Expand Up @@ -79,18 +79,20 @@ _____ _ _ ___ _____ _
#include "Arduino.h"
#include "FS.h"
#include "LittleFS.h"
#include "WiFiClient.h"
#include "WiFiServer.h"
#include "WebServer.h"
#include "WiFiUdp.h"
#include "StreamString.h"
#include "Updater.h"
#define HARDWARE "RP2040"
#define ELEGANTOTA_WEBSERVER WebServer
// Throw an error if async mode is enabled
#if ELEGANTOTA_USE_ASYNC_WEBSERVER == 1
#error "Async mode is not supported on RP2040. Please set ELEGANTOTA_USE_ASYNC_WEBSERVER to 0."
#include "AsyncTCP_RP2040W.h"
#include "ESPAsyncWebServer.h"
#define ELEGANTOTA_WEBSERVER AsyncWebServer
#else
#include "WiFiClient.h"
#include "WiFiServer.h"
#include "WebServer.h"
#include "WiFiUdp.h"
#define ELEGANTOTA_WEBSERVER WebServer
#endif
#define HARDWARE "RP2040"
extern uint8_t _FS_start;
extern uint8_t _FS_end;
#endif
Expand Down

0 comments on commit 3d256c1

Please sign in to comment.