Skip to content

Commit

Permalink
feat: example esp32 platformio project
Browse files Browse the repository at this point in the history
  • Loading branch information
BCsabaEngine committed Aug 13, 2024
1 parent 8ca7ca8 commit 8fcaa3f
Show file tree
Hide file tree
Showing 38 changed files with 559 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.DS_Store
node_modules
dist
svelte
demo
.env
.env.*
!.env.example
Expand Down
5 changes: 5 additions & 0 deletions demo/esp32/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
10 changes: 10 additions & 0 deletions demo/esp32/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
12 changes: 12 additions & 0 deletions demo/esp32/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[env]
platform = espressif32
board = wemos_d1_mini32
framework = arduino

[env:async]
build_flags = -D ASYNC
lib_deps = https://github.com/me-no-dev/ESPAsyncWebServer

[env:psychic]
build_flags = -D PSYCHIC
lib_deps = hoeken/PsychicHttp
31 changes: 31 additions & 0 deletions demo/esp32/src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#ifdef ASYNC
/* ESPAsyncWebServer example */

#include <ESPAsyncWebServer.h>
#include "svelteesp32async.h"

AsyncWebServer server(80);
void setup()
{
initSvelteStaticFiles(&server);
server.begin();
}
void loop() {}

#elif PSYCHIC
/* PsychicHttp example */

#include <PsychicHttp.h>
#include "svelteesp32psychic.h"

PsychicHttpServer server;
void setup()
{
server.listen(80);
initSvelteStaticFiles(&server);
}
void loop() {}

#else
#error Unknown platform
#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default [
'**/node_modules',
'**/bin',
'**/dist',
'**/svelte',
'**/demo',
'**/.env',
'**/.env.*',
'!**/.env.example',
Expand Down
Loading

0 comments on commit 8fcaa3f

Please sign in to comment.