|
@@ -26,15 +26,21 @@
|
26
|
26
|
|
27
|
27
|
#include "MarlinConfig.h"
|
28
|
28
|
|
29
|
|
-#if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(UBL_G26_MESH_VALIDATION)
|
|
29
|
+#if ENABLED(G26_MESH_VALIDATION)
|
30
|
30
|
|
31
|
|
- #include "ubl.h"
|
32
|
31
|
#include "Marlin.h"
|
33
|
32
|
#include "planner.h"
|
34
|
33
|
#include "stepper.h"
|
35
|
34
|
#include "temperature.h"
|
36
|
35
|
#include "ultralcd.h"
|
37
|
36
|
#include "gcode.h"
|
|
37
|
+ #include "bitmap_flags.h"
|
|
38
|
+
|
|
39
|
+ #if ENABLED(MESH_BED_LEVELING)
|
|
40
|
+ #include "mesh_bed_leveling.h"
|
|
41
|
+ #elif ENABLED(AUTO_BED_LEVELING_UBL)
|
|
42
|
+ #include "ubl.h"
|
|
43
|
+ #endif
|
38
|
44
|
|
39
|
45
|
#define EXTRUSION_MULTIPLIER 1.0
|
40
|
46
|
#define RETRACTION_MULTIPLIER 1.0
|
|
@@ -48,6 +54,9 @@
|
48
|
54
|
#error "SIZE_OF_CROSSHAIRS must be less than SIZE_OF_INTERSECTION_CIRCLES."
|
49
|
55
|
#endif
|
50
|
56
|
|
|
57
|
+ #define G26_OK false
|
|
58
|
+ #define G26_ERROR true
|
|
59
|
+
|
51
|
60
|
/**
|
52
|
61
|
* G26 Mesh Validation Tool
|
53
|
62
|
*
|
|
@@ -146,35 +155,42 @@
|
146
|
155
|
|
147
|
156
|
static bool g26_retracted = false; // Track the retracted state of the nozzle so mismatched
|
148
|
157
|
// retracts/recovers won't result in a bad state.
|
149
|
|
-
|
150
|
158
|
float valid_trig_angle(float);
|
151
|
159
|
|
152
|
|
- float unified_bed_leveling::g26_extrusion_multiplier,
|
153
|
|
- unified_bed_leveling::g26_retraction_multiplier,
|
154
|
|
- unified_bed_leveling::g26_nozzle,
|
155
|
|
- unified_bed_leveling::g26_filament_diameter,
|
156
|
|
- unified_bed_leveling::g26_layer_height,
|
157
|
|
- unified_bed_leveling::g26_prime_length,
|
158
|
|
- unified_bed_leveling::g26_x_pos,
|
159
|
|
- unified_bed_leveling::g26_y_pos,
|
160
|
|
- unified_bed_leveling::g26_ooze_amount;
|
161
|
|
-
|
162
|
|
- int16_t unified_bed_leveling::g26_bed_temp,
|
163
|
|
- unified_bed_leveling::g26_hotend_temp;
|
164
|
|
-
|
165
|
|
- int8_t unified_bed_leveling::g26_prime_flag;
|
166
|
|
-
|
167
|
|
- bool unified_bed_leveling::g26_continue_with_closest,
|
168
|
|
- unified_bed_leveling::g26_keep_heaters_on;
|
169
|
|
-
|
170
|
|
- int16_t unified_bed_leveling::g26_repeats;
|
171
|
|
-
|
172
|
|
- void unified_bed_leveling::G26_line_to_destination(const float &feed_rate) {
|
|
160
|
+ void G26_line_to_destination(const float &feed_rate) {
|
173
|
161
|
const float save_feedrate = feedrate_mm_s;
|
174
|
162
|
feedrate_mm_s = feed_rate; // use specified feed rate
|
175
|
|
- prepare_move_to_destination(); // will ultimately call ubl.line_to_destination_cartesian or ubl.prepare_linear_move_to for UBL_DELTA
|
|
163
|
+ prepare_move_to_destination(); // will ultimately call ubl.line_to_destination_cartesian for UBL or ubl.prepare_linear_move_to for UBL_DELTA
|
176
|
164
|
feedrate_mm_s = save_feedrate; // restore global feed rate
|
177
|
165
|
}
|
|
166
|
+ static bool exit_from_g26();
|
|
167
|
+ static bool parse_G26_parameters();
|
|
168
|
+ static mesh_index_pair find_closest_circle_to_print(const float&, const float&);
|
|
169
|
+ static bool look_for_lines_to_connect();
|
|
170
|
+ static bool turn_on_heaters();
|
|
171
|
+ static bool prime_nozzle();
|
|
172
|
+ static void retract_filament(const float where[XYZE]);
|
|
173
|
+ static void recover_filament(const float where[XYZE]);
|
|
174
|
+ static void print_line_from_here_to_there(const float&, const float&, const float&, const float&, const float&, const float&);
|
|
175
|
+ static void move_to(const float&, const float&, const float&, const float&);
|
|
176
|
+ #if ENABLED(NEWPANEL)
|
|
177
|
+ extern bool ubl_lcd_clicked();
|
|
178
|
+ #endif
|
|
179
|
+ static void move_to(const float where[XYZE], const float &de) { move_to(where[X_AXIS], where[Y_AXIS], where[Z_AXIS], de); }
|
|
180
|
+
|
|
181
|
+ static float g26_extrusion_multiplier,
|
|
182
|
+ g26_retraction_multiplier,
|
|
183
|
+ g26_nozzle,
|
|
184
|
+ g26_filament_diameter,
|
|
185
|
+ g26_prime_length,
|
|
186
|
+ g26_x_pos, g26_y_pos,
|
|
187
|
+ g26_ooze_amount,
|
|
188
|
+ g26_layer_height;
|
|
189
|
+ static int16_t g26_bed_temp,
|
|
190
|
+ g26_hotend_temp,
|
|
191
|
+ g26_repeats;
|
|
192
|
+ static int8_t g26_prime_flag;
|
|
193
|
+ static bool g26_continue_with_closest, g26_keep_heaters_on;
|
178
|
194
|
|
179
|
195
|
#if ENABLED(NEWPANEL)
|
180
|
196
|
/**
|
|
@@ -207,7 +223,7 @@
|
207
|
223
|
* Used to interactively edit UBL's Mesh by placing the
|
208
|
224
|
* nozzle in a problem area and doing a G29 P4 R command.
|
209
|
225
|
*/
|
210
|
|
- void unified_bed_leveling::G26() {
|
|
226
|
+ void gcode_G26() {
|
211
|
227
|
SERIAL_ECHOLNPGM("G26 command started. Waiting for heater(s).");
|
212
|
228
|
float tmp, start_angle, end_angle;
|
213
|
229
|
int i, xi, yi;
|
|
@@ -250,7 +266,10 @@
|
250
|
266
|
move_to(destination, 0.0);
|
251
|
267
|
move_to(destination, g26_ooze_amount);
|
252
|
268
|
|
253
|
|
- has_control_of_lcd_panel = true;
|
|
269
|
+ #if ENABLED(ULTRA_LCD)
|
|
270
|
+ lcd_external_control = true;
|
|
271
|
+ #endif
|
|
272
|
+
|
254
|
273
|
//debug_current_and_destination(PSTR("Starting G26 Mesh Validation Pattern."));
|
255
|
274
|
|
256
|
275
|
/**
|
|
@@ -269,8 +288,8 @@
|
269
|
288
|
: find_closest_circle_to_print(g26_x_pos, g26_y_pos); // Find the closest Mesh Intersection to where we are now.
|
270
|
289
|
|
271
|
290
|
if (location.x_index >= 0 && location.y_index >= 0) {
|
272
|
|
- const float circle_x = mesh_index_to_xpos(location.x_index),
|
273
|
|
- circle_y = mesh_index_to_ypos(location.y_index);
|
|
291
|
+ const float circle_x = _GET_MESH_X(location.x_index),
|
|
292
|
+ circle_y = _GET_MESH_Y(location.y_index);
|
274
|
293
|
|
275
|
294
|
// If this mesh location is outside the printable_radius, skip it.
|
276
|
295
|
|
|
@@ -373,7 +392,9 @@
|
373
|
392
|
move_to(destination, 0); // Move back to the starting position
|
374
|
393
|
//debug_current_and_destination(PSTR("done doing X/Y move."));
|
375
|
394
|
|
376
|
|
- has_control_of_lcd_panel = false; // Give back control of the LCD Panel!
|
|
395
|
+ #if ENABLED(ULTRA_LCD)
|
|
396
|
+ lcd_external_control = false; // Give back control of the LCD Panel!
|
|
397
|
+ #endif
|
377
|
398
|
|
378
|
399
|
if (!g26_keep_heaters_on) {
|
379
|
400
|
#if HAS_TEMP_BED
|
|
@@ -389,7 +410,7 @@
|
389
|
410
|
return d;
|
390
|
411
|
}
|
391
|
412
|
|
392
|
|
- mesh_index_pair unified_bed_leveling::find_closest_circle_to_print(const float &X, const float &Y) {
|
|
413
|
+ mesh_index_pair find_closest_circle_to_print(const float &X, const float &Y) {
|
393
|
414
|
float closest = 99999.99;
|
394
|
415
|
mesh_index_pair return_val;
|
395
|
416
|
|
|
@@ -398,8 +419,8 @@
|
398
|
419
|
for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
|
399
|
420
|
for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) {
|
400
|
421
|
if (!is_bit_set(circle_flags, i, j)) {
|
401
|
|
- const float mx = mesh_index_to_xpos(i), // We found a circle that needs to be printed
|
402
|
|
- my = mesh_index_to_ypos(j);
|
|
422
|
+ const float mx = _GET_MESH_X(i), // We found a circle that needs to be printed
|
|
423
|
+ my = _GET_MESH_Y(j);
|
403
|
424
|
|
404
|
425
|
// Get the distance to this intersection
|
405
|
426
|
float f = HYPOT(X - mx, Y - my);
|
|
@@ -427,7 +448,7 @@
|
427
|
448
|
return return_val;
|
428
|
449
|
}
|
429
|
450
|
|
430
|
|
- bool unified_bed_leveling::look_for_lines_to_connect() {
|
|
451
|
+ bool look_for_lines_to_connect() {
|
431
|
452
|
float sx, sy, ex, ey;
|
432
|
453
|
|
433
|
454
|
for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
|
|
@@ -447,11 +468,11 @@
|
447
|
468
|
// We found two circles that need a horizontal line to connect them
|
448
|
469
|
// Print it!
|
449
|
470
|
//
|
450
|
|
- sx = mesh_index_to_xpos( i ) + (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // right edge
|
451
|
|
- ex = mesh_index_to_xpos(i + 1) - (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // left edge
|
|
471
|
+ sx = _GET_MESH_X( i ) + (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // right edge
|
|
472
|
+ ex = _GET_MESH_X(i + 1) - (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // left edge
|
452
|
473
|
|
453
|
474
|
sx = constrain(sx, X_MIN_POS + 1, X_MAX_POS - 1);
|
454
|
|
- sy = ey = constrain(mesh_index_to_ypos(j), Y_MIN_POS + 1, Y_MAX_POS - 1);
|
|
475
|
+ sy = ey = constrain(_GET_MESH_Y(j), Y_MIN_POS + 1, Y_MAX_POS - 1);
|
455
|
476
|
ex = constrain(ex, X_MIN_POS + 1, X_MAX_POS - 1);
|
456
|
477
|
|
457
|
478
|
if (position_is_reachable(sx, sy) && position_is_reachable(ex, ey)) {
|
|
@@ -480,10 +501,10 @@
|
480
|
501
|
// We found two circles that need a vertical line to connect them
|
481
|
502
|
// Print it!
|
482
|
503
|
//
|
483
|
|
- sy = mesh_index_to_ypos( j ) + (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // top edge
|
484
|
|
- ey = mesh_index_to_ypos(j + 1) - (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // bottom edge
|
|
504
|
+ sy = _GET_MESH_Y( j ) + (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // top edge
|
|
505
|
+ ey = _GET_MESH_Y(j + 1) - (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // bottom edge
|
485
|
506
|
|
486
|
|
- sx = ex = constrain(mesh_index_to_xpos(i), X_MIN_POS + 1, X_MAX_POS - 1);
|
|
507
|
+ sx = ex = constrain(_GET_MESH_X(i), X_MIN_POS + 1, X_MAX_POS - 1);
|
487
|
508
|
sy = constrain(sy, Y_MIN_POS + 1, Y_MAX_POS - 1);
|
488
|
509
|
ey = constrain(ey, Y_MIN_POS + 1, Y_MAX_POS - 1);
|
489
|
510
|
|
|
@@ -496,7 +517,10 @@
|
496
|
517
|
SERIAL_ECHOPAIR(", ey=", ey);
|
497
|
518
|
SERIAL_CHAR(')');
|
498
|
519
|
SERIAL_EOL();
|
499
|
|
- debug_current_and_destination(PSTR("Connecting vertical line."));
|
|
520
|
+
|
|
521
|
+ #if ENABLED(AUTO_BED_LEVELING_UBL)
|
|
522
|
+ debug_current_and_destination(PSTR("Connecting vertical line."));
|
|
523
|
+ #endif
|
500
|
524
|
}
|
501
|
525
|
print_line_from_here_to_there(sx, sy, g26_layer_height, ex, ey, g26_layer_height);
|
502
|
526
|
}
|
|
@@ -510,7 +534,7 @@
|
510
|
534
|
return false;
|
511
|
535
|
}
|
512
|
536
|
|
513
|
|
- void unified_bed_leveling::move_to(const float &x, const float &y, const float &z, const float &e_delta) {
|
|
537
|
+ void move_to(const float &x, const float &y, const float &z, const float &e_delta) {
|
514
|
538
|
float feed_value;
|
515
|
539
|
static float last_z = -999.99;
|
516
|
540
|
|
|
@@ -548,14 +572,14 @@
|
548
|
572
|
|
549
|
573
|
}
|
550
|
574
|
|
551
|
|
- void unified_bed_leveling::retract_filament(const float where[XYZE]) {
|
|
575
|
+ void retract_filament(const float where[XYZE]) {
|
552
|
576
|
if (!g26_retracted) { // Only retract if we are not already retracted!
|
553
|
577
|
g26_retracted = true;
|
554
|
578
|
move_to(where, -1.0 * g26_retraction_multiplier);
|
555
|
579
|
}
|
556
|
580
|
}
|
557
|
581
|
|
558
|
|
- void unified_bed_leveling::recover_filament(const float where[XYZE]) {
|
|
582
|
+ void recover_filament(const float where[XYZE]) {
|
559
|
583
|
if (g26_retracted) { // Only un-retract if we are retracted.
|
560
|
584
|
move_to(where, 1.2 * g26_retraction_multiplier);
|
561
|
585
|
g26_retracted = false;
|
|
@@ -577,7 +601,7 @@
|
577
|
601
|
* segment of a 'circle'. The time this requires is very short and is easily saved by the other
|
578
|
602
|
* cases where the optimization comes into play.
|
579
|
603
|
*/
|
580
|
|
- 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) {
|
|
604
|
+ void print_line_from_here_to_there(const float &sx, const float &sy, const float &sz, const float &ex, const float &ey, const float &ez) {
|
581
|
605
|
const float dx_s = current_position[X_AXIS] - sx, // find our distance from the start of the actual line segment
|
582
|
606
|
dy_s = current_position[Y_AXIS] - sy,
|
583
|
607
|
dist_start = HYPOT2(dx_s, dy_s), // We don't need to do a sqrt(), we can compare the distance^2
|
|
@@ -615,7 +639,7 @@
|
615
|
639
|
* parameters it made sense to turn them into static globals and get
|
616
|
640
|
* this code out of sight of the main routine.
|
617
|
641
|
*/
|
618
|
|
- bool unified_bed_leveling::parse_G26_parameters() {
|
|
642
|
+ bool parse_G26_parameters() {
|
619
|
643
|
|
620
|
644
|
g26_extrusion_multiplier = EXTRUSION_MULTIPLIER;
|
621
|
645
|
g26_retraction_multiplier = RETRACTION_MULTIPLIER;
|
|
@@ -635,7 +659,7 @@
|
635
|
659
|
g26_bed_temp = parser.value_celsius();
|
636
|
660
|
if (!WITHIN(g26_bed_temp, 15, 140)) {
|
637
|
661
|
SERIAL_PROTOCOLLNPGM("?Specified bed temperature not plausible.");
|
638
|
|
- return UBL_ERR;
|
|
662
|
+ return G26_ERROR;
|
639
|
663
|
}
|
640
|
664
|
}
|
641
|
665
|
|
|
@@ -643,7 +667,7 @@
|
643
|
667
|
g26_layer_height = parser.value_linear_units();
|
644
|
668
|
if (!WITHIN(g26_layer_height, 0.0, 2.0)) {
|
645
|
669
|
SERIAL_PROTOCOLLNPGM("?Specified layer height not plausible.");
|
646
|
|
- return UBL_ERR;
|
|
670
|
+ return G26_ERROR;
|
647
|
671
|
}
|
648
|
672
|
}
|
649
|
673
|
|
|
@@ -652,12 +676,12 @@
|
652
|
676
|
g26_retraction_multiplier = parser.value_float();
|
653
|
677
|
if (!WITHIN(g26_retraction_multiplier, 0.05, 15.0)) {
|
654
|
678
|
SERIAL_PROTOCOLLNPGM("?Specified Retraction Multiplier not plausible.");
|
655
|
|
- return UBL_ERR;
|
|
679
|
+ return G26_ERROR;
|
656
|
680
|
}
|
657
|
681
|
}
|
658
|
682
|
else {
|
659
|
683
|
SERIAL_PROTOCOLLNPGM("?Retraction Multiplier must be specified.");
|
660
|
|
- return UBL_ERR;
|
|
684
|
+ return G26_ERROR;
|
661
|
685
|
}
|
662
|
686
|
}
|
663
|
687
|
|
|
@@ -665,7 +689,7 @@
|
665
|
689
|
g26_nozzle = parser.value_float();
|
666
|
690
|
if (!WITHIN(g26_nozzle, 0.1, 1.0)) {
|
667
|
691
|
SERIAL_PROTOCOLLNPGM("?Specified nozzle size not plausible.");
|
668
|
|
- return UBL_ERR;
|
|
692
|
+ return G26_ERROR;
|
669
|
693
|
}
|
670
|
694
|
}
|
671
|
695
|
|
|
@@ -675,7 +699,7 @@
|
675
|
699
|
g26_prime_flag = -1;
|
676
|
700
|
#else
|
677
|
701
|
SERIAL_PROTOCOLLNPGM("?Prime length must be specified when not using an LCD.");
|
678
|
|
- return UBL_ERR;
|
|
702
|
+ return G26_ERROR;
|
679
|
703
|
#endif
|
680
|
704
|
}
|
681
|
705
|
else {
|
|
@@ -683,7 +707,7 @@
|
683
|
707
|
g26_prime_length = parser.value_linear_units();
|
684
|
708
|
if (!WITHIN(g26_prime_length, 0.0, 25.0)) {
|
685
|
709
|
SERIAL_PROTOCOLLNPGM("?Specified prime length not plausible.");
|
686
|
|
- return UBL_ERR;
|
|
710
|
+ return G26_ERROR;
|
687
|
711
|
}
|
688
|
712
|
}
|
689
|
713
|
}
|
|
@@ -692,7 +716,7 @@
|
692
|
716
|
g26_filament_diameter = parser.value_linear_units();
|
693
|
717
|
if (!WITHIN(g26_filament_diameter, 1.0, 4.0)) {
|
694
|
718
|
SERIAL_PROTOCOLLNPGM("?Specified filament size not plausible.");
|
695
|
|
- return UBL_ERR;
|
|
719
|
+ return G26_ERROR;
|
696
|
720
|
}
|
697
|
721
|
}
|
698
|
722
|
g26_extrusion_multiplier *= sq(1.75) / sq(g26_filament_diameter); // If we aren't using 1.75mm filament, we need to
|
|
@@ -705,7 +729,7 @@
|
705
|
729
|
g26_hotend_temp = parser.value_celsius();
|
706
|
730
|
if (!WITHIN(g26_hotend_temp, 165, 280)) {
|
707
|
731
|
SERIAL_PROTOCOLLNPGM("?Specified nozzle temperature not plausible.");
|
708
|
|
- return UBL_ERR;
|
|
732
|
+ return G26_ERROR;
|
709
|
733
|
}
|
710
|
734
|
}
|
711
|
735
|
|
|
@@ -720,21 +744,21 @@
|
720
|
744
|
#else
|
721
|
745
|
if (!parser.seen('R')) {
|
722
|
746
|
SERIAL_PROTOCOLLNPGM("?(R)epeat must be specified when not using an LCD.");
|
723
|
|
- return UBL_ERR;
|
|
747
|
+ return G26_ERROR;
|
724
|
748
|
}
|
725
|
749
|
else
|
726
|
750
|
g26_repeats = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS + 1;
|
727
|
751
|
#endif
|
728
|
752
|
if (g26_repeats < 1) {
|
729
|
753
|
SERIAL_PROTOCOLLNPGM("?(R)epeat value not plausible; must be at least 1.");
|
730
|
|
- return UBL_ERR;
|
|
754
|
+ return G26_ERROR;
|
731
|
755
|
}
|
732
|
756
|
|
733
|
757
|
g26_x_pos = parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position[X_AXIS];
|
734
|
758
|
g26_y_pos = parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position[Y_AXIS];
|
735
|
759
|
if (!position_is_reachable(g26_x_pos, g26_y_pos)) {
|
736
|
760
|
SERIAL_PROTOCOLLNPGM("?Specified X,Y coordinate out of bounds.");
|
737
|
|
- return UBL_ERR;
|
|
761
|
+ return G26_ERROR;
|
738
|
762
|
}
|
739
|
763
|
|
740
|
764
|
/**
|
|
@@ -742,14 +766,14 @@
|
742
|
766
|
*/
|
743
|
767
|
set_bed_leveling_enabled(!parser.seen('D'));
|
744
|
768
|
|
745
|
|
- return UBL_OK;
|
|
769
|
+ return G26_OK;
|
746
|
770
|
}
|
747
|
771
|
|
748
|
772
|
#if ENABLED(NEWPANEL)
|
749
|
|
- bool unified_bed_leveling::exit_from_g26() {
|
|
773
|
+ bool exit_from_g26() {
|
750
|
774
|
lcd_setstatusPGM(PSTR("Leaving G26"), -1);
|
751
|
775
|
while (ubl_lcd_clicked()) idle();
|
752
|
|
- return UBL_ERR;
|
|
776
|
+ return G26_ERROR;
|
753
|
777
|
}
|
754
|
778
|
#endif
|
755
|
779
|
|
|
@@ -757,15 +781,15 @@
|
757
|
781
|
* Turn on the bed and nozzle heat and
|
758
|
782
|
* wait for them to get up to temperature.
|
759
|
783
|
*/
|
760
|
|
- bool unified_bed_leveling::turn_on_heaters() {
|
|
784
|
+ bool turn_on_heaters() {
|
761
|
785
|
millis_t next = millis() + 5000UL;
|
762
|
786
|
#if HAS_TEMP_BED
|
763
|
787
|
#if ENABLED(ULTRA_LCD)
|
764
|
788
|
if (g26_bed_temp > 25) {
|
765
|
789
|
lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99);
|
766
|
790
|
lcd_quick_feedback();
|
|
791
|
+ lcd_external_control = true;
|
767
|
792
|
#endif
|
768
|
|
- has_control_of_lcd_panel = true;
|
769
|
793
|
thermalManager.setTargetBed(g26_bed_temp);
|
770
|
794
|
while (abs(thermalManager.degBed() - g26_bed_temp) > 3) {
|
771
|
795
|
|
|
@@ -808,20 +832,20 @@
|
808
|
832
|
lcd_quick_feedback();
|
809
|
833
|
#endif
|
810
|
834
|
|
811
|
|
- return UBL_OK;
|
|
835
|
+ return G26_OK;
|
812
|
836
|
}
|
813
|
837
|
|
814
|
838
|
/**
|
815
|
839
|
* Prime the nozzle if needed. Return true on error.
|
816
|
840
|
*/
|
817
|
|
- bool unified_bed_leveling::prime_nozzle() {
|
|
841
|
+ bool prime_nozzle() {
|
818
|
842
|
|
819
|
843
|
#if ENABLED(NEWPANEL)
|
820
|
844
|
float Total_Prime = 0.0;
|
821
|
845
|
|
822
|
846
|
if (g26_prime_flag == -1) { // The user wants to control how much filament gets purged
|
823
|
847
|
|
824
|
|
- has_control_of_lcd_panel = true;
|
|
848
|
+ lcd_external_control = true;
|
825
|
849
|
lcd_setstatusPGM(PSTR("User-Controlled Prime"), 99);
|
826
|
850
|
chirp_at_user();
|
827
|
851
|
|
|
@@ -834,7 +858,7 @@
|
834
|
858
|
destination[E_AXIS] += 0.25;
|
835
|
859
|
#ifdef PREVENT_LENGTHY_EXTRUDE
|
836
|
860
|
Total_Prime += 0.25;
|
837
|
|
- if (Total_Prime >= EXTRUDE_MAXLENGTH) return UBL_ERR;
|
|
861
|
+ if (Total_Prime >= EXTRUDE_MAXLENGTH) return G26_ERROR;
|
838
|
862
|
#endif
|
839
|
863
|
G26_line_to_destination(planner.max_feedrate_mm_s[E_AXIS] / 15.0);
|
840
|
864
|
|
|
@@ -853,10 +877,8 @@
|
853
|
877
|
// So... We cheat to get a message up.
|
854
|
878
|
lcd_setstatusPGM(PSTR("Done Priming"), 99);
|
855
|
879
|
lcd_quick_feedback();
|
|
880
|
+ lcd_external_control = false;
|
856
|
881
|
#endif
|
857
|
|
-
|
858
|
|
- has_control_of_lcd_panel = false;
|
859
|
|
-
|
860
|
882
|
}
|
861
|
883
|
else {
|
862
|
884
|
#else
|
|
@@ -874,7 +896,7 @@
|
874
|
896
|
retract_filament(destination);
|
875
|
897
|
}
|
876
|
898
|
|
877
|
|
- return UBL_OK;
|
|
899
|
+ return G26_OK;
|
878
|
900
|
}
|
879
|
901
|
|
880
|
|
-#endif // AUTO_BED_LEVELING_UBL && UBL_G26_MESH_VALIDATION
|
|
902
|
+#endif // G26_MESH_VALIDATION
|