minor tune for stable detection

This commit is contained in:
Yunhorn 2025-04-30 09:52:02 +08:00
parent 23ed469d40
commit ffe6fbf58d
4 changed files with 11 additions and 7 deletions

View File

@ -118,6 +118,7 @@ void SystemApp_Init(void)
/*Initialize the Sensors */
EnvSensors_Init();
// LED1 Flash 3 times for normal power on
LED1_OFF;
LED1_TOGGLE; HAL_Delay(200);
LED1_TOGGLE; HAL_Delay(200);
LED1_TOGGLE; HAL_Delay(200);

View File

@ -152,7 +152,7 @@ static uint8_t sts_rss_init_ok=0;
volatile uint8_t sts_presence_singularity=0;
extern uint8_t sts_lamp_bar_color;
acc_detector_presence_handle_t rss_handle=NULL;
volatile acc_detector_presence_result_t rss_result;
acc_detector_presence_result_t rss_result;
volatile float sts_rss_threshold=1.6f;
/* USER CODE END Includes */
@ -284,16 +284,19 @@ static void set_default_configuration(acc_detector_presence_configuration_t pres
{
acc_detector_presence_configuration_sensor_set(presence_configuration, DEFAULT_SENSOR_ID);
acc_detector_presence_configuration_service_profile_set(presence_configuration, DEFAULT_PROFILE); // *** optional
uint16_t sweeps_per_frame = acc_detector_presence_configuration_sweeps_per_frame_get(presence_configuration);
acc_detector_presence_configuration_sweeps_per_frame_set(presence_configuration, sweeps_per_frame);
acc_detector_presence_configuration_downsampling_factor_set(presence_configuration, 1);
acc_detector_presence_configuration_hw_accelerated_average_samples_set(presence_configuration, DEFAULT_HWAAS);
acc_detector_presence_configuration_update_rate_set(presence_configuration, 10); //DEFAULT_UPDATE_RATE_PRESENCE);
acc_detector_presence_configuration_detection_threshold_set(presence_configuration, 1.6f); //DEFAULT_THRESHOLD);
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
int sweeps_per_frame = acc_service_sparse_configuration_sweeps_per_frame_get(presence_configuration);
acc_service_sparse_configuration_sweeps_per_frame_set(presence_configuration, 16);
acc_detector_presence_configuration_power_save_mode_set(presence_configuration, DEFAULT_POWER_SAVE_MODE);
acc_detector_presence_configuration_hw_accelerated_average_samples_set(presence_configuration, DEFAULT_HWAAS);
acc_detector_presence_configuration_start_set(presence_configuration, 0.5f);//DEFAULT_START_M);
acc_detector_presence_configuration_length_set(presence_configuration, 1.7f); //DEFAULT_LENGTH_M);
acc_detector_presence_configuration_downsampling_factor_set(presence_configuration, 1);
acc_detector_presence_configuration_receiver_gain_set(presence_configuration, 0.5f);
//set_default_configuration_common(presence_configuration);
@ -306,7 +309,7 @@ static void set_default_configuration(acc_detector_presence_configuration_t pres
// will be disabled if this value > 1/2 of update rate, default update rate 65, so must < 30
filter.inter_frame_fast_cutoff = 18.0f; //DEFAULT_INTER_FRAME_FAST_CUTOFF;
filter.inter_frame_slow_cutoff = 0.17f; //DEFAULT_INTER_FRAME_SLOW_CUTOFF;
filter.output_time_const = 0.f;
filter.output_time_const = 0.2f;
// no effect if intra-frame-weight set to 0
//filter.intra_frame_time_const = DEFAULT_INTRA_FRAME_TIME_CONST;
// for slow movement, people sit still, rest in sofa, seat, closestool, etc.

View File

@ -70,7 +70,7 @@ void MX_LoRaWAN_Init(void)
SystemApp_Init();
/* USER CODE BEGIN MX_LoRaWAN_Init_2 */
//STS_Lamp_Bar_Self_Test_Simple();
//STS_Lamp_Bar_Self_Test();
STS_Lamp_Bar_Self_Test();
/* USER CODE END MX_LoRaWAN_Init_2 */
LoRaWAN_Init();
/* USER CODE BEGIN MX_LoRaWAN_Init_3 */

Binary file not shown.