解决偶然性误报“车辆进站”语音

This commit is contained in:
hehaoyang 2023-12-19 16:44:02 +08:00
parent 6787001a2d
commit d280ca2a05
3 changed files with 26 additions and 15 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ GD32F103C8T6/Bootloader/Output/*
GD32F103C8T6/._GD32F10x.emProject
*.emSession
*.jlink
._*

View File

@ -85,6 +85,8 @@ void v58_volume_down(void)
*/
void v58_stop(void)
{
delay_ms(100);
/* 停止 */
v58_send_pulse(1);

View File

@ -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();
}
diaodu_status = diaodu_status_temporry;
door_status = 0xFF;
door_status = 0x01;
turn_left_status = 0x01;
turn_right_status = 0x01;
diaodu_status = diaodu_status_temporry;
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: