2023-10-02 18:00:54 +08:00
# include "bsp_init.h"
# include "robot.h"
# include "robot_def.h"
# include "robot_task.h"
// 编译warning,提醒开发者修改机器人参数
# ifndef ROBOT_DEF_PARAM_WARNING
# define ROBOT_DEF_PARAM_WARNING
# pragma message "check if you have configured the parameters in robot_def.h, IF NOT, please refer to the comments AND DO IT, otherwise the robot will have FATAL ERRORS!!!"
# endif // !ROBOT_DEF_PARAM_WARNING
# if defined(ONE_BOARD) || defined(CHASSIS_BOARD)
# include "chassis.h"
# endif
# if defined(ONE_BOARD) || defined(GIMBAL_BOARD)
# include "gimbal.h"
# include "shoot.h"
# include "robot_cmd.h"
# endif
void RobotInit ( )
{
// 关闭中断,防止在初始化过程中发生中断
// 请不要在初始化过程中使用中断和延时函数!
// 若必须,则只允许使用DWT_Delay()
__disable_irq ( ) ;
BSPInit ( ) ;
# if defined(ONE_BOARD) || defined(GIMBAL_BOARD)
RobotCMDInit ( ) ;
2024-01-20 16:16:13 +08:00
2023-10-12 19:29:48 +08:00
GimbalInit ( ) ;
2024-01-20 16:16:13 +08:00
ShootInit ( ) ;
2023-10-02 18:00:54 +08:00
# endif
# if defined(ONE_BOARD) || defined(CHASSIS_BOARD)
2024-01-20 16:16:13 +08:00
ChassisInit ( ) ;
2023-10-02 18:00:54 +08:00
# endif
OSTaskInit ( ) ; // 创建基础任务
// 初始化完成,开启中断
__enable_irq ( ) ;
}
void RobotTask ( )
{
# if defined(ONE_BOARD) || defined(GIMBAL_BOARD)
RobotCMDTask ( ) ;
2023-10-03 20:10:45 +08:00
//暂时注释云台和发射任务 调试底盘
2023-10-12 19:29:48 +08:00
GimbalTask ( ) ;
2024-01-20 16:16:13 +08:00
ShootTask ( ) ;
2023-10-02 18:00:54 +08:00
# endif
# if defined(ONE_BOARD) || defined(CHASSIS_BOARD)
2024-01-20 16:16:13 +08:00
ChassisTask ( ) ;
2023-10-02 18:00:54 +08:00
# endif
}