This commit is contained in:
Yunhorn 2024-12-04 18:52:47 +08:00
parent 884487f01e
commit 969a892d33
3 changed files with 4 additions and 4 deletions

View File

@ -76,7 +76,7 @@ extern volatile uint8_t sts_hall3_read, sts_hall4_read;
extern volatile uint8_t sts_pir_state;
extern volatile uint8_t last_sts_hall1_read, last_sts_hall2_read, last_sts_hall3_read, last_sts_hall4_read;
volatile uint8_t sts_PIR_read = 0;
volatile bool locklow = true;
volatile bool locklow = false;
volatile uint32_t lowin=0;
volatile bool takelowTime;
/* USER CODE END EV */
@ -699,7 +699,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
UTIL_SEQ_SetTask((1 << CFG_SEQ_Task_LoRaStoreContextEvent), CFG_SEQ_Prio_0);
break;
#endif
#if 0
#if 1
case PIR_Pin:
sts_pir_state = PIR_STATE;
printf("\r\n pir state =%u \r\n", sts_pir_state);
@ -723,8 +723,8 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
printf("\r\n lowin start at: %u \r\n", lowin);
takelowTime = false;
}
printf("\r\n low duration=%d \r\n", check_time-lowin);
if ((!locklow && (check_time - lowin >= 5000))) {
//printf("\r\n low duration=%d \r\n", check_time-lowin);
if ((!locklow && (check_time - lowin >= 50))) {
printf("\r\n low duration=%d \r\n", check_time-lowin);
sts_PIR_read = 0;
locklow = true;