Kaynağa Gözat

add define BT6702_SERVICE dor service soft

balbekova 7 yıl önce
ebeveyn
işleme
d21db8b235
3 değiştirilmiş dosya ile 17 ekleme ve 9 silme
  1. 12 7
      modules/parameters.c
  2. 4 1
      modules/settings_api.c
  3. 1 1
      modules/sys_hal.c

+ 12 - 7
modules/parameters.c

@@ -15,12 +15,14 @@
 
 #include "settings_api.h"
 #include "rtc.h"
+#ifndef BT6702_SERVICE
 #include "snmp_api.h"
-#include "settings_api.h"
 #include "snmp.h"
+#include "megatec.h"
+#endif
 #include "sntp.h"
 #include "common_config.h"
-#include "megatec.h"
+#include "settings_api.h"
 //#include "d_inouts.h"
 #include "gpio.h"
 #if defined HARDWARE_BT6702
@@ -53,7 +55,7 @@ extern WEB_PARAMS_t sTempWebParams;
   * @brief  Флаг подтверждения новых сетевых параметров пользователем
   */  
 extern bool fConfirmWebParams;
-
+#ifndef BT6702_SERVICE
 
 // ************************************************************************** //
 //                        Параметры UPS
@@ -163,7 +165,7 @@ void GetAlarmStr(char *str, uint8_t *len)
 	*len = strlen(str);
 
 }
-
+#endif
 // ************************************************************************** //
 //                             Параметры даты и времени
 
@@ -324,6 +326,7 @@ void GetDOUT1StatusStr(char *str, uint8_t *len)
 // ************************************************************************** //
 //                             Информация
 
+#ifndef BT6702_SERVICE
 /**
   * @brief  Время работы устройства
   */
@@ -347,7 +350,7 @@ void GetWorkTimeStr(char *str, uint8_t *len)
   sprintf(str, "%d дн. %d ч. %d мин.", day, hour, min);
   *len = strlen(str);
 }
-
+#endif
 /**
   * @brief  Модель устройства
   */
@@ -420,6 +423,7 @@ void GetCommentsStr(char *str, uint8_t *len)
   strncpy(str, sSettings.sInfo.comments, *len);
 }
 
+#ifndef BT6702_SERVICE
 /**
   * @brief  Модель UPS
   */
@@ -437,7 +441,7 @@ void GetUPSVersionStr(char *str, uint8_t *len) // +
 	*len = strlen(UPS.vertion);
 	strncpy(str, UPS.vertion, *len);
 }
-
+#endif
 // ************************************************************************** //
 //                          Настройки аутентификации
 
@@ -806,6 +810,7 @@ void SetWriteCommunity(char *str)
   strcpy(sSettings.sSnmp.writeCommunity, str);
 }
 
+#ifndef BT6702_SERVICE
 /**
   * @brief  IP SNMP менеджера
   */
@@ -857,7 +862,7 @@ void SetLocation(char *str)
   strcpy(sSettings.sSnmp.sysLocation, str);
   SNMP_SetSysLocation(sSettings.sSnmp.sysLocation);
 }
-
+#endif
 /**
   * @brief  Установить комментарий
   */

+ 4 - 1
modules/settings_api.c

@@ -13,9 +13,11 @@
 #include "stm32f4xx.h"  
 #include "settings_api.h"
 #include "common_config.h"
+#ifndef BT6702_SERVICE
 #include "snmp_api.h"
 #include "trap_api.h"
 #include "log.h"
+#endif
 #include "sys_api.h"
 
 #include "FreeRTOS.h"
@@ -404,9 +406,10 @@ void SETTINGS_ResetBootTry(void)
 	/* Check FW update flag */
 	if (RTC_ReadBackupRegister(RTC_BKP_DR3)) {
 		/* Отправка трапа об успешном обновлении ПО */
+#ifndef BT6702_SERVICE
 		SNMP_SendUserTrap(FW_VERSION_UPDATED);
 		log_event_data(LOG_UPDATE_SOFT, "Успешно");
-
+#endif
 		/* Clear FW update flag */
 		RTC_WriteBackupRegister(RTC_BKP_DR3, 0);
 	}

+ 1 - 1
modules/sys_hal.c

@@ -10,7 +10,7 @@
 #include "sys_api.h"
 #include "common_config.h"
 #include "main.h"
-#include "hal.h"
+//#include "hal.h"
 #ifdef PRINTF_STDLIB
 #include <stdio.h>
 #endif