add debug message only

This commit is contained in:
Yunhorn 2024-05-31 10:29:08 +08:00
parent 12202479de
commit 49daa9bbf7
4 changed files with 22 additions and 14 deletions

View File

@ -58,10 +58,11 @@
/*#define YUNHORN_STS_O8_ENABLED */
/*#define YUNHORN_STS_O9_ENABLED */
/*#define YUNHORN_STS_O10_ENABLED */
// #define YUNHORN_STS_O6_ENABLED
#ifdef STS_O6
#define YUNHORN_STS_O6_ENABLED 1U
#endif
#ifdef STS_O7
#define YUNHORN_STS_O7_ENABLED
#define YUNHORN_STS_O7_ENABLED 1U
#endif
/** YUNHORN SMARTOILETS ENVIRONMENT PRODUCTS **/
/*#define YUNHORN_STS_E1_ENABLED */
@ -210,7 +211,7 @@
#ifdef YUNHORN_STS_O7_ENABLED
#define MajorVer 24U
#define MinorVer 05U
#define SubMinorVer 14U
#define SubMinorVer 30U
#define FirmwareVersion 3U
#define YUNHORN_STS_MAX_NVM_CFG_SIZE 64U

View File

@ -412,10 +412,12 @@ void STS_Combined_Status_Processing(void)
STS_Lamp_Bar_Refresh();
#if 1
if ((sts_rss_result_changed_flag)|| (sts_reed_hall_1_changed_flag)|| (sts_reed_hall_2_changed_flag) || (sts_tof_result_changed_flag) )
//|| (sts_water_leakage_changed_flag))
{
APP_LOG(TS_OFF, VLEVEL_L, "\r\nRSS result Changed = %d Hall 1 changed = %d Hall 2 changed = %d Sensor Data Ready=%d \r\n", sts_rss_result_changed_flag, sts_reed_hall_1_changed_flag, sts_reed_hall_2_changed_flag, sensor_data_ready);
//sts_rss_result_changed_flag =0;
sts_rss_result_changed_flag =0;
sts_reed_hall_1_changed_flag =0;
@ -428,6 +430,7 @@ void STS_Combined_Status_Processing(void)
//STS_PRESENCE_SENSOR_Prepare_Send_Data();
}
#endif
APP_LOG(TS_OFF, VLEVEL_L, "\r\nRSS result Changed = %d Hall 1 changed = %d Hall 2 changed = %d Sensor Data Ready=%d \r\n", sts_rss_result_changed_flag, sts_reed_hall_1_changed_flag, sts_reed_hall_2_changed_flag, sensor_data_ready);
}
void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim)

View File

@ -597,8 +597,8 @@ 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_YunhornSTSEventP1), UTIL_SEQ_RFU, STS_YunhornSTSEventP1_Process);
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP2), UTIL_SEQ_RFU, STS_YunhornSTSEventP2_Process);
#if 0
UTIL_SEQ_RegTask((1 << CFG_SEQ_Task_YunhornSTSEventP3), UTIL_SEQ_RFU, STS_YunhornSTSEventP3_Process);
#if 0
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_YunhornSTSEventP6), UTIL_SEQ_RFU, STS_YunhornSTSEventP6_Process);
@ -637,8 +637,9 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
case HALL1_Pin:
if (sts_reed_hall_1_changed)
{
HAL_Delay(250); //de-bouncing
sts_hall1_read = HALL1_STATE;
sts_reed_hall_1_changed =0;
HAL_Delay(50); //de-bouncing
//sts_hall1_read = HALL1_STATE;
APP_LOG(TS_OFF, VLEVEL_M, "\n\n Door Contact Read = %02x --%20s\r\n", HALL1_STATE, (HALL1_STATE==STS_Status_Door_Close)?"Door Closed":"Door Opened");
/* Note: when "EventType == TX_ON_TIMER" this GPIO is not initialized */
@ -648,21 +649,22 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP1), CFG_SEQ_Prio_0);
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
}
//sts_reed_hall_1_changed =0;
}
break;
case HALL2_Pin:
if (sts_reed_hall_2_changed)
{
HAL_Delay(250); //de-bouncing
sts_hall2_read = HALL2_STATE;
sts_reed_hall_2_changed =0;
HAL_Delay(50); //de-bouncing
//sts_hall2_read = HALL2_STATE;
APP_LOG(TS_OFF, VLEVEL_M, "\n\n SOS Button Read = %02x --%20s\r\n", HALL2_STATE, (HALL2_STATE==STS_Status_SOS_Pushdown)?"SOS Pushdown":"SOS Released");
//sensor_data_ready =1;
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_YunhornSTSEventP1), CFG_SEQ_Prio_0);
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
//sts_reed_hall_2_changed =0;
}
break;
@ -847,7 +849,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######| %6s | %5s|\r\n",(char *)sts_lamp_color_code[(uint8_t)(AppData.Buffer[0])], (char*)sts_work_mode_code[AppData.Buffer[1]]);
#endif
@ -855,7 +857,7 @@ static void SendTxData(void)
APP_LOG(TS_OFF, VLEVEL_L,"\r\n######| S1-DoorOpen | S2-Motion | S3-No_Emergency| S4 | Distance(mm) | MotionScore|\r\n######| %6u | %6u | %6u | %6u | %4u | %4u |\r\n",
AppData.Buffer[2], AppData.Buffer[3],AppData.Buffer[4],AppData.Buffer[5],AppData.Buffer[6]<<8|AppData.Buffer[7],AppData.Buffer[8]<<8|AppData.Buffer[9]);
#endif
#if 0
#if 1
APP_LOG(TS_OFF, VLEVEL_L,"\r\n######| Unconcious | Fall state| Over_Stay state| OverStayduration|\r\n######| %1d | %1d | %1d | %4d |\r\n",
sts_o7_sensorData.unconcious_state, sts_o7_sensorData.fall_state, sts_o7_sensorData.over_stay_duration, sts_o7_sensorData.unconcious_duration );
@ -865,6 +867,7 @@ static void SendTxData(void)
AppData.BufferSize = (sts_service_mask > STS_SERVICE_MASK_L1? 0:i);
//AppData.BufferSize = (sts_service_mask > STS_SERVICE_MASK_L1? 0:i);
APP_LOG(TS_OFF, VLEVEL_L, "\r\n **************** BufferSize = %d *** Port=%d \r\n", AppData.BufferSize, AppData.Port);
if ((JoinLedTimer.IsRunning) && (LmHandlerJoinStatus() == LORAMAC_HANDLER_SET))
{

View File

@ -153,6 +153,7 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1119592399" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.2024044405" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="CORE_CM4"/>
<listOptionValue builtIn="false" value="STS_O7"/>
<listOptionValue builtIn="false" value="STS_O6"/>
<listOptionValue builtIn="false" value="RM2_1"/>
<listOptionValue builtIn="false" value="STS_O7"/>