diff --git a/inc/assert.h b/inc/assert.h index ffc8150..3683e68 100644 --- a/inc/assert.h +++ b/inc/assert.h @@ -1,5 +1,5 @@ -#ifndef _ASSERT_H -#define _ASSERT_H +#ifndef _RTLIBC_ASSERT_H +#define _RTLIBC_ASSERT_H #include diff --git a/inc/ctype.h b/inc/ctype.h index c973e7b..d4a3916 100644 --- a/inc/ctype.h +++ b/inc/ctype.h @@ -1,5 +1,5 @@ -#ifndef _RTCTYPE_H -#define _RTCTYPE_H +#ifndef _RTLIBC_CTYPE_H +#define _RTLIBC_CTYPE_H #include diff --git a/inc/malloc.h b/inc/malloc.h index c40007c..abf9aa6 100644 --- a/inc/malloc.h +++ b/inc/malloc.h @@ -1,5 +1,5 @@ -#ifndef _RTMALLOC_H -#define _RTMALLOC_H +#ifndef _RTLIBC_MALLOC_H +#define _RTLIBC_MALLOC_H #include #include diff --git a/inc/math.h b/inc/math.h index eeb5e8a..3830101 100644 --- a/inc/math.h +++ b/inc/math.h @@ -5,12 +5,6 @@ #include -#if defined ARM_MATH_CM7 || defined ARM_MATH_CM4 || defined ARM_MATH_CM3 || defined ARM_MATH_CM0 -#include -#include -#endif - - #define M_E 2.718281828459045235360287471352662498L //e #define M_LOG2E 1.442695040888963407359924681001892137L //log_2 e #define M_LOG10E 0.434294481903251827651128918916605082L //log_10 e @@ -224,43 +218,6 @@ } - -#if defined(ARM_MATH_CM7) || defined(ARM_MATH_CM4) - - -static inline float sin(float x) -{ - return arm_sin_f32(x); -} - - -static inline float cos(float x) -{ - return arm_cos_f32(x); -} - - -static inline float tan(float x) -{ - float s, c; - - arm_sin_cos_f32(x, &s, &c); - - return s / c; -} - - -static inline float cotan(float x) -{ - float s, c; - - arm_sin_cos_f32(x, &s, &c); - - return c / s; -} - -#else - float sin(float x); float cos(float x); @@ -275,11 +232,6 @@ return cos(x) / sin(x); } -#endif - - - - float exp(float x); float log(float x); diff --git a/inc/printf.h b/inc/printf.h index 033b911..1fc1602 100644 --- a/inc/printf.h +++ b/inc/printf.h @@ -1,5 +1,5 @@ -#ifndef _RTPRINTF_H -#define _RTPRINTF_H +#ifndef _RTLIBC_PRINTF_H +#define _RTLIBC_PRINTF_H #include diff --git a/inc/stdio.h b/inc/stdio.h index 743ee42..dd7dda0 100644 --- a/inc/stdio.h +++ b/inc/stdio.h @@ -1,5 +1,5 @@ -#ifndef _RTSTDIO_H -#define _RTSTDIO_H +#ifndef _RTLIBC_STDIO_H +#define _RTLIBC_STDIO_H #include diff --git a/inc/stdlib.h b/inc/stdlib.h index 511e4a5..c6d981d 100644 --- a/inc/stdlib.h +++ b/inc/stdlib.h @@ -1,5 +1,5 @@ -#ifndef _RTSTDLIB_H -#define _RTSTDLIB_H +#ifndef _RTLIBC_STDLIB_H +#define _RTLIBC_STDLIB_H #include @@ -16,29 +16,12 @@ #endif - -#ifdef _RTLIBC_MALLOC_FREERTOS_ - -#define malloc_init(...) while(0) -#define msize (0) - -void* malloc(size_t size); -void free(void *p); - -#endif - - -#ifdef _RTLIBC_MALLOC_NOOS_ - void malloc_init(void *heap, size_t size, size_t alignment); size_t msize(void *p); void* malloc(size_t size); void free(void *p); -#endif - - uint64_t strtoul(const char *str, char **endptr, int32_t base); int64_t strtol(const char *str, char **endptr, int32_t base); diff --git a/inc/string.h b/inc/string.h index bbdc908..5edade2 100644 --- a/inc/string.h +++ b/inc/string.h @@ -1,5 +1,5 @@ -#ifndef _RTSTRING_H -#define _RTSTRING_H +#ifndef _RTLIBC_STRING_H +#define _RTLIBC_STRING_H #include diff --git a/inc/types.h b/inc/types.h index 21529a3..1fecd45 100644 --- a/inc/types.h +++ b/inc/types.h @@ -1,5 +1,5 @@ -#ifndef _RTTYPES_H -#define _RTTYPES_H +#ifndef _RTLIBC_TYPES_H +#define _RTLIBC_TYPES_H #include diff --git a/src/iprintf.c b/src/iprintf.c index 61f5fa1..21cffc1 100644 --- a/src/iprintf.c +++ b/src/iprintf.c @@ -1,5 +1,3 @@ -#include - #include #include #include diff --git a/src/printf.c b/src/printf.c index 7e27958..1e58446 100644 --- a/src/printf.c +++ b/src/printf.c @@ -1,5 +1,3 @@ -#include - #include #include #include diff --git a/src/stdio.c b/src/stdio.c index 0339185..d8d53e3 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -1,5 +1,3 @@ -#include - #include #include #include diff --git a/src/stdio_internal.h b/src/stdio_internal.h index 48a76e8..17ee84a 100644 --- a/src/stdio_internal.h +++ b/src/stdio_internal.h @@ -1,8 +1,6 @@ #ifndef _STDIO_INTERNAL_H #define _STDIO_INTERNAL_H -#include - #include #include diff --git a/src/stdlib.c b/src/stdlib.c index f74c1c0..06ac18d 100644 --- a/src/stdlib.c +++ b/src/stdlib.c @@ -275,7 +275,6 @@ - void abort(void) { rtlibc_abort_handler(); @@ -283,28 +282,6 @@ - -#ifdef _RTLIBC_MALLOC_FREERTOS_ - -#include - -void* malloc(size_t size) -{ - return pvPortMalloc(size); -} - -void free(void *p) -{ - vPortFree(p); -} - -#endif - - -#ifdef _RTLIBC_MALLOC_NOOS_ - -#include - static rtmalloc_context_t l_malloc_context; __attribute__((weak)) void rtlibc_malloc_failed_handler(void) @@ -340,5 +317,3 @@ assert(p); return rtmsize(&l_malloc_context, p); } - -#endif diff --git a/src/string.c b/src/string.c index 35dcb6a..8a93b52 100644 --- a/src/string.c +++ b/src/string.c @@ -1,5 +1,3 @@ -#include - #include #include