Add MG_ARCH_RP2040

This commit is contained in:
Sergey Lyubka 2022-07-03 23:00:15 +01:00
parent dca43f430b
commit 30126072dc
3 changed files with 30 additions and 0 deletions

View File

@ -40,6 +40,7 @@ extern "C" {
#define MG_ARCH_NEWLIB 10 #define MG_ARCH_NEWLIB 10
#define MG_ARCH_RTX 11 #define MG_ARCH_RTX 11
#define MG_ARCH_TIRTOS 12 #define MG_ARCH_TIRTOS 12
#define MG_ARCH_RP2040 13
#if !defined(MG_ARCH) #if !defined(MG_ARCH)
#if defined(__unix__) || defined(__APPLE__) #if defined(__unix__) || defined(__APPLE__)
@ -56,6 +57,8 @@ extern "C" {
#define MG_ARCH MG_ARCH_AZURERTOS #define MG_ARCH MG_ARCH_AZURERTOS
#elif defined(__ZEPHYR__) #elif defined(__ZEPHYR__)
#define MG_ARCH MG_ARCH_ZEPHYR #define MG_ARCH MG_ARCH_ZEPHYR
#elif defined(PICO_TARGET_NAME)
#define MG_ARCH MG_ARCH_RP2040
#endif #endif
#if !defined(MG_ARCH) #if !defined(MG_ARCH)
@ -318,6 +321,18 @@ struct timeval {
#endif #endif
#if MG_ARCH == MG_ARCH_RP2040
#include <errno.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#endif
#if MG_ARCH == MG_ARCH_RTX #if MG_ARCH == MG_ARCH_RTX
#include <ctype.h> #include <ctype.h>

View File

@ -13,6 +13,7 @@
#define MG_ARCH_NEWLIB 10 #define MG_ARCH_NEWLIB 10
#define MG_ARCH_RTX 11 #define MG_ARCH_RTX 11
#define MG_ARCH_TIRTOS 12 #define MG_ARCH_TIRTOS 12
#define MG_ARCH_RP2040 13
#if !defined(MG_ARCH) #if !defined(MG_ARCH)
#if defined(__unix__) || defined(__APPLE__) #if defined(__unix__) || defined(__APPLE__)
@ -29,6 +30,8 @@
#define MG_ARCH MG_ARCH_AZURERTOS #define MG_ARCH MG_ARCH_AZURERTOS
#elif defined(__ZEPHYR__) #elif defined(__ZEPHYR__)
#define MG_ARCH MG_ARCH_ZEPHYR #define MG_ARCH MG_ARCH_ZEPHYR
#elif defined(PICO_TARGET_NAME)
#define MG_ARCH MG_ARCH_RP2040
#endif #endif
#if !defined(MG_ARCH) #if !defined(MG_ARCH)

12
src/arch_rp2040.h Normal file
View File

@ -0,0 +1,12 @@
#pragma once
#if MG_ARCH == MG_ARCH_RP2040
#include <errno.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#endif