One Framework 0.1.0
RoboMaster嵌入式框架“一键”解决方案,为你的“创意”服务。
载入中...
搜索中...
未找到
Macro.hpp 文件参考
#include <zephyr/sys/iterable_sections.h>
#include <OF/utils/CCM.h>
#include "Node.hpp"
#include "Descriptor.hpp"
#include "Topic.hpp"
Macro.hpp 的引用(Include)关系图:
此图展示该文件被哪些文件直接或间接地引用了:

浏览该文件的源代码.

宏定义

#define ONE_NODE_REGISTER(UserClass)
 
#define ONE_TOPIC_REGISTER(Type, VarName, TopicNameStr)
 

宏定义说明

◆ ONE_NODE_REGISTER

#define ONE_NODE_REGISTER ( UserClass)
值:
static_assert(NodeConcept<UserClass>, \
"Your Node must define a full Meta struct and implement init, run and cleanup function! See 'NodeConcept' for more detail. ' " \
); \
/* stack definition */ \
K_THREAD_STACK_DEFINE(_stack_##UserClass, UserClass::Meta::stack_size); \
/* thread data */ \
static struct k_thread _thread_data_##UserClass;\
/* launcher */ \
static void _launcher_##UserClass(void) { \
UserClass::start_impl(&_thread_data_##UserClass, _stack_##UserClass); \
} \
/* register it into global linker section */ \
STRUCT_SECTION_ITERABLE(node_desc, _desc_##UserClass) ={ \
.name = UserClass::Meta::name, \
.thread_id_ptr = &UserClass::tid_storage, \
.start_func = &_launcher_##UserClass \
}

◆ ONE_TOPIC_REGISTER

#define ONE_TOPIC_REGISTER ( Type,
VarName,
TopicNameStr )
值:
\
/* CCM Topic instance and reference */ \
OF_CCM_ATTR static OF::Topic<Type> _topic_instance_##VarName; \
OF::Topic<Type>& VarName = _topic_instance_##VarName;\
/* register it into global linker section */ \
STRUCT_SECTION_ITERABLE(topic_desc, _topic_desc_##VarName) = { \
.name = TopicNameStr, \
.topic_instance = &_topic_instance_##VarName, \
.type_size = sizeof(Type),\
};
#define OF_CCM_ATTR
定义 CCM.h:12
定义 Topic.hpp:20
static void print_stub(const topic_desc *desc)
定义 Topic.hpp:43