|
@@ -47,6 +47,7 @@
|
47
|
47
|
|
48
|
48
|
#include "../marlinui.h"
|
49
|
49
|
#include "../../gcode/queue.h"
|
|
50
|
+#include "../../gcode/gcode.h"
|
50
|
51
|
#include "../../module/motion.h"
|
51
|
52
|
#include "../../module/planner.h"
|
52
|
53
|
#include "../../module/probe.h"
|
|
@@ -353,14 +354,9 @@ namespace ExtUI {
|
353
|
354
|
|
354
|
355
|
extruder_t getTool(const uint8_t extruder) {
|
355
|
356
|
switch (extruder) {
|
356
|
|
- case 7: return E7;
|
357
|
|
- case 6: return E6;
|
358
|
|
- case 5: return E5;
|
359
|
|
- case 4: return E4;
|
360
|
|
- case 3: return E3;
|
361
|
|
- case 2: return E2;
|
362
|
|
- case 1: return E1;
|
363
|
|
- default: return E0;
|
|
357
|
+ default:
|
|
358
|
+ case 0: return E0; case 1: return E1; case 2: return E2; case 3: return E3;
|
|
359
|
+ case 4: return E4; case 5: return E5; case 6: return E6; case 7: return E7;
|
364
|
360
|
}
|
365
|
361
|
}
|
366
|
362
|
|
|
@@ -372,8 +368,8 @@ namespace ExtUI {
|
372
|
368
|
switch (axis) {
|
373
|
369
|
#if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING)
|
374
|
370
|
case X: return axis_should_home(X_AXIS);
|
375
|
|
- case Y: return axis_should_home(Y_AXIS);
|
376
|
|
- case Z: return axis_should_home(Z_AXIS);
|
|
371
|
+ OPTCODE(HAS_Y_AXIS, case Y: return axis_should_home(Y_AXIS))
|
|
372
|
+ OPTCODE(HAS_Z_AXIS, case Z: return axis_should_home(Z_AXIS))
|
377
|
373
|
#else
|
378
|
374
|
case X: case Y: case Z: return true;
|
379
|
375
|
#endif
|
|
@@ -385,6 +381,8 @@ namespace ExtUI {
|
385
|
381
|
return !thermalManager.tooColdToExtrude(extruder - E0);
|
386
|
382
|
}
|
387
|
383
|
|
|
384
|
+ GcodeSuite::MarlinBusyState getMachineBusyState() { return TERN0(HOST_KEEPALIVE_FEATURE, GcodeSuite::busy_state); }
|
|
385
|
+
|
388
|
386
|
#if HAS_SOFTWARE_ENDSTOPS
|
389
|
387
|
bool getSoftEndstopState() { return soft_endstop._enabled; }
|
390
|
388
|
void setSoftEndstopState(const bool value) { soft_endstop._enabled = value; }
|
|
@@ -396,18 +394,27 @@ namespace ExtUI {
|
396
|
394
|
#if AXIS_IS_TMC(X)
|
397
|
395
|
case X: return stepperX.getMilliamps();
|
398
|
396
|
#endif
|
399
|
|
- #if AXIS_IS_TMC(X2)
|
400
|
|
- case X2: return stepperX2.getMilliamps();
|
401
|
|
- #endif
|
402
|
397
|
#if AXIS_IS_TMC(Y)
|
403
|
398
|
case Y: return stepperY.getMilliamps();
|
404
|
399
|
#endif
|
405
|
|
- #if AXIS_IS_TMC(Y2)
|
406
|
|
- case Y2: return stepperY2.getMilliamps();
|
407
|
|
- #endif
|
408
|
400
|
#if AXIS_IS_TMC(Z)
|
409
|
401
|
case Z: return stepperZ.getMilliamps();
|
410
|
402
|
#endif
|
|
403
|
+ #if AXIS_IS_TMC(I)
|
|
404
|
+ case I: return stepperI.getMilliamps();
|
|
405
|
+ #endif
|
|
406
|
+ #if AXIS_IS_TMC(J)
|
|
407
|
+ case J: return stepperJ.getMilliamps();
|
|
408
|
+ #endif
|
|
409
|
+ #if AXIS_IS_TMC(K)
|
|
410
|
+ case K: return stepperK.getMilliamps();
|
|
411
|
+ #endif
|
|
412
|
+ #if AXIS_IS_TMC(X2)
|
|
413
|
+ case X2: return stepperX2.getMilliamps();
|
|
414
|
+ #endif
|
|
415
|
+ #if AXIS_IS_TMC(Y2)
|
|
416
|
+ case Y2: return stepperY2.getMilliamps();
|
|
417
|
+ #endif
|
411
|
418
|
#if AXIS_IS_TMC(Z2)
|
412
|
419
|
case Z2: return stepperZ2.getMilliamps();
|
413
|
420
|
#endif
|
|
@@ -450,18 +457,27 @@ namespace ExtUI {
|
450
|
457
|
#if AXIS_IS_TMC(X)
|
451
|
458
|
case X: stepperX.rms_current(constrain(mA, 400, 1500)); break;
|
452
|
459
|
#endif
|
453
|
|
- #if AXIS_IS_TMC(X2)
|
454
|
|
- case X2: stepperX2.rms_current(constrain(mA, 400, 1500)); break;
|
455
|
|
- #endif
|
456
|
460
|
#if AXIS_IS_TMC(Y)
|
457
|
461
|
case Y: stepperY.rms_current(constrain(mA, 400, 1500)); break;
|
458
|
462
|
#endif
|
459
|
|
- #if AXIS_IS_TMC(Y2)
|
460
|
|
- case Y2: stepperY2.rms_current(constrain(mA, 400, 1500)); break;
|
461
|
|
- #endif
|
462
|
463
|
#if AXIS_IS_TMC(Z)
|
463
|
464
|
case Z: stepperZ.rms_current(constrain(mA, 400, 1500)); break;
|
464
|
465
|
#endif
|
|
466
|
+ #if AXIS_IS_TMC(I)
|
|
467
|
+ case I: stepperI.rms_current(constrain(mA, 400, 1500)); break;
|
|
468
|
+ #endif
|
|
469
|
+ #if AXIS_IS_TMC(J)
|
|
470
|
+ case J: stepperJ.rms_current(constrain(mA, 400, 1500)); break;
|
|
471
|
+ #endif
|
|
472
|
+ #if AXIS_IS_TMC(K)
|
|
473
|
+ case K: stepperK.rms_current(constrain(mA, 400, 1500)); break;
|
|
474
|
+ #endif
|
|
475
|
+ #if AXIS_IS_TMC(X2)
|
|
476
|
+ case X2: stepperX2.rms_current(constrain(mA, 400, 1500)); break;
|
|
477
|
+ #endif
|
|
478
|
+ #if AXIS_IS_TMC(Y2)
|
|
479
|
+ case Y2: stepperY2.rms_current(constrain(mA, 400, 1500)); break;
|
|
480
|
+ #endif
|
465
|
481
|
#if AXIS_IS_TMC(Z2)
|
466
|
482
|
case Z2: stepperZ2.rms_current(constrain(mA, 400, 1500)); break;
|
467
|
483
|
#endif
|
|
@@ -501,66 +517,59 @@ namespace ExtUI {
|
501
|
517
|
|
502
|
518
|
int getTMCBumpSensitivity(const axis_t axis) {
|
503
|
519
|
switch (axis) {
|
504
|
|
- #if ENABLED(X_SENSORLESS)
|
505
|
|
- case X: return stepperX.homing_threshold();
|
|
520
|
+ OPTCODE(X_SENSORLESS, case X: return stepperX.homing_threshold())
|
|
521
|
+ OPTCODE(Y_SENSORLESS, case Y: return stepperY.homing_threshold())
|
|
522
|
+ OPTCODE(Z_SENSORLESS, case Z: return stepperZ.homing_threshold())
|
|
523
|
+ OPTCODE(I_SENSORLESS, case I: return stepperI.homing_threshold())
|
|
524
|
+ OPTCODE(J_SENSORLESS, case J: return stepperJ.homing_threshold())
|
|
525
|
+ OPTCODE(K_SENSORLESS, case K: return stepperK.homing_threshold())
|
|
526
|
+ OPTCODE(X2_SENSORLESS, case X2: return stepperX2.homing_threshold())
|
|
527
|
+ OPTCODE(Y2_SENSORLESS, case Y2: return stepperY2.homing_threshold())
|
|
528
|
+ OPTCODE(Z2_SENSORLESS, case Z2: return stepperZ2.homing_threshold())
|
|
529
|
+ OPTCODE(Z3_SENSORLESS, case Z3: return stepperZ3.homing_threshold())
|
|
530
|
+ OPTCODE(Z4_SENSORLESS, case Z4: return stepperZ4.homing_threshold())
|
|
531
|
+ default: return 0;
|
|
532
|
+ }
|
|
533
|
+ }
|
|
534
|
+
|
|
535
|
+ void setTMCBumpSensitivity(const_float_t value, const axis_t axis) {
|
|
536
|
+ switch (axis) {
|
|
537
|
+ #if X_SENSORLESS
|
|
538
|
+ case X: stepperX.homing_threshold(value); break;
|
506
|
539
|
#endif
|
507
|
|
- #if ENABLED(X2_SENSORLESS)
|
508
|
|
- case X2: return stepperX2.homing_threshold();
|
|
540
|
+ #if Y_SENSORLESS
|
|
541
|
+ case Y: stepperY.homing_threshold(value); break;
|
509
|
542
|
#endif
|
510
|
|
- #if ENABLED(Y_SENSORLESS)
|
511
|
|
- case Y: return stepperY.homing_threshold();
|
|
543
|
+ #if Z_SENSORLESS
|
|
544
|
+ case Z: stepperZ.homing_threshold(value); break;
|
512
|
545
|
#endif
|
513
|
|
- #if ENABLED(Y2_SENSORLESS)
|
514
|
|
- case Y2: return stepperY2.homing_threshold();
|
|
546
|
+ #if I_SENSORLESS
|
|
547
|
+ case I: stepperI.homing_threshold(value); break;
|
515
|
548
|
#endif
|
516
|
|
- #if ENABLED(Z_SENSORLESS)
|
517
|
|
- case Z: return stepperZ.homing_threshold();
|
|
549
|
+ #if J_SENSORLESS
|
|
550
|
+ case J: stepperJ.homing_threshold(value); break;
|
518
|
551
|
#endif
|
519
|
|
- #if ENABLED(Z2_SENSORLESS)
|
520
|
|
- case Z2: return stepperZ2.homing_threshold();
|
|
552
|
+ #if K_SENSORLESS
|
|
553
|
+ case K: stepperK.homing_threshold(value); break;
|
521
|
554
|
#endif
|
522
|
|
- #if ENABLED(Z3_SENSORLESS)
|
523
|
|
- case Z3: return stepperZ3.homing_threshold();
|
|
555
|
+ #if X2_SENSORLESS
|
|
556
|
+ case X2: stepperX2.homing_threshold(value); break;
|
524
|
557
|
#endif
|
525
|
|
- #if ENABLED(Z4_SENSORLESS)
|
526
|
|
- case Z4: return stepperZ4.homing_threshold();
|
|
558
|
+ #if Y2_SENSORLESS
|
|
559
|
+ case Y2: stepperY2.homing_threshold(value); break;
|
527
|
560
|
#endif
|
528
|
|
- default: return 0;
|
529
|
|
- }
|
530
|
|
- }
|
531
|
|
-
|
532
|
|
- void setTMCBumpSensitivity(const_float_t value, const axis_t axis) {
|
533
|
|
- switch (axis) {
|
534
|
|
- #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS
|
535
|
|
- #if X_SENSORLESS
|
536
|
|
- case X: stepperX.homing_threshold(value); break;
|
537
|
|
- #endif
|
538
|
|
- #if X2_SENSORLESS
|
539
|
|
- case X2: stepperX2.homing_threshold(value); break;
|
540
|
|
- #endif
|
541
|
|
- #if Y_SENSORLESS
|
542
|
|
- case Y: stepperY.homing_threshold(value); break;
|
543
|
|
- #endif
|
544
|
|
- #if Y2_SENSORLESS
|
545
|
|
- case Y2: stepperY2.homing_threshold(value); break;
|
546
|
|
- #endif
|
547
|
|
- #if Z_SENSORLESS
|
548
|
|
- case Z: stepperZ.homing_threshold(value); break;
|
549
|
|
- #endif
|
550
|
|
- #if Z2_SENSORLESS
|
551
|
|
- case Z2: stepperZ2.homing_threshold(value); break;
|
552
|
|
- #endif
|
553
|
|
- #if Z3_SENSORLESS
|
554
|
|
- case Z3: stepperZ3.homing_threshold(value); break;
|
555
|
|
- #endif
|
556
|
|
- #if Z4_SENSORLESS
|
557
|
|
- case Z4: stepperZ4.homing_threshold(value); break;
|
558
|
|
- #endif
|
559
|
|
- #else
|
560
|
|
- UNUSED(value);
|
|
561
|
+ #if Z2_SENSORLESS
|
|
562
|
+ case Z2: stepperZ2.homing_threshold(value); break;
|
|
563
|
+ #endif
|
|
564
|
+ #if Z3_SENSORLESS
|
|
565
|
+ case Z3: stepperZ3.homing_threshold(value); break;
|
|
566
|
+ #endif
|
|
567
|
+ #if Z4_SENSORLESS
|
|
568
|
+ case Z4: stepperZ4.homing_threshold(value); break;
|
561
|
569
|
#endif
|
562
|
570
|
default: break;
|
563
|
571
|
}
|
|
572
|
+ UNUSED(value);
|
564
|
573
|
}
|
565
|
574
|
#endif
|
566
|
575
|
|
|
@@ -661,9 +670,7 @@ namespace ExtUI {
|
661
|
670
|
|
662
|
671
|
#if HAS_JUNCTION_DEVIATION
|
663
|
672
|
|
664
|
|
- float getJunctionDeviation_mm() {
|
665
|
|
- return planner.junction_deviation_mm;
|
666
|
|
- }
|
|
673
|
+ float getJunctionDeviation_mm() { return planner.junction_deviation_mm; }
|
667
|
674
|
|
668
|
675
|
void setJunctionDeviation_mm(const_float_t value) {
|
669
|
676
|
planner.junction_deviation_mm = constrain(value, 0.001, 0.3);
|
|
@@ -682,7 +689,7 @@ namespace ExtUI {
|
682
|
689
|
#endif
|
683
|
690
|
|
684
|
691
|
#if PREHEAT_COUNT
|
685
|
|
- uint16_t getMaterial_preset_E(const uint16_t index) { return ui.material_preset[index].hotend_temp; }
|
|
692
|
+ uint16_t getMaterial_preset_E(const uint16_t index) { return ui.material_preset[index].hotend_temp; }
|
686
|
693
|
#if HAS_HEATED_BED
|
687
|
694
|
uint16_t getMaterial_preset_B(const uint16_t index) { return ui.material_preset[index].bed_temp; }
|
688
|
695
|
#endif
|
|
@@ -709,9 +716,13 @@ namespace ExtUI {
|
709
|
716
|
switch (axis) {
|
710
|
717
|
#if ENABLED(BABYSTEP_XY)
|
711
|
718
|
case X: babystep.add_steps(X_AXIS, steps); break;
|
712
|
|
- case Y: babystep.add_steps(Y_AXIS, steps); break;
|
|
719
|
+ #if HAS_Y_AXIS
|
|
720
|
+ case Y: babystep.add_steps(Y_AXIS, steps); break;
|
|
721
|
+ #endif
|
|
722
|
+ #endif
|
|
723
|
+ #if HAS_Z_AXIS
|
|
724
|
+ case Z: babystep.add_steps(Z_AXIS, steps); break;
|
713
|
725
|
#endif
|
714
|
|
- case Z: babystep.add_steps(Z_AXIS, steps); break;
|
715
|
726
|
default: return false;
|
716
|
727
|
};
|
717
|
728
|
return true;
|
|
@@ -750,8 +761,8 @@ namespace ExtUI {
|
750
|
761
|
hotend_offset[e][axis] += mm;
|
751
|
762
|
|
752
|
763
|
normalizeNozzleOffset(X);
|
753
|
|
- normalizeNozzleOffset(Y);
|
754
|
|
- normalizeNozzleOffset(Z);
|
|
764
|
+ TERN_(HAS_Y_AXIS, normalizeNozzleOffset(Y));
|
|
765
|
+ TERN_(HAS_Z_AXIS, normalizeNozzleOffset(Z));
|
755
|
766
|
}
|
756
|
767
|
#else
|
757
|
768
|
UNUSED(linked_nozzles);
|
|
@@ -1014,8 +1025,7 @@ namespace ExtUI {
|
1014
|
1025
|
TERN_(HAS_FAN, thermalManager.zero_fan_speeds());
|
1015
|
1026
|
}
|
1016
|
1027
|
|
1017
|
|
- bool awaitingUserConfirm() { return wait_for_user; }
|
1018
|
|
-
|
|
1028
|
+ bool awaitingUserConfirm() { return TERN0(HAS_RESUME_CONTINUE, wait_for_user); }
|
1019
|
1029
|
void setUserConfirmed() { TERN_(HAS_RESUME_CONTINUE, wait_for_user = false); }
|
1020
|
1030
|
|
1021
|
1031
|
void printFile(const char *filename) {
|
|
@@ -1038,9 +1048,9 @@ namespace ExtUI {
|
1038
|
1048
|
|
1039
|
1049
|
bool isMediaInserted() { return TERN0(SDSUPPORT, IS_SD_INSERTED() && card.isMounted()); }
|
1040
|
1050
|
|
1041
|
|
- void pausePrint() { ui.pause_print(); }
|
|
1051
|
+ void pausePrint() { ui.pause_print(); }
|
1042
|
1052
|
void resumePrint() { ui.resume_print(); }
|
1043
|
|
- void stopPrint() { ui.abort_print(); }
|
|
1053
|
+ void stopPrint() { ui.abort_print(); }
|
1044
|
1054
|
|
1045
|
1055
|
void onUserConfirmRequired_P(PGM_P const pstr) {
|
1046
|
1056
|
char msg[strlen_P(pstr) + 1];
|