Browse Source

Merge remote-tracking branch 'prusa3d/MK3' into fix_octoprint_mmu_load_failed

Marek Bel 5 years ago
parent
commit
0d3e3c506a

+ 2 - 2
Firmware/Configuration.h

@@ -7,8 +7,8 @@
 #define STR(x) STR_HELPER(x)
 
 // Firmware version
-#define FW_VERSION "3.7.0-RC1"
-#define FW_COMMIT_NR   2175
+#define FW_VERSION "3.7.0"
+#define FW_COMMIT_NR   2201
 // FW_VERSION_UNKNOWN means this is an unofficial build.
 // The firmware should only be checked into github with this symbol.
 #define FW_DEV_VERSION FW_VERSION_UNKNOWN

+ 1 - 0
Firmware/messages.c

@@ -78,6 +78,7 @@ const char MSG_SELFTEST_FAN_YES[] PROGMEM_I1 = ISTR("Spinning"); ////c=19 r=0
 const char MSG_SELFTEST_CHECK_BED[] PROGMEM_I1 = ISTR("Checking bed     "); ////c=20 r=0
 const char MSG_SELFTEST_CHECK_FSENSOR[] PROGMEM_I1 = ISTR("Checking sensors "); ////c=20 r=0
 const char MSG_SELFTEST_MOTOR[] PROGMEM_I1 = ISTR("Motor"); ////c=0 r=0
+const char MSG_SELFTEST_FILAMENT_SENSOR[] PROGMEM_I1 = ISTR("Filament sensor"); ////c=17 r=0
 const char MSG_SELFTEST_WIRINGERROR[] PROGMEM_I1 = ISTR("Wiring error"); ////c=0 r=0
 const char MSG_SETTINGS[] PROGMEM_I1 = ISTR("Settings"); ////c=0 r=0
 const char MSG_SILENT_MODE_OFF[] PROGMEM_I1 = ISTR("Mode [high power]"); ////c=0 r=0

+ 1 - 0
Firmware/messages.h

@@ -80,6 +80,7 @@ extern const char MSG_SELFTEST_FAN_YES[];
 extern const char MSG_SELFTEST_CHECK_BED[];
 extern const char MSG_SELFTEST_CHECK_FSENSOR[];
 extern const char MSG_SELFTEST_MOTOR[];
+extern const char MSG_SELFTEST_FILAMENT_SENSOR[];
 extern const char MSG_SELFTEST_WIRINGERROR[];
 extern const char MSG_SETTINGS[];
 extern const char MSG_SILENT_MODE_OFF[];

+ 18 - 9
Firmware/timer02.c

@@ -11,11 +11,19 @@
 
 uint8_t timer02_pwm0 = 0;
 
-
 void timer02_set_pwm0(uint8_t pwm0)
 {
-	TCCR0A |= (2 << COM0B0); //switch OC0B to OCR mode
-	OCR0B = (uint16_t)OCR0A * pwm0 / 255;
+	if (timer02_pwm0 == pwm0) return;
+	if (pwm0)
+	{
+		TCCR0A |= (2 << COM0B0);
+		OCR0B = pwm0 - 1;
+	}
+	else
+	{
+		TCCR0A &= ~(2 << COM0B0);
+		OCR0B = 0;
+	}
 	timer02_pwm0 = pwm0;
 }
 
@@ -31,12 +39,13 @@ void timer02_init(void)
 	TIMSK0 &= ~(1<<OCIE0B);
 	//setup timer0
 	TCCR0A = 0x00; //COM_A-B=00, WGM_0-1=00
-	OCR0A = 200; //max PWM value (freq = 40kHz)
-	OCR0B = 0; //current PWM value
-	//switch timer0 to mode 5 (Phase Correct PWM)
-	TCCR0A |= (1 << WGM00); //WGM_0-1=01
-	TCCR0B = (1 << CS00) | (1 << WGM02); //WGM_2=1, CS_0-2=001 (no prescaling)
-	TCCR0A |= (2 << COM0B0); //switch OC0B to OCR mode
+	TCCR0B = (1 << CS00); //WGM_2=0, CS_0-2=011
+	//switch timer0 to fast pwm mode
+	TCCR0A |= (3 << WGM00); //WGM_0-1=11
+	//set OCR0B register to zero
+	OCR0B = 0;
+	//disable OCR0B output (will be enabled in timer02_set_pwm0)
+	TCCR0A &= ~(2 << COM0B0);
 	//setup timer2
 	TCCR2A = 0x00; //COM_A-B=00, WGM_0-1=00
 	TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011

+ 64 - 38
Firmware/ultralcd.cpp

@@ -165,7 +165,7 @@ static bool lcd_selfcheck_pulleys(int axis);
 #endif //TMC2130
 
 static bool lcd_selfcheck_check_heater(bool _isbed);
-enum class testScreen
+enum class testScreen : uint_least8_t
 {
     extruderFan,
     printFan,
@@ -184,6 +184,22 @@ enum class testScreen
     home,
 };
 
+enum class TestError : uint_least8_t
+{
+    heater,
+    bed,
+    endstops,
+    motor,
+    endstop,
+    printFan,
+    extruderFan,
+    pulley,
+    axis,
+    swappedFan,
+    wiringFsensor,
+    triggeringFsensor,
+};
+
 static int  lcd_selftest_screen(testScreen screen, int _progress, int _progress_scale, bool _clear, int _delay);
 static void lcd_selftest_screen_step(int _row, int _col, int _state, const char *_name, const char *_indicator);
 static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite);
@@ -194,7 +210,7 @@ static bool lcd_selftest_fan_dialog(int _fan);
 static bool lcd_selftest_fsensor();
 #endif //PAT9125
 static bool selftest_irsensor();
-static void lcd_selftest_error(int _error_no, const char *_error_1, const char *_error_2);
+static void lcd_selftest_error(TestError error, const char *_error_1, const char *_error_2);
 static void lcd_colorprint_change();
 #ifdef SNMM
 static int get_ext_nr();
@@ -6911,14 +6927,13 @@ bool lcd_selftest()
 	KEEPALIVE_STATE(IN_HANDLER);
 
 	_progress = lcd_selftest_screen(testScreen::extruderFan, _progress, 3, true, 2000);
-#if (defined(FANCHECK) && defined(TACH_0)) 		
+#if (defined(FANCHECK) && defined(TACH_0))
 	_result = lcd_selftest_fan_dialog(0);
 #else //defined(TACH_0)
 	_result = lcd_selftest_manual_fan_check(0, false);
 	if (!_result)
 	{
-		const char *_err;
-		lcd_selftest_error(7, _err, _err); //extruder fan not spinning
+		lcd_selftest_error(TestError::extruderFan, "", "");
 	}
 #endif //defined(TACH_0)
 	
@@ -6932,7 +6947,7 @@ bool lcd_selftest()
 		_result = lcd_selftest_manual_fan_check(1, false);
 		if (!_result)
 		{			
-			lcd_selftest_error(6, 0, 0); //print fan not spinning
+			lcd_selftest_error(TestError::printFan, "", ""); //print fan not spinning
 		}
 
 #endif //defined(TACH_1)
@@ -7190,7 +7205,7 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
 			if (axis == Y_AXIS) _error_1 = "Y";
 			if (axis == Z_AXIS) _error_1 = "Z";
 
-			lcd_selftest_error(9, _error_1, NULL);
+			lcd_selftest_error(TestError::axis, _error_1, "");
 			current_position[axis] = 0;
 			plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
 			reset_crash_det(axis);
@@ -7208,7 +7223,7 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
 			if (axis == Y_AXIS) _error_1 = "Y";
 			if (axis == Z_AXIS) _error_1 = "Z";
 
-			lcd_selftest_error(8, _error_1, NULL);
+			lcd_selftest_error(TestError::pulley, _error_1, "");
 			current_position[axis] = 0;
 			plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
 			reset_crash_det(axis);
@@ -7315,11 +7330,11 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
 
 		if (_travel_done >= _travel)
 		{
-			lcd_selftest_error(5, _error_1, _error_2);
+			lcd_selftest_error(TestError::endstop, _error_1, _error_2);
 		}
 		else
 		{
-			lcd_selftest_error(4, _error_1, _error_2);
+			lcd_selftest_error(TestError::motor, _error_1, _error_2);
 		}
 	}
 
@@ -7359,7 +7374,7 @@ static bool lcd_selfcheck_pulleys(int axis)
 		st_synchronize();
 		if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
 			((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) {
-			lcd_selftest_error(8, (axis == 0) ? "X" : "Y", "");
+			lcd_selftest_error(TestError::pulley, (axis == 0) ? "X" : "Y", "");
 			return(false);
 		}
 	}
@@ -7377,7 +7392,7 @@ static bool lcd_selfcheck_pulleys(int axis)
 				return(true);
 			}
 			else {
-				lcd_selftest_error(8, (axis == 0) ? "X" : "Y", "");
+				lcd_selftest_error(TestError::pulley, (axis == 0) ? "X" : "Y", "");
 				return(false);
 			}
 		}
@@ -7386,7 +7401,7 @@ static bool lcd_selfcheck_pulleys(int axis)
 			plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
 			st_synchronize();
 			if (_millis() > timeout_counter) {
-				lcd_selftest_error(8, (axis == 0) ? "X" : "Y", "");
+				lcd_selftest_error(TestError::pulley, (axis == 0) ? "X" : "Y", "");
 				return(false);
 			}
 		}
@@ -7419,7 +7434,7 @@ static bool lcd_selfcheck_endstops()
 		if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "X");
 		if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Y");
 		if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Z");
-		lcd_selftest_error(3, _error, "");
+		lcd_selftest_error(TestError::endstops, _error, "");
 	}
 	manage_heater();
 	manage_inactivity(true);
@@ -7485,12 +7500,12 @@ static bool lcd_selfcheck_check_heater(bool _isbed)
 		}
 		else
 		{
-			lcd_selftest_error(1, "", "");
+			lcd_selftest_error(TestError::heater, "", "");
 		}
 	}
 	else
 	{
-		lcd_selftest_error(2, "", "");
+		lcd_selftest_error(TestError::bed, "", "");
 	}
 
 	manage_heater();
@@ -7499,7 +7514,7 @@ static bool lcd_selfcheck_check_heater(bool _isbed)
 	return _stepresult;
 
 }
-static void lcd_selftest_error(int _error_no, const char *_error_1, const char *_error_2)
+static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2)
 {
 	lcd_beeper_quick_feedback();
 
@@ -7515,21 +7530,21 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
 	lcd_set_cursor(0, 1);
 	lcd_puts_P(_i("Please check :"));////MSG_SELFTEST_PLEASECHECK c=0 r=0
 
-	switch (_error_no)
+	switch (testError)
 	{
-	case 1:
+	case TestError::heater:
 		lcd_set_cursor(0, 2);
 		lcd_puts_P(_i("Heater/Thermistor"));////MSG_SELFTEST_HEATERTHERMISTOR c=0 r=0
 		lcd_set_cursor(0, 3);
 		lcd_puts_P(_i("Not connected"));////MSG_SELFTEST_NOTCONNECTED c=0 r=0
 		break;
-	case 2:
+	case TestError::bed:
 		lcd_set_cursor(0, 2);
 		lcd_puts_P(_i("Bed / Heater"));////MSG_SELFTEST_BEDHEATER c=0 r=0
 		lcd_set_cursor(0, 3);
 		lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
 		break;
-	case 3:
+	case TestError::endstops:
 		lcd_set_cursor(0, 2);
 		lcd_puts_P(_i("Endstops"));////MSG_SELFTEST_ENDSTOPS c=0 r=0
 		lcd_set_cursor(0, 3);
@@ -7537,7 +7552,7 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
 		lcd_set_cursor(17, 3);
 		lcd_print(_error_1);
 		break;
-	case 4:
+	case TestError::motor:
 		lcd_set_cursor(0, 2);
 		lcd_puts_P(_T(MSG_SELFTEST_MOTOR));
 		lcd_set_cursor(18, 2);
@@ -7547,7 +7562,7 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
 		lcd_set_cursor(18, 3);
 		lcd_print(_error_2);
 		break;
-	case 5:
+	case TestError::endstop:
 		lcd_set_cursor(0, 2);
 		lcd_puts_P(_i("Endstop not hit"));////MSG_SELFTEST_ENDSTOP_NOTHIT c=20 r=1
 		lcd_set_cursor(0, 3);
@@ -7555,7 +7570,7 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
 		lcd_set_cursor(18, 3);
 		lcd_print(_error_1);
 		break;
-	case 6:
+	case TestError::printFan:
 		lcd_set_cursor(0, 2);
 		lcd_puts_P(_T(MSG_SELFTEST_COOLING_FAN));
 		lcd_set_cursor(0, 3);
@@ -7563,7 +7578,7 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
 		lcd_set_cursor(18, 3);
 		lcd_print(_error_1);
 		break;
-	case 7:
+	case TestError::extruderFan:
 		lcd_set_cursor(0, 2);
 		lcd_puts_P(_T(MSG_SELFTEST_EXTRUDER_FAN));
 		lcd_set_cursor(0, 3);
@@ -7571,7 +7586,7 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
 		lcd_set_cursor(18, 3);
 		lcd_print(_error_1);
 		break;
-	case 8:
+	case TestError::pulley:
 		lcd_set_cursor(0, 2);
 		lcd_puts_P(_i("Loose pulley"));////MSG_LOOSE_PULLEY c=20 r=1
 		lcd_set_cursor(0, 3);
@@ -7579,7 +7594,7 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
 		lcd_set_cursor(18, 3);
 		lcd_print(_error_1);
 		break;
-	case 9:
+	case TestError::axis:
 		lcd_set_cursor(0, 2);
 		lcd_puts_P(_i("Axis length"));////MSG_SELFTEST_AXIS_LENGTH c=0 r=0
 		lcd_set_cursor(0, 3);
@@ -7587,7 +7602,7 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
 		lcd_set_cursor(18, 3);
 		lcd_print(_error_1);
 		break;
-	case 10:
+	case TestError::swappedFan:
 		lcd_set_cursor(0, 2);
 		lcd_puts_P(_i("Front/left fans"));////MSG_SELFTEST_FANS c=0 r=0
 		lcd_set_cursor(0, 3);
@@ -7595,12 +7610,18 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
 		lcd_set_cursor(18, 3);
 		lcd_print(_error_1);
 		break;
-	case 11: 
+	case TestError::wiringFsensor:
 		lcd_set_cursor(0, 2);
-		lcd_puts_P(_i("Filament sensor"));////MSG_FILAMENT_SENSOR c=20 r=0
+		lcd_puts_P(_T(MSG_SELFTEST_FILAMENT_SENSOR));
 		lcd_set_cursor(0, 3);
 		lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
 		break;
+	case TestError::triggeringFsensor:
+	    lcd_set_cursor(0, 2);
+        lcd_puts_P(_T(MSG_SELFTEST_FILAMENT_SENSOR));
+        lcd_set_cursor(0, 3);
+        lcd_puts_P(_i("False triggering"));////c=20 r=0
+        break;
 	}
 
 	_delay(1000);
@@ -7624,7 +7645,7 @@ static bool lcd_selftest_fsensor(void)
 	fsensor_init();
 	if (fsensor_not_responding)
 	{
-		lcd_selftest_error(11, NULL, NULL);
+		lcd_selftest_error(TestError::wiringFsensor, "", "");
 	}
 	return (!fsensor_not_responding);
 }
