Skip to content

Commit b9809ea

Browse files
authored
Merge pull request #7281 from thinkyhead/bf_seen_not_volatile
Fixes for recent merges
2 parents 9af67e2 + 0873c66 commit b9809ea

File tree

6 files changed

+445
-529
lines changed

6 files changed

+445
-529
lines changed

Marlin/G26_Mesh_Validation_Tool.cpp

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -58,67 +58,67 @@
5858
*
5959
* G26 is a Mesh Validation Tool intended to provide support for the Marlin Unified Bed Leveling System.
6060
* In order to fully utilize and benefit from the Marlin Unified Bed Leveling System an accurate Mesh must
61-
* be defined. G29 is designed to allow the user to quickly validate the correctness of her Mesh. It will
61+
* be defined. G29 is designed to allow the user to quickly validate the correctness of her Mesh. It will
6262
* first heat the bed and nozzle. It will then print lines and circles along the Mesh Cell boundaries and
6363
* the intersections of those lines (respectively).
6464
*
6565
* This action allows the user to immediately see where the Mesh is properly defined and where it needs to
66-
* be edited. The command will generate the Mesh lines closest to the nozzle's starting position. Alternatively
67-
* the user can specify the X and Y position of interest with command parameters. This allows the user to
66+
* be edited. The command will generate the Mesh lines closest to the nozzle's starting position. Alternatively
67+
* the user can specify the X and Y position of interest with command parameters. This allows the user to
6868
* focus on a particular area of the Mesh where attention is needed.
6969
*
70-
* B # Bed Set the Bed Temperature. If not specified, a default of 60 C. will be assumed.
70+
* B # Bed Set the Bed Temperature. If not specified, a default of 60 C. will be assumed.
7171
*
7272
* C Current When searching for Mesh Intersection points to draw, use the current nozzle location
7373
* as the base for any distance comparison.
7474
*
75-
* D Disable Disable the Unified Bed Leveling System. In the normal case the user is invoking this
76-
* command to see how well a Mesh as been adjusted to match a print surface. In order to do
77-
* this the Unified Bed Leveling System is turned on by the G26 command. The D parameter
75+
* D Disable Disable the Unified Bed Leveling System. In the normal case the user is invoking this
76+
* command to see how well a Mesh as been adjusted to match a print surface. In order to do
77+
* this the Unified Bed Leveling System is turned on by the G26 command. The D parameter
7878
* alters the command's normal behaviour and disables the Unified Bed Leveling System even if
7979
* it is on.
8080
*
81-
* H # Hotend Set the Nozzle Temperature. If not specified, a default of 205 C. will be assumed.
81+
* H # Hotend Set the Nozzle Temperature. If not specified, a default of 205 C. will be assumed.
8282
*
83-
* F # Filament Used to specify the diameter of the filament being used. If not specified
84-
* 1.75mm filament is assumed. If you are not getting acceptable results by using the
83+
* F # Filament Used to specify the diameter of the filament being used. If not specified
84+
* 1.75mm filament is assumed. If you are not getting acceptable results by using the
8585
* 'correct' numbers, you can scale this number up or down a little bit to change the amount
8686
* of filament that is being extruded during the printing of the various lines on the bed.
8787
*
8888
* K Keep-On Keep the heaters turned on at the end of the command.
8989
*
90-
* L # Layer Layer height. (Height of nozzle above bed) If not specified .20mm will be used.
90+
* L # Layer Layer height. (Height of nozzle above bed) If not specified .20mm will be used.
9191
*
92-
* O # Ooooze How much your nozzle will Ooooze filament while getting in position to print. This
92+
* O # Ooooze How much your nozzle will Ooooze filament while getting in position to print. This
9393
* is over kill, but using this parameter will let you get the very first 'circle' perfect
9494
* so you have a trophy to peel off of the bed and hang up to show how perfectly you have your
95-
* Mesh calibrated. If not specified, a filament length of .3mm is assumed.
95+
* Mesh calibrated. If not specified, a filament length of .3mm is assumed.
9696
*
97-
* P # Prime Prime the nozzle with specified length of filament. If this parameter is not
98-
* given, no prime action will take place. If the parameter specifies an amount, that much
99-
* will be purged before continuing. If no amount is specified the command will start
97+
* P # Prime Prime the nozzle with specified length of filament. If this parameter is not
98+
* given, no prime action will take place. If the parameter specifies an amount, that much
99+
* will be purged before continuing. If no amount is specified the command will start
100100
* purging filament until the user provides an LCD Click and then it will continue with
101-
* printing the Mesh. You can carefully remove the spent filament with a needle nose
102-
* pliers while holding the LCD Click wheel in a depressed state. If you do not have
101+
* printing the Mesh. You can carefully remove the spent filament with a needle nose
102+
* pliers while holding the LCD Click wheel in a depressed state. If you do not have
103103
* an LCD, you must specify a value if you use P.
104104
*
105-
* Q # Multiplier Retraction Multiplier. Normally not needed. Retraction defaults to 1.0mm and
105+
* Q # Multiplier Retraction Multiplier. Normally not needed. Retraction defaults to 1.0mm and
106106
* un-retraction is at 1.2mm These numbers will be scaled by the specified amount
107107
*
108108
* R # Repeat Prints the number of patterns given as a parameter, starting at the current location.
109109
* If a parameter isn't given, every point will be printed unless G26 is interrupted.
110110
* This works the same way that the UBL G29 P4 R parameter works.
111111
*
112-
* NOTE: If you do not have an LCD, you -must- specify R. This is to ensure that you are
112+
* NOTE: If you do not have an LCD, you -must- specify R. This is to ensure that you are
113113
* aware that there's some risk associated with printing without the ability to abort in
114-
* cases where mesh point Z value may be inaccurate. As above, if you do not include a
114+
* cases where mesh point Z value may be inaccurate. As above, if you do not include a
115115
* parameter, every point will be printed.
116116
*
117-
* S # Nozzle Used to control the size of nozzle diameter. If not specified, a .4mm nozzle is assumed.
117+
* S # Nozzle Used to control the size of nozzle diameter. If not specified, a .4mm nozzle is assumed.
118118
*
119-
* U # Random Randomize the order that the circles are drawn on the bed. The search for the closest
120-
* undrawn cicle is still done. But the distance to the location for each circle has a
121-
* random number of the size specified added to it. Specifying S50 will give an interesting
119+
* U # Random Randomize the order that the circles are drawn on the bed. The search for the closest
120+
* undrawn cicle is still done. But the distance to the location for each circle has a
121+
* random number of the size specified added to it. Specifying S50 will give an interesting
122122
* deviation from the normal behaviour on a 10 x 10 Mesh.
123123
*
124124
* X # X Coord. Specify the starting location of the drawing activity.
@@ -218,7 +218,7 @@
218218
* nozzle in a problem area and doing a G29 P4 R command.
219219
*/
220220
void unified_bed_leveling::G26() {
221-
SERIAL_ECHOLNPGM("G26 command started. Waiting for heater(s).");
221+
SERIAL_ECHOLNPGM("G26 command started. Waiting for heater(s).");
222222
float tmp, start_angle, end_angle;
223223
int i, xi, yi;
224224
mesh_index_pair location;
@@ -264,7 +264,7 @@
264264
//debug_current_and_destination(PSTR("Starting G26 Mesh Validation Pattern."));
265265

266266
/**
267-
* Declare and generate a sin() & cos() table to be used during the circle drawing. This will lighten
267+
* Declare and generate a sin() & cos() table to be used during the circle drawing. This will lighten
268268
* the CPU load and make the arc drawing faster and more smooth
269269
*/
270270
float sin_table[360 / 30 + 1], cos_table[360 / 30 + 1];
@@ -575,17 +575,17 @@
575575

576576
/**
577577
* print_line_from_here_to_there() takes two cartesian coordinates and draws a line from one
578-
* to the other. But there are really three sets of coordinates involved. The first coordinate
579-
* is the present location of the nozzle. We don't necessarily want to print from this location.
580-
* We first need to move the nozzle to the start of line segment where we want to print. Once
578+
* to the other. But there are really three sets of coordinates involved. The first coordinate
579+
* is the present location of the nozzle. We don't necessarily want to print from this location.
580+
* We first need to move the nozzle to the start of line segment where we want to print. Once
581581
* there, we can use the two coordinates supplied to draw the line.
582582
*
583583
* Note: Although we assume the first set of coordinates is the start of the line and the second
584-
* set of coordinates is the end of the line, it does not always work out that way. This function
585-
* optimizes the movement to minimize the travel distance before it can start printing. This saves
586-
* a lot of time and eleminates a lot of non-sensical movement of the nozzle. However, it does
584+
* set of coordinates is the end of the line, it does not always work out that way. This function
585+
* optimizes the movement to minimize the travel distance before it can start printing. This saves
586+
* a lot of time and eliminates a lot of nonsensical movement of the nozzle. However, it does
587587
* cause a lot of very little short retracement of th nozzle when it draws the very first line
588-
* segment of a 'circle'. The time this requires is very short and is easily saved by the other
588+
* segment of a 'circle'. The time this requires is very short and is easily saved by the other
589589
* cases where the optimization comes into play.
590590
*/
591591
void unified_bed_leveling::print_line_from_here_to_there(const float &sx, const float &sy, const float &sz, const float &ex, const float &ey, const float &ez) {
@@ -850,7 +850,7 @@
850850

851851
stepper.synchronize(); // Without this synchronize, the purge is more consistent,
852852
// but because the planner has a buffer, we won't be able
853-
// to stop as quickly. So we put up with the less smooth
853+
// to stop as quickly. So we put up with the less smooth
854854
// action to give the user a more responsive 'Stop'.
855855
set_destination_to_current();
856856
idle();
@@ -860,7 +860,7 @@
860860

861861
#if ENABLED(ULTRA_LCD)
862862
strcpy_P(lcd_status_message, PSTR("Done Priming")); // We can't do lcd_setstatusPGM() without having it continue;
863-
// So... We cheat to get a message up.
863+
// So... We cheat to get a message up.
864864
lcd_setstatusPGM(PSTR("Done Priming"), 99);
865865
lcd_quick_feedback();
866866
#endif

Marlin/Marlin_main.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3242,7 +3242,7 @@ inline void gcode_G0_G1(
32423242
if (autoretract_enabled && !(parser.seen('X') || parser.seen('Y') || parser.seen('Z')) && parser.seen('E')) {
32433243
const float echange = destination[E_AXIS] - current_position[E_AXIS];
32443244
// Is this move an attempt to retract or recover?
3245-
if ((echange < -MIN_RETRACT && !retracted[active_extruder]) || (echange > MIN_RETRACT && retracted[active_extruder])) {
3245+
if ((echange < -(MIN_RETRACT) && !retracted[active_extruder]) || (echange > MIN_RETRACT && retracted[active_extruder])) {
32463246
current_position[E_AXIS] = destination[E_AXIS]; // hide the slicer-generated retract/recover from calculations
32473247
sync_plan_position_e(); // AND from the planner
32483248
retract(!retracted[active_extruder]);
@@ -4617,11 +4617,11 @@ void home_all_axes() { gcode_G28(true); }
46174617

46184618
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
46194619

4620-
// mean += measured_z; // I believe this is unused code?
4621-
// eqnBVector[abl_probe_index] = measured_z; // I believe this is unused code?
4622-
// eqnAMatrix[abl_probe_index + 0 * abl2] = xProbe; // I believe this is unused code?
4623-
// eqnAMatrix[abl_probe_index + 1 * abl2] = yProbe; // I believe this is unused code?
4624-
// eqnAMatrix[abl_probe_index + 2 * abl2] = 1; // I believe this is unused code?
4620+
mean += measured_z;
4621+
eqnBVector[abl_probe_index] = measured_z;
4622+
eqnAMatrix[abl_probe_index + 0 * abl2] = xProbe;
4623+
eqnAMatrix[abl_probe_index + 1 * abl2] = yProbe;
4624+
eqnAMatrix[abl_probe_index + 2 * abl2] = 1;
46254625

46264626
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
46274627

@@ -4797,9 +4797,6 @@ void home_all_axes() { gcode_G28(true); }
47974797

47984798
incremental_LSF(&lsf_results, xProbe, yProbe, measured_z);
47994799

4800-
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
4801-
indexIntoAB[xCount][yCount] = abl_probe_index;
4802-
#endif
48034800
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
48044801

48054802
z_values[xCount][yCount] = measured_z + zoffset;
@@ -4924,11 +4921,10 @@ void home_all_axes() { gcode_G28(true); }
49244921
}
49254922

49264923
// Create the matrix but don't correct the position yet
4927-
if (!dryrun) {
4924+
if (!dryrun)
49284925
planner.bed_level_matrix = matrix_3x3::create_look_at(
4929-
vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1) // We can eleminate the '-' here and up above
4926+
vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1) // We can eliminate the '-' here and up above
49304927
);
4931-
}
49324928

49334929
// Show the Topography map if enabled
49344930
if (do_topography_map) {

Marlin/least_squares_fit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ int finish_incremental_LSF(struct linear_fit_data *lsf) {
6868
return 0;
6969
}
7070

71-
#endif // AUTO_BED_LEVELING_UBL || ENABLED(AUTO_BED_LEVELING_LINEAR)
71+
#endif // AUTO_BED_LEVELING_UBL || ENABLED(AUTO_BED_LEVELING_LINEAR)

Marlin/least_squares_fit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
#include "MarlinConfig.h"
3636

37-
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_LINEAR)
37+
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(AUTO_BED_LEVELING_LINEAR)
3838

3939
#include "Marlin.h"
4040
#include "macros.h"

Marlin/ultralcd_impl_DOGM.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,8 @@ static void lcd_implementation_status_screen() {
976976
uint8_t x_map_pixels = ((MAP_MAX_PIXELS_X - 4) / (GRID_MAX_POINTS_X)) * (GRID_MAX_POINTS_X),
977977
y_map_pixels = ((MAP_MAX_PIXELS_Y - 4) / (GRID_MAX_POINTS_Y)) * (GRID_MAX_POINTS_Y),
978978

979-
pixels_per_X_mesh_pnt = x_map_pixels / (GRID_MAX_POINTS_X),
980-
pixels_per_Y_mesh_pnt = y_map_pixels / (GRID_MAX_POINTS_Y),
979+
pixels_per_x_mesh_pnt = x_map_pixels / (GRID_MAX_POINTS_X),
980+
pixels_per_y_mesh_pnt = y_map_pixels / (GRID_MAX_POINTS_Y),
981981

982982
x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X - x_map_pixels - 2) / 2,
983983
y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y - y_map_pixels - 2) / 2;
@@ -996,23 +996,23 @@ static void lcd_implementation_status_screen() {
996996
// Display Mesh Point Locations
997997

998998
u8g.setColorIndex(1);
999-
const uint8_t sx = x_offset + pixels_per_X_mesh_pnt / 2;
1000-
uint8_t y = y_offset + pixels_per_Y_mesh_pnt / 2;
1001-
for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++, y += pixels_per_Y_mesh_pnt)
999+
const uint8_t sx = x_offset + pixels_per_x_mesh_pnt / 2;
1000+
uint8_t y = y_offset + pixels_per_y_mesh_pnt / 2;
1001+
for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++, y += pixels_per_y_mesh_pnt)
10021002
if (PAGE_CONTAINS(y, y))
1003-
for (uint8_t i = 0, x = sx; i < GRID_MAX_POINTS_X; i++, x += pixels_per_X_mesh_pnt)
1003+
for (uint8_t i = 0, x = sx; i < GRID_MAX_POINTS_X; i++, x += pixels_per_x_mesh_pnt)
10041004
u8g.drawBox(sx, y, 1, 1);
10051005

10061006
// Fill in the Specified Mesh Point
10071007

10081008
uint8_t inverted_y = GRID_MAX_POINTS_Y - y_plot - 1; // The origin is typically in the lower right corner. We need to
10091009
// invert the Y to get it to plot in the right location.
10101010

1011-
const uint8_t by = y_offset + inverted_y * pixels_per_Y_mesh_pnt;
1012-
if (PAGE_CONTAINS(by, by + pixels_per_Y_mesh_pnt))
1011+
const uint8_t by = y_offset + inverted_y * pixels_per_y_mesh_pnt;
1012+
if (PAGE_CONTAINS(by, by + pixels_per_y_mesh_pnt))
10131013
u8g.drawBox(
1014-
x_offset + x_plot * pixels_per_X_mesh_pnt, by,
1015-
pixels_per_X_mesh_pnt, pixels_per_Y_mesh_pnt
1014+
x_offset + x_plot * pixels_per_x_mesh_pnt, by,
1015+
pixels_per_x_mesh_pnt, pixels_per_y_mesh_pnt
10161016
);
10171017

10181018
// Put Relevant Text on Display

0 commit comments

Comments
 (0)