Skip to content

Commit 75b3558

Browse files
authored
新增:event loop 软件包 (#1984)
* event loop 软件包 * fix: 修改json语法错误 * fix: 修复Version 错误
1 parent 5f2a5d5 commit 75b3558

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

system/event_loop/Kconfig

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
# Kconfig file for package event_loop
3+
menuconfig PKG_USING_EVENT_LOOP
4+
bool "Event loop (delayed dispatch: mq + soft one-shot timer)"
5+
default n
6+
select RT_USING_MESSAGEQUEUE
7+
select RT_USING_MUTEX
8+
select RT_USING_TIMER_SOFT
9+
help
10+
Delay table processing runs only in the soft-timer callback (system timer thread):
11+
RT_TIMER_FLAG_ONE_SHOT | RT_TIMER_FLAG_SOFT_TIMER. No extra el_tmr worker thread.
12+
Public API: evt_loop_push_delayed / evt_loop_remove_delayed and
13+
macros EVT_LOOP_PUSH, EVT_LOOP_REMOVE, EVT_LOOP_REMOVE_WITH_ARGS.
14+
15+
if PKG_USING_EVENT_LOOP
16+
17+
config PKG_EVENT_LOOP_PATH
18+
string
19+
default "/packages/system/event_loop"
20+
21+
config EVENT_LOOP_MAX_EVENT_CNT
22+
int "Maximum delayed slots in table"
23+
default 32
24+
help
25+
Fixed table size for pending delayed events.
26+
27+
config EVENT_LOOP_MSGQ_DEPTH
28+
int "Message queue depth (immediate + due callbacks)"
29+
default 15
30+
help
31+
rt_mq capacity for evt_loop_handle_t messages.
32+
33+
config EVENT_LOOP_THREAD_STACK_SIZE
34+
int "Event loop thread stack size (bytes)"
35+
default 3072
36+
37+
config EVENT_LOOP_THREAD_PRIORITY
38+
int "Event loop thread priority (smaller = higher)"
39+
default 12
40+
range 0 31
41+
help
42+
Must be strictly greater than RT_TIMER_THREAD_PRIO in rtconfig.h so the
43+
soft-timer daemon (lower number) preempts evt_loop. Example: timer prio 4,
44+
use 12 here.
45+
46+
config EVENT_LOOP_USING_SAMPLES
47+
bool "Build event_loop sample (event_loop_test.c)"
48+
default n
49+
help
50+
Registers MSH command event_loop_test (when FINSH enabled).
51+
52+
config PKG_EVENT_LOOP_VER
53+
string
54+
default "latest"
55+
56+
endif

system/event_loop/package.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "event_loop",
3+
"description": "RT-Thread event loop: delayed callback dispatch (message queue + soft timer)",
4+
"description_zh": "RT-Thread 事件循环:消息队列与软定时器实现延迟回调执行",
5+
"enable": "PKG_USING_EVENT_LOOP",
6+
"keywords": [
7+
"event",
8+
"loop"
9+
],
10+
"category": "system",
11+
"author": {
12+
"name": "John.liu",
13+
"email": "450547566@qq.com",
14+
"github": "https://github.com/Bluetooth-BLE"
15+
},
16+
"license": "Apache-2.0",
17+
"repository": "https://github.com/Bluetooth-BLE/event_loop",
18+
"icon": "unknown",
19+
"homepage": "https://github.com/Bluetooth-BLE/event_loop#readme",
20+
"doc": "unknown",
21+
"site": [
22+
{
23+
"version": "latest",
24+
"URL": "https://github.com/Bluetooth-BLE/event_loop.git",
25+
"filename": "",
26+
"VER_SHA": "main"
27+
}
28+
]
29+
}

0 commit comments

Comments
 (0)