diff --git a/Core/Inc/yunhorn_sts_prd_conf.h b/Core/Inc/yunhorn_sts_prd_conf.h index d76c6ed..95fe2b0 100644 --- a/Core/Inc/yunhorn_sts_prd_conf.h +++ b/Core/Inc/yunhorn_sts_prd_conf.h @@ -210,7 +210,7 @@ #ifdef YUNHORN_STS_O7_ENABLED #define MajorVer 24U #define MinorVer 05U -#define SubMinorVer 05U +#define SubMinorVer 12U #define FirmwareVersion 3U #define YUNHORN_STS_MAX_NVM_CFG_SIZE 64U diff --git a/Core/Src/sts_lamp_bar.c b/Core/Src/sts_lamp_bar.c index 528c952..1cf2ebc 100644 --- a/Core/Src/sts_lamp_bar.c +++ b/Core/Src/sts_lamp_bar.c @@ -238,7 +238,7 @@ void STS_Combined_Status_Processing(void) event_start_time = mems_event_time.Seconds; event_stop_time = 0; - APP_LOG(TS_OFF, VLEVEL_M, "\r\n Event Started at %6u Seconds \r\n", event_start_time); + APP_LOG(TS_OFF, VLEVEL_H, "\r\n Event Started at %6u Seconds \r\n", event_start_time); } @@ -250,7 +250,7 @@ void STS_Combined_Status_Processing(void) event_start_time = 0; - APP_LOG(TS_OFF, VLEVEL_M, "\r\n Event Stop at %6u Seconds \r\n", event_stop_time); + APP_LOG(TS_OFF, VLEVEL_H, "\r\n Event Stop at %6u Seconds \r\n", event_stop_time); } } @@ -390,7 +390,7 @@ void STS_Combined_Status_Processing(void) //if ((sts_rss_result_changed_flag)|| (sts_reed_hall_changed_flag) || (sts_tof_result_changed_flag) || (sts_water_leakage_changed_flag)) { - sts_rss_result_changed_flag =0; + //sts_rss_result_changed_flag =0; sts_reed_hall_changed_flag =0; sts_tof_result_changed_flag =0; #ifdef STS_M1 diff --git a/Core/Src/yunhorn_sts_presence_rss.c b/Core/Src/yunhorn_sts_presence_rss.c index f62f388..8ce5d15 100644 --- a/Core/Src/yunhorn_sts_presence_rss.c +++ b/Core/Src/yunhorn_sts_presence_rss.c @@ -291,7 +291,7 @@ static void print_result(acc_detector_presence_result_t result) { uint32_t detected_zone = (uint32_t)((float)(result.presence_distance - DEFAULT_START_M) / (float)DEFAULT_ZONE_LENGTH); - APP_LOG(TS_OFF, VLEVEL_L,"Motion in zone: %u, distance: %d, score: %d\n", (unsigned int)detected_zone, + APP_LOG(TS_OFF, VLEVEL_H,"Motion in zone: %u, distance: %d, score: %d\n", (unsigned int)detected_zone, (int)(result.presence_distance * 1000.0f), (int)(result.presence_score * 1000.0f)); } @@ -367,9 +367,10 @@ int sts_presence_rss_fall_rise_detection(void) float average_score =0.0f; uint8_t k=0; uint16_t motion_in_zone[10]={0x0}; + uint16_t detected_zone=0; //for (k=0; k<5; k++) {motion_in_zone[k]=0;} -#if 0 +#if 1 for (int i = 0; i < (iterations/2); i++) { success = acc_detector_presence_get_next(handle, &result); @@ -387,6 +388,8 @@ int sts_presence_rss_fall_rise_detection(void) average_result++; average_distance += result.presence_distance; average_score += result.presence_score; + detected_zone = (uint16_t)((float)(result.presence_distance - DEFAULT_START_M) / (float)DEFAULT_ZONE_LENGTH); + motion_in_zone[detected_zone]++; } if (sts_presence_fall_detection == 1) @@ -429,7 +432,7 @@ int sts_presence_rss_fall_rise_detection(void) } acc_detector_presence_configuration_destroy(&presence_configuration); // set to full lenght of iteration - for (int i = 0; i < (iterations); i++) + for (int i = 0; i < (iterations/2); i++) { success = acc_detector_presence_get_next(handle, &result); if (!success) @@ -446,7 +449,7 @@ int sts_presence_rss_fall_rise_detection(void) average_result++; average_distance += result.presence_distance; average_score += result.presence_score; - uint16_t detected_zone = (uint16_t)((float)(result.presence_distance - DEFAULT_START_M) / (float)DEFAULT_ZONE_LENGTH); + detected_zone = (uint16_t)((float)(result.presence_distance - DEFAULT_START_M) / (float)DEFAULT_ZONE_LENGTH); motion_in_zone[detected_zone]++; } diff --git a/LoRaWAN/App/lora_app.c b/LoRaWAN/App/lora_app.c index da60834..de15f52 100644 --- a/LoRaWAN/App/lora_app.c +++ b/LoRaWAN/App/lora_app.c @@ -960,7 +960,7 @@ static void SendTxData(void) AppData.Buffer[i++] = (uint8_t)(sts_o7_sensorData.over_stay_duration>>8)&0xff; //13 occupancy over time or not AppData.Buffer[i++] = (uint8_t)(sts_o7_sensorData.over_stay_duration)&0xff; //13 occupancy over time or not #endif -#if 0 +#if 1 APP_LOG(TS_OFF, VLEVEL_L, "\r\n######| Color | Mode |\r\n######| %4s | %5s |\r\n",(char *)sts_lamp_color_code[(uint8_t)(AppData.Buffer[0])], (char*)sts_work_mode_code[AppData.Buffer[1]]); APP_LOG(TS_OFF, VLEVEL_L, diff --git a/STM32CubeIDE/Release/STS_O7.bin b/STM32CubeIDE/Release/STS_O7.bin index 9b93e41..f43b891 100644 Binary files a/STM32CubeIDE/Release/STS_O7.bin and b/STM32CubeIDE/Release/STS_O7.bin differ