feat:增加避障时间可调参数

This commit is contained in:
2024-07-13 19:10:00 +08:00
parent b88aaf47e5
commit f7b52d9d2e
4 changed files with 6 additions and 4 deletions

View File

@@ -10,7 +10,7 @@ int temp_min_s;
int temp_max_s;
int barrier_begin_flag = 0;
int barrier_count = 0;
float barrirer_time=500.f;
void CheckBarrier()
{
if (barrier_type == BARRIER_NONE && Lpt0_found_barrier_in && !Lpt1_found_barrier_in && is_straight1) {
@@ -33,7 +33,7 @@ void RunBarrier()
}
if (barrier_type == BARRIER_LEFT_RUNNING)
{
if (timer_get(TIM_2) >= 500)
if (timer_get(TIM_2) >= barrirer_time)
{
barrier_type = BARRIER_NONE;
timer_stop(TIM_2);
@@ -126,7 +126,7 @@ void RunBarrier()
}
if (barrier_type == BARRIER_RIGHT_RUNNING)
{
if (timer_get(TIM_2) >= 500)
if (timer_get(TIM_2) >= barrirer_time)
{
barrier_type = BARRIER_NONE;
timer_stop(TIM_2);