Merge pull request #9323 from thinkyhead/bf1_simple_patches

[1.1.x] Optimize some strings, arc length calculation
This commit is contained in:
Scott Lahteine 2018-01-23 19:13:00 -06:00 committed by GitHub
commit e5c6448063
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 11 deletions

View File

@ -117,7 +117,7 @@
SERIAL_ECHOPGM("New position reads as ");
SERIAL_ECHO(get_position());
SERIAL_ECHOPGM("(");
SERIAL_CHAR('(');
SERIAL_ECHO(mm_from_count(get_position()));
SERIAL_ECHOLNPGM(")");
#endif

View File

@ -10029,7 +10029,7 @@ inline void gcode_M502() {
if (!ijk) {
SERIAL_ECHO_START();
SERIAL_ECHO(MSG_SKEW_FACTOR " XY: ");
SERIAL_ECHOPGM(MSG_SKEW_FACTOR " XY: ");
SERIAL_ECHO_F(planner.xy_skew_factor, 6);
SERIAL_EOL();
#if ENABLED(SKEW_CORRECTION_FOR_Z)
@ -12880,7 +12880,8 @@ void prepare_move_to_destination() {
if (angular_travel == 0 && current_position[p_axis] == cart[p_axis] && current_position[q_axis] == cart[q_axis])
angular_travel = RADIANS(360);
const float mm_of_travel = HYPOT(angular_travel * radius, FABS(linear_travel));
const float flat_mm = radius * angular_travel,
mm_of_travel = linear_travel ? HYPOT(flat_mm, linear_travel) : flat_mm;
if (mm_of_travel < 0.001) return;
uint16_t segments = FLOOR(mm_of_travel / (MM_PER_ARC_SEGMENT));

View File

@ -2228,7 +2228,7 @@ void MarlinSettings::reset() {
}
CONFIG_ECHO_START;
#if ENABLED(SKEW_CORRECTION_FOR_Z)
SERIAL_ECHO(" M852 I");
SERIAL_ECHOPGM(" M852 I");
SERIAL_ECHO_F(LINEAR_UNIT(planner.xy_skew_factor), 6);
SERIAL_ECHOPGM(" J");
SERIAL_ECHO_F(LINEAR_UNIT(planner.xz_skew_factor), 6);
@ -2236,7 +2236,7 @@ void MarlinSettings::reset() {
SERIAL_ECHO_F(LINEAR_UNIT(planner.yz_skew_factor), 6);
SERIAL_EOL();
#else
SERIAL_ECHO(" M852 S");
SERIAL_ECHOPGM(" M852 S");
SERIAL_ECHO_F(LINEAR_UNIT(planner.xy_skew_factor), 6);
SERIAL_EOL();
#endif
@ -2251,7 +2251,7 @@ void MarlinSettings::reset() {
SERIAL_ECHOLNPGM("Stepper driver current:");
}
CONFIG_ECHO_START;
SERIAL_ECHO(" M906");
SERIAL_ECHOPGM(" M906");
#if ENABLED(X_IS_TMC2130) || ENABLED(X_IS_TMC2208)
SERIAL_ECHOPAIR(" X ", stepperX.getCurrent());
#endif
@ -2297,7 +2297,7 @@ void MarlinSettings::reset() {
SERIAL_ECHOLNPGM("Sensorless homing threshold:");
}
CONFIG_ECHO_START;
SERIAL_ECHO(" M914");
SERIAL_ECHOPGM(" M914");
#if ENABLED(X_IS_TMC2130)
SERIAL_ECHOPAIR(" X", stepperX.sgt());
#endif

View File

@ -282,7 +282,7 @@ void GCodeParser::unknown_command_error() {
#else
SERIAL_ECHOPAIR(" args: \"", command_args);
#endif
SERIAL_ECHOPGM("\"");
SERIAL_CHAR('"');
if (string_arg) {
SERIAL_ECHOPGM(" string: \"");
SERIAL_ECHO(string_arg);

View File

@ -362,7 +362,7 @@ void Planner::recalculate_trapezoids() {
}
}
/*
/**
* Recalculate the motion plan according to the following algorithm:
*
* 1. Go over every block in reverse order...
@ -392,7 +392,6 @@ void Planner::recalculate() {
recalculate_trapezoids();
}
#if ENABLED(AUTOTEMP)
void Planner::getHighESpeed() {

View File

@ -140,7 +140,7 @@ void PrintCounter::showStats() {
SERIAL_ECHOPGM("Filament used: ");
SERIAL_ECHO(this->data.filamentUsed / 1000);
SERIAL_ECHOPGM("m");
SERIAL_CHAR('m');
SERIAL_EOL();
}