Skip to content

Commit 578cfc0

Browse files
GuEe-GUIRbb666
authored andcommitted
[DM/CORE] Add IDA init in runtime
Signed-off-by: GuEe-GUI <[email protected]>
1 parent d41a035 commit 578cfc0

File tree

1 file changed

+5
-0
lines changed
  • components/drivers/include/drivers/core

1 file changed

+5
-0
lines changed

components/drivers/include/drivers/core/dm.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ struct rt_dm_ida
4040
};
4141

4242
#define RT_DM_IDA_INIT(id) { .master_id = MASTER_ID_##id }
43+
#define rt_dm_ida_init(ida, id) \
44+
do { \
45+
(ida)->master_id = MASTER_ID_##id; \
46+
rt_spin_lock_init(&(ida)->lock); \
47+
} while (0)
4348

4449
int rt_dm_ida_alloc(struct rt_dm_ida *ida);
4550
rt_bool_t rt_dm_ida_take(struct rt_dm_ida *ida, int id);

0 commit comments

Comments
 (0)