sentry_gimbal_hzz/application/robot.c

47 lines
884 B
C
Raw Normal View History

#include "bsp_init.h"
#include "robot.h"
#include "robot_def.h"
#if defined(ONE_BOARD) || defined(CHASSIS_BOARD)
#include "chassis.h"
#endif
2023-01-02 23:50:04 +08:00
#if defined(ONE_BOARD) || defined(GIMBAL_BOARD)
#include "gimbal.h"
#include "shoot.h"
#include "robot_cmd.h"
#endif
void RobotInit()
{
// 关闭中断,防止在初始化过程中发生中断
// 请不要在初始化过程中使用中断!!!
__disable_irq();
BSPInit();
#if defined(ONE_BOARD) || defined(GIMBAL_BOARD)
2023-01-01 17:32:22 +08:00
RobotCMDInit();
GimbalInit();
ShootInit();
#endif
#if defined(ONE_BOARD) || defined(CHASSIS_BOARD)
ChassisInit();
#endif
// 初始化完成,开启中断
__enable_irq();
}
void RobotTask()
{
#if defined(ONE_BOARD) || defined(GIMBAL_BOARD)
2022-12-19 17:15:42 +08:00
RobotCMDTask();
GimbalTask();
ShootTask();
#endif
#if defined(ONE_BOARD) || defined(CHASSIS_BOARD)
ChassisTask();
#endif
}