try PIR
This commit is contained in:
parent
ef5a56ba97
commit
172b589397
|
@ -53,6 +53,7 @@ volatile uint8_t sts_ac_code[YUNHORN_STS_AC_CODE_SIZE]={0x0};
|
|||
extern hmac_result_t hmac_result;
|
||||
extern volatile uint8_t sts_reed_hall_ext_int;
|
||||
extern volatile uint8_t sts_hall1_read, sts_hall2_read;
|
||||
volatile uint8_t last_sts_hall1_read=0;
|
||||
extern volatile uint8_t sts_reed_hall_1_changed, sts_reed_hall_2_changed;
|
||||
volatile uint8_t sts_reed_hall_result =0, sts_emergency_button_pushed=0; // inital 0 = close
|
||||
extern volatile uint8_t sts_work_mode, sts_cloud_netcolor, sts_lamp_bar_color, sts_status_color;
|
||||
|
@ -691,6 +692,8 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
|||
{
|
||||
HAL_Delay(250); //de-bouncing
|
||||
sts_hall1_read = HALL1_STATE;
|
||||
//if (last_sts_hall1_read !=sts_hall1_read)
|
||||
{
|
||||
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");
|
||||
OnSensor1StateChanged();
|
||||
/* Note: when "EventType == TX_ON_TIMER" this GPIO is not initialized */
|
||||
|
@ -701,6 +704,8 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
|
|||
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent), CFG_SEQ_Prio_0);
|
||||
}
|
||||
//sts_reed_hall_1_changed =0;
|
||||
last_sts_hall1_read = sts_hall1_read;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue