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)