diff --git a/App/Inc/inflash.h b/App/Inc/inflash.h index 40f9d99..db3c976 100644 --- a/App/Inc/inflash.h +++ b/App/Inc/inflash.h @@ -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; diff --git a/App/Src/anemometer_dev.c b/App/Src/anemometer_dev.c index cb63dd5..2a45d42 100644 --- a/App/Src/anemometer_dev.c +++ b/App/Src/anemometer_dev.c @@ -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)