|
|
@@ -15,7 +15,7 @@
|
|
|
|
|
|
static board_t *board = 0;
|
|
|
static void timer14_config(uint16_t arr,uint16_t psc);
|
|
|
-static void timer15_config(uint16_t arr,uint16_t psc);
|
|
|
+
|
|
|
static void relay_remember(void);
|
|
|
|
|
|
static uint16_t count_1s = 0;
|
|
|
@@ -24,15 +24,21 @@ static uint16_t count_100ms = 0;
|
|
|
|
|
|
uint16_t rl_delay_cnt[RelaySlaveChaNum] = {0};
|
|
|
uint16_t rl_delay_flag[RelaySlaveChaNum] = {0};
|
|
|
+
|
|
|
+#if SUPPORT_PWM_OUT_RELAY
|
|
|
+
|
|
|
uint8_t rl_open_delay_flag[RelaySlaveChaNum] = {0};
|
|
|
uint8_t rl_open_delay_count[RelaySlaveChaNum] = {0};
|
|
|
uint8_t rl_pwm_flag[RelaySlaveChaNum] = {0};
|
|
|
-
|
|
|
+static void timer15_config(uint16_t arr,uint16_t psc);
|
|
|
+#endif
|
|
|
|
|
|
void time_init(void)
|
|
|
{
|
|
|
timer14_config(9999,71);;
|
|
|
+#if SUPPORT_PWM_OUT_RELAY
|
|
|
timer15_config(24,71);
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -82,6 +88,7 @@ void TIMER14_IRQHandler(void)
|
|
|
SET_RL_COUNTER_END_FLAG(board->relay_staging_staus[i]);
|
|
|
}
|
|
|
}
|
|
|
+#if SUPPORT_PWM_OUT_RELAY
|
|
|
if(rl_open_delay_flag[i])
|
|
|
{
|
|
|
if(rl_open_delay_count[i] < 3)
|
|
|
@@ -94,6 +101,7 @@ void TIMER14_IRQHandler(void)
|
|
|
rl_open_delay_flag[i] = 0;
|
|
|
}
|
|
|
}
|
|
|
+#endif
|
|
|
}
|
|
|
if(count_1s == 100)
|
|
|
{
|
|
|
@@ -130,6 +138,7 @@ void TIMER14_IRQHandler(void)
|
|
|
|
|
|
}
|
|
|
|
|
|
+#if SUPPORT_PWM_OUT_RELAY
|
|
|
|
|
|
static void timer15_config(uint16_t arr,uint16_t psc)
|
|
|
{
|
|
|
@@ -166,4 +175,4 @@ void TIMER15_IRQHandler(void)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+#endif
|