You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

105 lines
2.7 KiB

/******************************************************************************
版权所有 (C), 2018-2099, Radkil
******************************************************************************
文 件 名 : BHBF.c
版 本 号 : 初稿
作 者 : radkil
生成日期 : 2026年6月8日
最近修改 :
功能描述 : 机器人主程序
修改历史 :
1.日 期 : 2026年6月8日
作 者 : radkil
修改内容 : 创建文件
******************************************************************************/
#include "BHBF.h"
#include "common.h"
#include "msg_center.h"
/*----------------------------------------------*
* 外部变量说明 *
*----------------------------------------------*/
/*----------------------------------------------*
* 外部函数原型说明 *
*----------------------------------------------*/
/*----------------------------------------------*
* 内部函数原型说明 *
*----------------------------------------------*/
/*----------------------------------------------*
* 全局变量 *
*----------------------------------------------*/
static uint32_t g_uiRBcoreModuleID = 0;
/*----------------------------------------------*
* 模块级变量 *
*----------------------------------------------*/
/*----------------------------------------------*
* 常量定义 *
*----------------------------------------------*/
/*----------------------------------------------*
* 宏定义 *
*----------------------------------------------*/
static void RBcore_ModuleHandler(const Msg_t *pstMsg)
{
if (NULL == pstMsg)
{
return;
}
switch (pstMsg->m_uiMsgID)
{
case RBCORE_CMD_MANUAL_FORWARD:
{
break;
}
case RBCORE_CMD_MANUAL_BACKWARD:
{
break;
}
case RBCORE_CMD_MANUAL_TURNLEFT:
{
break;
}
case RBCORE_CMD_MANUAL_TURNRIGHT:
{
break;
}
default:
break;
}
}
void RBcore_Task(void *argument)
{
while(1)
{
// 处理消息
MsgCenter_ProcessWait(g_uiRBcoreModuleID, 2);
}
}
void RBcore_Init(void)
{
g_uiRBcoreModuleID = MsgCenter_Register(MODULE_NAME_RBCORE, RBcore_ModuleHandler);
const osThreadAttr_t GF_Dispatch_attributes = {
.name = MODULE_NAME_RBCORE,
.stack_size = 1024,
.priority = (osPriority_t) osPriorityRealtime1,
};
(void)osThreadNew(RBcore_Task, NULL, &GF_Dispatch_attributes);
}