mirror of
https://gitee.com/dlmu-cone/tronone-h7-scaffold
synced 2026-07-24 03:27:45 +08:00
add DMA remote control
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "delayticks.h"
|
||||
|
||||
#include "robot_def.h"
|
||||
#include "rc.h"
|
||||
|
||||
/*---------------------VARIABLES---------------------*/
|
||||
uint8_t r = 0;
|
||||
@@ -53,10 +54,13 @@ void robotSelfCheck(void)
|
||||
void ws2812Task(void *argument)
|
||||
{
|
||||
(void) argument;
|
||||
RobotMode_t RobotMode = REMOTE_NOT_CONNECTED; // 初始状态为遥控器未连接
|
||||
while (1)
|
||||
{
|
||||
switch (RobotMode)
|
||||
RobotMode_t display_mode = RobotMode;
|
||||
if (display_mode != SYS_ERROR_OCCURRED && !RemoteControlIsOnline())
|
||||
display_mode = REMOTE_NOT_CONNECTED;
|
||||
|
||||
switch (display_mode)
|
||||
{
|
||||
case NORMAL_MODE:
|
||||
BlinkGreen();
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
#include "bsp_init.h"
|
||||
#include "robot.h"
|
||||
#include "rc.h"
|
||||
#include "robot_def.h"
|
||||
|
||||
#include "cmsis_gcc.h"
|
||||
// #include "robot_def.h"
|
||||
@@ -27,6 +29,8 @@
|
||||
// #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
|
||||
|
||||
volatile RobotMode_t RobotMode = REMOTE_NOT_CONNECTED;
|
||||
|
||||
// #if defined(ONE_BOARD) || defined(CHASSIS_BOARD)
|
||||
// #include "chassis.h"
|
||||
// #endif
|
||||
@@ -59,6 +63,9 @@ void RobotInit()
|
||||
|
||||
BSPInit();
|
||||
|
||||
if (RemoteControlInit(&huart5) == NULL)
|
||||
RobotMode = SYS_ERROR_OCCURRED;
|
||||
|
||||
#if defined(ONE_BOARD) || defined(GIMBAL_BOARD)
|
||||
RobotCMDInit();
|
||||
// GimbalInit();
|
||||
|
||||
Reference in New Issue
Block a user