@@ -7676,7 +7697,11 @@ static bool selftest_irsensor()
         mmu_load_step(false);
         while (blocks_queued())
         {
-            if (PIN_GET(IR_SENSOR_PIN) == 0) return false;
+            if (PIN_GET(IR_SENSOR_PIN) == 0)
+            {
+                lcd_selftest_error(TestError::triggeringFsensor, "", "");
+                return false;
+            }
 #ifdef TMC2130
             manage_heater();
             // Vojtech: Don't disable motors inside the planner!
@@ -7802,7 +7827,7 @@ static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite)
 static bool lcd_selftest_fan_dialog(int _fan)
 {
 	bool _result = true;
-	int _errno = 7;
+	TestError testError = TestError::extruderFan;
 	switch (_fan) {
 	case 0:
 		fanSpeed = 0;
@@ -7857,7 +7882,7 @@ static bool lcd_selftest_fan_dialog(int _fan)
 		printf_P(PSTR("Print fan speed: %d \n"), fan_speed[1]);
 		printf_P(PSTR("Extr fan speed: %d \n"), fan_speed[0]);
 		if (!fan_speed[1]) {
-			_result = false; _errno = 6; //print fan not spinning
+			_result = false; testError = TestError::printFan;
 		}
 #ifdef FAN_SOFT_PWM 
 		else {
@@ -7868,10 +7893,10 @@ static bool lcd_selftest_fan_dialog(int _fan)
 			_result = lcd_selftest_manual_fan_check(1, true); //turn on print fan and check that left extruder fan is not spinning
 			if (_result) {
 				_result = lcd_selftest_manual_fan_check(1, false); //print fan is stil turned on; check that it is spinning
-				if (!_result) _errno = 6; //print fan not spinning
+				if (!_result) testError = TestError::printFan;
 			}
 			else {
-				_errno = 10; //swapped fans
+			    testError = TestError::swappedFan;
 			}
 		}
 
@@ -7883,7 +7908,7 @@ static bool lcd_selftest_fan_dialog(int _fan)
 	}
 	if (!_result)
 	{
-		lcd_selftest_error(_errno, NULL, NULL);
+		lcd_selftest_error(testError, "", "");
 	}
 	return _result;
 }
@@ -7932,7 +7957,8 @@ static int lcd_selftest_screen(testScreen screen, int _progress, int _progress_s
 	}
 	else if (screen >= testScreen::fsensor && screen <= testScreen::fsensorOk)
 	{
-		lcd_puts_at_P(0, 2, _i("Filament sensor:"));////MSG_SELFTEST_FILAMENT_SENSOR c=18 r=0
+		lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR));
+		lcd_putc(':');
 		lcd_set_cursor(18, 2);
 		(screen == testScreen::fsensor) ? lcd_print(_indicator) : lcd_print("OK");
 	}

