add DMA remote control

This commit is contained in:
TuxMonkey
2026-07-14 21:56:46 +08:00
parent 591707d9fc
commit f4c0424c45
16 changed files with 371 additions and 191 deletions

View File

@@ -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();

View File

@@ -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();