|
@@ -126,6 +126,8 @@
|
126
|
126
|
void set_destination_to_current();
|
127
|
127
|
void set_current_to_destination();
|
128
|
128
|
float code_value_float();
|
|
129
|
+ float code_value_linear_units();
|
|
130
|
+ float code_value_axis_units(const AxisEnum axis);
|
129
|
131
|
bool code_value_bool();
|
130
|
132
|
bool code_has_value();
|
131
|
133
|
void lcd_init();
|
|
@@ -164,10 +166,11 @@
|
164
|
166
|
filament_diameter = FILAMENT,
|
165
|
167
|
prime_length = PRIME_LENGTH,
|
166
|
168
|
x_pos, y_pos,
|
167
|
|
- bed_temp = BED_TEMP,
|
168
|
|
- hotend_temp = HOTEND_TEMP,
|
169
|
169
|
ooze_amount = OOZE_AMOUNT;
|
170
|
170
|
|
|
171
|
+ static int16_t bed_temp = BED_TEMP,
|
|
172
|
+ hotend_temp = HOTEND_TEMP;
|
|
173
|
+
|
171
|
174
|
static int8_t prime_flag = 0;
|
172
|
175
|
|
173
|
176
|
static bool keep_heaters_on = false;
|
|
@@ -379,9 +382,9 @@
|
379
|
382
|
|
380
|
383
|
if (!keep_heaters_on) {
|
381
|
384
|
#if HAS_TEMP_BED
|
382
|
|
- thermalManager.setTargetBed(0.0);
|
|
385
|
+ thermalManager.setTargetBed(0);
|
383
|
386
|
#endif
|
384
|
|
- thermalManager.setTargetHotend(0.0, 0);
|
|
387
|
+ thermalManager.setTargetHotend(0, 0);
|
385
|
388
|
}
|
386
|
389
|
}
|
387
|
390
|
|
|
@@ -640,8 +643,8 @@
|
640
|
643
|
keep_heaters_on = false;
|
641
|
644
|
|
642
|
645
|
if (code_seen('B')) {
|
643
|
|
- bed_temp = code_value_float();
|
644
|
|
- if (!WITHIN(bed_temp, 15.0, 140.0)) {
|
|
646
|
+ bed_temp = code_value_temp_abs();
|
|
647
|
+ if (!WITHIN(bed_temp, 15, 140)) {
|
645
|
648
|
SERIAL_PROTOCOLLNPGM("?Specified bed temperature not plausible.");
|
646
|
649
|
return UBL_ERR;
|
647
|
650
|
}
|
|
@@ -650,7 +653,7 @@
|
650
|
653
|
if (code_seen('C')) continue_with_closest++;
|
651
|
654
|
|
652
|
655
|
if (code_seen('L')) {
|
653
|
|
- layer_height = code_value_float();
|
|
656
|
+ layer_height = code_value_linear_units();
|
654
|
657
|
if (!WITHIN(layer_height, 0.0, 2.0)) {
|
655
|
658
|
SERIAL_PROTOCOLLNPGM("?Specified layer height not plausible.");
|
656
|
659
|
return UBL_ERR;
|
|
@@ -682,14 +685,14 @@
|
682
|
685
|
if (code_seen('K')) keep_heaters_on++;
|
683
|
686
|
|
684
|
687
|
if (code_seen('O') && code_has_value())
|
685
|
|
- ooze_amount = code_value_float();
|
|
688
|
+ ooze_amount = code_value_linear_units();
|
686
|
689
|
|
687
|
690
|
if (code_seen('P')) {
|
688
|
691
|
if (!code_has_value())
|
689
|
692
|
prime_flag = -1;
|
690
|
693
|
else {
|
691
|
694
|
prime_flag++;
|
692
|
|
- prime_length = code_value_float();
|
|
695
|
+ prime_length = code_value_linear_units();
|
693
|
696
|
if (!WITHIN(prime_length, 0.0, 25.0)) {
|
694
|
697
|
SERIAL_PROTOCOLLNPGM("?Specified prime length not plausible.");
|
695
|
698
|
return UBL_ERR;
|
|
@@ -698,7 +701,7 @@
|
698
|
701
|
}
|
699
|
702
|
|
700
|
703
|
if (code_seen('F')) {
|
701
|
|
- filament_diameter = code_value_float();
|
|
704
|
+ filament_diameter = code_value_linear_units();
|
702
|
705
|
if (!WITHIN(filament_diameter, 1.0, 4.0)) {
|
703
|
706
|
SERIAL_PROTOCOLLNPGM("?Specified filament size not plausible.");
|
704
|
707
|
return UBL_ERR;
|
|
@@ -711,8 +714,8 @@
|
711
|
714
|
extrusion_multiplier *= filament_diameter * sq(nozzle) / sq(0.3); // Scale up by nozzle size
|
712
|
715
|
|
713
|
716
|
if (code_seen('H')) {
|
714
|
|
- hotend_temp = code_value_float();
|
715
|
|
- if (!WITHIN(hotend_temp, 165.0, 280.0)) {
|
|
717
|
+ hotend_temp = code_value_temp_abs();
|
|
718
|
+ if (!WITHIN(hotend_temp, 165, 280)) {
|
716
|
719
|
SERIAL_PROTOCOLLNPGM("?Specified nozzle temperature not plausible.");
|
717
|
720
|
return UBL_ERR;
|
718
|
721
|
}
|
|
@@ -727,7 +730,7 @@
|
727
|
730
|
y_pos = current_position[Y_AXIS];
|
728
|
731
|
|
729
|
732
|
if (code_seen('X')) {
|
730
|
|
- x_pos = code_value_float();
|
|
733
|
+ x_pos = code_value_axis_units(X_AXIS);
|
731
|
734
|
if (!WITHIN(x_pos, X_MIN_POS, X_MAX_POS)) {
|
732
|
735
|
SERIAL_PROTOCOLLNPGM("?Specified X coordinate not plausible.");
|
733
|
736
|
return UBL_ERR;
|
|
@@ -736,7 +739,7 @@
|
736
|
739
|
else
|
737
|
740
|
|
738
|
741
|
if (code_seen('Y')) {
|
739
|
|
- y_pos = code_value_float();
|
|
742
|
+ y_pos = code_value_axis_units(Y_AXIS);
|
740
|
743
|
if (!WITHIN(y_pos, Y_MIN_POS, Y_MAX_POS)) {
|
741
|
744
|
SERIAL_PROTOCOLLNPGM("?Specified Y coordinate not plausible.");
|
742
|
745
|
return UBL_ERR;
|