From d280ca2a0593e80afad8ea6453654cc7dafed1cd Mon Sep 17 00:00:00 2001 From: hehaoyang <1109196436@qq.com> Date: Tue, 19 Dec 2023 16:44:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=81=B6=E7=84=B6=E6=80=A7?= =?UTF-8?q?=E8=AF=AF=E6=8A=A5=E2=80=9C=E8=BD=A6=E8=BE=86=E8=BF=9B=E7=AB=99?= =?UTF-8?q?=E2=80=9D=E8=AF=AD=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- GD32F103C8T6/App/User/Peripheral/V58/v58.c | 2 ++ GD32F103C8T6/App/User/app.c | 36 +++++++++++++--------- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 213b68e..8b1112e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ GD32F103C8T6/App/Output/* GD32F103C8T6/Bootloader/Output/* GD32F103C8T6/._GD32F10x.emProject *.emSession -*.jlink \ No newline at end of file +*.jlink +._* \ No newline at end of file diff --git a/GD32F103C8T6/App/User/Peripheral/V58/v58.c b/GD32F103C8T6/App/User/Peripheral/V58/v58.c index a002b8c..1a4753d 100644 --- a/GD32F103C8T6/App/User/Peripheral/V58/v58.c +++ b/GD32F103C8T6/App/User/Peripheral/V58/v58.c @@ -85,6 +85,8 @@ void v58_volume_down(void) */ void v58_stop(void) { + delay_ms(100); + /* 停止 */ v58_send_pulse(1); diff --git a/GD32F103C8T6/App/User/app.c b/GD32F103C8T6/App/User/app.c index 57460a4..494095b 100644 --- a/GD32F103C8T6/App/User/app.c +++ b/GD32F103C8T6/App/User/app.c @@ -548,7 +548,19 @@ static void vehicle_status_parsing_task(uint8_t uuid) { status = 0x00; status_type = 5; + + door_status = 0x01; + turn_left_status = 0x01; + turn_right_status = 0x01; + + diaodu_status = diaodu_status_temporry; + + goto EXECUTE; } + + diaodu_status = diaodu_status_temporry; + + return; } /* 到站 */ else if (diaodu_status_temporry == 1) @@ -558,30 +570,27 @@ static void vehicle_status_parsing_task(uint8_t uuid) /* 优先级最高,关闭语音 */ v58_stop(); + + door_status = 0x01; + turn_left_status = 0x01; + turn_right_status = 0x01; + + diaodu_status = diaodu_status_temporry; + + goto EXECUTE; } - diaodu_status = diaodu_status_temporry; - - door_status = 0xFF; - turn_left_status = 0x01; - turn_right_status = 0x01; - - goto EXECUTE; } } /* 如果一直处于进站状态, 超过 2 分钟, 则取消该状态, 并停止语音 */ if (diaodu_status == 1) { + /* 修改为出站状态 */ if (diaodu_status_rx_timestamp != 0 && timestamp - diaodu_status_rx_timestamp >= 120000) - { - /* 修改为出站状态 */ diaodu_arrival_or_departure_parsing(0x02); - goto EXECUTE; - } - return; } @@ -924,8 +933,7 @@ void api_notify_data_forwarding(uint8_t type, uint8_t value) break; case 0x05: - diaodu_upload_status = 0x01; - diaodu_status_temporry = value; + diaodu_arrival_or_departure_parsing(value); break; case 0x06: