Use sprintf_P for M301 instead of ftostr32
Also fixed indentation of if statement Saves 248 bytes of flash
This commit is contained in:
parent
0e6ff38b61
commit
6d98e99356
|
|
@ -1031,14 +1031,9 @@ void lcd_commands()
|
||||||
lcd_setstatuspgm(_i("PID cal. finished"));////MSG_PID_FINISHED c=20
|
lcd_setstatuspgm(_i("PID cal. finished"));////MSG_PID_FINISHED c=20
|
||||||
setAllTargetHotends(0); // reset all hotends temperature including the number displayed on the main screen
|
setAllTargetHotends(0); // reset all hotends temperature including the number displayed on the main screen
|
||||||
if (_Kp != 0 || _Ki != 0 || _Kd != 0) {
|
if (_Kp != 0 || _Ki != 0 || _Kd != 0) {
|
||||||
strcpy_P(cmd1, PSTR("M301 P"));
|
sprintf_P(cmd1, PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd);
|
||||||
strcat(cmd1, ftostr32(_Kp));
|
enquecommand(cmd1);
|
||||||
strcat_P(cmd1, PSTR(" I"));
|
enquecommand_P(PSTR("M500"));
|
||||||
strcat(cmd1, ftostr32(_Ki));
|
|
||||||
strcat_P(cmd1, PSTR(" D"));
|
|
||||||
strcat(cmd1, ftostr32(_Kd));
|
|
||||||
enquecommand(cmd1);
|
|
||||||
enquecommand_P(PSTR("M500"));
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM.");
|
SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM.");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue