summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorlongtengmcu <[email protected]>2020-05-17 09:36:34 +0800
committerlongtengmcu <[email protected]>2020-05-17 09:36:34 +0800
commit21a3ba358aabad6c96bf803c752d86a870a2e019 (patch)
tree28fd9c74b695ba5c87bfa2b435250abc412f1e78 /include
parent33e1ef436a603d91b849a5dfe0b3ea2de95a71df (diff)
parentee2cec13b13e0587f69fa73c2119aae27d4b8360 (diff)
Merge branch 'master' of https://github.com/RT-Thread/rt-thread
~update rtt master
Diffstat (limited to 'include')
-rw-r--r--include/rtdbg.h12
-rw-r--r--include/rtdef.h1
-rw-r--r--include/rtservice.h14
-rw-r--r--include/rtthread.h5
4 files changed, 22 insertions, 10 deletions
diff --git a/include/rtdbg.h b/include/rtdbg.h
index a2dfbd9697..be5a57f312 100644
--- a/include/rtdbg.h
+++ b/include/rtdbg.h
@@ -32,6 +32,10 @@
#include <rtconfig.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* the debug log will force enable when RT_DEBUG macro is defined */
#if defined(RT_DEBUG) && !defined(DBG_ENABLE)
#define DBG_ENABLE
@@ -91,13 +95,13 @@
#ifdef DBG_COLOR
#define _DBG_COLOR(n) rt_kprintf("\033["#n"m")
#define _DBG_LOG_HDR(lvl_name, color_n) \
- rt_kprintf("\033["#color_n"m["lvl_name"/"DBG_SECTION_NAME"] ")
+ rt_kprintf("\033["#color_n"m[" lvl_name "/" DBG_SECTION_NAME "] ")
#define _DBG_LOG_X_END \
rt_kprintf("\033[0m\n")
#else
#define _DBG_COLOR(n)
#define _DBG_LOG_HDR(lvl_name, color_n) \
- rt_kprintf("["lvl_name"/"DBG_SECTION_NAME"] ")
+ rt_kprintf("[" lvl_name "/" DBG_SECTION_NAME "] ")
#define _DBG_LOG_X_END \
rt_kprintf("\n")
#endif /* DBG_COLOR */
@@ -176,4 +180,8 @@
#endif /* defined(RT_USING_ULOG) && define(DBG_ENABLE) */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* RT_DBG_H__ */
diff --git a/include/rtdef.h b/include/rtdef.h
index 8b86213082..f2b546f75e 100644
--- a/include/rtdef.h
+++ b/include/rtdef.h
@@ -898,6 +898,7 @@ enum rt_device_class_type
#define RT_DEVICE_CTRL_RESUME 0x01 /**< resume device */
#define RT_DEVICE_CTRL_SUSPEND 0x02 /**< suspend device */
#define RT_DEVICE_CTRL_CONFIG 0x03 /**< configure device */
+#define RT_DEVICE_CTRL_CLOSE 0x04 /**< close device */
#define RT_DEVICE_CTRL_SET_INT 0x10 /**< set interrupt */
#define RT_DEVICE_CTRL_CLR_INT 0x11 /**< clear interrupt */
diff --git a/include/rtservice.h b/include/rtservice.h
index 81d6c71f17..5bd2b1c23b 100644
--- a/include/rtservice.h
+++ b/include/rtservice.h
@@ -128,21 +128,21 @@ rt_inline unsigned int rt_list_len(const rt_list_t *l)
/**
* rt_list_for_each - iterate over a list
- * @pos: the rt_list_t * to use as a loop cursor.
- * @head: the head for your list.
+ * @pos: the rt_list_t * to use as a loop cursor.
+ * @head: the head for your list.
*/
#define rt_list_for_each(pos, head) \
for (pos = (head)->next; pos != (head); pos = pos->next)
/**
* rt_list_for_each_safe - iterate over a list safe against removal of list entry
- * @pos: the rt_list_t * to use as a loop cursor.
- * @n: another rt_list_t * to use as temporary storage
- * @head: the head for your list.
+ * @pos: the rt_list_t * to use as a loop cursor.
+ * @n: another rt_list_t * to use as temporary storage
+ * @head: the head for your list.
*/
#define rt_list_for_each_safe(pos, n, head) \
- for (pos = (head)->next, n = pos->next; pos != (head); \
- pos = n, n = pos->next)
+ for (pos = (head)->next, n = pos->next; pos != (head); \
+ pos = n, n = pos->next)
/**
* rt_list_for_each_entry - iterate over list of given type
diff --git a/include/rtthread.h b/include/rtthread.h
index 92cdf012b2..a76601a3bf 100644
--- a/include/rtthread.h
+++ b/include/rtthread.h
@@ -41,6 +41,9 @@ extern "C" {
void rt_system_object_init(void);
struct rt_object_information *
rt_object_get_information(enum rt_object_class_type type);
+int rt_object_get_length(enum rt_object_class_type type);
+int rt_object_get_pointers(enum rt_object_class_type type, rt_object_t *pointers, int maxlen);
+
void rt_object_init(struct rt_object *object,
enum rt_object_class_type type,
const char *name);
@@ -554,7 +557,7 @@ 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_uint32_t rt_strcasecmp(const char *a, const char *b);
+rt_int32_t rt_strcasecmp(const char *a, const char *b);
void rt_show_version(void);