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.

107 lines
2.7 KiB

2 months ago
/******************************************************************************
(C), 2018-2099, Radkil
******************************************************************************
: BHBF.c
2 months ago
: 稿
: radkil
: 202668
:
:
:
1. : 202668
: radkil
:
******************************************************************************/
#include "BHBF.h"
2 months ago
#include "common.h"
#include "msg_center.h"
2 months ago
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
static uint32_t g_uiRBcoreModuleID = 0;
2 months ago
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
static void RBcore_ModuleHandler(const Msg_t *pstMsg)
2 months ago
{
if (NULL == pstMsg)
{
return;
}
2 months ago
switch (pstMsg->m_uiMsgID)
{
case MOTOR_CMD_SET_SPEED:
{
break;
}
case MOTOR_CMD_STOP:
{
break;
}
case MOTOR_CMD_SET_HOME:
{
break;
}
case MOTOR_CMD_GET_STATUS:
{
break;
}
default:
break;
}
2 months ago
}
void RBcore_Task(void *argument)
2 months ago
{
while(1)
{
// 处理消息
MsgCenter_ProcessWait(g_uiRBcoreModuleID, 2);
2 months ago
}
}
void RBcore_Init(void)
2 months ago
{
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);
2 months ago
}