+ 25 - 25
PF-build.sh

@@ -1,12 +1,12 @@
 #!/bin/bash 
-# This bash script is used to compile automatically the Prusa firmware with a dedecated build enviroment and settings
+# This bash script is used to compile automatically the Prusa firmware with a dedicated build environment and settings
 # 
 # Supported OS: Windows 10, Linux64 bit
 #
 # Linux:
 #
 # Windows:
-# To excecute this sciprt you gonna need few things on your Windows machine
+# To execute this script you gonna need few things on your Windows machine
 #
 # Linux Subsystem Ubuntu
 # 1. Follow these instructions
@@ -28,15 +28,15 @@
 # 4. Run git Bash under Administrator privilege and navigate to the directory /c/Program Files/Git/mingw64/bin,
 #    you can run the command ln -s /c/Program Files/7-Zip/7z.exe zip.exe
 #
-# Usefull things to edit and compare your custom Firmware
+# Useful things to edit and compare your custom Firmware
 # 1. Download and install current and correct (64bit or 32bit) Notepad++ version https://notepad-plus-plus.org/download
 # 2. Another great tool to compare your custom mod and stock firmware is WinMerge http://winmerge.org/downloads/?lang=en
 # 
-# Example for MK3: open git bash and chage to your Firmware directory 
+# Example for MK3: open git bash and change to your Firmware directory 
 # <username>@<machinename> MINGW64 /<drive>/path
 # bash build.sh 1_75mm_MK3-EINSy10a-E3Dv6full
 #
-# Example for MK25: open git bash and chage to your directory 
+# Example for MK25: open git bash and change to your directory 
 # gussner@WIN01 MINGW64 /d/Data/Prusa-Firmware/MK3
 # bash build.sh 1_75mm_MK25-RAMBo13a-E3Dv6full
 #
@@ -47,7 +47,7 @@
 # Version: 1.0.1-Build_8
 # Change log:
 # 12 Jan 2019, 3d-gussner, Fixed "compiler.c.elf.flags=-w -Os -Wl,-u,vfprintf -lprintf_flt -lm -Wl,--gc-sections" in 'platform.txt'
-# 16 Jan 2019, 3d-gussner, Build_2, Added development check to modify 'Configuration.h' to prevent unwanted LCD messages that Firmware is uknown
+# 16 Jan 2019, 3d-gussner, Build_2, Added development check to modify 'Configuration.h' to prevent unwanted LCD messages that Firmware is unknown
 # 17 Jan 2019, 3d-gussner, Build_3, Check for OS Windows or Linux and use the right build enviroment
 # 10 Feb 2019, ropaha, Pull Request, Select variant from list while using build.sh
 # 10 Feb 2019, ropaha, change FW_DEV_VERSION automatically depending on FW_VERSION RC/BETA/ALPHA
@@ -96,7 +96,7 @@ else
 	exit
 fi
 sleep 2
-###Prepare bash enviroment and check if wget and zip are availible
+###Prepare bash enviroment and check if wget and zip are available
 if ! type wget > /dev/null; then
 	echo "$(tput setaf 1)Missing 'wget' which is important to run this script"
 	echo "Please follow these instructions https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f058 to install wget$(tput sgr0)"
@@ -139,7 +139,7 @@ fi
 cd ../build-env || exit 3
 
 # Check if PF-build-env-<version> exists and downloads + creates it if not
-# The build enviroment is based on the Arduino IDE 1.8.5 portal vesion with some changes
+# The build enviroment is based on the Arduino IDE 1.8.5 portal version with some changes
 if [ ! -d "../PF-build-env-$BUILD_ENV" ]; then
 	echo "$(tput setaf 6)PF-build-env-$BUILD_ENV is missing ... creating it now for you$(tput sgr 0)"
 	mkdir ../PF-build-env-$BUILD_ENV
@@ -148,14 +148,14 @@ fi
 
 if [ $OSTYPE == "msys" ]; then
 	if [ ! -f "PF-build-env-Win-$BUILD_ENV.zip" ]; then
-		echo "$(tput setaf 6)Downloding Windows build enviroment...$(tput setaf 2)"
+		echo "$(tput setaf 6)Downloading Windows build environment...$(tput setaf 2)"
 		sleep 2
 		wget https://github.com/3d-gussner/PF-build-env/releases/download/Win-$BUILD_ENV/PF-build-env-Win-$BUILD_ENV.zip || exit 4
 		#cp -f ../../PF-build-env/PF-build-env-Win-$BUILD_ENV.zip PF-build-env-Win-$BUILD_ENV.zip || exit4
 		echo "$(tput sgr 0)"
 	fi
 	if [ ! -d "../PF-build-env-$BUILD_ENV/$OSTYPE" ]; then
-		echo "$(tput setaf 6)Unzipping Windows build enviroment...$(tput setaf 2)"
+		echo "$(tput setaf 6)Unzipping Windows build environment...$(tput setaf 2)"
 		sleep 2
 		unzip PF-build-env-Win-$BUILD_ENV.zip -d ../PF-build-env-$BUILD_ENV/$OSTYPE || exit 4
 		echo "$(tput sgr0)"
@@ -165,7 +165,7 @@ fi
 
 if [ $OSTYPE == "linux-gnu" ]; then
 	if [ ! -f "PF-build-env-Linux64-$BUILD_ENV.zip" ]; then
-		echo "$(tput setaf 6)Downloading Linux 64 build enviroment...$(tput setaf 2)"
+		echo "$(tput setaf 6)Downloading Linux 64 build environment...$(tput setaf 2)"
 		sleep 2
 		wget https://github.com/mkbel/PF-build-env/releases/download/$BUILD_ENV/PF-build-env-Linux64-$BUILD_ENV.zip || exit 3
 		echo "$(tput sgr0)"
@@ -180,9 +180,9 @@ if [ $OSTYPE == "linux-gnu" ]; then
 fi
 cd $SCRIPT_PATH
 
-# First argument defines which varaint of the Prusa Firmware will be compiled 
+# First argument defines which variant of the Prusa Firmware will be compiled 
 if [ -z "$1" ] ; then
-	# Select which varaint of the Prusa Firmware will be compiled, like
+	# Select which variant of the Prusa Firmware will be compiled, like
 	PS3="Select a variant: "
 	while IFS= read -r -d $'\0' f; do
 		options[i++]="$f"
@@ -248,7 +248,7 @@ else
 	if [[ "$2" == "ALL" || "$2" == "EN_ONLY" ]] ; then
 		LANGUAGES=$2
 	else
-		echo "$(tput setaf 1)Language agrument is wrong!$(tput sgr0)"
+		echo "$(tput setaf 1)Language argument is wrong!$(tput sgr0)"
 		echo "Only $(tput setaf 2)'ALL'$(tput sgr0) or $(tput setaf 2)'EN_ONLY'$(tput sgr0) are allowed as 2nd argument!"
 		exit
 	fi
@@ -270,7 +270,7 @@ BUILD_ENV_PATH="$( pwd -P )"
 
 cd ../..
 
-#Checkif BUILD_PATH exisits and if not creates it
+#Checkif BUILD_PATH exists and if not creates it
 if [ ! -d "Prusa-Firmware-build" ]; then
     mkdir Prusa-Firmware-build  || exit 6
 fi
