有障碍物遮挡探头时,滑动平均数组索引与计数归零;修改统计错误次数的变量增值逻辑,避免溢出;用户配置区域与出厂配置区域都预留20个字节

This commit is contained in:
95384 2025-01-18 10:26:13 +08:00
parent 117777c092
commit 980d3a2429
2 changed files with 8 additions and 3 deletions

View File

@ -39,6 +39,8 @@ typedef struct _usr_config_info{
u_int16_t temp5; /* 占位留待升级 */
u_int16_t temp6; /* 占位留待升级 */
u_int16_t temp7; /* 占位留待升级 */
u_int16_t temp8; /* 占位留待升级 */
u_int16_t temp9; /* 占位留待升级 */
u_int8_t flag_end;
}usr_config_info;

View File

@ -460,6 +460,7 @@ char str[100];
//}
SlidingWindow_10min win_10min = {0};
void wind_task(void const * argument)
{
//软件加密校验
@ -527,7 +528,6 @@ void wind_task(void const * argument)
// 接受信号很小
if(tofx<0||tofy<0)
{
tof_error_log_NS ++;
// 放弃本次采样,可以有效筛选雨滴等导致的异常大的风速数据
// 但是持续的遮挡会导致风速数据保持不变。
// 连续10次采样有问题判定为有遮挡置错误标志位将声速与风速分量置0
@ -540,6 +540,7 @@ void wind_task(void const * argument)
}
else
{
tof_error_log_NS ++;
continue;
}
// 手动设置渡越时间差为0会在探头受遮挡的时候输出0持续遮挡的时候也输出0但是计算出声速将变得很大
@ -594,7 +595,6 @@ void wind_task(void const * argument)
// 如果测量的信号幅值过小。
if(tofx<0||tofy<0)
{
tof_error_log_WE ++;
// 放弃本次采样,可以有效筛选雨滴等导致的异常大的风速数据
// 但是持续的遮挡会导致风速数据保持不变。
// 连续10次采样有问题判定为有遮挡置错误标志位将声速与风速分量置0
@ -607,6 +607,7 @@ void wind_task(void const * argument)
}
else
{
tof_error_log_WE ++;
continue;
}
// 手动设置渡越时间差为0会在探头受遮挡的时候输出0持续遮挡的时候也输出0但是计算出声速将变得很大
@ -663,6 +664,9 @@ void wind_task(void const * argument)
{
av_speed = 0;
av_angle = 0;
//滑动平均值索引归零
win_10min.count = 0;
win_10min.index = 0;
}
// 360一圈
if(av_speedy<0)
@ -844,7 +848,6 @@ void update_mcs_param(float new_wind_speed, float new_wind_dirction)
}
}
SlidingWindow_10min win_10min = {0};
SlidingWindow_3s win_3s = {0};
//求和函数
float sum(float arr[], int n)