From 819f3e362509cc7d4b409055a10e5b54d75c0a05 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Mon, 20 Mar 2023 10:37:45 +0100 Subject: [PATCH] Fix AP mode --- src/config.h | 2 +- src/creds.dist.h | 1 + src/setup.cpp | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/config.h b/src/config.h index e23e12d..0444adf 100644 --- a/src/config.h +++ b/src/config.h @@ -3,7 +3,7 @@ // Uncomment to switch to AP mode. // Leave commented for wifi station mode. -// #define B_WIFI_AP +#define B_WIFI_AP // DAC #define I2S_DOUT 32 diff --git a/src/creds.dist.h b/src/creds.dist.h index 5e0110d..fc15479 100644 --- a/src/creds.dist.h +++ b/src/creds.dist.h @@ -1,4 +1,5 @@ // Copy to creds.h or creds_ap.h and edit +// If both, use different define guards #ifndef __CREDS_H__ #define __CREDS_H__ const char *ssid = "buzzer"; diff --git a/src/setup.cpp b/src/setup.cpp index 684af36..a3178d9 100644 --- a/src/setup.cpp +++ b/src/setup.cpp @@ -3,13 +3,15 @@ #include #include +// config.h must come before creds loading +// because it sets B_WIFI_AP +#include "config.h" #ifdef B_WIFI_AP #include "creds_ap.h" #else #include "creds.h" #endif -#include "config.h" #include "utils.h" #include "webHandlers.h"