From 3f1ae66a3db9a31fe88ef4eabee70ab574230880 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Tue, 19 May 2026 16:26:22 -0300 Subject: [PATCH] FreeRTOS: arch_ -> os_ --- mongoose.c | 15 ++- mongoose.h | 104 ++++++++---------- src/arch.h | 12 +- src/arch_armcgt.h | 1 - src/arch_armgcc.h | 3 +- src/arch_cube.h | 5 +- src/arch_freertos.h | 51 --------- src/arch_rtx.h | 3 + src/arch_unix.h | 2 + src/arch_win32.h | 2 + src/config.h | 6 +- src/os_freertos.h | 21 ++++ src/util.c | 15 ++- test/Makefile | 2 +- test/wizard/Makefile | 4 +- .../source/mongoose_config.h | 3 +- .../source/mongoose_config.h | 3 +- .../source/mongoose_config.h | 3 +- .../com.st.stm32cube.ide.mcu.sfrview.prefs | 2 - .../.settings/language.settings.xml | 36 ------ .../.settings/org.eclipse.cdt.core.prefs | 6 - .../.settings/stm32cubeide.project.prefs | 5 - .../Core/Inc/mongoose_config.h | 3 +- .../com.st.stm32cube.ide.mcu.sfrview.prefs | 2 - .../.settings/language.settings.xml | 36 ------ .../.settings/stm32cubeide.project.prefs | 5 - .../Core/Inc/mongoose_config.h | 3 +- .../mongoose_config.h | 4 +- 28 files changed, 122 insertions(+), 235 deletions(-) delete mode 100644 src/arch_freertos.h create mode 100644 src/os_freertos.h delete mode 100644 tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/com.st.stm32cube.ide.mcu.sfrview.prefs delete mode 100644 tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/language.settings.xml delete mode 100644 tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/org.eclipse.cdt.core.prefs delete mode 100644 tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/stm32cubeide.project.prefs delete mode 100644 tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/.settings/com.st.stm32cube.ide.mcu.sfrview.prefs delete mode 100644 tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/.settings/language.settings.xml delete mode 100644 tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/.settings/stm32cubeide.project.prefs diff --git a/mongoose.c b/mongoose.c index 4fd1e4a1..e1bb248d 100644 --- a/mongoose.c +++ b/mongoose.c @@ -24474,15 +24474,8 @@ bool mg_path_is_sane(const struct mg_str path) { #if MG_ENABLE_CUSTOM_MILLIS #else uint64_t mg_millis(void) { -#if MG_ARCH == MG_ARCH_WIN32 - return GetTickCount(); -#elif MG_ARCH == MG_ARCH_PICOSDK - return time_us_64() / 1000; -#elif MG_ARCH == MG_ARCH_ESP8266 || MG_ARCH == MG_ARCH_ESP32 || \ - MG_ARCH == MG_ARCH_FREERTOS +#if MG_ARCH == MG_ARCH_ESP8266 || MG_ARCH == MG_ARCH_ESP32 || MG_ENABLE_FREERTOS return xTaskGetTickCount() * portTICK_PERIOD_MS; -#elif MG_ARCH == MG_ARCH_CUBE - return (uint64_t) HAL_GetTick(); #elif MG_ARCH == MG_ARCH_THREADX return tx_time_get() * (1000 /* MS per SEC */ / TX_TIMER_TICKS_PER_SECOND); #elif MG_ARCH == MG_ARCH_TIRTOS @@ -24495,6 +24488,12 @@ uint64_t mg_millis(void) { return (uint64_t) ((osKernelGetTickCount() * 1000) / osKernelGetTickFreq()); #elif MG_ARCH == MG_ARCH_RTTHREAD return (uint64_t) ((rt_tick_get() * 1000) / RT_TICK_PER_SECOND); +#elif MG_ARCH == MG_ARCH_WIN32 + return GetTickCount(); +#elif MG_ARCH == MG_ARCH_PICOSDK + return time_us_64() / 1000; +#elif MG_ARCH == MG_ARCH_CUBE + return (uint64_t) HAL_GetTick(); #elif MG_ARCH == MG_ARCH_UNIX && defined(__APPLE__) // Apple CLOCK_MONOTONIC_RAW is equivalent to CLOCK_BOOTTIME on linux // Apple CLOCK_UPTIME_RAW is equivalent to CLOCK_MONOTONIC_RAW on linux diff --git a/mongoose.h b/mongoose.h index dda26322..fde4b93f 100644 --- a/mongoose.h +++ b/mongoose.h @@ -32,7 +32,9 @@ extern "C" { #define MG_ARCH_WIN32 2 // Windows #define MG_ARCH_ESP32 3 // ESP32 #define MG_ARCH_ESP8266 4 // ESP8266 -#define MG_ARCH_FREERTOS 5 // FreeRTOS + +#define MG_ARCH_FREERTOS 5 // FreeRTOS <-- DEPRECATED !!! + #define MG_ARCH_THREADX 6 // Eclipse ThreadX (former MS Azure RTOS) #define MG_ARCH_ZEPHYR 7 // Zephyr RTOS #define MG_ARCH_ARMGCC 8 // Plain ARM GCC @@ -61,6 +63,11 @@ extern "C" { #if !defined(MG_ARCH) #error "MG_ARCH is not specified and we couldn't guess it. Define MG_ARCH=... in mongoose_config.h" +#elif MG_ARCH == MG_ARCH_FREERTOS +#error "MG_ARCH_FREERTOS has been deprecated, set MG_ARCH=your_build_environment and MG_ENABLE_FREERTOS=1 instead" +#undef MG_ARCH // avoid errors piling up, provide a clean environment so the error above is seen +#define MG_ARCH MG_ARCH_ARMGCC +#define MG_ENABLE_FREERTOS 1 #endif // http://esr.ibiblio.org/?p=5095 @@ -82,6 +89,7 @@ extern "C" { + #if MG_ARCH == MG_ARCH_ARMCGT #include @@ -95,7 +103,6 @@ extern "C" { #include #define MG_PATH_MAX 100 -#define MG_ENABLE_SOCKET 0 #define MG_ENABLE_DIRLIST 0 #endif @@ -105,7 +112,9 @@ extern "C" { #define _POSIX_TIMERS #include +#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP #include +#endif #include #include #include @@ -118,7 +127,6 @@ extern "C" { #include #define MG_PATH_MAX 100 -#define MG_ENABLE_SOCKET 0 #define MG_ENABLE_DIRLIST 0 #endif @@ -127,7 +135,9 @@ extern "C" { #if MG_ARCH == MG_ARCH_CUBE #include +#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP #include +#endif #include #include #include @@ -151,9 +161,6 @@ extern "C" { #define MG_ENABLE_DIRLIST 0 #endif -#ifndef MG_ENABLE_SOCKET -#define MG_ENABLE_SOCKET 0 -#endif #ifndef MG_ENABLE_TCPIP #define MG_ENABLE_TCPIP 1 // Enable built-in TCP/IP stack @@ -281,57 +288,6 @@ extern "C" { #endif -#if MG_ARCH == MG_ARCH_FREERTOS - -#include -#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP -#include -#endif -#include -#include -#include -#include -#include -#include // rand(), strtol(), atoi() -#include -#if defined(__ARMCC_VERSION) -#define mode_t size_t -#include -#include -#define strdup(s) ((char *) mg_strdup(mg_str(s)).buf) -#elif defined(__CCRH__) -#else -#include -#endif - -#include -#include - -#define MG_ENABLE_CUSTOM_CALLOC 1 - -static inline void mg_free(void *ptr) { - vPortFree(ptr); -} - -// Re-route calloc/free to the FreeRTOS's functions, don't use stdlib -static inline void *mg_calloc(size_t cnt, size_t size) { - void *p = pvPortMalloc(cnt * size); - if (p != NULL) memset(p, 0, size * cnt); - return p; -} - -#if !defined(MG_ENABLE_POSIX_FS) || !MG_ENABLE_POSIX_FS -#else -#define mkdir(a, b) mg_mkdir(a, b) -static inline int mg_mkdir(const char *path, mode_t mode) { - (void) path, (void) mode; - return -1; -} -#endif - -#endif // MG_ARCH == MG_ARCH_FREERTOS - - #if MG_ARCH == MG_ARCH_PICOSDK #if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP #include @@ -406,12 +362,15 @@ extern uint32_t rt_time_get(void); #if defined(__ARMCC_VERSION) #define mode_t size_t +#if !defined(MG_ENABLE_POSIX_FS) || !MG_ENABLE_POSIX_FS +#else #define mkdir(a, b) mg_mkdir(a, b) static inline int mg_mkdir(const char *path, mode_t mode) { (void) path, (void) mode; return -1; } #endif +#endif #if (MG_ARCH == MG_ARCH_CMSIS_RTOS1 || MG_ARCH == MG_ARCH_CMSIS_RTOS2) && \ !defined MG_ENABLE_RL && (!defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP) && \ @@ -504,7 +463,9 @@ static inline int mg_mkdir(const char *path, mode_t mode) { #include #include #include +#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP #include +#endif #include #include #include @@ -597,7 +558,9 @@ static inline int mg_mkdir(const char *path, mode_t mode) { #include #include +#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP #include +#endif #include #include #include @@ -779,6 +742,27 @@ int sscanf(const char *, const char *, ...); #endif +#if defined(MG_ENABLE_FREERTOS) && MG_ENABLE_FREERTOS + +#include +#include + +#define MG_ENABLE_CUSTOM_CALLOC 1 + +static inline void mg_free(void *ptr) { + vPortFree(ptr); +} + +// Re-route calloc/free to FreeRTOS functions, don't use stdlib +static inline void *mg_calloc(size_t cnt, size_t size) { + void *p = pvPortMalloc(cnt * size); + if (p != NULL) memset(p, 0, size * cnt); + return p; +} + +#endif // MG_ENABLE_FREERTOS + + #if defined(MG_ENABLE_FREERTOS_TCP) && MG_ENABLE_FREERTOS_TCP #include @@ -913,12 +897,16 @@ struct timeval { #define MG_ENABLE_CUSTOM_LOG 0 // Let user define their own MG_LOG #endif +#ifndef MG_ENABLE_FREERTOS +#define MG_ENABLE_FREERTOS 0 // FreeRTOS RTOS +#endif + #ifndef MG_ENABLE_TCPIP #define MG_ENABLE_TCPIP 0 // Mongoose built-in network stack #endif #ifndef MG_ENABLE_LWIP -#define MG_ENABLE_LWIP 0 // lWIP network stack +#define MG_ENABLE_LWIP 0 // lwIP network stack #endif #ifndef MG_ENABLE_FREERTOS_TCP diff --git a/src/arch.h b/src/arch.h index 1d0ef712..5df1b76e 100644 --- a/src/arch.h +++ b/src/arch.h @@ -5,7 +5,9 @@ #define MG_ARCH_WIN32 2 // Windows #define MG_ARCH_ESP32 3 // ESP32 #define MG_ARCH_ESP8266 4 // ESP8266 -#define MG_ARCH_FREERTOS 5 // FreeRTOS + +#define MG_ARCH_FREERTOS 5 // FreeRTOS <-- DEPRECATED !!! + #define MG_ARCH_THREADX 6 // Eclipse ThreadX (former MS Azure RTOS) #define MG_ARCH_ZEPHYR 7 // Zephyr RTOS #define MG_ARCH_ARMGCC 8 // Plain ARM GCC @@ -34,6 +36,11 @@ #if !defined(MG_ARCH) #error "MG_ARCH is not specified and we couldn't guess it. Define MG_ARCH=... in mongoose_config.h" +#elif MG_ARCH == MG_ARCH_FREERTOS +#error "MG_ARCH_FREERTOS has been deprecated, set MG_ARCH=your_build_environment and MG_ENABLE_FREERTOS=1 instead" +#undef MG_ARCH // avoid errors piling up, provide a clean environment so the error above is seen +#define MG_ARCH MG_ARCH_ARMGCC +#define MG_ENABLE_FREERTOS 1 #endif // http://esr.ibiblio.org/?p=5095 @@ -43,13 +50,14 @@ #include "arch_cube.h" #include "arch_esp32.h" #include "arch_esp8266.h" -#include "arch_freertos.h" #include "arch_rtx.h" #include "arch_threadx.h" #include "arch_unix.h" #include "arch_win32.h" #include "arch_zephyr.h" +#include "os_freertos.h" + #include "net_ft.h" #include "net_lwip.h" #include "net_rl.h" diff --git a/src/arch_armcgt.h b/src/arch_armcgt.h index 42626ed3..100d5da3 100644 --- a/src/arch_armcgt.h +++ b/src/arch_armcgt.h @@ -13,7 +13,6 @@ #include #define MG_PATH_MAX 100 -#define MG_ENABLE_SOCKET 0 #define MG_ENABLE_DIRLIST 0 #endif diff --git a/src/arch_armgcc.h b/src/arch_armgcc.h index f11c2967..cd2ffee4 100644 --- a/src/arch_armgcc.h +++ b/src/arch_armgcc.h @@ -4,7 +4,9 @@ #define _POSIX_TIMERS #include +#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP #include +#endif #include #include #include @@ -17,7 +19,6 @@ #include #define MG_PATH_MAX 100 -#define MG_ENABLE_SOCKET 0 #define MG_ENABLE_DIRLIST 0 #endif diff --git a/src/arch_cube.h b/src/arch_cube.h index 73425b98..6d63275a 100644 --- a/src/arch_cube.h +++ b/src/arch_cube.h @@ -3,7 +3,9 @@ #if MG_ARCH == MG_ARCH_CUBE #include +#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP #include +#endif #include #include #include @@ -27,9 +29,6 @@ #define MG_ENABLE_DIRLIST 0 #endif -#ifndef MG_ENABLE_SOCKET -#define MG_ENABLE_SOCKET 0 -#endif #ifndef MG_ENABLE_TCPIP #define MG_ENABLE_TCPIP 1 // Enable built-in TCP/IP stack diff --git a/src/arch_freertos.h b/src/arch_freertos.h deleted file mode 100644 index dd54ad40..00000000 --- a/src/arch_freertos.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#if MG_ARCH == MG_ARCH_FREERTOS - -#include -#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP -#include -#endif -#include -#include -#include -#include -#include -#include // rand(), strtol(), atoi() -#include -#if defined(__ARMCC_VERSION) -#define mode_t size_t -#include -#include -#define strdup(s) ((char *) mg_strdup(mg_str(s)).buf) -#elif defined(__CCRH__) -#else -#include -#endif - -#include -#include - -#define MG_ENABLE_CUSTOM_CALLOC 1 - -static inline void mg_free(void *ptr) { - vPortFree(ptr); -} - -// Re-route calloc/free to the FreeRTOS's functions, don't use stdlib -static inline void *mg_calloc(size_t cnt, size_t size) { - void *p = pvPortMalloc(cnt * size); - if (p != NULL) memset(p, 0, size * cnt); - return p; -} - -#if !defined(MG_ENABLE_POSIX_FS) || !MG_ENABLE_POSIX_FS -#else -#define mkdir(a, b) mg_mkdir(a, b) -static inline int mg_mkdir(const char *path, mode_t mode) { - (void) path, (void) mode; - return -1; -} -#endif - -#endif // MG_ARCH == MG_ARCH_FREERTOS diff --git a/src/arch_rtx.h b/src/arch_rtx.h index a6008db7..97799c43 100644 --- a/src/arch_rtx.h +++ b/src/arch_rtx.h @@ -26,12 +26,15 @@ extern uint32_t rt_time_get(void); #if defined(__ARMCC_VERSION) #define mode_t size_t +#if !defined(MG_ENABLE_POSIX_FS) || !MG_ENABLE_POSIX_FS +#else #define mkdir(a, b) mg_mkdir(a, b) static inline int mg_mkdir(const char *path, mode_t mode) { (void) path, (void) mode; return -1; } #endif +#endif #if (MG_ARCH == MG_ARCH_CMSIS_RTOS1 || MG_ARCH == MG_ARCH_CMSIS_RTOS2) && \ !defined MG_ENABLE_RL && (!defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP) && \ diff --git a/src/arch_unix.h b/src/arch_unix.h index 1ea9fd51..ea5e4b60 100644 --- a/src/arch_unix.h +++ b/src/arch_unix.h @@ -17,7 +17,9 @@ #include #include #include +#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP #include +#endif #include #include #include diff --git a/src/arch_win32.h b/src/arch_win32.h index a85b63d4..39923c17 100644 --- a/src/arch_win32.h +++ b/src/arch_win32.h @@ -43,7 +43,9 @@ #include #include +#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP #include +#endif #include #include #include diff --git a/src/config.h b/src/config.h index 7e8bb87c..b327502c 100644 --- a/src/config.h +++ b/src/config.h @@ -12,12 +12,16 @@ #define MG_ENABLE_CUSTOM_LOG 0 // Let user define their own MG_LOG #endif +#ifndef MG_ENABLE_FREERTOS +#define MG_ENABLE_FREERTOS 0 // FreeRTOS RTOS +#endif + #ifndef MG_ENABLE_TCPIP #define MG_ENABLE_TCPIP 0 // Mongoose built-in network stack #endif #ifndef MG_ENABLE_LWIP -#define MG_ENABLE_LWIP 0 // lWIP network stack +#define MG_ENABLE_LWIP 0 // lwIP network stack #endif #ifndef MG_ENABLE_FREERTOS_TCP diff --git a/src/os_freertos.h b/src/os_freertos.h new file mode 100644 index 00000000..45c2ab2a --- /dev/null +++ b/src/os_freertos.h @@ -0,0 +1,21 @@ +#pragma once + +#if defined(MG_ENABLE_FREERTOS) && MG_ENABLE_FREERTOS + +#include +#include + +#define MG_ENABLE_CUSTOM_CALLOC 1 + +static inline void mg_free(void *ptr) { + vPortFree(ptr); +} + +// Re-route calloc/free to FreeRTOS functions, don't use stdlib +static inline void *mg_calloc(size_t cnt, size_t size) { + void *p = pvPortMalloc(cnt * size); + if (p != NULL) memset(p, 0, size * cnt); + return p; +} + +#endif // MG_ENABLE_FREERTOS diff --git a/src/util.c b/src/util.c index 3df83065..459a581f 100644 --- a/src/util.c +++ b/src/util.c @@ -156,15 +156,8 @@ bool mg_path_is_sane(const struct mg_str path) { #if MG_ENABLE_CUSTOM_MILLIS #else uint64_t mg_millis(void) { -#if MG_ARCH == MG_ARCH_WIN32 - return GetTickCount(); -#elif MG_ARCH == MG_ARCH_PICOSDK - return time_us_64() / 1000; -#elif MG_ARCH == MG_ARCH_ESP8266 || MG_ARCH == MG_ARCH_ESP32 || \ - MG_ARCH == MG_ARCH_FREERTOS +#if MG_ARCH == MG_ARCH_ESP8266 || MG_ARCH == MG_ARCH_ESP32 || MG_ENABLE_FREERTOS return xTaskGetTickCount() * portTICK_PERIOD_MS; -#elif MG_ARCH == MG_ARCH_CUBE - return (uint64_t) HAL_GetTick(); #elif MG_ARCH == MG_ARCH_THREADX return tx_time_get() * (1000 /* MS per SEC */ / TX_TIMER_TICKS_PER_SECOND); #elif MG_ARCH == MG_ARCH_TIRTOS @@ -177,6 +170,12 @@ uint64_t mg_millis(void) { return (uint64_t) ((osKernelGetTickCount() * 1000) / osKernelGetTickFreq()); #elif MG_ARCH == MG_ARCH_RTTHREAD return (uint64_t) ((rt_tick_get() * 1000) / RT_TICK_PER_SECOND); +#elif MG_ARCH == MG_ARCH_WIN32 + return GetTickCount(); +#elif MG_ARCH == MG_ARCH_PICOSDK + return time_us_64() / 1000; +#elif MG_ARCH == MG_ARCH_CUBE + return (uint64_t) HAL_GetTick(); #elif MG_ARCH == MG_ARCH_UNIX && defined(__APPLE__) // Apple CLOCK_MONOTONIC_RAW is equivalent to CLOCK_BOOTTIME on linux // Apple CLOCK_UPTIME_RAW is equivalent to CLOCK_MONOTONIC_RAW on linux diff --git a/test/Makefile b/test/Makefile index 9bf68514..147c1aa6 100644 --- a/test/Makefile +++ b/test/Makefile @@ -251,7 +251,7 @@ mongoose.c: Makefile $(wildcard ../src/*.c) $(wildcard ../src/drivers/*.c) cd .. && (export LC_ALL=C ; cat src/license.h; echo; echo '#include "mongoose.h"' ; (for F in src/*.c src/drivers/*.c ; do echo; echo '#ifdef MG_ENABLE_LINES'; echo "#line 1 \"$$F\""; echo '#endif'; cat $$F | sed -e 's,#include ".*,,'; done))> $@ mongoose.h: $(HDRS) Makefile - cd .. && (cat src/license.h; echo; echo '#ifndef MONGOOSE_H'; echo '#define MONGOOSE_H'; echo; cat src/version.h ; echo; echo '#ifdef __cplusplus'; echo 'extern "C" {'; echo '#endif'; cat src/arch.h src/arch_*.h src/net_ft.h src/net_lwip.h src/net_rl.h src/config.h src/profile.h src/str.h src/queue.h src/fmt.h src/printf.h src/log.h src/timer.h src/fs.h src/util.h src/url.h src/iobuf.h src/base64.h src/md5.h src/sha1.h src/sha256.h src/event.h src/net.h src/http.h src/ssi.h src/tls.h src/tls_x25519.h src/tls_aes128.h src/tls_uecc.h src/tls_chacha20.h src/tls_rsa.h src/tls_mbed.h src/tls_openssl.h src/ws.h src/sntp.h src/mqtt.h src/dns.h src/modbus.h src/json.h src/rpc.h src/dash.h src/ota.h src/flash.h src/wifi.h src/l2.h src/net_builtin.h src/drivers/*.h | sed -e '/keep/! s,#include ".*,,' -e 's,^#pragma once,,'; echo; echo '#ifdef __cplusplus'; echo '}'; echo '#endif'; echo '#endif // MONGOOSE_H')> $@ + cd .. && (cat src/license.h; echo; echo '#ifndef MONGOOSE_H'; echo '#define MONGOOSE_H'; echo; cat src/version.h ; echo; echo '#ifdef __cplusplus'; echo 'extern "C" {'; echo '#endif'; cat src/arch.h src/arch_*.h src/os_*.h src/net_ft.h src/net_lwip.h src/net_rl.h src/config.h src/profile.h src/str.h src/queue.h src/fmt.h src/printf.h src/log.h src/timer.h src/fs.h src/util.h src/url.h src/iobuf.h src/base64.h src/md5.h src/sha1.h src/sha256.h src/event.h src/net.h src/http.h src/ssi.h src/tls.h src/tls_x25519.h src/tls_aes128.h src/tls_uecc.h src/tls_chacha20.h src/tls_rsa.h src/tls_mbed.h src/tls_openssl.h src/ws.h src/sntp.h src/mqtt.h src/dns.h src/modbus.h src/json.h src/rpc.h src/dash.h src/ota.h src/flash.h src/wifi.h src/l2.h src/net_builtin.h src/drivers/*.h | sed -e '/keep/! s,#include ".*,,' -e 's,^#pragma once,,'; echo; echo '#ifdef __cplusplus'; echo '}'; echo '#endif'; echo '#endif // MONGOOSE_H')> $@ clean: clean_tutorials clean_tutorials_embedded diff --git a/test/wizard/Makefile b/test/wizard/Makefile index 9a668281..bd96ec64 100644 --- a/test/wizard/Makefile +++ b/test/wizard/Makefile @@ -42,8 +42,8 @@ firmware.bin: wizard $(BUILD) && rm -rf wizard* wizard: FORCE - hash=$$(curl -s -X POST -H "Content-Type: application/json" -d '{"build":{"board":"$(BOARD)","ide":"$(IDE)","rtos":"$(RTOS)"}}' $(WIZARD_URL)/api/hash | jq -r '.hash') \ - && curl -s $(WIZARD_URL)/api/zip/$(BOARD)/$(IDE)/$(RTOS)/$$hash -o wizard.zip + hash=$$(curl -H 'Cookie: mongoose_wizard_uid=F2PPlAgQCqSthV1g' -s -X POST -H "Content-Type: application/json" -d '{"build":{"board":"$(BOARD)","ide":"$(IDE)","rtos":"$(RTOS)"},"http":{"http": true}}' $(WIZARD_URL)/api/hash | jq -r '.hash') \ + && curl -H 'Cookie: mongoose_wizard_uid=F2PPlAgQCqSthV1g' -s $(WIZARD_URL)/api/zip -o wizard.zip unzip wizard.zip FORCE: diff --git a/tutorials/nxp/frdm-rw612-xpresso-freertos-builtin-wifi/source/mongoose_config.h b/tutorials/nxp/frdm-rw612-xpresso-freertos-builtin-wifi/source/mongoose_config.h index 04c3059d..58c9d47c 100644 --- a/tutorials/nxp/frdm-rw612-xpresso-freertos-builtin-wifi/source/mongoose_config.h +++ b/tutorials/nxp/frdm-rw612-xpresso-freertos-builtin-wifi/source/mongoose_config.h @@ -1,7 +1,8 @@ #pragma once // See https://mongoose.ws/documentation/#build-options -#define MG_ARCH MG_ARCH_FREERTOS +#define MG_ARCH MG_ARCH_ARMGCC +#define MG_ENABLE_FREERTOS 1 #define MG_ENABLE_TCPIP 1 #define MG_ENABLE_DRIVER_NXP_WIFI 1 diff --git a/tutorials/nxp/frdm-rw612-xpresso-freertos-lwip-wifi/source/mongoose_config.h b/tutorials/nxp/frdm-rw612-xpresso-freertos-lwip-wifi/source/mongoose_config.h index 83cdfac4..9aa5b24e 100644 --- a/tutorials/nxp/frdm-rw612-xpresso-freertos-lwip-wifi/source/mongoose_config.h +++ b/tutorials/nxp/frdm-rw612-xpresso-freertos-lwip-wifi/source/mongoose_config.h @@ -1,7 +1,8 @@ #pragma once // See https://mongoose.ws/documentation/#build-options -#define MG_ARCH MG_ARCH_FREERTOS +#define MG_ARCH MG_ARCH_ARMGCC +#define MG_ENABLE_FREERTOS 1 #define MG_ENABLE_LWIP 1 diff --git a/tutorials/nxp/frdm-rw612-xpresso-freertos-lwip/source/mongoose_config.h b/tutorials/nxp/frdm-rw612-xpresso-freertos-lwip/source/mongoose_config.h index e2cc4f88..b987f679 100644 --- a/tutorials/nxp/frdm-rw612-xpresso-freertos-lwip/source/mongoose_config.h +++ b/tutorials/nxp/frdm-rw612-xpresso-freertos-lwip/source/mongoose_config.h @@ -1,6 +1,7 @@ #pragma once // See https://mongoose.ws/documentation/#build-options -#define MG_ARCH MG_ARCH_FREERTOS +#define MG_ARCH MG_ARCH_ARMGCC +#define MG_ENABLE_FREERTOS 1 #define MG_ENABLE_LWIP 1 diff --git a/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/com.st.stm32cube.ide.mcu.sfrview.prefs b/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/com.st.stm32cube.ide.mcu.sfrview.prefs deleted file mode 100644 index 98a69fc7..00000000 --- a/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/com.st.stm32cube.ide.mcu.sfrview.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -sfrviewstate={"fFavorites"\:{"fLists"\:{}},"fProperties"\:{"fNodeProperties"\:{}}} diff --git a/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/language.settings.xml b/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/language.settings.xml deleted file mode 100644 index a1a457ac..00000000 --- a/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/language.settings.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/org.eclipse.cdt.core.prefs b/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/org.eclipse.cdt.core.prefs deleted file mode 100644 index c8ec5df2..00000000 --- a/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/org.eclipse.cdt.core.prefs +++ /dev/null @@ -1,6 +0,0 @@ -doxygen/doxygen_new_line_after_brief=true -doxygen/doxygen_use_brief_tag=false -doxygen/doxygen_use_javadoc_tags=true -doxygen/doxygen_use_pre_tag=false -doxygen/doxygen_use_structural_commands=false -eclipse.preferences.version=1 diff --git a/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/stm32cubeide.project.prefs b/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/stm32cubeide.project.prefs deleted file mode 100644 index be6e2fec..00000000 --- a/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/.settings/stm32cubeide.project.prefs +++ /dev/null @@ -1,5 +0,0 @@ -635E684B79701B039C64EA45C3F84D30=1767C1FD5A90CBA93D279BE91F305A67 -66BE74F758C12D739921AEA421D593D3=0 -8DF89ED150041C4CBC7CB9A9CAA90856=7FFD126C0666B803FF7CCACF304BE6C0 -DC22A860405A8BF2F2C095E5B6529F12=7FFD126C0666B803FF7CCACF304BE6C0 -eclipse.preferences.version=1 diff --git a/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/Core/Inc/mongoose_config.h b/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/Core/Inc/mongoose_config.h index 2254f6f4..010b53de 100644 --- a/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/Core/Inc/mongoose_config.h +++ b/tutorials/stm32/nucleo-f429zi-cube-freertos-lwip/Core/Inc/mongoose_config.h @@ -9,7 +9,8 @@ #define MG_ENABLE_CUSTOM_MILLIS 0 #define MG_ENABLE_MBEDTLS 0 -#define MG_ARCH MG_ARCH_FREERTOS +#define MG_ARCH MG_ARCH_ARMGCC +#define MG_ENABLE_FREERTOS 1 #define MG_STMPACK_NET 1 #define MG_ENABLE_CUSTOM_RANDOM 1 diff --git a/tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/.settings/com.st.stm32cube.ide.mcu.sfrview.prefs b/tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/.settings/com.st.stm32cube.ide.mcu.sfrview.prefs deleted file mode 100644 index 98a69fc7..00000000 --- a/tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/.settings/com.st.stm32cube.ide.mcu.sfrview.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -sfrviewstate={"fFavorites"\:{"fLists"\:{}},"fProperties"\:{"fNodeProperties"\:{}}} diff --git a/tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/.settings/language.settings.xml b/tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/.settings/language.settings.xml deleted file mode 100644 index 7f05fe9e..00000000 --- a/tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/.settings/language.settings.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/.settings/stm32cubeide.project.prefs b/tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/.settings/stm32cubeide.project.prefs deleted file mode 100644 index 1e444d44..00000000 --- a/tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/.settings/stm32cubeide.project.prefs +++ /dev/null @@ -1,5 +0,0 @@ -635E684B79701B039C64EA45C3F84D30=7EC62A8EEAB33E6B6251E64B7094FD8B -66BE74F758C12D739921AEA421D593D3=1 -8DF89ED150041C4CBC7CB9A9CAA90856=B51B08583BFB231F447A5555C047C200 -DC22A860405A8BF2F2C095E5B6529F12=B51B08583BFB231F447A5555C047C200 -eclipse.preferences.version=1 diff --git a/tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/Core/Inc/mongoose_config.h b/tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/Core/Inc/mongoose_config.h index 2254f6f4..010b53de 100644 --- a/tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/Core/Inc/mongoose_config.h +++ b/tutorials/stm32/nucleo-f746zg-cube-freertos-lwip/Core/Inc/mongoose_config.h @@ -9,7 +9,8 @@ #define MG_ENABLE_CUSTOM_MILLIS 0 #define MG_ENABLE_MBEDTLS 0 -#define MG_ARCH MG_ARCH_FREERTOS +#define MG_ARCH MG_ARCH_ARMGCC +#define MG_ENABLE_FREERTOS 1 #define MG_STMPACK_NET 1 #define MG_ENABLE_CUSTOM_RANDOM 1 diff --git a/tutorials/stm32/nucleo-f746zg-make-freertos-tcp/mongoose_config.h b/tutorials/stm32/nucleo-f746zg-make-freertos-tcp/mongoose_config.h index 4396dd03..efe62b72 100644 --- a/tutorials/stm32/nucleo-f746zg-make-freertos-tcp/mongoose_config.h +++ b/tutorials/stm32/nucleo-f746zg-make-freertos-tcp/mongoose_config.h @@ -1,9 +1,9 @@ #pragma once // See https://mongoose.ws/documentation/#build-options -#define MG_ARCH MG_ARCH_FREERTOS +#define MG_ARCH MG_ARCH_ARMGCC +#define MG_ENABLE_FREERTOS 1 #define MG_ENABLE_FREERTOS_TCP 1 -#define MG_ENABLE_DRIVER_STM32F 1 #define MG_ENABLE_CUSTOM_RANDOM 1