From 1532f4a1f48b52b25e8f1d69a47f1c30692b0a48 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Mon, 19 Aug 2024 13:50:46 +0800 Subject: [PATCH] ---revised for height output format --- Core/Src/yunhorn_sts_presence_rss.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Core/Src/yunhorn_sts_presence_rss.c b/Core/Src/yunhorn_sts_presence_rss.c index 7bb3b86..eaf66b4 100644 --- a/Core/Src/yunhorn_sts_presence_rss.c +++ b/Core/Src/yunhorn_sts_presence_rss.c @@ -618,18 +618,23 @@ int sts_presence_rss_fall_rise_detection(void) OnSensorRSS3CStateChanged(); } -#ifdef LOG_RSS - APP_LOG(TS_OFF, VLEVEL_H,"\r\nSensor at Ceiling Height: %u mm\r\n",(uint16_t)sts_sensor_install_height); - APP_LOG(TS_OFF, VLEVEL_H,"\r\n|Motion Distance Zone| ##### |Height cm|\r\n"); - uint8_t kk = (uint8_t)(sts_sensor_install_height/400+1); - APP_LOG(TS_OFF, VLEVEL_L,"\r\n|-----------Ceiling-------Sensor---V-----|\r\n"); - for (uint8_t k=0; k<=kk; k++) +//#ifdef LOG_RSS + APP_LOG(TS_OFF, VLEVEL_M,"\r\nSensor at Ceiling Height: %u cm\r\n",(uint16_t)sts_sensor_install_height/10); + APP_LOG(TS_OFF, VLEVEL_M,"\r\n|Motion Distance Zone| ##### |Height cm|\r\n"); + uint8_t kk = (uint8_t)((uint16_t)(sts_sensor_install_height/1000)/(DEFAULT_ZONE_LENGTH)); + APP_LOG(TS_OFF, VLEVEL_M,"\r\n|-----------Ceiling-------Sensor---V-----|\r\n"); + for (uint8_t k=0; k <=kk; k++) { - if (motion_in_hs_zone[kk-k][thiscnt]>0) APP_LOG(TS_OFF, VLEVEL_L,"\r\n| %2u | %4u | %4u |\r\n", kk-k, (uint8_t)motion_in_hs_zone[kk-k][thiscnt], (int)(kk-k+1)*40); - else APP_LOG(TS_OFF, VLEVEL_L,"\r\n| %2u | | |\r\n", kk-k); + if (motion_in_hs_zone[kk - k][thiscnt] > 0) + { + APP_LOG(TS_OFF, VLEVEL_M,"\r\n| %2u | %4u | %4u |\r\n", + (kk-k), (uint8_t)motion_in_hs_zone[kk-k][thiscnt], (int)(kk-k)*40); + } else { + APP_LOG(TS_OFF, VLEVEL_M,"\r\n| %2u | | |\r\n", kk-k); + } } - APP_LOG(TS_OFF, VLEVEL_L,"\r\n|-----------Floor Ground-----------^-----|\r\n"); -#endif + APP_LOG(TS_OFF, VLEVEL_M,"\r\n|-----------Floor Ground-----------^-----|\r\n"); +//#endif if (deactivated && success)