RM2_1 #2

Merged
sundp merged 208 commits from RM2_1 into master 2024-09-13 09:16:14 +08:00
5 changed files with 19 additions and 18 deletions
Showing only changes of commit ae0fd3c981 - Show all commits

View File

@ -50,7 +50,7 @@ extern "C" {
* #define VLEVEL_M 2 functional traces
* #define VLEVEL_H 3 all traces
*/
#define VERBOSE_LEVEL VLEVEL_M
#define VERBOSE_LEVEL VLEVEL_L
/**
* @brief Enable trace logs

View File

@ -147,7 +147,7 @@ int sts_distance_rss_detector_distance(void)
if (deactivated && success)
{
APP_LOG(TS_OFF, VLEVEL_L, "Application finished OK\n");
APP_LOG(TS_OFF, VLEVEL_H, "Application finished OK\n");
return EXIT_SUCCESS;
}

View File

@ -83,7 +83,7 @@
#define DEFAULT_DOWNSAMPLING_FACTOR (2) //default 1
//#define DEFAULT_RECEIVER_GAIN (0.65f) //default 0.9 gain mdB [4]
#define DEFAULT_RECEIVER_GAIN (0.40f) //default 0.9 gain mdB [4]
#define DEFAULT_RECEIVER_GAIN (0.65f) //default 0.9 gain mdB [4]
#define DEFAULT_MOTION_DATASET_LEN (128) //MOTION DATASET/PATTERN COLLECTION
#define DEFAULT_MOTION_FEATURE_LEN (10) //MOTION FEATURE IDENDIFIED
@ -462,7 +462,8 @@ int sts_presence_rss_fall_rise_detection(void)
}
//acc_integration_sleep_ms(1000 / DEFAULT_UPDATE_RATE_PRESENCE); // 15ms, DEFAULT_UPDATE_RATE);
acc_integration_sleep_ms(2);
acc_integration_sleep_ms(10); // --- around 1500 ms in total
//acc_integration_sleep_ms(2);
}
deactivated = acc_detector_presence_deactivate(handle);
@ -516,11 +517,11 @@ int sts_presence_rss_fall_rise_detection(void)
if (!result.data_saturated)
{
APP_LOG(TS_OFF, VLEVEL_H,"\n%u ", i);
//APP_LOG(TS_OFF, VLEVEL_L,"\n%u ", i);
//print_result(result);
if ((result.presence_detected) && (result.presence_score > DEFAULT_THRESHOLD))
{
print_result(result);
//print_result(result);
average_result++;
average_distance += result.presence_distance;
average_score += result.presence_score;
@ -549,15 +550,15 @@ int sts_presence_rss_fall_rise_detection(void)
}
// ~12 ms per RSS scan
// acc_integration_sleep_ms(1000 / DEFAULT_UPDATE_RATE_PRESENCE); // 15 ms, DEFAULT_UPDATE_RATE);
//acc_integration_sleep_ms(10); --- around 1500 ms in total
acc_integration_sleep_ms(2); //--- around 1000ms in total
acc_integration_sleep_ms(10); //--- around 1500 ms in total
//acc_integration_sleep_ms(2); //--- around 1000ms in total
}
deactivated = acc_detector_presence_deactivate(handle);
acc_detector_presence_destroy(&handle);
acc_rss_deactivate();
APP_LOG(TS_OFF, VLEVEL_M, "\r\n Second Half --- Motion Count Sum to = %u \r\n", motion_count);
APP_LOG(TS_OFF, VLEVEL_H, "\r\n Second Half --- Motion Count Sum to = %u \r\n", motion_count);
//APP_LOG(TS_OFF, VLEVEL_L,"Second Half, Fall Rise Detection, Motion Count = %u \r\n", (int)motion_count);
@ -578,11 +579,11 @@ int sts_presence_rss_fall_rise_detection(void)
sts_presence_rss_distance = average_distance;
sts_presence_rss_score = average_score;
sts_rss_result = (average_result > (DEFAULT_UPDATE_RATE_PRESENCE/5))? 1: 0;
sts_rss_result = (average_result > (DEFAULT_UPDATE_RATE_PRESENCE/20))? 1: 0;
//if (average_result) //if (average_score !=0) //if (sts_rss_result)
if (sts_rss_result) //if (average_score !=0) //if (sts_rss_result)
{
APP_LOG(TS_OFF, VLEVEL_L,"\r\n######## Motion: %u Distance=%u mm, Score=%u Average_result=%u out of %u \r\n",
APP_LOG(TS_OFF, VLEVEL_M,"\r\n######## Motion: %u Distance=%u mm, Score=%u Average_result=%u out of %u \r\n",
(uint8_t)sts_rss_result,(int) sts_presence_rss_distance, (int)(sts_presence_rss_score), (int)average_result, (int)iterations);
}
@ -614,9 +615,9 @@ int sts_presence_rss_fall_rise_detection(void)
}
// RSS feature 3: No motion, or stay still , or unconscious process
APP_LOG(TS_OFF, VLEVEL_M,"\r\n|Motion Detected Count =%u \r\n", motion_detected_count);
// APP_LOG(TS_OFF, VLEVEL_M,"\r\n|Motion Detected Count =%u \r\n", motion_detected_count);
uint8_t thiscnt= motion_detected_count++;
APP_LOG(TS_OFF, VLEVEL_M,"\r\n|Motion Detected Count =%u and thiscnt=%u \r\n", motion_detected_count, thiscnt);
// APP_LOG(TS_OFF, VLEVEL_M,"\r\n|Motion Detected Count =%u and thiscnt=%u \r\n", motion_detected_count, thiscnt);
if (motion_detected_count == 10) {
//for (uint8_t j=0; j<12; j++) motion_in_hs_zone[j][thiscnt]=0;
motion_detected_count=0;
@ -625,7 +626,7 @@ int sts_presence_rss_fall_rise_detection(void)
OnSensorRSS3CStateChanged();
//#ifdef LOG_RSS
#ifdef LOG_RSS
if (sts_work_mode == STS_UNI_MODE)
{
APP_LOG(TS_OFF, VLEVEL_M,"\r\nSensor at Ceiling Height: %u cm\r\n",(uint16_t)sts_sensor_install_height/10);
@ -644,7 +645,7 @@ int sts_presence_rss_fall_rise_detection(void)
}
APP_LOG(TS_OFF, VLEVEL_M,"\r\n|-----------Floor Ground-----------^-----|\r\n");
}
//#endif
#endif
if (deactivated && success)

View File

@ -986,7 +986,7 @@ void STS_PRESENCE_SENSOR_Distance_Measure_Process(void)
{
uint8_t exit_status = EXIT_SUCCESS, i=0;
APP_LOG(TS_OFF, VLEVEL_L, "\r\n ****start_m=%u length_m=%u profile=%u hwaas=%u \r\n",
APP_LOG(TS_OFF, VLEVEL_M, "\r\n ****start_m=%u length_m=%u profile=%u hwaas=%u \r\n",
(unsigned int)(distance_cfg.start_m*1000),(unsigned int)(distance_cfg.length_m*1000),
(unsigned int)(distance_cfg.acc_profile),(unsigned int)(distance_cfg.hwaas));
do

View File

@ -1430,7 +1430,7 @@ static void OnJoinRequest(LmHandlerJoinParams_t *joinParams)
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
//UTIL_TIMER_Start(&TxTimer);
//UTIL_TIMER_Start(&STSDurationCheckTimer);
UTIL_TIMER_Start(&STSDurationCheckTimer);
OnYunhornSTSHeartBeatPeriodicityChanged(HeartBeatPeriodicity);
//UTIL_TIMER_Create(&YunhornSTSRSSWakeUpTimer, YUNHORN_STS_RSS_WAKEUP_CHECK_TIME, UTIL_TIMER_PERIODIC, OnYunhornSTSOORSSWakeUpTimerEvent, NULL);