diff --git a/Project/HC32F460/MDK/HC32F460.uvoptx b/Project/HC32F460/MDK/HC32F460.uvoptx index 74babe2..bb5bad4 100644 --- a/Project/HC32F460/MDK/HC32F460.uvoptx +++ b/Project/HC32F460/MDK/HC32F460.uvoptx @@ -101,7 +101,9 @@ 0 0 1 - 2 + 0 + 0 + 12 @@ -151,72 +153,7 @@ - - - 0 - 0 - 235 - 1 -
24890
- 0 - 0 - 0 - 0 - 0 - 1 - ..\source\User\Src\main.c - - \\BombSensor\../source/User/Src/main.c\235 -
- - 1 - 0 - 211 - 1 -
24642
- 0 - 0 - 0 - 0 - 0 - 1 - ..\source\User\Src\main.c - - \\BombSensor\../source/User/Src/main.c\211 -
- - 2 - 0 - 185 - 1 -
24380
- 0 - 0 - 0 - 0 - 0 - 1 - ..\source\User\Src\main.c - - \\BombSensor\../source/User/Src/main.c\185 -
- - 3 - 0 - 163 - 1 -
24122
- 0 - 0 - 0 - 0 - 0 - 1 - ..\source\User\Src\main.c - - \\BombSensor\../source/User/Src/main.c\163 -
-
+ 0 @@ -353,6 +290,7 @@ 1 + 0 0 2 5000000 @@ -440,6 +378,8 @@ 0 0 1 + 0 + 0 -1 diff --git a/Project/HC32F460/MDK/HC32F460.uvprojx b/Project/HC32F460/MDK/HC32F460.uvprojx index 47814fb..0850732 100644 --- a/Project/HC32F460/MDK/HC32F460.uvprojx +++ b/Project/HC32F460/MDK/HC32F460.uvprojx @@ -184,6 +184,9 @@ 0 0 2 + 0 + 0 + 0 1 1 8 @@ -324,6 +327,7 @@ 0 0 1 + 0 0 3 3 @@ -349,7 +353,7 @@ 0 0 0 - 0 + 4 @@ -858,6 +862,9 @@ 0 0 1 + 0 + 0 + 0 1 1 8 @@ -998,6 +1005,7 @@ 0 0 1 + 0 0 0 0 @@ -1023,7 +1031,7 @@ 0 0 0 - 0 + 4 diff --git a/Project/HC32F460/MDK/RTE/_Debug/RTE_Components.h b/Project/HC32F460/MDK/RTE/_Debug/RTE_Components.h index d0352e7..74af911 100644 --- a/Project/HC32F460/MDK/RTE/_Debug/RTE_Components.h +++ b/Project/HC32F460/MDK/RTE/_Debug/RTE_Components.h @@ -1,6 +1,6 @@ /* - * Auto generated Run-Time-Environment Component Configuration File + * Auto generated Run-Time-Environment Configuration File * *** Do not modify ! *** * * Project: 'HC32F460' @@ -17,4 +17,5 @@ #define CMSIS_device_header "HC32F460JETA.h" + #endif /* RTE_COMPONENTS_H */ diff --git a/Project/HC32F460/source/User/Inc/main.h b/Project/HC32F460/source/User/Inc/main.h index 700c12b..7ab3222 100644 --- a/Project/HC32F460/source/User/Inc/main.h +++ b/Project/HC32F460/source/User/Inc/main.h @@ -4,18 +4,18 @@ #include "bsp.h" -#define USE_FILE_SYSTEM 1 +#define USE_FILE_SYSTEM 1 #define SDCARD_BLOCK_MAX (10000) -#define OSC_CNT 40 -#define SLOPE_CNT 40 +#define OSC_CNT 40 +#define SLOPE_CNT 40 -#define STOP_TIME_MS 500 -#define RUN_TIME_MS 0 +#define STOP_TIME_MS 500 +#define RUN_TIME_MS 0 #define BDC_STOP() Motor_Control(MOTOR_CMD_STOP) -#define BDC_UP() Motor_Control(MOTOR_CMD_FORWARD) +#define BDC_UP() Motor_Control(MOTOR_CMD_FORWARD) #define BDC_DOWN() Motor_Control(MOTOR_CMD_REVERSE) typedef struct{ @@ -26,6 +26,11 @@ typedef struct{ int32_t RightUpVPT;//右上设备阈值 int32_t RightLowVPT;//右下设备阈值 + int32_t LeftUpShieldVPT; //左上屏蔽阈值 + int32_t LeftLowpShieldVPT; //左下屏蔽阈值 + int32_t RightUpShieldVPT; //右上屏蔽阈值 + int32_t RightLowShieldVPT; //右下屏蔽阈值 + int32_t LeftUp_Org_AdZero;//左上设备原始AD零点 int32_t LeftLow_Org_AdZero;//左下设备原始AD零点 int32_t RightUp_Org_AdZero;//右上设备原始AD零点 diff --git a/Project/HC32F460/source/User/Src/main.c b/Project/HC32F460/source/User/Src/main.c index 349f4bc..eac3b17 100644 --- a/Project/HC32F460/source/User/Src/main.c +++ b/Project/HC32F460/source/User/Src/main.c @@ -154,8 +154,8 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_ && (Oll_diff2 <= -App.ADTrack.LeftLowVPT) && (Oll_diff3 <= -App.ADTrack.LeftLowVPT))) { - if((abs(Olu_diff1) > abs(Orl_diff1) + 10000) - && (abs(Oll_diff1) > abs(Oru_diff1) + 10000)) + if((abs(Olu_diff1) > abs(Orl_diff1) + App.ADTrack.LeftUpShieldVPT) + && (abs(Oll_diff1) > abs(Oru_diff1) + App.ADTrack.LeftLowpShieldVPT)) { BDC_UP(); App.UpFlag = true; @@ -177,8 +177,8 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_ && (Oll_diff1 >= App.ADTrack.LeftLowVPT) && (Oll_diff1 >= App.ADTrack.LeftLowVPT))) { - if((abs(Oll_diff1) > abs(Oru_diff1) + 10000) - && (abs(Olu_diff1) > abs(Orl_diff1) + 10000)) + if((abs(Oll_diff1) > abs(Oru_diff1) + App.ADTrack.LeftLowShieldVPT) + && (abs(Olu_diff1) > abs(Orl_diff1) + App.ADTrack.LeftUpShieldVPT)) { BDC_DOWN(); App.DownFlag = true; @@ -204,8 +204,8 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_ && (Orl_diff2 <= -App.ADTrack.RightLowVPT) && (Orl_diff3 <= -App.ADTrack.RightLowVPT))) { - if((abs(Orl_diff1) > abs(Olu_diff1) + 10000) - && (abs(Oru_diff1) > abs(Oll_diff1) + 10000)) + if((abs(Orl_diff1) > abs(Olu_diff1) + App.ADTrack.RightLowShieldVPT) + && (abs(Oru_diff1) > abs(Oll_diff1) + App.ADTrack.RightUpShieldVPT)) { BDC_UP(); App.UpFlag = true; @@ -228,8 +228,8 @@ void SupportControlHandle(int32_t *lu_ad, int32_t *ll_ad, int32_t *ru_ad, int32_ && (Orl_diff3 >= App.ADTrack.RightLowVPT)) ) { - if((abs(Oru_diff1) > abs(Oll_diff1) + 10000) - && (abs(Orl_diff1) > abs(Olu_diff1) + 10000)) + if((abs(Oru_diff1) > abs(Oll_diff1) + App.ADTrack.RightUpShieldVPT) + && (abs(Orl_diff1) > abs(Olu_diff1) + App.ADTrack.RightLowShieldVPT)) { BDC_DOWN(); App.DownFlag = true; @@ -550,7 +550,11 @@ static void AppLoopHandler(void) App.ADTrack.LeftUpVPT = 40000; App.ADTrack.LeftLowVPT = 40000; App.ADTrack.RightUpVPT = 40000; - App.ADTrack.RightLowVPT = 40000; + App.ADTrack.RightLowVPT = 40000; + App.ADTrack.LeftUpShieldVPT = 10000; + App.ADTrack.LeftLowpShieldVPT = 10000; + App.ADTrack.RightUpShieldVPT = 10000; + App.ADTrack.RightLowShieldVPT = 10000; App.ADTrack.LeftUp_Org_AdZero = App.LeftUpCS1237_TrendArray[0]; App.ADTrack.LeftLow_Org_AdZero = App.LeftLowCS1237_TrendArray[0];