@@ -286,7 +286,7 @@ do
 	FW=$(grep --max-count=1 "\bFW_VERSION\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/  */ /g'|cut -d '"' -f2|sed 's/\.//g')
 	# Find build version in Configuration.h file and use it to generate the hex filename
 	BUILD=$(grep --max-count=1 "\bFW_COMMIT_NR\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/  */ /g'|cut -d ' ' -f3)
-	# Check if the motherboard is an EINSY and if so the only one hex file will generated
+	# Check if the motherboard is an EINSY and if so only one hex file will generated
 	MOTHERBOARD=$(grep --max-count=1 "\bMOTHERBOARD\b" $SCRIPT_PATH/Firmware/variants/$VARIANT.h | sed -e's/  */ /g' |cut -d ' ' -f3)
 	# Check development status
 	DEV_CHECK=$(grep --max-count=1 "\bFW_VERSION\b" $SCRIPT_PATH/Firmware/Configuration.h | sed -e's/  */ /g'|cut -d '"' -f2|sed 's/\.//g'|cut -d '-' -f2)
@@ -333,22 +333,22 @@ do
 	fi
 	OUTPUT_FOLDER="Hex-files/FW$FW-Build$BUILD/$MOTHERBOARD"
 	
-	#Check if exacly the same hexfile already exsits
+	#Check if exactly the same hexfile already exists
 	if [[ -f "$SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT.hex"  &&  "$LANGUAGES" == "ALL" ]]; then
 		echo ""
 		ls -1 $SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT.hex | xargs -n1 basename
-		echo "$(tput setaf 6)This hex file to be comiled already exsits! To cancle this process press CRTL+C and rename existing hex file.$(tput sgr 0)"
+		echo "$(tput setaf 6)This hex file to be compiled already exists! To cancel this process press CRTL+C and rename existing hex file.$(tput sgr 0)"
 		read -t 10 -p "Press Enter to continue..."
 	elif [[ -f "$SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT-EN_ONLY.hex"  &&  "$LANGUAGES" == "EN_ONLY" ]]; then
 		echo ""
 		ls -1 $SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT-EN_ONLY.hex | xargs -n1 basename
-		echo "$(tput setaf 6)This hex file to be comiled already exsits! To cancle this process press CRTL+C and rename existing hex file.$(tput sgr 0)"
+		echo "$(tput setaf 6)This hex file to be compiled already exists! To cancel this process press CRTL+C and rename existing hex file.$(tput sgr 0)"
 		read -t 10 -p "Press Enter to continue..."
 	fi
 	if [[ -f "$SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT.zip"  &&  "$LANGUAGES" == "ALL" ]]; then
 		echo ""
 		ls -1 $SCRIPT_PATH/../$OUTPUT_FOLDER/FW$FW-Build$BUILD-$VARIANT.zip | xargs -n1 basename
-		echo "$(tput setaf 6)This zip file to be comiled already exsits! To cancle this process press CRTL+C and rename existing hex file.$(tput sgr 0)"
+		echo "$(tput setaf 6)This zip file to be compiled already exists! To cancel this process press CRTL+C and rename existing hex file.$(tput sgr 0)"
 		read -t 10 -p "Press Enter to continue..."
 	fi
 	
@@ -382,11 +382,11 @@ do
 	#Prepare english only or multilanguage version to be build
 	if [ $LANGUAGES == "ALL" ]; then
 		echo " "
-		echo "Multi-language firmware will be build"
+		echo "Multi-language firmware will be built"
 		echo " "
 	else
 		echo " "
-		echo "English only language firmware will be build"
+		echo "English only language firmware will be built"
 		echo " "
 	fi
 		
@@ -439,14 +439,14 @@ do
 
 	if [ $LANGUAGES ==  "ALL" ]; then
 		echo "$(tput setaf 2)"
-		echo "Building mutli language firmware" $MULTI_LANGUAGE_CHECK
+		echo "Building multi language firmware" $MULTI_LANGUAGE_CHECK
 		echo "$(tput sgr 0)"
 		sleep 2
 		cd $SCRIPT_PATH/lang
 		echo "$(tput setaf 3)"
 		./config.sh || exit 15
 		echo "$(tput sgr 0)"
-		# Check if privious languages and firmware build exist and if so clean them up
+		# Check if previous languages and firmware build exist and if so clean them up
 		if [ -f "lang_en.tmp" ]; then
 			echo ""
 			echo "$(tput setaf 6)Previous lang build files already exist these will be cleaned up in 10 seconds.$(tput sgr 0)"
@@ -469,7 +469,7 @@ do
 		# Combine compiled firmware with languages 
 		./fw-build.sh || exit 17
 		echo "$(tput sgr 0)"
-		# Check if the motherboard is an EINSY and if so the only one hex file will generated
+		# Check if the motherboard is an EINSY and if so only one hex file will generated
 		MOTHERBOARD=$(grep --max-count=1 "\bMOTHERBOARD\b" $SCRIPT_PATH/Firmware/variants/$VARIANT.h | sed -e's/  */ /g' |cut -d ' ' -f3)
 		# If the motherboard is an EINSY just copy one hexfile
 		if [ "$MOTHERBOARD" = "BOARD_EINSY_1_0a" ]; then

+ 3 - 3
lang/lang_en.txt

@@ -812,16 +812,16 @@
 "Some files will not be sorted. Max. No. of files in 1 folder for sorting is 100."
 
 #MSG_SORT_NONE c=17 r=1
-"Sort:      [none]"
+"Sort       [none]"
 
 #MSG_SORT_TIME c=17 r=1
-"Sort:      [time]"
+"Sort       [time]"
 
 #
 "Severe skew"
 
 #MSG_SORT_ALPHA c=17 r=1
-"Sort:  [alphabet]"
+"Sort   [alphabet]"
 
 #MSG_SORTING c=20 r=1
 "Sorting files"

+ 4 - 4
lang/lang_en_cz.txt

@@ -1083,19 +1083,19 @@
 "Nektere soubory nebudou setrideny. Maximalni pocet souboru ve slozce pro setrideni je 100."
 
 #MSG_SORT_NONE c=17 r=1
-"Sort:      [none]"
+"Sort       [none]"
 "Trideni   [Zadne]"
 
 #MSG_SORT_TIME c=17 r=1
-"Sort:      [time]"
-"Trideni:    [cas]"
+"Sort       [time]"
+"Trideni     [cas]"
 
 #
 "Severe skew"
 "Tezke zkoseni"
 
 #MSG_SORT_ALPHA c=17 r=1
-"Sort:  [alphabet]"
+"Sort   [alphabet]"
 "Trideni [Abeceda]"
 
 #MSG_SORTING c=20 r=1

+ 6 - 6
lang/lang_en_de.txt

@@ -1083,20 +1083,20 @@
 "Einige Dateien wur- den nicht sortiert. Max. Dateien pro Verzeichnis = 100."
 
 #MSG_SORT_NONE c=17 r=1
-"Sort:      [none]"
-"Sort.:    [Keine]"
+"Sort       [none]"
+"Sort.     [Keine]"
 
 #MSG_SORT_TIME c=17 r=1
-"Sort:      [time]"
-"Sort.:     [Zeit]"
+"Sort       [time]"
+"Sort.      [Zeit]"
 
 #
 "Severe skew"
 "Schwerer Schraeglauf"
 
 #MSG_SORT_ALPHA c=17 r=1
-"Sort:  [alphabet]"
-"Sort.: [Alphabet]"
+"Sort   [alphabet]"
+"Sort.  [Alphabet]"
 
 #MSG_SORTING c=20 r=1
 "Sorting files"

+ 6 - 6
lang/lang_en_es.txt

@@ -1083,20 +1083,20 @@
 "Algunos archivos no se ordenaran. Maximo 100 archivos por carpeta para ordenar. "
 
 #MSG_SORT_NONE c=17 r=1
-"Sort:      [none]"
-"Ordenar:   [nada]"
+"Sort       [none]"
+"Ordenar    [nada]"
 
 #MSG_SORT_TIME c=17 r=1
-"Sort:      [time]"
-"Orden:    [Fecha]"
+"Sort       [time]"
+"Ordenar   [Fecha]"
 
 #
 "Severe skew"
 "Inclinacion severa"
 
 #MSG_SORT_ALPHA c=17 r=1
-"Sort:  [alphabet]"
-"Ordenar:[alfabet]"
+"Sort   [alphabet]"
+"Ordenar [alfabet]"
 
 #MSG_SORTING c=20 r=1
 "Sorting files"

+ 5 - 5
lang/lang_en_fr.txt

@@ -1083,20 +1083,20 @@
 "Certains fichiers ne seront pas tries. Max 100 fichiers tries par dossier."
 
 #MSG_SORT_NONE c=17 r=1
-"Sort:      [none]"
+"Sort       [none]"
 "Tri :     [aucun]"
 
 #MSG_SORT_TIME c=17 r=1
-"Sort:      [time]"
-"Tri :     [heure]"
+"Sort       [time]"
+"Tri       [heure]"
 
 #
 "Severe skew"
 "Deviation severe"
 
 #MSG_SORT_ALPHA c=17 r=1
-"Sort:  [alphabet]"
-"Tri : [alphabet]"
+"Sort   [alphabet]"
+"Tri    [alphabet]"
 
 #MSG_SORTING c=20 r=1
 "Sorting files"

+ 6 - 6
lang/lang_en_it.txt

@@ -1083,20 +1083,20 @@
 "Alcuni file non saranno ordinati. Il numero massimo di file in una cartella e 100 perche siano ordinati."
 
 #MSG_SORT_NONE c=17 r=1
-"Sort:      [none]"
-"Ordina:    [none]"
+"Sort       [none]"
+"Ordina     [none]"
 
 #MSG_SORT_TIME c=17 r=1
-"Sort:      [time]"
-"Ordina:    [time]"
+"Sort       [time]"
+"Ordina     [time]"
 
 #
 "Severe skew"
 "Disassamento grave"
 
 #MSG_SORT_ALPHA c=17 r=1
-"Sort:  [alphabet]"
-"Ordine: [alfabet]"
+"Sort   [alphabet]"
+"Ordine  [alfabet]"
 
 #MSG_SORTING c=20 r=1
 "Sorting files"

+ 6 - 6
lang/lang_en_pl.txt

@@ -1083,20 +1083,20 @@
 "Niektore pliki nie zostana posortowane. Max. liczba plikow w 1 folderze = 100."
 
 #MSG_SORT_NONE c=17 r=1
-"Sort:      [none]"
-"Sortuj:    [brak]"
+"Sort       [none]"
+"Sortuj     [brak]"
 
 #MSG_SORT_TIME c=17 r=1
-"Sort:      [time]"
-"Sortuj:    [czas]"
+"Sort       [time]"
+"Sortuj     [czas]"
 
 #
 "Severe skew"
 "Znaczny skos"
 
 #MSG_SORT_ALPHA c=17 r=1
-"Sort:  [alphabet]"
-"Sortuj: [alfabet]"
+"Sort   [alphabet]"
+"Sortuj  [alfabet]"
 
 #MSG_SORTING c=20 r=1
 "Sorting files"