Index: trunk/firmware/CubeMX/Inc/main.h
===================================================================
--- trunk/firmware/CubeMX/Inc/main.h	(revision 10)
+++ trunk/firmware/CubeMX/Inc/main.h	(revision 1)
@@ -59,7 +59,5 @@
 /* USER CODE BEGIN EFP */
 
-#ifdef VARIANT_24V
-#define DISABLE_SHORTCUT_DETECTION_DURING_SWITCH_OFF
-#endif
+//#define DISABLE_SHORTCUT_DETECTION_DURING_SWITCH_OFF
 
 #ifdef DISABLE_SHORTCUT_DETECTION_DURING_SWITCH_OFF
@@ -127,5 +125,5 @@
 #define BTN1_Pin GPIO_PIN_15
 #define BTN1_GPIO_Port GPIOA
-#define OUT_CTRL_Pin GPIO_PIN_0
+#define OUT_CTRL_Pin GPIO_PIN_1
 #define OUT_CTRL_GPIO_Port GPIOD
 #define SW_OFF_Pin GPIO_PIN_2
@@ -143,4 +141,6 @@
 /* USER CODE BEGIN Private defines */
 
+#define INVERTER_CAP_PRECHARGE
+
 #ifdef DEBUG
 	#define DEVICE_TYPE_ID						201
@@ -148,5 +148,4 @@
 	#ifdef VARIANT_24V
 		#define DEVICE_TYPE_ID					202
-		#define INVERTER_CAP_PRECHARGE
 	#else
 		#define DEVICE_TYPE_ID					201
@@ -184,12 +183,12 @@
 #ifdef VARIANT_24V
 	#define CONTROL_CURRENT_A					380		// [A] long-term current limit of the device.
-	#define SHORTCUT_CURRENT_mV					1100
-	#define INRUSH_CURRENT_mV					550		// [mV] Some big value to pass test sequence
-	#define COPPER_V_DROP_AT_CONTROL_CURRENT_mV	200		// [mV] - must be measured on the board
+	#define SHORTCUT_CURRENT_mV					800		// [mV] Some big value to pass test sequence
+	#define INRUSH_CURRENT_mV					1100	// [mV] Some big value to pass test sequence
+	#define COPPER_V_DROP_AT_CONTROL_CURRENT_mV	56		// [mV] - must be measured on the board
 #else
 	#define CONTROL_CURRENT_A					500		// [A] long-term current limit of the device.
-    #define SHORTCUT_CURRENT_mV					1500
-	#define INRUSH_CURRENT_mV					500
-	#define COPPER_V_DROP_AT_CONTROL_CURRENT_mV	100		// [mV] - must be measured during calibration
+    #define SHORTCUT_CURRENT_mV					1500	// [mV] Some big value to pass test sequence
+	#define INRUSH_CURRENT_mV					616		// [mV] Some big value to pass test sequence
+	#define COPPER_V_DROP_AT_CONTROL_CURRENT_mV	150		// [mV] - must be measured on the board
 #endif
 //#define COPPER_V_DROP_AT_INRUSH_CURRENT		((INRUSH_CURRENT_A * COPPER_V_DROP_AT_CONTROL_CURRENT_A)/CONTROL_CURRENT_A)	// ~391mV
@@ -203,5 +202,5 @@
 #define CURRENT_INTEGRAL_FREQ					320000U		// (7.5cycles + 12.5cycles)*1channels + (3.5cycles + 12.5cycles)*5channels = 20 + 80 = 100cycles @ 32MHz = 320 kHz
 #ifdef VARIANT_24V
-	#define CURRENT_INTEGRATION_PERIOD			1500		// µs
+	#define CURRENT_INTEGRATION_PERIOD			575			// µs
 #else
 	#define CURRENT_INTEGRATION_PERIOD			1700		// µs
@@ -287,12 +286,11 @@
 #define COMMAND_TURN_OVERLOAD_DETECTION_ON		30405
 
-//#define U_BAT_CALC_PERIOD				        5	// ms
+#define U_BAT_CALC_PERIOD				        5	// ms
 #ifdef VARIANT_24V
 #define U_BAT_CRITICAL_VOLTAGE			        20000 // mV	(If voltage on battery is lower than 10V, then there is a probability that MOSFETs will not open/close properly)
 #define U_BAT_RECOVERY_VOLTAGE			        24000 // mV	(If voltage on battery is higher than 12V, then it is fully recovered from possible previous discharge)
 #else
-#define U_BAT_CRITICAL_VOLTAGE_mV		        10000 // mV	(If voltage on battery is lower than 10V, then there is a probability that MOSFETs will not open/close properly)
-#define U_BAT_RECOVERY_VOLTAGE_mV		        12000 // mV	(If voltage on battery is higher than 12V, then it is fully recovered from possible previous discharge)
-#define ADC_BAT_CRITICAL_VOLTAGE				((((U_BAT_CRITICAL_VOLTAGE_mV / 1000) * R22) * (ADC_MAX_VALUE + 1)) / ((R23 + R22) * (ADC_VREF / 1000)))
+#define U_BAT_CRITICAL_VOLTAGE			        10000 // mV	(If voltage on battery is lower than 10V, then there is a probability that MOSFETs will not open/close properly)
+#define U_BAT_RECOVERY_VOLTAGE			        12000 // mV	(If voltage on battery is higher than 12V, then it is fully recovered from possible previous discharge)
 #endif
 
@@ -349,5 +347,5 @@
 #define FC_WRITE_MULTIPLE_REGISTER		        0x10
 
-#define HOUR_TIME_INTERVALL						(60U * 60000U)	// 2 min for DEBUG
+#define HOUR_TIME_INTERVALL						(2UL * 60000UL)	// 2 min for DEBUG
 
 #define DAC_HANDLE								hdac1
