mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-23 18:49:01 +08:00
remove arch autodetection for embedded
This commit is contained in:
parent
0f4ca8d010
commit
157f87f01a
1
examples/esp32/device-dashboard/main/mongoose_config.h
Normal file
1
examples/esp32/device-dashboard/main/mongoose_config.h
Normal file
@ -0,0 +1 @@
|
||||
#define MG_ARCH MG_ARCH_ESP32
|
@ -1,2 +1 @@
|
||||
// For some reason, IDF detection at build time does not work here
|
||||
#define MG_ARCH MG_ARCH_ESP32
|
||||
|
1
examples/esp32/uart-bridge/main/mongoose_config.h
Normal file
1
examples/esp32/uart-bridge/main/mongoose_config.h
Normal file
@ -0,0 +1 @@
|
||||
#define MG_ARCH MG_ARCH_ESP32
|
@ -7,4 +7,3 @@
|
||||
# please read the ESP-IDF documents if you need to do this.
|
||||
#
|
||||
|
||||
COMPONENT_INCLUDES += ../../../../../..
|
||||
|
1
examples/esp8266/http-client-server/src/main/mongoose.h
Symbolic link
1
examples/esp8266/http-client-server/src/main/mongoose.h
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../../mongoose.h
|
@ -0,0 +1,2 @@
|
||||
#define MG_ARCH MG_ARCH_ESP8266
|
||||
|
@ -17,8 +17,3 @@ pico_add_extra_outputs(firmware) # create map/bin/hex file etc.
|
||||
|
||||
pico_enable_stdio_usb(firmware 1) # Route stdio
|
||||
pico_enable_stdio_uart(firmware 0) # to USB
|
||||
|
||||
# Mongoose build flags
|
||||
add_definitions(-DMG_ENABLE_TCPIP=1)
|
||||
add_definitions(-DMG_ENABLE_TCPIP_DRIVER_INIT=0)
|
||||
add_definitions(-DMG_ENABLE_PACKED_FS=1)
|
||||
|
5
examples/rp2040/pico-rmii/mongoose_config.h
Normal file
5
examples/rp2040/pico-rmii/mongoose_config.h
Normal file
@ -0,0 +1,5 @@
|
||||
#define MG_ARCH MG_ARCH_RP2040
|
||||
|
||||
#define MG_ENABLE_TCPIP 1
|
||||
#define MG_ENABLE_TCPIP_DRIVER_INIT 0
|
||||
#define MG_ENABLE_PACKED_FS 1
|
@ -23,12 +23,7 @@ pico_add_extra_outputs(firmware) # create map/bin/hex file etc.
|
||||
pico_enable_stdio_usb(firmware 0) # Route stdio
|
||||
pico_enable_stdio_uart(firmware 1) # to the UART
|
||||
|
||||
# Mongoose build flags
|
||||
add_definitions(-DMG_ENABLE_TCPIP=1)
|
||||
add_definitions(-DMG_ENABLE_PACKED_FS=1)
|
||||
add_definitions(-DMG_ENABLE_TCPIP_DRIVER_INIT=0)
|
||||
add_definitions(-DMG_ENABLE_POSIX_FS=0)
|
||||
add_definitions(-DDISABLE_ROUTING=1)
|
||||
# Mongoose build flags in mongoose_config.h
|
||||
|
||||
# Example build options
|
||||
add_definitions(-DHTTP_URL="http://0.0.0.0/")
|
||||
|
6
examples/rp2040/pico-rndis-dashboard/mongoose_config.h
Normal file
6
examples/rp2040/pico-rndis-dashboard/mongoose_config.h
Normal file
@ -0,0 +1,6 @@
|
||||
#define MG_ARCH MG_ARCH_RP2040
|
||||
|
||||
#define MG_ENABLE_TCPIP 1
|
||||
#define MG_ENABLE_TCPIP_DRIVER_INIT 0
|
||||
#define MG_ENABLE_PACKED_FS 1
|
||||
#define MG_ENABLE_POSIX_FS 0
|
@ -21,9 +21,6 @@ pico_add_extra_outputs(firmware) # create map/bin/hex file etc.
|
||||
pico_enable_stdio_usb(firmware 0) # Route stdio
|
||||
pico_enable_stdio_uart(firmware 1) # to the UART
|
||||
|
||||
# Mongoose build flags
|
||||
add_definitions(-DMG_ENABLE_TCPIP=1)
|
||||
add_definitions(-DMG_ENABLE_TCPIP_DRIVER_INIT=0)
|
||||
add_definitions(-DMG_ENABLE_POSIX_FS=0)
|
||||
# Mongoose build flags in mongoose_config.h
|
||||
|
||||
# Example build options
|
||||
|
6
examples/rp2040/pico-rndis-device/mongoose_config.h
Normal file
6
examples/rp2040/pico-rndis-device/mongoose_config.h
Normal file
@ -0,0 +1,6 @@
|
||||
#define MG_ARCH MG_ARCH_RP2040
|
||||
|
||||
#define MG_ENABLE_TCPIP 1
|
||||
#define MG_ENABLE_TCPIP_DRIVER_INIT 0
|
||||
#define MG_ENABLE_PACKED_FS 1
|
||||
#define MG_ENABLE_POSIX_FS 0
|
@ -12,12 +12,7 @@ pico_add_extra_outputs(firmware) # create map/bin/hex file etc.
|
||||
pico_enable_stdio_usb(firmware 0) # Route stdio
|
||||
pico_enable_stdio_uart(firmware 1) # to the UART, for remote testing
|
||||
|
||||
# Mongoose build flags
|
||||
add_definitions(-DMG_ENABLE_TCPIP=1)
|
||||
add_definitions(-DMG_ENABLE_DRIVER_W5500=1)
|
||||
add_definitions(-DMG_ENABLE_PACKED_FS=1)
|
||||
add_definitions(-DMG_ENABLE_CUSTOM_RANDOM=1)
|
||||
add_definitions(-DMG_ENABLE_POSIX_FS=0)
|
||||
# Mongoose build flags in mongoose_config.h
|
||||
|
||||
# Example build options
|
||||
add_definitions(-DHTTP_URL="http://0.0.0.0/")
|
||||
|
8
examples/rp2040/pico-w5500/mongoose_config.h
Normal file
8
examples/rp2040/pico-w5500/mongoose_config.h
Normal file
@ -0,0 +1,8 @@
|
||||
#define MG_ARCH MG_ARCH_RP2040
|
||||
|
||||
#define MG_ENABLE_TCPIP 1
|
||||
#define MG_ENABLE_TCPIP_DRIVER_INIT 0
|
||||
#define MG_ENABLE_DRIVER_W5500 1
|
||||
#define MG_ENABLE_CUSTOM_RANDOM 1
|
||||
#define MG_ENABLE_PACKED_FS 1
|
||||
#define MG_ENABLE_POSIX_FS 0
|
@ -6,5 +6,4 @@
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(device_dashboard)
|
||||
add_definitions(-DMG_ENABLE_PACKED_FS=1)
|
||||
target_sources(app PRIVATE src/main.c src/mongoose.c src/net.c src/packed_fs.c)
|
||||
|
4
examples/zephyr/device-dashboard/src/mongoose_config.h
Normal file
4
examples/zephyr/device-dashboard/src/mongoose_config.h
Normal file
@ -0,0 +1,4 @@
|
||||
#define MG_ARCH MG_ARCH_ZEPHYR
|
||||
|
||||
#define MG_ENABLE_PACKED_FS 1
|
||||
#define MG_TLS MG_TLS_MBED
|
@ -6,6 +6,4 @@
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(http_client)
|
||||
#add_definitions(-DMG_ENABLE_LINES=1)
|
||||
add_definitions(-DMG_TLS=MG_TLS_MBED -DMG_MBEDTLS_DEBUG_LEVEL=4)
|
||||
target_sources(app PRIVATE src/main.c src/mongoose.c)
|
||||
|
4
examples/zephyr/http-client/src/mongoose_config.h
Normal file
4
examples/zephyr/http-client/src/mongoose_config.h
Normal file
@ -0,0 +1,4 @@
|
||||
#define MG_ARCH MG_ARCH_ZEPHYR
|
||||
|
||||
#define MG_ENABLE_PACKED_FS 1
|
||||
#define MG_TLS MG_TLS_MBED
|
@ -6,5 +6,4 @@
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(http_server)
|
||||
add_definitions(-DMG_TLS=MG_TLS_MBED)
|
||||
target_sources(app PRIVATE src/main.c src/mongoose.c)
|
||||
|
4
examples/zephyr/http-server/src/mongoose_config.h
Normal file
4
examples/zephyr/http-server/src/mongoose_config.h
Normal file
@ -0,0 +1,4 @@
|
||||
#define MG_ARCH MG_ARCH_ZEPHYR
|
||||
|
||||
#define MG_ENABLE_PACKED_FS 1
|
||||
#define MG_TLS MG_TLS_MBED
|
@ -6,6 +6,4 @@
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(mqtt_aws_client)
|
||||
#add_definitions(-DMG_ENABLE_LINES=1)
|
||||
add_definitions(-DMG_TLS=MG_TLS_MBED -DMG_MBEDTLS_DEBUG_LEVEL=4)
|
||||
target_sources(app PRIVATE src/main.c src/mongoose.c)
|
||||
|
4
examples/zephyr/mqtt-aws-client/src/mongoose_config.h
Normal file
4
examples/zephyr/mqtt-aws-client/src/mongoose_config.h
Normal file
@ -0,0 +1,4 @@
|
||||
#define MG_ARCH MG_ARCH_ZEPHYR
|
||||
|
||||
#define MG_ENABLE_PACKED_FS 1
|
||||
#define MG_TLS MG_TLS_MBED
|
@ -6,6 +6,4 @@
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(websocket_server)
|
||||
#add_definitions(-DMG_ENABLE_LINES=1)
|
||||
add_definitions(-DMG_TLS=MG_TLS_MBED)
|
||||
target_sources(app PRIVATE src/main.c src/mongoose.c)
|
||||
|
4
examples/zephyr/websocket-server/src/mongoose_config.h
Normal file
4
examples/zephyr/websocket-server/src/mongoose_config.h
Normal file
@ -0,0 +1,4 @@
|
||||
#define MG_ARCH MG_ARCH_ZEPHYR
|
||||
|
||||
#define MG_ENABLE_PACKED_FS 1
|
||||
#define MG_TLS MG_TLS_MBED
|
17
mongoose.h
17
mongoose.h
@ -48,21 +48,6 @@ extern "C" {
|
||||
#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
|
||||
#elif defined(__ZEPHYR__)
|
||||
#define MG_ARCH MG_ARCH_ZEPHYR
|
||||
#elif defined(ESP_PLATFORM)
|
||||
#define MG_ARCH MG_ARCH_ESP32
|
||||
#elif defined(FREERTOS_IP_H)
|
||||
#define MG_ARCH MG_ARCH_FREERTOS
|
||||
#define MG_ENABLE_FREERTOS_TCP 1
|
||||
#elif defined(AZURE_RTOS_THREADX)
|
||||
#define MG_ARCH MG_ARCH_AZURERTOS
|
||||
#elif defined(PICO_TARGET_NAME)
|
||||
#define MG_ARCH MG_ARCH_RP2040
|
||||
#elif defined(__RTTHREAD__)
|
||||
#define MG_ARCH MG_ARCH_RTTHREAD
|
||||
#endif
|
||||
#endif // !defined(MG_ARCH)
|
||||
|
||||
@ -71,7 +56,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(MG_ARCH)
|
||||
#error "MG_ARCH is not specified and we couldn't guess it. Set -D MG_ARCH=..."
|
||||
#error "MG_ARCH is not specified and we couldn't guess it. Define MG_ARCH=... in your compiler"
|
||||
#endif
|
||||
|
||||
// http://esr.ibiblio.org/?p=5095
|
||||
|
17
src/arch.h
17
src/arch.h
@ -21,21 +21,6 @@
|
||||
#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
|
||||
#elif defined(__ZEPHYR__)
|
||||
#define MG_ARCH MG_ARCH_ZEPHYR
|
||||
#elif defined(ESP_PLATFORM)
|
||||
#define MG_ARCH MG_ARCH_ESP32
|
||||
#elif defined(FREERTOS_IP_H)
|
||||
#define MG_ARCH MG_ARCH_FREERTOS
|
||||
#define MG_ENABLE_FREERTOS_TCP 1
|
||||
#elif defined(AZURE_RTOS_THREADX)
|
||||
#define MG_ARCH MG_ARCH_AZURERTOS
|
||||
#elif defined(PICO_TARGET_NAME)
|
||||
#define MG_ARCH MG_ARCH_RP2040
|
||||
#elif defined(__RTTHREAD__)
|
||||
#define MG_ARCH MG_ARCH_RTTHREAD
|
||||
#endif
|
||||
#endif // !defined(MG_ARCH)
|
||||
|
||||
@ -44,7 +29,7 @@
|
||||
#endif
|
||||
|
||||
#if !defined(MG_ARCH)
|
||||
#error "MG_ARCH is not specified and we couldn't guess it. Set -D MG_ARCH=..."
|
||||
#error "MG_ARCH is not specified and we couldn't guess it. Define MG_ARCH=... in your compiler"
|
||||
#endif
|
||||
|
||||
// http://esr.ibiblio.org/?p=5095
|
||||
|
Loading…
Reference in New Issue
Block a user