no good on restore FACTORY DEFAULT Nvm
This commit is contained in:
parent
66033b8db6
commit
7ba0f9954d
|
@ -344,7 +344,7 @@ static void print_current_configuration(acc_detector_presence_configuration_t pr
|
||||||
float sts_run_f_intra_frame_weight = sts_run_filter.intra_frame_weight;
|
float sts_run_f_intra_frame_weight = sts_run_filter.intra_frame_weight;
|
||||||
float sts_run_f_output_time_const = sts_run_filter.output_time_const;
|
float sts_run_f_output_time_const = sts_run_filter.output_time_const;
|
||||||
|
|
||||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\nWork_mode:%2d Start: %4d (mm) Length: %4d (mm) Threshold: %4d (*) Gain= %2d (%) UpdateRate=%4d Profile= %d \r\n",
|
APP_LOG(TS_OFF, VLEVEL_H, "\r\nWork_mode:%2d Start: %4d (mm) Length: %4d (mm) Threshold: %4d (*) Gain= %2d (%) UpdateRate=%4d Profile= %d \r\n",
|
||||||
sts_work_mode, (int)(1000.0*sts_run_start), (int)(1000.0*sts_run_length), (int)(1000.0*sts_run_threshold),
|
sts_work_mode, (int)(1000.0*sts_run_start), (int)(1000.0*sts_run_length), (int)(1000.0*sts_run_threshold),
|
||||||
(int)(100.0*sts_run_gain),(int)sts_run_update_rate, (int)sts_run_profile);
|
(int)(100.0*sts_run_gain),(int)sts_run_update_rate, (int)sts_run_profile);
|
||||||
|
|
||||||
|
@ -399,7 +399,7 @@ int sts_presence_rss_fall_rise_detection(void)
|
||||||
|
|
||||||
if ((sts_rss_config_updated_flag != STS_RSS_CONFIG_NON) || (sts_rss_init_ok != 1))
|
if ((sts_rss_config_updated_flag != STS_RSS_CONFIG_NON) || (sts_rss_init_ok != 1))
|
||||||
{
|
{
|
||||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n ------ ---------- rss cfg update flag=%02x \r\n", sts_rss_config_updated_flag);
|
APP_LOG(TS_OFF, VLEVEL_H, "\r\n ------ ---------- rss cfg update flag=%02x \r\n", sts_rss_config_updated_flag);
|
||||||
|
|
||||||
|
|
||||||
if (sts_rss_init_ok==0)
|
if (sts_rss_init_ok==0)
|
||||||
|
@ -412,7 +412,7 @@ int sts_presence_rss_fall_rise_detection(void)
|
||||||
sts_rss_init_ok = 1;
|
sts_rss_init_ok = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\n Update flag=%02x, workmode=%2d \r\n", sts_rss_config_updated_flag, sts_work_mode);
|
APP_LOG(TS_OFF, VLEVEL_H, "\r\n Update flag=%02x, workmode=%2d \r\n", sts_rss_config_updated_flag, sts_work_mode);
|
||||||
switch (sts_rss_config_updated_flag)
|
switch (sts_rss_config_updated_flag)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -1506,31 +1506,37 @@ uint8_t STS_RSS_Filter(uint8_t pre_sts_rss_result)
|
||||||
uint8_t sum_sliding_win=0;
|
uint8_t sum_sliding_win=0;
|
||||||
motion_read[idx_filter] = pre_sts_rss_result;
|
motion_read[idx_filter] = pre_sts_rss_result;
|
||||||
|
|
||||||
idx_filter = (idx_filter + 1) % FILTER_LEN;
|
|
||||||
|
|
||||||
switch(idx_filter)
|
switch(idx_filter)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
sum_sliding_win = motion_read[idx_filter-1] + motion_read[FILTER_LEN-1] + motion_read[FILTER_LEN-2];
|
sum_sliding_win = motion_read[1] + motion_read[0] + motion_read[FILTER_LEN-1];
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
sum_sliding_win = motion_read[idx_filter-1] + motion_read[idx_filter-2] + motion_read[FILTER_LEN-1];
|
sum_sliding_win = motion_read[2] + motion_read[1] + motion_read[0];
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
sum_sliding_win = motion_read[FILTER_LEN-1] + motion_read[FILTER_LEN-2] + motion_read[FILTER_LEN-3];
|
sum_sliding_win = motion_read[0] + motion_read[FILTER_LEN-1] + motion_read[FILTER_LEN-2];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sum_sliding_win = motion_read[idx_filter-1] + motion_read[idx_filter-2] + motion_read[idx_filter-3];
|
sum_sliding_win = motion_read[idx_filter] + motion_read[idx_filter-1] + motion_read[idx_filter-2];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
idx_filter = (idx_filter + 1) % FILTER_LEN;
|
||||||
|
|
||||||
uint8_t sum_filter = 0;
|
uint8_t sum_filter = 0;
|
||||||
for (j=0; j<FILTER_LEN; j++)
|
for (j=0; j<FILTER_LEN; j++)
|
||||||
{
|
{
|
||||||
sum_filter += motion_read[j];
|
sum_filter += motion_read[j];
|
||||||
}
|
}
|
||||||
return ((sum_sliding_win==3)||(sum_filter > 5))? 1:0;
|
|
||||||
|
return ((sum_sliding_win>=3))? 1:0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* USER CODE BEGIN EF */
|
/* USER CODE BEGIN EF */
|
||||||
|
|
||||||
/* USER CODE END EF */
|
/* USER CODE END EF */
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue