Skip to content
#

cortex-m

Here are 338 public repositories matching this topic...

wineee
wineee commented May 22, 2022

https://github.com/RT-Thread/rt-thread/blob/master/include/rtservice.h

/**
 * rt_container_of - return the member address of ptr, if the type of ptr is the
 * struct type.
 */
#define rt_container_of(ptr, type, member) \
    ((type *)((char *)(ptr) - (unsigned long)(&((type *)0)->member)))

按照英文,应该是说如果 ptr 的类型是 struct 类型,返回ptr的成员(member)的地址

但实际上,ptr 应该是某个 struct (type)的一个

good first issue

Improve this page

Add a description, image, and links to the cortex-m topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the cortex-m topic, visit your repo's landing page and select "manage topics."

Learn more