diff --git a/Core/Src/sys_app.c b/Core/Src/sys_app.c index 0e67901..f5cc30b 100644 --- a/Core/Src/sys_app.c +++ b/Core/Src/sys_app.c @@ -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); diff --git a/Core/Src/yunhorn_sts_presence_rss.c b/Core/Src/yunhorn_sts_presence_rss.c index 538393a..037d80a 100644 --- a/Core/Src/yunhorn_sts_presence_rss.c +++ b/Core/Src/yunhorn_sts_presence_rss.c @@ -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. diff --git a/LoRaWAN/App/app_lorawan.c b/LoRaWAN/App/app_lorawan.c index 8c72b4c..0317ebe 100644 --- a/LoRaWAN/App/app_lorawan.c +++ b/LoRaWAN/App/app_lorawan.c @@ -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 */ diff --git a/STM32CubeIDE/Release/STS_O7.bin b/STM32CubeIDE/Release/STS_O7.bin index d69e713..beaef25 100644 Binary files a/STM32CubeIDE/Release/STS_O7.bin and b/STM32CubeIDE/Release/STS_O7.bin differ