summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2021-11-24 17:37:25 +0800
committerGitHub <[email protected]>2021-11-24 17:37:25 +0800
commitf11113f55780a71345bbd0dffda6e3b904fc76da (patch)
tree648be97315ceefaa3bf631059dabc0adc00a326e /components
parent940566c867c8a2b1047404defcd3fa092ac5506a (diff)
parentc6c1544c84e5e64da6a4fab8c4a985817b773288 (diff)
Merge pull request #5277 from mysterywolf/compatibility
implement legacy support
Diffstat (limited to 'components')
-rw-r--r--components/Kconfig4
-rw-r--r--components/dfs/SConscript1
-rw-r--r--components/legacy/README.md2
-rw-r--r--components/legacy/SConscript22
-rw-r--r--components/legacy/dfs/dfs_poll.h (renamed from components/dfs/include/dfs_poll.h)3
-rw-r--r--components/legacy/dfs/dfs_select.h (renamed from components/dfs/include/dfs_select.h)3
-rw-r--r--components/legacy/ipc/workqueue_legacy.c18
-rw-r--r--components/legacy/ipc/workqueue_legacy.h25
-rw-r--r--components/legacy/rtlegacy.h27
9 files changed, 101 insertions, 4 deletions
diff --git a/components/Kconfig b/components/Kconfig
index 9a9efa8434..f99ede204f 100644
--- a/components/Kconfig
+++ b/components/Kconfig
@@ -19,6 +19,10 @@ config RT_USING_USER_MAIN
default 85 if RT_THREAD_PRIORITY_256
endif
+config RT_USING_LEGACY
+ bool "Support legacy version for compatibility"
+ default n
+
source "$RTT_DIR/components/cplusplus/Kconfig"
source "$RTT_DIR/components/finsh/Kconfig"
diff --git a/components/dfs/SConscript b/components/dfs/SConscript
index 790fbd3efe..18b4721a7b 100644
--- a/components/dfs/SConscript
+++ b/components/dfs/SConscript
@@ -1,4 +1,5 @@
from building import *
+import os
# The set of source files associated with this SConscript file.
src = Split('''
diff --git a/components/legacy/README.md b/components/legacy/README.md
new file mode 100644
index 0000000000..7b1eae98da
--- /dev/null
+++ b/components/legacy/README.md
@@ -0,0 +1,2 @@
+# RT-Thread Legacy
+
diff --git a/components/legacy/SConscript b/components/legacy/SConscript
new file mode 100644
index 0000000000..d3821af7ab
--- /dev/null
+++ b/components/legacy/SConscript
@@ -0,0 +1,22 @@
+from building import *
+import os
+
+src = Split('''
+ipc/workqueue_legacy.c
+''')
+
+cwd = GetCurrentDir()
+CPPPATH = [cwd]
+
+if GetDepend('RT_USING_DFS'):
+ dfs_cwd = os.path.join(cwd,'dfs')
+ CPPPATH += [dfs_cwd]
+
+group = DefineGroup('Legacy', src, depend = ['RT_USING_LEGACY'], CPPPATH = CPPPATH)
+
+list = os.listdir(cwd)
+for item in list:
+ if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
+ group = group + SConscript(os.path.join(item, 'SConscript'))
+
+Return('group')
diff --git a/components/dfs/include/dfs_poll.h b/components/legacy/dfs/dfs_poll.h
index cba73b04d4..a59e7e2d17 100644
--- a/components/dfs/include/dfs_poll.h
+++ b/components/legacy/dfs/dfs_poll.h
@@ -5,6 +5,7 @@
*
* Change Logs:
* Date Author Notes
+ * 2021-11-14 Meco Man the first version
*/
#ifndef DFS_POLL_H__
@@ -12,6 +13,4 @@
#include <poll.h>
-#warning "This file will be obsolete in the next version! Please use <poll.h> to instead."
-
#endif /* DFS_POLL_H__ */
diff --git a/components/dfs/include/dfs_select.h b/components/legacy/dfs/dfs_select.h
index 5b7c6428bd..6eaaf3bf89 100644
--- a/components/dfs/include/dfs_select.h
+++ b/components/legacy/dfs/dfs_select.h
@@ -5,6 +5,7 @@
*
* Change Logs:
* Date Author Notes
+ * 2021-11-14 Meco Man the first version
*/
#ifndef DFS_SELECT_H__
@@ -12,6 +13,4 @@
#include <sys/select.h>
-#warning "This file will be obsolete in the next version! Please use <sys/select.h> to instead."
-
#endif
diff --git a/components/legacy/ipc/workqueue_legacy.c b/components/legacy/ipc/workqueue_legacy.c
new file mode 100644
index 0000000000..e79c1ca87b
--- /dev/null
+++ b/components/legacy/ipc/workqueue_legacy.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2006-2021, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2021-11-14 Meco Man the first version
+ */
+
+#include "workqueue_legacy.h"
+
+void rt_delayed_work_init(struct rt_delayed_work *work,
+ void (*work_func)(struct rt_work *work,
+ void *work_data), void *work_data)
+{
+ rt_work_init(&work->work, work_func, work_data);
+}
diff --git a/components/legacy/ipc/workqueue_legacy.h b/components/legacy/ipc/workqueue_legacy.h
new file mode 100644
index 0000000000..a39cc86669
--- /dev/null
+++ b/components/legacy/ipc/workqueue_legacy.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2006-2021, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2021-11-14 Meco Man the first version
+ */
+
+#ifndef __WORKQUEUE_LEGACY_H__
+#define __WORKQUEUE_LEGACY_H__
+
+#include <ipc/workqueue.h>
+
+struct rt_delayed_work
+{
+ struct rt_work work;
+};
+
+void rt_delayed_work_init(struct rt_delayed_work *work,
+ void (*work_func)(struct rt_work *work,
+ void *work_data), void *work_data);
+
+#endif
diff --git a/components/legacy/rtlegacy.h b/components/legacy/rtlegacy.h
new file mode 100644
index 0000000000..df8463cdd2
--- /dev/null
+++ b/components/legacy/rtlegacy.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2006-2021, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2021-11-14 Meco Man the first version
+ */
+
+#ifndef __RT_LEGACY_H__
+#define __RT_LEGACY_H__
+
+#include <rtconfig.h>
+
+/* rtlibc */
+#include <stdint.h>
+#include <stddef.h>
+
+/* IPC */
+#ifdef RT_USING_DEVICE_IPC
+#include "ipc/workqueue_legacy.h"
+#endif /* RT_USING_DEVICE_IPC */
+
+/* FinSH */
+
+#endif /* __RT_LEGACY_H__ */