reduce debug info

This commit is contained in:
Yunhorn 2024-05-08 18:52:45 +08:00
parent 0e0be968dc
commit 5032f6bf20
4 changed files with 20 additions and 6 deletions

View File

@ -290,13 +290,13 @@ 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); uint32_t detected_zone = (uint32_t)((float)(result.presence_distance - DEFAULT_START_M) / (float)DEFAULT_ZONE_LENGTH);
APP_LOG(TS_OFF, VLEVEL_H,"Motion in zone: %u, distance: %d, score: %d\n", (unsigned int)detected_zone, APP_LOG(TS_OFF, VLEVEL_M,"Motion in zone: %u, distance: %d, score: %d\n", (unsigned int)detected_zone,
(int)(result.presence_distance * 1000.0f), (int)(result.presence_distance * 1000.0f),
(int)(result.presence_score * 1000.0f)); (int)(result.presence_score * 1000.0f));
} }
else else
{ {
APP_LOG(TS_OFF, VLEVEL_H,"No motion, score: %d\n", (int)(result.presence_score * 1000.0f)); APP_LOG(TS_OFF, VLEVEL_M,"No motion, score: %d\n", (int)(result.presence_score * 1000.0f));
} }
} }

View File

@ -231,6 +231,7 @@ void STS_YunhornSTSEventP1_Process(void)
*/ */
void STS_YunhornSTSEventP2_Process(void) void STS_YunhornSTSEventP2_Process(void)
{ {
STS_Lamp_Bar_Refresh(); //TODO XXX eliminate refresh every second.... try STS_Lamp_Bar_Refresh(); //TODO XXX eliminate refresh every second.... try
if ((sts_work_mode >= STS_RSS_MODE) && (sts_work_mode <= STS_TOF_RSS_MODE)) if ((sts_work_mode >= STS_RSS_MODE) && (sts_work_mode <= STS_TOF_RSS_MODE))
{ {

View File

@ -596,12 +596,14 @@ void LoRaWAN_Init(void)
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventRFAC), UTIL_SEQ_RFU, STS_YunhornSTSEventRFAC_Process); UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventRFAC), UTIL_SEQ_RFU, STS_YunhornSTSEventRFAC_Process);
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP1), UTIL_SEQ_RFU, STS_YunhornSTSEventP1_Process); UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP1), UTIL_SEQ_RFU, STS_YunhornSTSEventP1_Process);
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP2), UTIL_SEQ_RFU, STS_YunhornSTSEventP2_Process); UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP2), UTIL_SEQ_RFU, STS_YunhornSTSEventP2_Process);
#if 1
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP3), UTIL_SEQ_RFU, STS_YunhornSTSEventP3_Process); UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP3), UTIL_SEQ_RFU, STS_YunhornSTSEventP3_Process);
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP4), UTIL_SEQ_RFU, STS_YunhornSTSEventP4_Process); UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP4), UTIL_SEQ_RFU, STS_YunhornSTSEventP4_Process);
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP5), UTIL_SEQ_RFU, STS_YunhornSTSEventP5_Process); UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP5), UTIL_SEQ_RFU, STS_YunhornSTSEventP5_Process);
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP6), UTIL_SEQ_RFU, STS_YunhornSTSEventP6_Process); UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP6), UTIL_SEQ_RFU, STS_YunhornSTSEventP6_Process);
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP7), UTIL_SEQ_RFU, STS_YunhornSTSEventP7_Process); UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP7), UTIL_SEQ_RFU, STS_YunhornSTSEventP7_Process);
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP8), UTIL_SEQ_RFU, STS_YunhornSTSEventP8_Process); UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP8), UTIL_SEQ_RFU, STS_YunhornSTSEventP8_Process);
#endif
#ifdef YUNHORN_STS_O7_ENABLED #ifdef YUNHORN_STS_O7_ENABLED
UTIL_TIMER_Create(&YunhornSTSRSSWakeUpTimer, UTIL_TIMER_Create(&YunhornSTSRSSWakeUpTimer,
@ -1327,8 +1329,8 @@ static void OnYunhornSTSOORSSWakeUpTimerEvent(void *context)
if ((STS_LoRa_WAN_Joined != 0)&&(sts_rss_result_changed_flag==1)) if ((STS_LoRa_WAN_Joined != 0)&&(sts_rss_result_changed_flag==1))
{ {
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0); sts_rss_result_changed_flag = 0;
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
} }
} }
@ -1402,7 +1404,7 @@ static void OnYunhornSTSSamplingPeriodicityChanged(uint32_t periodicity)
/* Update timer periodicity */ /* Update timer periodicity */
#ifdef YUNHORN_STS_O7_ENABLED #ifdef STS_O7
UTIL_TIMER_Stop(&YunhornSTSRSSWakeUpTimer); UTIL_TIMER_Stop(&YunhornSTSRSSWakeUpTimer);
UTIL_TIMER_SetPeriod(&YunhornSTSRSSWakeUpTimer, SamplingPeriodicity); UTIL_TIMER_SetPeriod(&YunhornSTSRSSWakeUpTimer, SamplingPeriodicity);
UTIL_TIMER_Start(&YunhornSTSRSSWakeUpTimer); UTIL_TIMER_Start(&YunhornSTSRSSWakeUpTimer);
@ -2275,6 +2277,17 @@ void OnRestoreSTSCFGContextProcess(void)
periodicity = (periodicity > 10)? periodicity : 10; // in seconds unit periodicity = (periodicity > 10)? periodicity : 10; // in seconds unit
TxPeriodicity= periodicity*1000; // to ms TxPeriodicity= periodicity*1000; // to ms
//OnTxPeriodicityChanged(TxPeriodicity); // in msec unit //OnTxPeriodicityChanged(TxPeriodicity); // in msec unit
uint32_t sampling = (sts_cfg_nvm.sampling);
if ((char)sts_cfg_nvm.s_unit =='M') {
sampling *= 60;
} else if ((char) sts_cfg_nvm.s_unit =='H') {
sampling *= 3600;
} else if ((char) sts_cfg_nvm.s_unit =='S') {
sampling *= 1;
}
sampling= sampling*1000; // to ms
if ((sts_cfg_nvm.ac[0] ==0x0 )&& (sts_cfg_nvm.ac[19]==0x0)) if ((sts_cfg_nvm.ac[0] ==0x0 )&& (sts_cfg_nvm.ac[19]==0x0))
{ // ensure it's not in production yet { // ensure it's not in production yet
OnTxPeriodicityChanged(APP_TX_DUTYCYCLE); // in msec unit OnTxPeriodicityChanged(APP_TX_DUTYCYCLE); // in msec unit
@ -2288,7 +2301,7 @@ void OnRestoreSTSCFGContextProcess(void)
HeartBeatPeriodicity = samplingperiodicity*1000; HeartBeatPeriodicity = samplingperiodicity*1000;
#endif #endif
#if defined(STS_O7)|| defined(STS_O6) ||defined(STS_O5) #if defined(STS_O7)|| defined(STS_O6) ||defined(STS_O5)
OnYunhornSTSSamplingPeriodicityChanged(HeartBeatPeriodicity); // in m-sec unit OnYunhornSTSSamplingPeriodicityChanged(sampling); // in m-sec unit
#endif #endif
#if defined(YUNHORN_STS_R0_ENABLED)||defined(YUNHORN_STS_R5_ENABLED)||defined(YUNHORN_STS_R4_ENABLED) #if defined(YUNHORN_STS_R0_ENABLED)||defined(YUNHORN_STS_R5_ENABLED)||defined(YUNHORN_STS_R4_ENABLED)

Binary file not shown.