summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorsheltonyu <[email protected]>2021-04-13 11:37:46 +0800
committerGitHub <[email protected]>2021-04-13 11:37:46 +0800
commit46c5ba9225702bf473646ec2f4200c9560e2db90 (patch)
treea7fe59ac9ce9a6a1c90d9c81324a4a6bb91b38a4 /include
parent35ef1f9e0fcf1ae881a83558dbf7334ab08c598e (diff)
parentc44e5165bef5b7b069eb99a4f027454f417a726b (diff)
Merge branch 'master' into developer
Diffstat (limited to 'include')
-rw-r--r--include/libc/libc_dirent.h5
-rw-r--r--include/libc/libc_errno.h4
-rw-r--r--include/libc/libc_fcntl.h4
-rw-r--r--include/libc/libc_fdset.h2
-rw-r--r--include/libc/libc_ioctl.h2
-rw-r--r--include/libc/libc_limits.h6
-rw-r--r--include/libc/libc_signal.h8
-rw-r--r--include/libc/libc_stat.h5
-rw-r--r--include/libc/libc_stdio.h6
-rw-r--r--include/rtdbg.h4
-rw-r--r--include/rtdebug.h5
-rw-r--r--include/rtdef.h54
-rw-r--r--include/rthw.h4
-rw-r--r--include/rtlibc.h2
-rw-r--r--include/rtm.h5
-rw-r--r--include/rtservice.h2
-rw-r--r--include/rtthread.h37
17 files changed, 105 insertions, 50 deletions
diff --git a/include/libc/libc_dirent.h b/include/libc/libc_dirent.h
index c3a19878ec..a86332e633 100644
--- a/include/libc/libc_dirent.h
+++ b/include/libc/libc_dirent.h
@@ -1,7 +1,10 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
*/
#ifndef LIBC_DIRENT_H__
diff --git a/include/libc/libc_errno.h b/include/libc/libc_errno.h
index 9143c841f2..30d6092e33 100644
--- a/include/libc/libc_errno.h
+++ b/include/libc/libc_errno.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -161,7 +161,7 @@ defined in armcc/errno.h
#define EPROTONOSUPPORT (ERROR_BASE_NO + 93)
#define ESOCKTNOSUPPORT (ERROR_BASE_NO + 94)
#define EOPNOTSUPP (ERROR_BASE_NO + 95)
-#define ENOTSUP EOPNOTSUPP
+#define ENOTSUP EOPNOTSUPP
#define EPFNOSUPPORT (ERROR_BASE_NO + 96)
#define EAFNOSUPPORT (ERROR_BASE_NO + 97)
#define EADDRINUSE (ERROR_BASE_NO + 98)
diff --git a/include/libc/libc_fcntl.h b/include/libc/libc_fcntl.h
index d149d86964..945e674d35 100644
--- a/include/libc/libc_fcntl.h
+++ b/include/libc/libc_fcntl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -38,7 +38,7 @@
#ifdef _O_BINARY
#define O_BINARY _O_BINARY
#else
-#define O_BINARY 0
+#define O_BINARY 0
#endif
#endif
diff --git a/include/libc/libc_fdset.h b/include/libc/libc_fdset.h
index 9700c7e83e..c542e6855c 100644
--- a/include/libc/libc_fdset.h
+++ b/include/libc/libc_fdset.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
diff --git a/include/libc/libc_ioctl.h b/include/libc/libc_ioctl.h
index 516c56b1f4..05f0daa238 100644
--- a/include/libc/libc_ioctl.h
+++ b/include/libc/libc_ioctl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
diff --git a/include/libc/libc_limits.h b/include/libc/libc_limits.h
index b8368160df..36b8dbb202 100644
--- a/include/libc/libc_limits.h
+++ b/include/libc/libc_limits.h
@@ -1,11 +1,11 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
- * Date Author Notes
- * 2020-09-05 Meco Manthe first version
+ * Date Author Notes
+ * 2020-09-05 Meco Man the first version
*/
#ifndef LIBC_LIMITS_H__
diff --git a/include/libc/libc_signal.h b/include/libc/libc_signal.h
index 539685de3e..8a4cc0d738 100644
--- a/include/libc/libc_signal.h
+++ b/include/libc/libc_signal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -57,11 +57,11 @@ typedef struct siginfo siginfo_t;
#define SI_USER 0x01 /* Signal sent by kill(). */
#define SI_QUEUE 0x02 /* Signal sent by sigqueue(). */
-#define SI_TIMER 0x03 /* Signal generated by expiration of a
+#define SI_TIMER 0x03 /* Signal generated by expiration of a
timer set by timer_settime(). */
-#define SI_ASYNCIO 0x04 /* Signal generated by completion of an
+#define SI_ASYNCIO 0x04 /* Signal generated by completion of an
asynchronous I/O request. */
-#define SI_MESGQ 0x05 /* Signal generated by arrival of a
+#define SI_MESGQ 0x05 /* Signal generated by arrival of a
message on an empty message queue. */
#if !defined(RT_USING_NEWLIB)
diff --git a/include/libc/libc_stat.h b/include/libc/libc_stat.h
index 6497cfe12c..f680de4e06 100644
--- a/include/libc/libc_stat.h
+++ b/include/libc/libc_stat.h
@@ -1,7 +1,10 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
*/
#ifndef LIBC_STAT_H__
diff --git a/include/libc/libc_stdio.h b/include/libc/libc_stdio.h
index 85ba509852..565e1bfd32 100644
--- a/include/libc/libc_stdio.h
+++ b/include/libc/libc_stdio.h
@@ -1,11 +1,11 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
- * Date Author Notes
- * 2020-09-05 Meco Manthe first version
+ * Date Author Notes
+ * 2020-09-05 Meco Man the first version
*/
#ifndef LIBC_STDIO_H__
diff --git a/include/rtdbg.h b/include/rtdbg.h
index be5a57f312..6a6ea3d670 100644
--- a/include/rtdbg.h
+++ b/include/rtdbg.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -178,6 +178,8 @@ extern "C" {
#define LOG_RAW(...) dbg_raw(__VA_ARGS__)
+#define LOG_HEX(name, width, buf, size)
+
#endif /* defined(RT_USING_ULOG) && define(DBG_ENABLE) */
#ifdef __cplusplus
diff --git a/include/rtdebug.h b/include/rtdebug.h
index b66cd6fc69..8c7d450ad4 100644
--- a/include/rtdebug.h
+++ b/include/rtdebug.h
@@ -1,7 +1,10 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
*/
#ifndef __RTDEBUG_H__
diff --git a/include/rtdef.h b/include/rtdef.h
index 0256601949..b368208175 100644
--- a/include/rtdef.h
+++ b/include/rtdef.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -193,17 +193,15 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#define rt_inline static inline
#define RTT_API
#elif defined (__TASKING__)
-
#include <stdarg.h>
- #define RT_SECTION(x)
- #define RT_UNUSED
- #define RT_USED
+ #define RT_SECTION(x) __attribute__((section(x)))
+ #define RT_UNUSED __attribute__((unused))
+ #define RT_USED __attribute__((used, protect))
#define PRAGMA(x) _Pragma(#x)
- #define ALIGN(n)
- #define RT_WEAK
+ #define ALIGN(n) __attribute__((__align(n)))
+ #define RT_WEAK __attribute__((weak))
#define rt_inline static inline
#define RTT_API
-
#else
#error not supported tool chain
#endif
@@ -212,7 +210,32 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#ifdef RT_USING_COMPONENTS_INIT
typedef int (*init_fn_t)(void);
#ifdef _MSC_VER /* we do not support MS VC++ compiler */
- #define INIT_EXPORT(fn, level)
+#pragma section("rti_fn$f",read)
+ #if RT_DEBUG_INIT
+ struct rt_init_desc
+ {
+ const char* level;
+ const init_fn_t fn;
+ const char* fn_name;
+ };
+ #define INIT_EXPORT(fn, level) \
+ const char __rti_level_##fn[] = level"__rt_init_"#fn; \
+ const char __rti_##fn##_name[] = #fn; \
+ __declspec(allocate("rti_fn$f")) \
+ RT_USED const struct rt_init_desc __rt_init_msc_##fn = \
+ {__rti_level_##fn, fn, __rti_##fn##_name};
+ #else
+ struct rt_init_desc
+ {
+ const char* level;
+ const init_fn_t fn;
+ };
+ #define INIT_EXPORT(fn, level) \
+ const char __rti_level_##fn[] = level"__rt_init_"#fn; \
+ __declspec(allocate("rti_fn$f")) \
+ RT_USED const struct rt_init_desc __rt_init_msc_##fn = \
+ {__rti_level_##fn, fn };
+ #endif
#else
#if RT_DEBUG_INIT
struct rt_init_desc
@@ -802,6 +825,9 @@ struct rt_memheap_item
struct rt_memheap_item *next_free; /**< next free memheap item */
struct rt_memheap_item *prev_free; /**< prev free memheap item */
+#ifdef RT_USING_MEMTRACE
+ rt_uint8_t owner_thread_name[4]; /**< owner thread name */
+#endif
};
/**
@@ -1041,6 +1067,10 @@ struct rt_device_blk_sectors
#define RTGRAPHIC_CTRL_GET_INFO 3
#define RTGRAPHIC_CTRL_SET_MODE 4
#define RTGRAPHIC_CTRL_GET_EXT 5
+#define RTGRAPHIC_CTRL_SET_BRIGHTNESS 6
+#define RTGRAPHIC_CTRL_GET_BRIGHTNESS 7
+#define RTGRAPHIC_CTRL_GET_MODE 8
+#define RTGRAPHIC_CTRL_GET_STATUS 9
/* graphic deice */
enum
@@ -1057,9 +1087,7 @@ enum
RTGRAPHIC_PIXEL_FORMAT_RGB888,
RTGRAPHIC_PIXEL_FORMAT_ARGB888,
RTGRAPHIC_PIXEL_FORMAT_ABGR888,
- RTGRAPHIC_PIXEL_FORMAT_ARGB565,
- RTGRAPHIC_PIXEL_FORMAT_ALPHA,
- RTGRAPHIC_PIXEL_FORMAT_COLOR,
+ RTGRAPHIC_PIXEL_FORMAT_RESERVED,
};
/**
@@ -1074,7 +1102,7 @@ struct rt_device_graphic_info
{
rt_uint8_t pixel_format; /**< graphic format */
rt_uint8_t bits_per_pixel; /**< bits per pixel */
- rt_uint16_t reserved; /**< reserved field */
+ rt_uint16_t pitch; /**< bytes per line */
rt_uint16_t width; /**< width of graphic device */
rt_uint16_t height; /**< height of graphic device */
diff --git a/include/rthw.h b/include/rthw.h
index 89877faf90..5672a8f992 100644
--- a/include/rthw.h
+++ b/include/rthw.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -181,7 +181,7 @@ void rt_hw_secondary_cpu_up(void);
void rt_hw_secondary_cpu_idle_exec(void);
#else
-#define RT_DEFINE_SPINLOCK(x)
+#define RT_DEFINE_SPINLOCK(x)
#define RT_DECLARE_SPINLOCK(x) rt_ubase_t x
#define rt_hw_spin_lock(lock) *(lock) = rt_hw_interrupt_disable()
diff --git a/include/rtlibc.h b/include/rtlibc.h
index fb8c782095..5a260d250d 100644
--- a/include/rtlibc.h
+++ b/include/rtlibc.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
diff --git a/include/rtm.h b/include/rtm.h
index 9da3a6b8b2..ec05662416 100644
--- a/include/rtm.h
+++ b/include/rtm.h
@@ -1,7 +1,10 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
*/
#ifndef __RTM_H__
diff --git a/include/rtservice.h b/include/rtservice.h
index 5bd2b1c23b..d0bad85de1 100644
--- a/include/rtservice.h
+++ b/include/rtservice.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
diff --git a/include/rtthread.h b/include/rtthread.h
index 1e0094e73b..784b208a76 100644
--- a/include/rtthread.h
+++ b/include/rtthread.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -14,6 +14,7 @@
* 2013-06-24 Bernard add rt_kprintf re-define when not use RT_USING_CONSOLE.
* 2016-08-09 ArdaFu add new thread and interrupt hook.
* 2018-11-22 Jesven add all cpu's lock and ipi handler
+ * 2021-02-28 Meco Man add RT_KSERVICE_USING_STDLIB
*/
#ifndef __RT_THREAD_H__
@@ -437,8 +438,6 @@ rt_err_t rt_device_unregister(rt_device_t dev);
rt_device_t rt_device_create(int type, int attach_size);
void rt_device_destroy(rt_device_t device);
-rt_err_t rt_device_init_all(void);
-
rt_err_t
rt_device_set_rx_indicate(rt_device_t dev,
rt_err_t (*rx_ind)(rt_device_t dev, rt_size_t size));
@@ -517,10 +516,12 @@ void rt_components_board_init(void);
void rt_kprintf(const char *fmt, ...);
void rt_kputs(const char *str);
#endif
+
rt_int32_t rt_vsprintf(char *dest, const char *format, va_list arg_ptr);
rt_int32_t rt_vsnprintf(char *buf, rt_size_t size, const char *fmt, va_list args);
rt_int32_t rt_sprintf(char *buf, const char *format, ...);
rt_int32_t rt_snprintf(char *buf, rt_size_t size, const char *format, ...);
+rt_int32_t rt_sscanf(const char *buf, const char *fmt, ...);
#if defined(RT_USING_DEVICE) && defined(RT_USING_CONSOLE)
rt_device_t rt_console_set_device(const char *name);
@@ -541,23 +542,35 @@ int __rt_ffs(int value);
void *rt_memset(void *src, int c, rt_ubase_t n);
void *rt_memcpy(void *dest, const void *src, rt_ubase_t n);
+#ifndef RT_KSERVICE_USING_STDLIB
+void *rt_memmove(void *dest, const void *src, rt_ubase_t n);
+rt_int32_t rt_memcmp(const void *cs, const void *ct, rt_ubase_t count);
+char *rt_strstr(const char *str1, const char *str2);
+rt_int32_t rt_strcasecmp(const char *a, const char *b);
+char *rt_strncpy(char *dest, const char *src, rt_ubase_t n);
rt_int32_t rt_strncmp(const char *cs, const char *ct, rt_ubase_t count);
rt_int32_t rt_strcmp(const char *cs, const char *ct);
-rt_size_t rt_strlen(const char *src);
rt_size_t rt_strnlen(const char *s, rt_ubase_t maxlen);
+rt_size_t rt_strlen(const char *src);
+#else
+#include <string.h>
+#define rt_memmove(dest, src, n) memmove(dest, src, n)
+#define rt_memcmp(cs, ct, count) memcmp(cs, ct, count)
+#define rt_strstr(str1, str2) strstr(str1, str2)
+#define rt_strcasecmp(a, b) strcasecmp(a, b)
+#define rt_strncpy(dest, src, n) strncpy(dest, src, n)
+#define rt_strncmp(cs, ct, count) strncmp(cs, ct, count)
+#define rt_strcmp(cs, ct) strcmp(cs, ct)
+#define rt_strnlen(s, maxlen) strnlen(s, maxlen)
+#define rt_strlen(src) strlen(src)
+#endif /*RT_KSERVICE_USING_STDLIB*/
+
char *rt_strdup(const char *s);
#if defined(__CC_ARM) || defined(__CLANG_ARM)
-/* leak strdup interface */
+/* lack strdup interface */
char* strdup(const char* str);
#endif
-char *rt_strstr(const char *str1, const char *str2);
-rt_int32_t rt_sscanf(const char *buf, const char *fmt, ...);
-char *rt_strncpy(char *dest, const char *src, rt_ubase_t n);
-void *rt_memmove(void *dest, const void *src, rt_ubase_t n);
-rt_int32_t rt_memcmp(const void *cs, const void *ct, rt_ubase_t count);
-rt_int32_t rt_strcasecmp(const char *a, const char *b);
-
void rt_show_version(void);
#ifdef RT_DEBUG