Skip to content

[Bug] 当打开RT_USING_DM时rt_hw_cpu_shutdown 重复定义 #11099

@BernardXiong

Description

@BernardXiong

RT-Thread Version

upstream

Hardware Type/Architectures

riscv

Develop Toolchain

GCC

Describe the bug

Issue: Multiple definition of rt_hw_cpu_shutdown when RT_USING_DM is enabled.

Description:
When the device manager feature is enabled (RT_USING_DM), both rt-thread/libcpu/risc-v/common64/cpuport.c and rt-thread/components/drivers/core/power.c define rt_hw_cpu_shutdown, causing a linker error.

Solution:
Make the rt_hw_cpu_shutdown function in cpuport.c weak using the rt_weak attribute. This allows the power management implementation to override the default cpuport implementation when device manager is enabled.

Other additional context

No response

Metadata

Metadata

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