|
@@ -747,6 +747,68 @@ void UPS_PowerMonitor(void)
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
+#ifdef SENSOR_TEMP_MONITOR
|
|
|
+/**
|
|
|
+ * @brief Мониторинг аварии датчика температуры
|
|
|
+ */
|
|
|
+void sensorTemperatureMonitor(void)
|
|
|
+{
|
|
|
+ float temperature;
|
|
|
+ static uint8_t type_sensor[MAX_T_SENSORS];
|
|
|
+ static uint8_t alarm[MAX_T_SENSORS];
|
|
|
+ static uint8_t start_monitor = 0;
|
|
|
+
|
|
|
+ if (start_monitor == 0) {
|
|
|
+ start_monitor = 1;
|
|
|
+ for(uint8_t i = 0; i < MAX_T_SENSORS; i ++){
|
|
|
+ type_sensor[i] = sSettings.sTempControl[i].type_sensor;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for(uint8_t i = 0; i < MAX_T_SENSORS; i ++){
|
|
|
+ if (alarm[i] && sSettings.sTempControl[i].type_sensor != type_sensor[i]) {
|
|
|
+ alarm[i] = 0;
|
|
|
+ if (type_sensor[i] == TS_AKB) {
|
|
|
+ log_event_data(LOG_ALARM_SENSOR_AKB, "Норма");
|
|
|
+ } else if (type_sensor[i] == TS_CABINET) {
|
|
|
+ log_event_data(LOG_ALARM_SENSOR_CABINET, "Норма");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (sSettings.sTempControl[i].type_sensor == TS_AKB) {
|
|
|
+ GetInternalTempInt(&temperature);
|
|
|
+ if(temperature == 85) {
|
|
|
+ if(!alarm[i]) {
|
|
|
+ log_event_data(LOG_ALARM_SENSOR_AKB, "Авария");
|
|
|
+ flLedAlarm = true;
|
|
|
+ alarm[i] = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(alarm[i]) {
|
|
|
+ log_event_data(LOG_ALARM_SENSOR_AKB, "Норма");
|
|
|
+ alarm[i] = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (sSettings.sTempControl[i].type_sensor == TS_CABINET) {
|
|
|
+ GetTempCaseInt(&temperature);
|
|
|
+ if(temperature == 85) {
|
|
|
+ if(!alarm[i]) {
|
|
|
+ log_event_data(LOG_ALARM_SENSOR_CABINET, "Авария");
|
|
|
+ flLedAlarm = true;
|
|
|
+ alarm[i] = 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(alarm[i]) {
|
|
|
+ log_event_data(LOG_ALARM_SENSOR_CABINET, "Норма");
|
|
|
+ alarm[i] = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ type_sensor[i] = sSettings.sTempControl[i].type_sensor;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+#endif
|
|
|
+
|
|
|
#ifdef TEMP_AKB_MONITOR
|
|
|
/**
|
|
|
* @brief Мониторинг температуры по верхней границе
|