1、代码备份
This commit is contained in:
@@ -88,8 +88,8 @@ extern "C"
|
||||
#define DDL_QSPI_ENABLE (DDL_OFF)
|
||||
#define DDL_RMU_ENABLE (DDL_OFF)
|
||||
#define DDL_RTC_ENABLE (DDL_ON)
|
||||
#define DDL_SDIOC_ENABLE (DDL_ON)
|
||||
#define DDL_SPI_ENABLE (DDL_ON)
|
||||
#define DDL_SDIOC_ENABLE (DDL_OFF)
|
||||
#define DDL_SPI_ENABLE (DDL_OFF)
|
||||
#define DDL_SRAM_ENABLE (DDL_ON)
|
||||
#define DDL_SWDT_ENABLE (DDL_ON)
|
||||
#define DDL_TIMER0_ENABLE (DDL_OFF)
|
||||
@@ -98,7 +98,7 @@ extern "C"
|
||||
#define DDL_TIMER4_OCO_ENABLE (DDL_OFF)
|
||||
#define DDL_TIMER4_PWM_ENABLE (DDL_OFF)
|
||||
#define DDL_TIMER4_SEVT_ENABLE (DDL_OFF)
|
||||
#define DDL_TIMER6_ENABLE (DDL_OFF)
|
||||
#define DDL_TIMER6_ENABLE (DDL_ON)
|
||||
#define DDL_TIMERA_ENABLE (DDL_OFF)
|
||||
#define DDL_TRNG_ENABLE (DDL_OFF)
|
||||
#define DDL_USART_ENABLE (DDL_ON)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "Encryption.h"
|
||||
#include "Debug.h"
|
||||
#include "Algorithm.h"
|
||||
#include "dc_motor.h"
|
||||
#include "CS1237_LEFTUP.h"
|
||||
#include "CS1237_LEFTLOW.h"
|
||||
#include "CS1237_RIGHTUP.h"
|
||||
@@ -132,8 +133,8 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
||||
{
|
||||
uint32_t LeftSlopeSum = abs(App.LeftUpCS1237_SlopeArray[0]) + abs(App.LeftLowCS1237_SlopeArray[0]);
|
||||
uint32_t RightSlopeSum = abs(App.RightUpCS1237_SlopeArray[0]) + abs(App.RightLowCS1237_SlopeArray[0]);
|
||||
uint32_t LeftDiffSum = abs(lu_ad[0]) + abs(ll_ad[0]);
|
||||
uint32_t RightDiffSum = abs(ru_ad[0]) + abs(rl_ad[0]);
|
||||
uint32_t LeftDiffSum = abs(lu_diff[0]) + abs(ll_diff[0]);
|
||||
uint32_t RightDiffSum = abs(ru_diff[0]) + abs(rl_diff[0]);
|
||||
|
||||
App.LeftRunFalg = false;
|
||||
App.RightRunFalg = false;
|
||||
@@ -154,6 +155,7 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
||||
&& (Oll_diff3 <= -App.ADTrack.LeftLowVPT)))
|
||||
{
|
||||
//BDC_UP();
|
||||
Motor_Control(MOTOR_CMD_FORWARD);
|
||||
App.UpFlag = true;
|
||||
App.StopFlag = false;
|
||||
App.DownFlag = false;
|
||||
@@ -172,6 +174,7 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
||||
&& (Oll_diff1 >= App.ADTrack.LeftLowVPT)))
|
||||
{
|
||||
//BDC_DOWN();
|
||||
Motor_Control(MOTOR_CMD_REVERSE);
|
||||
App.DownFlag = true;
|
||||
App.StopFlag = false;
|
||||
App.UpFlag = false;
|
||||
@@ -194,6 +197,7 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
||||
&& (Orl_diff3 <= -App.ADTrack.RightLowVPT)))
|
||||
{
|
||||
//BDC_UP();
|
||||
Motor_Control(MOTOR_CMD_FORWARD);
|
||||
App.UpFlag = true;
|
||||
App.StopFlag = false;
|
||||
App.DownFlag = false;
|
||||
@@ -212,6 +216,7 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
||||
&& (Orl_diff3 >= App.ADTrack.RightLowVPT)))
|
||||
{
|
||||
//BDC_DOWN();
|
||||
Motor_Control(MOTOR_CMD_REVERSE);
|
||||
App.DownFlag = true;
|
||||
App.StopFlag = false;
|
||||
App.UpFlag = false;
|
||||
@@ -227,6 +232,7 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
||||
&& ll_slope > App.ADTrack.Slope_VPT)
|
||||
{
|
||||
//BDC_STOP();
|
||||
Motor_Control(MOTOR_CMD_STOP);
|
||||
App.StopFlag = true;
|
||||
App.DownFlag = false;
|
||||
App.UpFlag = false;
|
||||
@@ -236,6 +242,7 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
||||
&& Oll_diff1 < (App.ADTrack.LeftLowVPT / 2))
|
||||
{
|
||||
//BDC_STOP();
|
||||
Motor_Control(MOTOR_CMD_STOP);
|
||||
App.StopFlag = true;
|
||||
App.DownFlag = false;
|
||||
App.UpFlag = false;
|
||||
@@ -248,6 +255,7 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
||||
&& rl_slope > App.ADTrack.Slope_VPT)
|
||||
{
|
||||
//BDC_STOP();
|
||||
Motor_Control(MOTOR_CMD_STOP);
|
||||
App.StopFlag = true;
|
||||
App.DownFlag = false;
|
||||
App.UpFlag = false;
|
||||
@@ -257,6 +265,7 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
||||
&& Orl_diff1 < (App.ADTrack.RightLowVPT / 2))
|
||||
{
|
||||
//BDC_STOP();
|
||||
Motor_Control(MOTOR_CMD_STOP);
|
||||
App.StopFlag = true;
|
||||
App.DownFlag = false;
|
||||
App.UpFlag = false;
|
||||
@@ -272,6 +281,7 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
||||
&& ll_slope < -App.ADTrack.Slope_VPT)
|
||||
{
|
||||
//BDC_STOP();
|
||||
Motor_Control(MOTOR_CMD_STOP);
|
||||
App.StopFlag = true;
|
||||
App.DownFlag = false;
|
||||
App.UpFlag = false;
|
||||
@@ -281,6 +291,7 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
||||
&& Oll_diff1 > -(App.ADTrack.LeftLowVPT / 2))
|
||||
{
|
||||
//BDC_STOP();
|
||||
Motor_Control(MOTOR_CMD_STOP);
|
||||
App.StopFlag = true;
|
||||
App.DownFlag = false;
|
||||
App.UpFlag = false;
|
||||
@@ -293,15 +304,17 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_
|
||||
&& rl_slope < -App.ADTrack.Slope_VPT)
|
||||
{
|
||||
//BDC_STOP();
|
||||
App.StopFlag = true;
|
||||
App.DownFlag = false;
|
||||
App.UpFlag = false;
|
||||
App.StopCollDelay1mSCnt = 1000;
|
||||
Motor_Control(MOTOR_CMD_STOP);
|
||||
App.StopFlag = true;
|
||||
App.DownFlag = false;
|
||||
App.UpFlag = false;
|
||||
App.StopCollDelay1mSCnt = 1000;
|
||||
}
|
||||
else if(Oru_diff1 < (App.ADTrack.RightUpVPT / 2)
|
||||
&& Orl_diff1 > -(App.ADTrack.RightLowVPT / 2))
|
||||
{
|
||||
//BDC_STOP();
|
||||
Motor_Control(MOTOR_CMD_STOP);
|
||||
App.StopFlag = true;
|
||||
App.DownFlag = false;
|
||||
App.UpFlag = false;
|
||||
@@ -574,6 +587,7 @@ int main(void)
|
||||
RIGHTUP_CS1237DataLoopCollect();
|
||||
RIGHTLOW_CS1237DataLoopCollect();
|
||||
ReadLoopHandler();
|
||||
DcmotorLoopHandler();
|
||||
AppLoopHandler();
|
||||
}
|
||||
}
|
||||
@@ -593,6 +607,7 @@ void SysTick_IrqHandler(void)
|
||||
LEFTLOW_CS12371mSRoutine();
|
||||
RIGHTUP_CS12371mSRoutine();
|
||||
RIGHTLOW_CS12371mSRoutine();
|
||||
Dcmotor1msRoutine();
|
||||
}
|
||||
|
||||
/*****************************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user