Bladeren bron

Temperature selection is int16_t. Use sprintf for PID start command.

Saves 90B of flash and 2B of ram
Alex Voinea 2 jaren geleden
bovenliggende
commit
8e85242c8f
1 gewijzigde bestanden met toevoegingen van 3 en 4 verwijderingen
  1. 3 4
      Firmware/ultralcd.cpp

+ 3 - 4
Firmware/ultralcd.cpp

@@ -86,7 +86,7 @@ uint8_t farm_timer = 8;
 bool printer_connected = true;
 
 static ShortTimer display_time; //just timer for showing pid finished message on lcd;
-float pid_temp = DEFAULT_PID_TEMP;
+static uint16_t pid_temp = DEFAULT_PID_TEMP;
 
 static bool forceMenuExpire = false;
 static bool lcd_autoDeplete;
@@ -1018,8 +1018,7 @@ void lcd_commands()
 			lcd_commands_step = 3;
 		}
 		if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration
-			strcpy_P(cmd1, PSTR("M303 E0 S"));
-			strcat(cmd1, ftostr3(pid_temp));
+			sprintf_P(cmd1, PSTR("M303 E0 S%3u"), pid_temp);
 			// setting the correct target temperature (for visualization) is done in PID_autotune
 			enquecommand(cmd1);
 			lcd_setstatuspgm(_i("PID cal."));////MSG_PID_RUNNING c=20
@@ -2786,7 +2785,7 @@ void pid_extruder()
 	if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP;
 	lcd_encoder = 0;
 	lcd_set_cursor(1, 2);
-	lcd_print(ftostr3(pid_temp));
+	lcd_printf_P(PSTR("%3u"), pid_temp);
 	if (lcd_clicked()) {
 		lcd_commands_type = LcdCommands::PidExtruder;
 		lcd_return_to_status();