Skip to content

[Feature] rt_object_find函数应该允许在中断上下文使用 #10173

Closed
@mouch6131

Description

@mouch6131

Describe problem solved by the proposed feature

rt_object_find函数会调用RT_DEBUG_NOT_IN_INTERRUPT来检查当前上下文,如果在中断上下文会触发assert,从函数的实现来看,只是做了关中断(如果在smp架构下还会关调度),然后遍历链表,并不会导致睡眠。所以函数本身在中断上下文里调用应该是没有风险的,这个函数作为通用接口,目前就有在中断上下文调用的场景,例如:
如果启用了ulog和时间戳,同时启用了调度器的log,那tick中断就会直接调用到ulog的时间戳,进而通过这个函数去查找rtc的时间,此时assert就会触发,导致系统卡住。

Describe your preferred solution

No response

Describe possible alternatives

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions