|
@@ -205,12 +205,17 @@ void EXTI4_15_IRQHandler(void){
|
|
|
|
|
|
|
|
if(RESET != exti_interrupt_flag_get(DERECTION_IO_1_EXIT))
|
|
if(RESET != exti_interrupt_flag_get(DERECTION_IO_1_EXIT))
|
|
|
{
|
|
{
|
|
|
|
|
+ exti_interrupt_flag_clear(DERECTION_IO_1_EXIT);
|
|
|
if(board)
|
|
if(board)
|
|
|
{
|
|
{
|
|
|
- board->detection_1_value = 1;
|
|
|
|
|
- board->detection_1_count = 0;
|
|
|
|
|
|
|
+ //for(int i = 0;i <20;i++);
|
|
|
|
|
+ if(gpio_input_bit_get(DERECTION_GPIO_1,DERECTION_IO_1) == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ board->detection_1_value = 1;
|
|
|
|
|
+ board->detection_1_count = 0;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- exti_interrupt_flag_clear(DERECTION_IO_1_EXIT);
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -279,12 +284,17 @@ void EXTI2_3_IRQHandler(void)
|
|
|
#if SURPPORT_2_PT
|
|
#if SURPPORT_2_PT
|
|
|
if(RESET != exti_interrupt_flag_get(DERECTION_IO_2_EXIT))
|
|
if(RESET != exti_interrupt_flag_get(DERECTION_IO_2_EXIT))
|
|
|
{
|
|
{
|
|
|
|
|
+ exti_interrupt_flag_clear(DERECTION_IO_2_EXIT);
|
|
|
if(board)
|
|
if(board)
|
|
|
{
|
|
{
|
|
|
- board->detection_2_value = 1;
|
|
|
|
|
- board->detection_2_count = 0;
|
|
|
|
|
|
|
+ //for(int i = 0;i <20;i++);
|
|
|
|
|
+ if(gpio_input_bit_get(DERECTION_GPIO_2,DERECTION_IO_2) == 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ board->detection_2_value = 1;
|
|
|
|
|
+ board->detection_2_count = 0;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- exti_interrupt_flag_clear(DERECTION_IO_2_EXIT);
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
}
|
|
}
|
|
@@ -319,7 +329,7 @@ static void detection_opt(void)
|
|
|
{
|
|
{
|
|
|
if(board->handle_input_pt[0] == 0)
|
|
if(board->handle_input_pt[0] == 0)
|
|
|
{
|
|
{
|
|
|
- board->handle_input_pt[0] = 1;
|
|
|
|
|
|
|
+
|
|
|
for(uint8_t k = 0; k < PT_SUB_COUNT;k++)
|
|
for(uint8_t k = 0; k < PT_SUB_COUNT;k++)
|
|
|
{
|
|
{
|
|
|
#if SUPPORT_SELF_LOCK
|
|
#if SUPPORT_SELF_LOCK
|
|
@@ -341,6 +351,7 @@ static void detection_opt(void)
|
|
|
da.w_eep_flag = FLAG_N_W_EEP;
|
|
da.w_eep_flag = FLAG_N_W_EEP;
|
|
|
set_relay_sta_async(&da);
|
|
set_relay_sta_async(&da);
|
|
|
}
|
|
}
|
|
|
|
|
+ board->handle_input_pt[0] = 1;
|
|
|
}
|
|
}
|
|
|
}else
|
|
}else
|
|
|
{
|
|
{
|
|
@@ -372,7 +383,6 @@ static void detection_opt(void)
|
|
|
{
|
|
{
|
|
|
if(board->handle_input_pt[1] == 0)
|
|
if(board->handle_input_pt[1] == 0)
|
|
|
{
|
|
{
|
|
|
- board->handle_input_pt[1] = 1;
|
|
|
|
|
for(uint8_t k = PT_SUB_COUNT; k < RelaySlaveChaNum;k++)
|
|
for(uint8_t k = PT_SUB_COUNT; k < RelaySlaveChaNum;k++)
|
|
|
{
|
|
{
|
|
|
async_data da = {0};
|
|
async_data da = {0};
|
|
@@ -384,6 +394,7 @@ static void detection_opt(void)
|
|
|
da.w_eep_flag = FLAG_N_W_EEP;
|
|
da.w_eep_flag = FLAG_N_W_EEP;
|
|
|
set_relay_sta_async(&da);
|
|
set_relay_sta_async(&da);
|
|
|
}
|
|
}
|
|
|
|
|
+ board->handle_input_pt[1] = 1;
|
|
|
}
|
|
}
|
|
|
}else
|
|
}else
|
|
|
{
|
|
{
|