Index: trunk/firmware/CubeMX/Inc/main.h
===================================================================
--- trunk/firmware/CubeMX/Inc/main.h	(revision 4)
+++ trunk/firmware/CubeMX/Inc/main.h	(revision 7)
@@ -59,5 +59,7 @@
 /* USER CODE BEGIN EFP */
 
+#ifdef VARIANT_24V
 #define DISABLE_SHORTCUT_DETECTION_DURING_SWITCH_OFF
+#endif
 
 #ifdef DISABLE_SHORTCUT_DETECTION_DURING_SWITCH_OFF
@@ -141,6 +143,4 @@
 /* USER CODE BEGIN Private defines */
 
-#define INVERTER_CAP_PRECHARGE
-
 #ifdef DEBUG
 	#define DEVICE_TYPE_ID						201
@@ -148,4 +148,5 @@
 	#ifdef VARIANT_24V
 		#define DEVICE_TYPE_ID					202
+		#define INVERTER_CAP_PRECHARGE
 	#else
 		#define DEVICE_TYPE_ID					201
@@ -183,7 +184,7 @@
 #ifdef VARIANT_24V
 	#define CONTROL_CURRENT_A					380		// [A] long-term current limit of the device.
-	#define SHORTCUT_CURRENT_mV					2000	// [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	100		// [mV] - must be measured on the board
+	#define SHORTCUT_CURRENT_mV					1100	// [mV] Some big value to pass test sequence
+	#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
 #else
 	#define CONTROL_CURRENT_A					500		// [A] long-term current limit of the device.
@@ -202,5 +203,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			575			// µs
+	#define CURRENT_INTEGRATION_PERIOD			1500		// µs
 #else
 	#define CURRENT_INTEGRATION_PERIOD			1700		// µs
@@ -286,11 +287,12 @@
 #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			        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)
+#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)))
 #endif
 
