diff --git a/Core/Src/yunhorn_sts_presence_rss.c b/Core/Src/yunhorn_sts_presence_rss.c index f29cc4e..f8d1b73 100644 --- a/Core/Src/yunhorn_sts_presence_rss.c +++ b/Core/Src/yunhorn_sts_presence_rss.c @@ -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_output_time_const = sts_run_filter.output_time_const; - 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", + 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", 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); @@ -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)) { - APP_LOG(TS_OFF, VLEVEL_H, "\r\n ------ ---------- rss cfg update flag=%02x \r\n", sts_rss_config_updated_flag); + APP_LOG(TS_OFF, VLEVEL_M, "\r\n ------ ---------- rss cfg update flag=%02x \r\n", sts_rss_config_updated_flag); if (sts_rss_init_ok==0) @@ -407,12 +407,12 @@ int sts_presence_rss_fall_rise_detection(void) if (sts_work_mode ==STS_UNI_MODE) sts_rss_config_updated_flag |= STS_RSS_CONFIG_FALL_DETECTION; else if ((sts_work_mode == STS_RSS_MODE) || (sts_work_mode == STS_DUAL_MODE)) sts_rss_config_updated_flag |= STS_RSS_CONFIG_DEFAULT; set_default_configuration(presence_configuration); - APP_LOG(TS_OFF, VLEVEL_H, "\r\n First Time RSS init, update flag=%02x\r\n", sts_rss_config_updated_flag); + APP_LOG(TS_OFF, VLEVEL_M, "\r\n First Time RSS init, update flag=%02x\r\n", sts_rss_config_updated_flag); print_current_configuration(presence_configuration); sts_rss_init_ok = 1; } - APP_LOG(TS_OFF, VLEVEL_H, "\r\n Update flag=%02x, workmode=%2d \r\n", sts_rss_config_updated_flag, sts_work_mode); + APP_LOG(TS_OFF, VLEVEL_M, "\r\n Update flag=%02x, workmode=%2d \r\n", sts_rss_config_updated_flag, sts_work_mode); switch (sts_rss_config_updated_flag) { #if 0 diff --git a/Core/Src/yunhorn_sts_process.c b/Core/Src/yunhorn_sts_process.c index e3e8c5d..3935106 100644 --- a/Core/Src/yunhorn_sts_process.c +++ b/Core/Src/yunhorn_sts_process.c @@ -715,7 +715,8 @@ void STS_PRESENCE_SENSOR_NVM_CFG(void) sts_presence_rss_config.default_downsampling_factor = (float)(sts_cfg_nvm.p[RSS_CFG_DOWNSAMPLING_FACTOR]); sts_presence_rss_config.default_power_save_mode = (float)(sts_cfg_nvm.p[RSS_CFG_POWER_MODE]); - sts_rss_config_updated_flag = (sts_rss_config_updated_flag|STS_RSS_CONFIG_FULL); //set to 2 for FULL config effect in next detection + // sts_rss_config_updated_flag = (sts_rss_config_updated_flag|STS_RSS_CONFIG_FULL); //set to 2 for FULL config effect in next detection + sts_rss_config_updated_flag = (STS_RSS_CONFIG_FULL); //set to 2 for FULL config effect in next detection } void STS_PRESENCE_SENSOR_NVM_CFG_SIMPLE(void) @@ -733,7 +734,8 @@ void STS_PRESENCE_SENSOR_NVM_CFG_SIMPLE(void) sts_presence_rss_config.default_nbr_removed_pc = (float)(sts_cfg_nvm.p[RSS_CFG_NBR_REMOVED_PC]); - sts_rss_config_updated_flag = (sts_rss_config_updated_flag|STS_RSS_CONFIG_SIMPLE); //set to 1 for simple config effect in next detection + // sts_rss_config_updated_flag = (sts_rss_config_updated_flag|STS_RSS_CONFIG_SIMPLE); //set to 1 for simple config effect in next detection + sts_rss_config_updated_flag = (STS_RSS_CONFIG_SIMPLE); //set to 1 for simple config effect in next detection } void STS_PRESENCE_SENSOR_Init_Send_Data(void) @@ -974,7 +976,7 @@ void STS_PRESENCE_SENSOR_RSS_Init(void) } STS_PRESENCE_SENSOR_NVM_CFG(); - +#if 0 switch (sts_work_mode) { case STS_RSS_MODE: @@ -990,7 +992,8 @@ void STS_PRESENCE_SENSOR_RSS_Init(void) default: break; } - +#endif + APP_LOG(TS_ON, VLEVEL_M, "##### Reboot --- with NVM CFG'ED RSS flag =%02x \r\n", sts_rss_config_updated_flag); } diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index fc4c607..a97e7e1 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -2563,7 +2563,7 @@ void USER_APP_AUTO_RESPONDER_Parse(char *tlv_buf, uint8_t tlv_buf_size) sts_cfg_nvm.p[RSS_CFG_THRESHOLD] = (uint8_t)((tlv_buf[CFG_CMD8] - 0x30)*10+(tlv_buf[CFG_CMD9] - 0x30)); sts_cfg_nvm.p[RSS_CFG_RECEIVER_GAIN] = (uint8_t)((tlv_buf[CFG_CMD10]- 0x30)*10+(tlv_buf[CFG_CMD11]- 0x30)); - APP_LOG(TS_OFF, VLEVEL_H,"\r\nStart,Lenght,threshold,gain=%02x %02x %02x %02x \r\n", + APP_LOG(TS_OFF, VLEVEL_M,"\r\nStart,Lenght,threshold,gain=%02x %02x %02x %02x \r\n", sts_cfg_nvm.p[RSS_CFG_START_M],sts_cfg_nvm.p[RSS_CFG_LENGTH_M],sts_cfg_nvm.p[RSS_CFG_THRESHOLD],sts_cfg_nvm.p[RSS_CFG_RECEIVER_GAIN]); STS_PRESENCE_SENSOR_NVM_CFG_SIMPLE(); @@ -2941,7 +2941,7 @@ void OnRestoreSTSCFGContextProcess(void) // if ((sts_version == sts_cfg_nvm.version)&& (NVM_CFG_PARAMETER_SIZE == sts_cfg_nvm.length)) { STS_PRESENCE_SENSOR_Init(); - //STS_PRESENCE_SENSOR_RSS_Init(); + STS_PRESENCE_SENSOR_RSS_Init(); } #endif //STS_SENSOR_Distance_Test_Process(); diff --git a/STM32CubeIDE/Release/STS_O7.bin b/STM32CubeIDE/Release/STS_O7.bin index 793d491..9254685 100644 Binary files a/STM32CubeIDE/Release/STS_O7.bin and b/STM32CubeIDE/Release/STS_O7.bin differ