2020-12-05 11:26:32 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-03-21 19:32:56 -03:00
|
|
|
#define MG_ARCH_CUSTOM 0 // User creates its own mongoose_custom.h
|
|
|
|
#define MG_ARCH_UNIX 1 // Linux, BSD, Mac, ...
|
|
|
|
#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_AZURERTOS 6 // MS Azure RTOS
|
|
|
|
#define MG_ARCH_ZEPHYR 7 // Zephyr RTOS
|
|
|
|
#define MG_ARCH_NEWLIB 8 // Bare metal ARM
|
|
|
|
#define MG_ARCH_CMSIS_RTOS1 9 // CMSIS-RTOS API v1 (Keil RTX)
|
|
|
|
#define MG_ARCH_TIRTOS 10 // Texas Semi TI-RTOS
|
|
|
|
#define MG_ARCH_RP2040 11 // Raspberry Pi RP2040
|
|
|
|
#define MG_ARCH_ARMCC 12 // Keil MDK-Core with Configuration Wizard
|
|
|
|
#define MG_ARCH_CMSIS_RTOS2 13 // CMSIS-RTOS API v2 (Keil RTX5, FreeRTOS)
|
2023-06-26 16:18:40 +08:00
|
|
|
#define MG_ARCH_RTTHREAD 14 // RT-Thread RTOS
|
2020-12-05 11:26:32 +00:00
|
|
|
|
|
|
|
#if !defined(MG_ARCH)
|
2021-05-11 09:12:06 +01:00
|
|
|
#if defined(__unix__) || defined(__APPLE__)
|
2020-12-05 11:26:32 +00:00
|
|
|
#define MG_ARCH MG_ARCH_UNIX
|
|
|
|
#elif defined(_WIN32)
|
|
|
|
#define MG_ARCH MG_ARCH_WIN32
|
|
|
|
#elif defined(ICACHE_FLASH) || defined(ICACHE_RAM_ATTR)
|
|
|
|
#define MG_ARCH MG_ARCH_ESP8266
|
2022-10-21 11:39:45 -03:00
|
|
|
#elif defined(__ZEPHYR__)
|
|
|
|
#define MG_ARCH MG_ARCH_ZEPHYR
|
2020-12-27 01:29:42 +00:00
|
|
|
#elif defined(ESP_PLATFORM)
|
|
|
|
#define MG_ARCH MG_ARCH_ESP32
|
2021-05-17 17:36:57 +01:00
|
|
|
#elif defined(FREERTOS_IP_H)
|
2022-11-06 01:03:33 +00:00
|
|
|
#define MG_ARCH MG_ARCH_FREERTOS
|
|
|
|
#define MG_ENABLE_FREERTOS_TCP 1
|
2021-09-14 09:28:28 +03:00
|
|
|
#elif defined(AZURE_RTOS_THREADX)
|
|
|
|
#define MG_ARCH MG_ARCH_AZURERTOS
|
2022-07-03 23:00:15 +01:00
|
|
|
#elif defined(PICO_TARGET_NAME)
|
|
|
|
#define MG_ARCH MG_ARCH_RP2040
|
2023-03-13 13:38:53 -03:00
|
|
|
#elif defined(__ARMCC_VERSION)
|
|
|
|
#define MG_ARCH MG_ARCH_ARMCC
|
2023-06-26 16:18:40 +08:00
|
|
|
#elif defined(__RTTHREAD__)
|
|
|
|
#define MG_ARCH MG_ARCH_RTTHREAD
|
2020-12-05 11:26:32 +00:00
|
|
|
#endif
|
2022-11-03 12:59:55 +00:00
|
|
|
#endif // !defined(MG_ARCH)
|
2020-12-05 11:26:32 +00:00
|
|
|
|
2023-03-13 13:38:53 -03:00
|
|
|
// if the user did not specify an MG_ARCH, or specified a custom one, OR
|
|
|
|
// we guessed a known IDE, pull the customized config (Configuration Wizard)
|
|
|
|
#if !defined(MG_ARCH) || (MG_ARCH == MG_ARCH_CUSTOM) || MG_ARCH == MG_ARCH_ARMCC
|
2022-08-31 18:20:34 +01:00
|
|
|
#include "mongoose_custom.h" // keep this include
|
2020-12-05 11:26:32 +00:00
|
|
|
#endif
|
|
|
|
|
2022-08-20 18:26:29 +01:00
|
|
|
#if !defined(MG_ARCH)
|
|
|
|
#error "MG_ARCH is not specified and we couldn't guess it. Set -D MG_ARCH=..."
|
2020-12-05 11:26:32 +00:00
|
|
|
#endif
|
|
|
|
|
2022-09-28 12:42:20 +01:00
|
|
|
// http://esr.ibiblio.org/?p=5095
|
2022-11-06 01:03:33 +00:00
|
|
|
#define MG_BIG_ENDIAN (*(uint16_t *) "\0\xff" < 0x100)
|
2022-09-28 12:42:20 +01:00
|
|
|
|
2020-12-05 11:26:32 +00:00
|
|
|
#include "arch_esp32.h"
|
|
|
|
#include "arch_esp8266.h"
|
2022-11-06 01:03:33 +00:00
|
|
|
#include "arch_freertos.h"
|
2022-05-01 13:47:33 +01:00
|
|
|
#include "arch_newlib.h"
|
2022-05-12 08:07:51 +01:00
|
|
|
#include "arch_rtx.h"
|
2020-12-05 11:26:32 +00:00
|
|
|
#include "arch_unix.h"
|
|
|
|
#include "arch_win32.h"
|
2022-03-30 07:56:44 +01:00
|
|
|
#include "arch_zephyr.h"
|
2022-11-06 01:03:33 +00:00
|
|
|
|
|
|
|
#include "net_ft.h"
|
|
|
|
#include "net_lwip.h"
|
|
|
|
#include "net_rl.h"
|