diff --git a/mongoose.h b/mongoose.h index 0b537e0c..bf6699ce 100644 --- a/mongoose.h +++ b/mongoose.h @@ -40,6 +40,7 @@ extern "C" { #define MG_ARCH_NEWLIB 10 #define MG_ARCH_RTX 11 #define MG_ARCH_TIRTOS 12 +#define MG_ARCH_RP2040 13 #if !defined(MG_ARCH) #if defined(__unix__) || defined(__APPLE__) @@ -56,6 +57,8 @@ extern "C" { #define MG_ARCH MG_ARCH_AZURERTOS #elif defined(__ZEPHYR__) #define MG_ARCH MG_ARCH_ZEPHYR +#elif defined(PICO_TARGET_NAME) +#define MG_ARCH MG_ARCH_RP2040 #endif #if !defined(MG_ARCH) @@ -318,6 +321,18 @@ struct timeval { #endif +#if MG_ARCH == MG_ARCH_RP2040 +#include +#include +#include +#include +#include +#include +#include +#include +#endif + + #if MG_ARCH == MG_ARCH_RTX #include diff --git a/src/arch.h b/src/arch.h index 4508c8f5..485c4fde 100644 --- a/src/arch.h +++ b/src/arch.h @@ -13,6 +13,7 @@ #define MG_ARCH_NEWLIB 10 #define MG_ARCH_RTX 11 #define MG_ARCH_TIRTOS 12 +#define MG_ARCH_RP2040 13 #if !defined(MG_ARCH) #if defined(__unix__) || defined(__APPLE__) @@ -29,6 +30,8 @@ #define MG_ARCH MG_ARCH_AZURERTOS #elif defined(__ZEPHYR__) #define MG_ARCH MG_ARCH_ZEPHYR +#elif defined(PICO_TARGET_NAME) +#define MG_ARCH MG_ARCH_RP2040 #endif #if !defined(MG_ARCH) diff --git a/src/arch_rp2040.h b/src/arch_rp2040.h new file mode 100644 index 00000000..5511c66e --- /dev/null +++ b/src/arch_rp2040.h @@ -0,0 +1,12 @@ +#pragma once + +#if MG_ARCH == MG_ARCH_RP2040 +#include +#include +#include +#include +#include +#include +#include +#include +#endif