|
@@ -52,7 +52,7 @@ void UPS_Monitor(void *params)
|
|
|
{
|
|
|
UPS_TestFinishMonitor();
|
|
|
UPS_LineFailMonitor();
|
|
|
-#if defined HARDWARE_BT6706 || HARDWARE_BT6708
|
|
|
+#if defined HARDWARE_BT6707 || HARDWARE_BT6709
|
|
|
UPS_VACoutputLowRangeMonitor();
|
|
|
UPS_VACoutputHighRangeMonitor();
|
|
|
#endif
|
|
@@ -63,14 +63,14 @@ void UPS_Monitor(void *params)
|
|
|
UPS_BatteryConnectMonitor();
|
|
|
}
|
|
|
UPS_ConnectMonitor();
|
|
|
-#ifndef HARDWARE_BT6708
|
|
|
+#ifndef HARDWARE_BT6709
|
|
|
UPS_DI0Monitor();
|
|
|
#endif
|
|
|
-#ifdef HARDWARE_BT6702
|
|
|
+#ifdef HARDWARE_BT6703
|
|
|
UPS_CriticalAlarmMonitor();
|
|
|
UPS_NonCriticalAlarmMonitor();
|
|
|
#endif
|
|
|
-#if defined HARDWARE_BT6706 || HARDWARE_BT6708
|
|
|
+#if defined HARDWARE_BT6707 || HARDWARE_BT6709
|
|
|
if(flCriticalAlarm){
|
|
|
if (UPS.Present)
|
|
|
LED_On(LED_MAJOR_R);
|
|
@@ -85,7 +85,7 @@ void UPS_Monitor(void *params)
|
|
|
vTaskDelay(1000);
|
|
|
}
|
|
|
}
|
|
|
-#ifndef HARDWARE_BT6708
|
|
|
+#ifndef HARDWARE_BT6709
|
|
|
/**
|
|
|
* @brief Мониторинг бита DI0 state
|
|
|
*/
|
|
@@ -148,18 +148,18 @@ void relay_setup_log(uint8_t *curr_source, ro_type_source_t src_act_ro, uint8_t
|
|
|
SNMP_SendUserTrap((DO0_TOGGLED+i));
|
|
|
if(state_relay){
|
|
|
flUpdateLog = true;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
log_event_data((LOG_DO0_STATE + i), "Разомкнуто");
|
|
|
-#elif HARDWARE_BT6702
|
|
|
+#elif HARDWARE_BT6703
|
|
|
log_event_data((LOG_DO0_STATE + i), "Замкнуто");
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
else{
|
|
|
flUpdateLog = true;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
log_event_data((LOG_DO0_STATE + i), "Замкнуто");
|
|
|
-#elif HARDWARE_BT6702
|
|
|
+#elif HARDWARE_BT6703
|
|
|
log_event_data((LOG_DO0_STATE + i), "Разомкнуто");
|
|
|
#endif
|
|
|
}
|
|
@@ -174,7 +174,7 @@ void relay_setup_log_change(uint8_t *curr_source, uint8_t *prev_source, ro_type_
|
|
|
|
|
|
for(i = 0; i < OUTPUTS_TOTAL_COUNT; i ++){
|
|
|
if(curr_source[i] != prev_source[i] && (prev_source[i] == src_act_ro || curr_source[i] == src_act_ro)){
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
if(curr_source[i] != src_act_ro){
|
|
|
flUpdateLog = true;
|
|
|
SetROInt(0, i);
|
|
@@ -187,7 +187,7 @@ void relay_setup_log_change(uint8_t *curr_source, uint8_t *prev_source, ro_type_
|
|
|
SNMP_SendUserTrap((DO0_TOGGLED+i));
|
|
|
log_event_data((LOG_DO0_STATE + i), "Разомкнуто");
|
|
|
}
|
|
|
-#elif HARDWARE_BT6702
|
|
|
+#elif HARDWARE_BT6703
|
|
|
if(curr_source[i] != src_act_ro){
|
|
|
flUpdateLog = true;
|
|
|
SetROInt(0, i);
|
|
@@ -208,7 +208,7 @@ void relay_setup_log_change(uint8_t *curr_source, uint8_t *prev_source, ro_type_
|
|
|
#endif
|
|
|
|
|
|
|
|
|
-#ifdef HARDWARE_BT6702
|
|
|
+#ifdef HARDWARE_BT6703
|
|
|
/**
|
|
|
* @brief Мониторинг бита CriticalAlarm
|
|
|
*/
|
|
@@ -357,7 +357,7 @@ void UPS_LineFailMonitor(void)
|
|
|
static uint8_t lineFailOldState = 0;
|
|
|
uint8_t lineFailCurrent;
|
|
|
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
uint8_t i = 0;
|
|
|
static uint8_t OldROtype_Sourse[OUTPUTS_TOTAL_COUNT] = {0};
|
|
|
uint8_t CurrROtype_Sourse[OUTPUTS_TOTAL_COUNT] = {0};
|
|
@@ -376,12 +376,12 @@ void UPS_LineFailMonitor(void)
|
|
|
log_event_data(LOG_ALARM_LINE, "Авария");
|
|
|
SNMP_SendUserTrap(LINE_ALARM);
|
|
|
flUpdateLog = true;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, AC_PRESENT, 1);
|
|
|
#endif
|
|
|
}
|
|
|
else{
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, AC_PRESENT, 0);
|
|
|
#endif
|
|
|
log_event_data(LOG_ALARM_LINE, "Норма");
|
|
@@ -400,7 +400,7 @@ void UPS_LineFailMonitor(void)
|
|
|
if (lineFailCurrent != lineFailOldState)
|
|
|
{
|
|
|
if (lineFailCurrent){
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, AC_PRESENT, 1);
|
|
|
#endif
|
|
|
|
|
@@ -409,7 +409,7 @@ void UPS_LineFailMonitor(void)
|
|
|
flUpdateLog = true;
|
|
|
}
|
|
|
else{
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, AC_PRESENT, 0);
|
|
|
#endif
|
|
|
log_event_data(LOG_ALARM_LINE, "Норма");
|
|
@@ -418,7 +418,7 @@ void UPS_LineFailMonitor(void)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
else{
|
|
|
if (lineFailCurrent)
|
|
|
relay_setup_log_change(CurrROtype_Sourse, OldROtype_Sourse, AC_PRESENT);
|
|
@@ -432,7 +432,7 @@ void UPS_LineFailMonitor(void)
|
|
|
lineFailOldState = lineFailCurrent;
|
|
|
}
|
|
|
|
|
|
-#if defined HARDWARE_BT6706 || HARDWARE_BT6708
|
|
|
+#if defined HARDWARE_BT6707 || HARDWARE_BT6709
|
|
|
/**
|
|
|
* @brief Мониторинг аварии выходного напряжения по нижней границе
|
|
|
*/
|
|
@@ -441,7 +441,7 @@ void UPS_VACoutputLowRangeMonitor(void)
|
|
|
|
|
|
static uint8_t stateCurrentVACoutput = HYST_IDLE;
|
|
|
uint8_t VACoutputCurrent;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
uint8_t i = 0;
|
|
|
static bool isValueRecv = false;
|
|
|
static uint8_t OldROtype_Sourse[OUTPUTS_TOTAL_COUNT] = {0};
|
|
@@ -463,7 +463,7 @@ void UPS_VACoutputLowRangeMonitor(void)
|
|
|
if (stateCurrentVACoutput == HYST_IDLE)
|
|
|
{
|
|
|
stateCurrentVACoutput = HYST_DOWN;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, DC_PRESENT, 1);
|
|
|
#endif
|
|
|
log_event_data(LOG_ALARM_VAC_LOW_OUTPUT, "Авария");
|
|
@@ -472,7 +472,7 @@ void UPS_VACoutputLowRangeMonitor(void)
|
|
|
flUpdateLog = true;
|
|
|
}
|
|
|
else{
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log_change(CurrROtype_Sourse, OldROtype_Sourse, DC_PRESENT);
|
|
|
#endif
|
|
|
}
|
|
@@ -483,7 +483,7 @@ void UPS_VACoutputLowRangeMonitor(void)
|
|
|
if (stateCurrentVACoutput == HYST_DOWN)
|
|
|
{
|
|
|
stateCurrentVACoutput = HYST_IDLE;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, DC_PRESENT, 0);
|
|
|
#endif
|
|
|
log_event_data(LOG_ALARM_VAC_LOW_OUTPUT, "Норма");
|
|
@@ -492,7 +492,7 @@ void UPS_VACoutputLowRangeMonitor(void)
|
|
|
flUpdateLog = true;
|
|
|
}
|
|
|
}
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
for(i = 0; i < OUTPUTS_TOTAL_COUNT; i ++){
|
|
|
OldROtype_Sourse[i] = CurrROtype_Sourse[i];
|
|
|
}
|
|
@@ -507,7 +507,7 @@ void UPS_VACoutputHighRangeMonitor(void)
|
|
|
|
|
|
static uint8_t stateCurrentVACoutput = HYST_IDLE;
|
|
|
uint8_t VACoutputCurrent;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
uint8_t i = 0;
|
|
|
static bool isValueRecv = false;
|
|
|
static uint8_t OldROtype_Sourse[OUTPUTS_TOTAL_COUNT] = {0};
|
|
@@ -529,7 +529,7 @@ void UPS_VACoutputHighRangeMonitor(void)
|
|
|
if (stateCurrentVACoutput == HYST_IDLE)
|
|
|
{
|
|
|
stateCurrentVACoutput = HYST_UP;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, DC_PRESENT, 1);
|
|
|
#endif
|
|
|
log_event_data(LOG_ALARM_VAC_HIGH_OUTPUT, "Авария");
|
|
@@ -538,7 +538,7 @@ void UPS_VACoutputHighRangeMonitor(void)
|
|
|
flUpdateLog = true;
|
|
|
}
|
|
|
else{
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log_change(CurrROtype_Sourse, OldROtype_Sourse, DC_PRESENT);
|
|
|
#endif
|
|
|
}
|
|
@@ -549,7 +549,7 @@ void UPS_VACoutputHighRangeMonitor(void)
|
|
|
if (stateCurrentVACoutput == HYST_UP)
|
|
|
{
|
|
|
stateCurrentVACoutput = HYST_IDLE;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, DC_PRESENT, 0);
|
|
|
#endif
|
|
|
log_event_data(LOG_ALARM_VAC_HIGH_OUTPUT, "Норма");
|
|
@@ -558,7 +558,7 @@ void UPS_VACoutputHighRangeMonitor(void)
|
|
|
flUpdateLog = true;
|
|
|
}
|
|
|
}
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
for(i = 0; i < OUTPUTS_TOTAL_COUNT; i ++){
|
|
|
OldROtype_Sourse[i] = CurrROtype_Sourse[i];
|
|
|
}
|
|
@@ -577,7 +577,7 @@ void UPS_LowBatMonitor(void)
|
|
|
static bool flag_alarm_time = false;
|
|
|
uint8_t lowBatCurrent;
|
|
|
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
uint8_t i = 0;
|
|
|
static uint8_t OldROtype_Sourse[OUTPUTS_TOTAL_COUNT] = {0};
|
|
|
uint8_t CurrROtype_Sourse[OUTPUTS_TOTAL_COUNT] = {0};
|
|
@@ -598,7 +598,7 @@ void UPS_LowBatMonitor(void)
|
|
|
log_event_data(LOG_ALARM_LOW_BAT, "Авария");
|
|
|
SNMP_SendUserTrap(LOW_BAT_ALARM);
|
|
|
flUpdateLog = true;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, CHARGE_AKB, 1);
|
|
|
#endif
|
|
|
}
|
|
@@ -606,7 +606,7 @@ void UPS_LowBatMonitor(void)
|
|
|
SNMP_SendUserTrap(LOW_BAT_NORM);
|
|
|
log_event_data(LOG_ALARM_LOW_BAT, "Норма");
|
|
|
flUpdateLog = true;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, CHARGE_AKB, 0);
|
|
|
#endif
|
|
|
}
|
|
@@ -621,7 +621,7 @@ void UPS_LowBatMonitor(void)
|
|
|
SNMP_SendUserTrap(LOW_BAT_ALARM);
|
|
|
log_event_data(LOG_ALARM_LOW_BAT, "Авария");
|
|
|
flUpdateLog = true;
|
|
|
-#ifdef HARDWARE_BT6706
|
|
|
+#ifdef HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, CHARGE_AKB, 1);
|
|
|
#endif
|
|
|
}
|
|
@@ -629,7 +629,7 @@ void UPS_LowBatMonitor(void)
|
|
|
SNMP_SendUserTrap(LOW_BAT_NORM);
|
|
|
log_event_data(LOG_ALARM_LOW_BAT, "Норма");
|
|
|
flUpdateLog = true;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, CHARGE_AKB, 0);
|
|
|
#endif
|
|
|
}
|
|
@@ -638,7 +638,7 @@ void UPS_LowBatMonitor(void)
|
|
|
flag_alarm_time = true;
|
|
|
}
|
|
|
}
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
else{
|
|
|
flag_alarm_time = false;
|
|
|
if (lowBatCurrent)
|
|
@@ -850,7 +850,7 @@ void UPS_BatteryConnectMonitor(void)
|
|
|
static uint8_t AKBconnectOldState = 0;
|
|
|
uint8_t AKBconnectCurrent;
|
|
|
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
uint8_t i = 0;
|
|
|
static uint8_t OldROtype_Sourse[OUTPUTS_TOTAL_COUNT] = {0};
|
|
|
uint8_t CurrROtype_Sourse[OUTPUTS_TOTAL_COUNT] = {0};
|
|
@@ -874,7 +874,7 @@ void UPS_BatteryConnectMonitor(void)
|
|
|
log_event_data(LOG_ALARM_AKB, "Авария");
|
|
|
SNMP_SendUserTrap(BATTERY_CONNECT_ALARM);
|
|
|
flUpdateLog = true;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, OFF_AKB, 1);
|
|
|
#endif
|
|
|
}
|
|
@@ -882,7 +882,7 @@ void UPS_BatteryConnectMonitor(void)
|
|
|
log_event_data(LOG_ALARM_AKB, "Норма");
|
|
|
SNMP_SendUserTrap(BATTERY_CONNECT_NORM);
|
|
|
flUpdateLog = true;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, OFF_AKB, 0);
|
|
|
#endif
|
|
|
}
|
|
@@ -897,7 +897,7 @@ void UPS_BatteryConnectMonitor(void)
|
|
|
log_event_data(LOG_ALARM_AKB, "Норма");
|
|
|
SNMP_SendUserTrap(BATTERY_CONNECT_NORM);
|
|
|
flUpdateLog = true;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, OFF_AKB, 0);
|
|
|
#endif
|
|
|
}
|
|
@@ -905,7 +905,7 @@ void UPS_BatteryConnectMonitor(void)
|
|
|
log_event_data(LOG_ALARM_AKB, "Авария");
|
|
|
SNMP_SendUserTrap(BATTERY_CONNECT_ALARM);
|
|
|
flUpdateLog = true;
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
relay_setup_log(CurrROtype_Sourse, OFF_AKB, 1);
|
|
|
#endif
|
|
|
}
|
|
@@ -914,7 +914,7 @@ void UPS_BatteryConnectMonitor(void)
|
|
|
flag_alarm_time = true;
|
|
|
}
|
|
|
}
|
|
|
-#if defined HARDWARE_BT6706
|
|
|
+#if defined HARDWARE_BT6707
|
|
|
else{
|
|
|
flag_alarm_time = false;
|
|
|
if (AKBconnectCurrent)
|