mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-08 16:11:18 +00:00
Restore logging, make WiFi creds settable from make
This commit is contained in:
1 parent
a9a94a6904
commit
b68da1548b
11 files changed
+74
-4
No files matched your search
@@ -16,3 +16,12 @@ pico_enable_stdio_usb(firmware 1) # Route stdio to USB
|
||||
|
||||
# Prevent extreme optimization from breaking OTA
|
||||
target_compile_options(firmware PRIVATE -fno-tree-loop-distribute-patterns)
|
||||
|
||||
# Wi-Fi credentials from the environment, e.g. make WIFI_NAME=... WIFI_PASS=...
|
||||
# Read when build/ is configured: run "make clean" after changing them
|
||||
if (DEFINED ENV{WIFI_NAME})
|
||||
target_compile_definitions(firmware PRIVATE "WIFI_SSID=\"$ENV{WIFI_NAME}\"")
|
||||
endif()
|
||||
if (DEFINED ENV{WIFI_PASS})
|
||||
target_compile_definitions(firmware PRIVATE "WIFI_PASS=\"$ENV{WIFI_PASS}\"")
|
||||
endif()
|
||||
@@ -16,10 +16,16 @@ static void http_ev_handler(struct mg_connection *c, int ev, void *ev_data) {
|
||||
}
|
||||
}
|
||||
|
||||
static void log_fn(char ch, void *param) {
|
||||
(void) param;
|
||||
putchar(ch);
|
||||
}
|
||||
|
||||
// In an RTOS environment, give this task 8 KB of stack space.
|
||||
static void run_mongoose(void) {
|
||||
void driver_init(struct mg_mgr *mgr);
|
||||
struct mg_mgr mgr;
|
||||
mg_log_set_fn(log_fn, NULL);
|
||||
mg_mgr_init(&mgr);
|
||||
driver_init(&mgr);
|
||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||
|
||||
@@ -4,8 +4,13 @@
|
||||
#include "hardware/pio.h"
|
||||
#include "mongoose.h"
|
||||
|
||||
#define WIFI_SSID "YOUR_WIFI_NETWORK_NAME" // SET THIS!
|
||||
#define WIFI_PASS "YOUR_WIFI_PASSWORD" // SET THIS!
|
||||
// Set these, or pass on the command line: make WIFI_NAME=... WIFI_PASS=...
|
||||
#ifndef WIFI_SSID
|
||||
#define WIFI_SSID "YOUR_WIFI_NETWORK_NAME"
|
||||
#endif
|
||||
#ifndef WIFI_PASS
|
||||
#define WIFI_PASS "YOUR_WIFI_PASSWORD"
|
||||
#endif
|
||||
|
||||
#define SPIPIO pio0
|
||||
#define SPISM 0
|
||||
|
||||
Reference in new issue
Block a user