|
@@ -152,7 +152,7 @@
|
152
|
152
|
bool turn_on_heaters();
|
153
|
153
|
bool prime_nozzle();
|
154
|
154
|
|
155
|
|
- static uint16_t circle_flags[16], horizontal_mesh_line_flags[16], vertical_mesh_line_flags[16], continue_with_closest = 0;
|
|
155
|
+ static uint16_t circle_flags[16], horizontal_mesh_line_flags[16], vertical_mesh_line_flags[16];
|
156
|
156
|
float g26_e_axis_feedrate = 0.020,
|
157
|
157
|
random_deviation = 0.0,
|
158
|
158
|
layer_height = LAYER_HEIGHT;
|
|
@@ -176,7 +176,7 @@
|
176
|
176
|
|
177
|
177
|
static int8_t prime_flag = 0;
|
178
|
178
|
|
179
|
|
- static bool keep_heaters_on = false;
|
|
179
|
+ static bool continue_with_closest, keep_heaters_on;
|
180
|
180
|
|
181
|
181
|
static int16_t g26_repeats;
|
182
|
182
|
|
|
@@ -361,7 +361,7 @@
|
361
|
361
|
|
362
|
362
|
//debug_current_and_destination(PSTR("Done with current circle."));
|
363
|
363
|
|
364
|
|
- } while (location.x_index >= 0 && location.y_index >= 0 && g26_repeats--);
|
|
364
|
+ } while (--g26_repeats && location.x_index >= 0 && location.y_index >= 0);
|
365
|
365
|
|
366
|
366
|
LEAVE:
|
367
|
367
|
lcd_reset_alert_level();
|
|
@@ -623,8 +623,8 @@
|
623
|
623
|
|
624
|
624
|
//if (ubl.g26_debug_flag) SERIAL_ECHOLNPGM(" Z bumping by 0.500 to minimize scraping.");
|
625
|
625
|
//todo: parameterize the bump height with a define
|
626
|
|
- move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]+0.500, 0.0); // Z bump to minimize scraping
|
627
|
|
- move_to(sx, sy, sz+0.500, 0.0); // Get to the starting point with no extrusion while bumped
|
|
626
|
+ move_to(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] + 0.500, 0.0); // Z bump to minimize scraping
|
|
627
|
+ move_to(sx, sy, sz + 0.500, 0.0); // Get to the starting point with no extrusion while bumped
|
628
|
628
|
}
|
629
|
629
|
|
630
|
630
|
move_to(sx, sy, sz, 0.0); // Get to the starting point with no extrusion / un-Z bump
|
|
@@ -655,9 +655,11 @@
|
655
|
655
|
prime_length = PRIME_LENGTH;
|
656
|
656
|
bed_temp = BED_TEMP;
|
657
|
657
|
hotend_temp = HOTEND_TEMP;
|
658
|
|
- ooze_amount = OOZE_AMOUNT;
|
659
|
658
|
prime_flag = 0;
|
660
|
|
- keep_heaters_on = false;
|
|
659
|
+
|
|
660
|
+ ooze_amount = code_seen('O') && code_has_value() ? code_value_linear_units() : OOZE_AMOUNT;
|
|
661
|
+ keep_heaters_on = code_seen('K') && code_value_bool();
|
|
662
|
+ continue_with_closest = code_seen('C') && code_value_bool();
|
661
|
663
|
|
662
|
664
|
if (code_seen('B')) {
|
663
|
665
|
bed_temp = code_value_temp_abs();
|
|
@@ -667,8 +669,6 @@
|
667
|
669
|
}
|
668
|
670
|
}
|
669
|
671
|
|
670
|
|
- if (code_seen('C')) continue_with_closest++;
|
671
|
|
-
|
672
|
672
|
if (code_seen('L')) {
|
673
|
673
|
layer_height = code_value_linear_units();
|
674
|
674
|
if (!WITHIN(layer_height, 0.0, 2.0)) {
|
|
@@ -699,11 +699,6 @@
|
699
|
699
|
}
|
700
|
700
|
}
|
701
|
701
|
|
702
|
|
- if (code_seen('K')) keep_heaters_on++;
|
703
|
|
-
|
704
|
|
- if (code_seen('O') && code_has_value())
|
705
|
|
- ooze_amount = code_value_linear_units();
|
706
|
|
-
|
707
|
702
|
if (code_seen('P')) {
|
708
|
703
|
if (!code_has_value())
|
709
|
704
|
prime_flag = -1;
|
|
@@ -740,33 +735,19 @@
|
740
|
735
|
|
741
|
736
|
if (code_seen('M')) {
|
742
|
737
|
randomSeed(millis());
|
|
738
|
+ // This setting will persist for the next G26
|
743
|
739
|
random_deviation = code_has_value() ? code_value_float() : 50.0;
|
744
|
740
|
}
|
745
|
741
|
|
746
|
|
- if (code_seen('R')) {
|
747
|
|
- g26_repeats = code_has_value() ? code_value_int() : 999;
|
748
|
|
-
|
749
|
|
- if (g26_repeats <= 0) {
|
750
|
|
- SERIAL_PROTOCOLLNPGM("?(R)epeat value not plausible; must be greater than 0.");
|
751
|
|
- return UBL_ERR;
|
752
|
|
- }
|
753
|
|
-
|
754
|
|
- g26_repeats--;
|
755
|
|
- }
|
756
|
|
-
|
757
|
|
-
|
758
|
|
- x_pos = current_position[X_AXIS];
|
759
|
|
- y_pos = current_position[Y_AXIS];
|
760
|
|
-
|
761
|
|
- if (code_seen('X')) {
|
762
|
|
- x_pos = code_value_float();
|
763
|
|
- }
|
764
|
|
-
|
765
|
|
- if (code_seen('Y')) {
|
766
|
|
- y_pos = code_value_float();
|
|
742
|
+ g26_repeats = code_seen('R') ? (code_has_value() ? code_value_int() : 999) : 1;
|
|
743
|
+ if (g26_repeats < 1) {
|
|
744
|
+ SERIAL_PROTOCOLLNPGM("?(R)epeat value not plausible; must be at least 1.");
|
|
745
|
+ return UBL_ERR;
|
767
|
746
|
}
|
768
|
747
|
|
769
|
|
- if ( ! position_is_reachable_xy( x_pos, y_pos )) {
|
|
748
|
+ x_pos = code_seen('X') ? code_value_linear_units() : current_position[X_AXIS];
|
|
749
|
+ y_pos = code_seen('Y') ? code_value_linear_units() : current_position[Y_AXIS];
|
|
750
|
+ if (!position_is_reachable_xy(x_pos, y_pos)) {
|
770
|
751
|
SERIAL_PROTOCOLLNPGM("?Specified X,Y coordinate out of bounds.");
|
771
|
752
|
return UBL_ERR;
|
772
|
753
|
}
|