revised PIR and door open/close lamp bar color logic
This commit is contained in:
parent
535665dc25
commit
b955c1bdb4
|
@ -686,12 +686,6 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
|||
__HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin);
|
||||
//__HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin);
|
||||
sts_hall1_read = HALL1_STATE;
|
||||
if (last_sts_hall1_read != sts_hall1_read) // to eliminate power drop issue of PCB with long REEDSWITCH CABLES
|
||||
{
|
||||
// 1) record event start/stop time
|
||||
APP_LOG(TS_OFF, VLEVEL_M,"\r\n EXIT_CALLBACK, Door state =%d \r\n", sts_hall1_read);
|
||||
OnSensor1StateChanged();
|
||||
// 2) change lamp bar color
|
||||
if (sts_hall1_read == STS_Status_Door_Close)
|
||||
{
|
||||
sts_lamp_bar_color = STS_OCCUPY_COLOR;
|
||||
|
@ -704,6 +698,14 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
|||
sts_lamp_bar_color = STS_VACANT_COLOR;
|
||||
// APP_LOG(TS_OFF, VLEVEL_M,"\r\n EXTI_CALLBACK, Door Open: sts status color =%d, lampbar_color=%d \r\n", sts_status_color, sts_lamp_bar_color);
|
||||
}
|
||||
|
||||
if (last_sts_hall1_read != sts_hall1_read) // to eliminate power drop issue of PCB with long REEDSWITCH CABLES
|
||||
{
|
||||
// 1) record event start/stop time
|
||||
APP_LOG(TS_OFF, VLEVEL_M,"\r\n EXIT_CALLBACK, Door state =%d \r\n", sts_hall1_read);
|
||||
OnSensor1StateChanged();
|
||||
// 2) change lamp bar color
|
||||
|
||||
// 3) combine states and colors
|
||||
//STS_YunhornSTSEventP1_Process();
|
||||
//STS_Combined_Status_Processing();
|
||||
|
@ -818,7 +820,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
|||
}
|
||||
// HAL_Delay(50);
|
||||
//__HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin);
|
||||
// APP_LOG(TS_OFF, VLEVEL_M, "\r\nMotion Detection result=%d \r\n", sts_pir_state);
|
||||
APP_LOG(TS_OFF, VLEVEL_M, "\r\nMotion Detection result=%d \r\n", sts_pir_read);
|
||||
OnSensorPIR1StateChanged();
|
||||
|
||||
if ( sts_pir_state_changed == 1)
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue