Skip to content

Commit af36f65

Browse files
gudnimgleptun
authored andcommittedFeb 27, 2022
Optimise a few uses of SERIAL_PROTOCOLLN
Saves 34 bytes of flash memory and reduces code by 8 lines.
1 parent bb56c35 commit af36f65

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed
 

‎Firmware/Marlin_main.cpp

+7-15
Original file line numberDiff line numberDiff line change
@@ -3676,9 +3676,7 @@ void gcode_M114()
36763676
SERIAL_PROTOCOLPGM(" Z:");
36773677
SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_unit[Z_AXIS]);
36783678
SERIAL_PROTOCOLPGM(" E:");
3679-
SERIAL_PROTOCOL(float(st_get_position(E_AXIS)) / cs.axis_steps_per_unit[E_AXIS]);
3680-
3681-
SERIAL_PROTOCOLLN();
3679+
SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_unit[E_AXIS]);
36823680
}
36833681

36843682
#if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1)))))
@@ -6158,8 +6156,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
61586156
SERIAL_PROTOCOL('.');
61596157
SERIAL_PROTOCOL(uint8_t(ip[2]));
61606158
SERIAL_PROTOCOL('.');
6161-
SERIAL_PROTOCOL(uint8_t(ip[3]));
6162-
SERIAL_PROTOCOLLN();
6159+
SERIAL_PROTOCOLLN(uint8_t(ip[3]));
61636160
} else {
61646161
SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n");
61656162
}
@@ -7730,8 +7727,7 @@ SERIAL_PROTOCOLPGM("\n\n");
77307727
SERIAL_PROTOCOL(" Servo ");
77317728
SERIAL_PROTOCOL(servo_index);
77327729
SERIAL_PROTOCOL(": ");
7733-
SERIAL_PROTOCOL(servos[servo_index].read());
7734-
SERIAL_PROTOCOLLN();
7730+
SERIAL_PROTOCOLLN(servos[servo_index].read());
77357731
}
77367732
}
77377733
break;
@@ -7839,8 +7835,7 @@ SERIAL_PROTOCOLPGM("\n\n");
78397835
SERIAL_PROTOCOL(" i:");
78407836
SERIAL_PROTOCOL(unscalePID_i(cs.bedKi));
78417837
SERIAL_PROTOCOL(" d:");
7842-
SERIAL_PROTOCOL(unscalePID_d(cs.bedKd));
7843-
SERIAL_PROTOCOLLN();
7838+
SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd));
78447839
}
78457840
break;
78467841
#endif //PIDTEMP
@@ -8272,8 +8267,7 @@ SERIAL_PROTOCOLPGM("\n\n");
82728267
LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT));
82738268

82748269
SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:");
8275-
SERIAL_PROTOCOL(set_target_pinda);
8276-
SERIAL_PROTOCOLLN();
8270+
SERIAL_PROTOCOLLN(set_target_pinda);
82778271

82788272
codenum = _millis();
82798273
cancel_heatup = false;
@@ -8334,8 +8328,7 @@ SERIAL_PROTOCOLPGM("\n\n");
83348328
SERIAL_PROTOCOLPGM(", ");
83358329
SERIAL_PROTOCOL(usteps);
83368330
SERIAL_PROTOCOLPGM(", ");
8337-
SERIAL_PROTOCOL(mm * 1000);
8338-
SERIAL_PROTOCOLLN();
8331+
SERIAL_PROTOCOLLN(mm * 1000);
83398332
}
83408333
}
83418334
else if (code_seen('!')) { // ! - Set factory default values
@@ -8381,8 +8374,7 @@ SERIAL_PROTOCOLPGM("\n\n");
83818374
SERIAL_PROTOCOLPGM(", ");
83828375
SERIAL_PROTOCOL(usteps);
83838376
SERIAL_PROTOCOLPGM(", ");
8384-
SERIAL_PROTOCOL(mm * 1000);
8385-
SERIAL_PROTOCOLLN();
8377+
SERIAL_PROTOCOLLN(mm * 1000);
83868378
}
83878379
}
83888380
}

0 commit comments

Comments
 (0)
Please sign in to comment.