Browse Source

Update MMU2 code style

Scott Lahteine 6 years ago
parent
commit
fae2b7edc3

+ 1
- 1
Marlin/src/Marlin.cpp View File

@@ -723,7 +723,7 @@ void idle(
723 723
   #endif
724 724
 
725 725
   #if ENABLED(PRUSA_MMU2)
726
-    mmu2.mmuLoop();
726
+    mmu2.mmu_loop();
727 727
   #endif
728 728
 }
729 729
 

+ 40
- 40
Marlin/src/feature/prusa_MMU2/mmu2.cpp View File

@@ -90,7 +90,7 @@ bool MMU2::enabled, MMU2::ready, MMU2::mmu_print_saved;
90 90
 uint8_t MMU2::cmd, MMU2::cmd_arg, MMU2::last_cmd, MMU2::extruder;
91 91
 int8_t MMU2::state = 0;
92 92
 volatile int8_t MMU2::finda = 1;
93
-volatile bool MMU2::findaRunoutValid;
93
+volatile bool MMU2::finda_runout_valid;
94 94
 int16_t MMU2::version = -1, MMU2::buildnr = -1;
95 95
 millis_t MMU2::last_request, MMU2::next_P0_request;
96 96
 char MMU2::rx_buffer[16], MMU2::tx_buffer[16];
@@ -103,7 +103,7 @@ char MMU2::rx_buffer[16], MMU2::tx_buffer[16];
103 103
   };
104 104
 
105 105
   static constexpr E_Step ramming_sequence[] PROGMEM = { MMU2_RAMMING_SEQUENCE };
106
-  static constexpr E_Step loadToNozzle_sequence[] PROGMEM = { MMU2_LOAD_TO_NOZZLE_SEQUENCE };
106
+  static constexpr E_Step load_to_nozzle_sequence[] PROGMEM = { MMU2_LOAD_TO_NOZZLE_SEQUENCE };
107 107
 
108 108
 #endif // MMU2_MENUS
109 109
 
@@ -142,11 +142,11 @@ void MMU2::reset() {
142 142
   #endif
143 143
 }
144 144
 
145
-uint8_t MMU2::getCurrentTool() {
145
+uint8_t MMU2::get_current_tool() {
146 146
   return extruder == MMU2_NO_TOOL ? -1 : extruder;
147 147
 }
148 148
 
149
-void MMU2::mmuLoop() {
149
+void MMU2::mmu_loop() {
150 150
 
151 151
   switch (state) {
152 152
 
@@ -185,7 +185,7 @@ void MMU2::mmuLoop() {
185 185
 
186 186
         DEBUG_ECHOLNPAIR("MMU => ", buildnr);
187 187
 
188
-        checkVersion();
188
+        check_version();
189 189
 
190 190
         #if ENABLED(MMU2_MODE_12V)
191 191
           DEBUG_ECHOLNPGM("MMU <= 'M1'");
@@ -207,7 +207,7 @@ void MMU2::mmuLoop() {
207 207
       if (rx_ok()) {
208 208
         DEBUG_ECHOLNPGM("MMU => ok");
209 209
 
210
-        checkVersion();
210
+        check_version();
211 211
 
212 212
         DEBUG_ECHOLNPGM("MMU <= 'P0'");
213 213
 
@@ -294,13 +294,13 @@ void MMU2::mmuLoop() {
294 294
         sscanf(rx_buffer, "%hhuok\n", &finda);
295 295
 
296 296
         // This is super annoying. Only activate if necessary
297
-        // if (findaRunoutValid) DEBUG_ECHOLNPAIR_F("MMU <= 'P0'\nMMU => ", finda, 6);
297
+        // if (finda_runout_valid) DEBUG_ECHOLNPAIR_F("MMU <= 'P0'\nMMU => ", finda, 6);
298 298
 
299 299
         state = 1;
300 300
 
301 301
         if (cmd == 0) ready = true;
302 302
 
303
-        if (!finda && findaRunoutValid) filamentRunout();
303
+        if (!finda && finda_runout_valid) filament_runout();
304 304
       }
305 305
       else if (ELAPSED(millis(), last_request + MMU_P0_TIMEOUT)) // Resend request after timeout (30s)
306 306
         state = 1;
@@ -434,7 +434,7 @@ bool MMU2::rx_ok() {
434 434
 /**
435 435
  * Check if MMU has compatible firmware
436 436
  */
437
-void MMU2::checkVersion() {
437
+void MMU2::check_version() {
438 438
   if (buildnr < MMU_REQUIRED_FW_BUILDNR) {
439 439
     SERIAL_ERROR_START();
440 440
     SERIAL_ECHOPGM("MMU2 firmware version invalid. Required version >= ");
@@ -447,7 +447,7 @@ void MMU2::checkVersion() {
447 447
 /**
448 448
  * Handle tool change
449 449
  */
450
-void MMU2::toolChange(uint8_t index) {
450
+void MMU2::tool_change(uint8_t index) {
451 451
 
452 452
   if (!enabled) return;
453 453
 
@@ -461,7 +461,7 @@ void MMU2::toolChange(uint8_t index) {
461 461
 
462 462
     command(MMU_CMD_T0 + index);
463 463
 
464
-    manageResponse(true, true);
464
+    manage_response(true, true);
465 465
     KEEPALIVE_STATE(IN_HANDLER);
466 466
 
467 467
     command(MMU_CMD_C0);
@@ -490,7 +490,7 @@ void MMU2::toolChange(uint8_t index) {
490 490
  * Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated.
491 491
  *
492 492
  */
493
-void MMU2::toolChange(const char* special) {
493
+void MMU2::tool_change(const char* special) {
494 494
 
495 495
   if (!enabled) return;
496 496
 
@@ -501,19 +501,19 @@ void MMU2::toolChange(const char* special) {
501 501
 
502 502
     switch (*special) {
503 503
       case '?': {
504
-        uint8_t index = mmu2_chooseFilament();
504
+        uint8_t index = mmu2_choose_filament();
505 505
         while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100);
506
-        loadFilamentToNozzle(index);
506
+        load_filament_to_nozzle(index);
507 507
       } break;
508 508
 
509 509
       case 'x': {
510 510
         planner.synchronize();
511
-        uint8_t index = mmu2_chooseFilament();
511
+        uint8_t index = mmu2_choose_filament();
512 512
         disable_E0();
513 513
         command(MMU_CMD_T0 + index);
514
-        manageResponse(true, true);
514
+        manage_response(true, true);
515 515
         command(MMU_CMD_C0);
516
-        mmuLoop();
516
+        mmu_loop();
517 517
 
518 518
         enable_E0();
519 519
         extruder = index;
@@ -522,7 +522,7 @@ void MMU2::toolChange(const char* special) {
522 522
 
523 523
       case 'c': {
524 524
         while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100);
525
-        executeExtruderSequence((const E_Step *)loadToNozzle_sequence, COUNT(loadToNozzle_sequence));
525
+        execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, COUNT(load_to_nozzle_sequence));
526 526
       } break;
527 527
     }
528 528
 
@@ -547,7 +547,7 @@ void MMU2::command(const uint8_t mmu_cmd) {
547 547
 /**
548 548
  * Wait for response from MMU
549 549
  */
550
-bool MMU2::getResponse(void) {
550
+bool MMU2::get_response(void) {
551 551
   while (cmd != MMU_CMD_NONE) idle();
552 552
 
553 553
   while (!ready) {
@@ -565,7 +565,7 @@ bool MMU2::getResponse(void) {
565 565
 /**
566 566
  * Wait for response and deal with timeout if nexcessary
567 567
  */
568
-void MMU2::manageResponse(bool move_axes, bool turn_off_nozzle) {
568
+void MMU2::manage_response(bool move_axes, bool turn_off_nozzle) {
569 569
 
570 570
   bool response = false;
571 571
   mmu_print_saved = false;
@@ -575,7 +575,7 @@ void MMU2::manageResponse(bool move_axes, bool turn_off_nozzle) {
575 575
 
576 576
   while (!response) {
577 577
 
578
-    response = getResponse(); //wait for "ok" from mmu
578
+    response = get_response(); //wait for "ok" from mmu
579 579
 
580 580
     if (!response) { //no "ok" was received in reserved time frame, user will fix the issue on mmu unit
581 581
       if (!mmu_print_saved) { //first occurence, we are saving current position, park print head in certain position and disable nozzle heater
@@ -636,7 +636,7 @@ void MMU2::manageResponse(bool move_axes, bool turn_off_nozzle) {
636 636
   }
637 637
 }
638 638
 
639
-void MMU2::setFilamentType(uint8_t index, uint8_t filamentType) {
639
+void MMU2::set_filament_type(uint8_t index, uint8_t filamentType) {
640 640
   if (!enabled) return;
641 641
 
642 642
   KEEPALIVE_STATE(IN_HANDLER);
@@ -644,12 +644,12 @@ void MMU2::setFilamentType(uint8_t index, uint8_t filamentType) {
644 644
   cmd_arg = filamentType;
645 645
   command(MMU_CMD_F0 + index);
646 646
 
647
-  manageResponse(true, true);
647
+  manage_response(true, true);
648 648
 
649 649
   KEEPALIVE_STATE(NOT_BUSY);
650 650
 }
651 651
 
652
-void MMU2::filamentRunout() {
652
+void MMU2::filament_runout() {
653 653
   enqueue_and_echo_commands_P(PSTR(MMU2_FILAMENT_RUNOUT_SCRIPT));
654 654
   planner.synchronize();
655 655
 }
@@ -657,10 +657,10 @@ void MMU2::filamentRunout() {
657 657
 #if HAS_LCD_MENU && ENABLED(MMU2_MENUS)
658 658
 
659 659
   // Load filament into MMU2
660
-  void MMU2::loadFilament(uint8_t index) {
660
+  void MMU2::load_filament(uint8_t index) {
661 661
     if (!enabled) return;
662 662
     command(MMU_CMD_L0 + index);
663
-    manageResponse(false, false);
663
+    manage_response(false, false);
664 664
     BUZZ(200, 404);
665 665
   }
666 666
 
@@ -669,7 +669,7 @@ void MMU2::filamentRunout() {
669 669
    * Switch material and load to nozzle
670 670
    *
671 671
    */
672
-  bool MMU2::loadFilamentToNozzle(uint8_t index) {
672
+  bool MMU2::load_filament_to_nozzle(uint8_t index) {
673 673
 
674 674
     if (!enabled) return false;
675 675
 
@@ -682,14 +682,14 @@ void MMU2::filamentRunout() {
682 682
       KEEPALIVE_STATE(IN_HANDLER);
683 683
 
684 684
       command(MMU_CMD_T0 + index);
685
-      manageResponse(true, true);
685
+      manage_response(true, true);
686 686
       command(MMU_CMD_C0);
687
-      mmuLoop();
687
+      mmu_loop();
688 688
 
689 689
       extruder = index;
690 690
       active_extruder = 0;
691 691
 
692
-      loadToNozzle();
692
+      load_to_nozzle();
693 693
 
694 694
       BUZZ(200, 404);
695 695
 
@@ -706,12 +706,12 @@ void MMU2::filamentRunout() {
706 706
    * It is not used after T0 .. T4 command (select filament), in such case, gcode is responsible for loading
707 707
    * filament to nozzle.
708 708
    */
709
-  void MMU2::loadToNozzle() {
709
+  void MMU2::load_to_nozzle() {
710 710
     if (!enabled) return;
711
-    executeExtruderSequence((const E_Step *)loadToNozzle_sequence, COUNT(loadToNozzle_sequence));
711
+    execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, COUNT(load_to_nozzle_sequence));
712 712
   }
713 713
 
714
-  bool MMU2::ejectFilament(uint8_t index, bool recover) {
714
+  bool MMU2::eject_filament(uint8_t index, bool recover) {
715 715
 
716 716
     if (!enabled) return false;
717 717
 
@@ -731,7 +731,7 @@ void MMU2::filamentRunout() {
731 731
     planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 2500 / 60, active_extruder);
732 732
     planner.synchronize();
733 733
     command(MMU_CMD_E0 + index);
734
-    manageResponse(false, false);
734
+    manage_response(false, false);
735 735
 
736 736
     if (recover)  {
737 737
       LCD_MESSAGEPGM(MSG_MMU2_EJECT_RECOVER);
@@ -745,7 +745,7 @@ void MMU2::filamentRunout() {
745 745
       BUZZ(200, 404);
746 746
 
747 747
       command(MMU_CMD_R0);
748
-      manageResponse(false, false);
748
+      manage_response(false, false);
749 749
     }
750 750
 
751 751
     ui.reset_status();
@@ -783,10 +783,10 @@ void MMU2::filamentRunout() {
783 783
 
784 784
     KEEPALIVE_STATE(IN_HANDLER);
785 785
 
786
-    filamentRamming();
786
+    filament_ramming();
787 787
 
788 788
     command(MMU_CMD_U0);
789
-    manageResponse(false, true);
789
+    manage_response(false, true);
790 790
 
791 791
     BUZZ(200, 404);
792 792
 
@@ -803,11 +803,11 @@ void MMU2::filamentRunout() {
803 803
   /**
804 804
    * Unload sequence to optimize shape of the tip of the unloaded filament
805 805
    */
806
-  void MMU2::filamentRamming() {
807
-    executeExtruderSequence((const E_Step *)ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step));
806
+  void MMU2::filament_ramming() {
807
+    execute_extruder_sequence((const E_Step *)ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step));
808 808
   }
809 809
 
810
-  void MMU2::executeExtruderSequence(const E_Step * sequence, int steps) {
810
+  void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) {
811 811
 
812 812
     planner.synchronize();
813 813
     enable_E0();

+ 18
- 18
Marlin/src/feature/prusa_MMU2/mmu2.h View File

@@ -36,18 +36,18 @@ public:
36 36
 
37 37
   static void init();
38 38
   static void reset();
39
-  static void mmuLoop();
40
-  static void toolChange(uint8_t index);
41
-  static void toolChange(const char* special);
42
-  static uint8_t getCurrentTool();
43
-  static void setFilamentType(uint8_t index, uint8_t type);
39
+  static void mmu_loop();
40
+  static void tool_change(uint8_t index);
41
+  static void tool_change(const char* special);
42
+  static uint8_t get_current_tool();
43
+  static void set_filament_type(uint8_t index, uint8_t type);
44 44
 
45 45
   #if HAS_LCD_MENU && ENABLED(MMU2_MENUS)
46 46
     static bool unload();
47
-    static void loadFilament(uint8_t);
48
-    static void loadAll();
49
-    static bool loadFilamentToNozzle(uint8_t index);
50
-    static bool ejectFilament(uint8_t index, bool recover);
47
+    static void load_filament(uint8_t);
48
+    static void load_all();
49
+    static bool load_filament_to_nozzle(uint8_t index);
50
+    static bool eject_filament(uint8_t index, bool recover);
51 51
   #endif
52 52
 
53 53
 private:
@@ -59,31 +59,31 @@ private:
59 59
 
60 60
   static bool rx_ok();
61 61
   static bool rx_start();
62
-  static void checkVersion();
62
+  static void check_version();
63 63
 
64 64
   static void command(const uint8_t cmd);
65
-  static bool getResponse(void);
66
-  static void manageResponse(bool move_axes, bool turn_off_nozzle);
65
+  static bool get_response(void);
66
+  static void manage_response(bool move_axes, bool turn_off_nozzle);
67 67
 
68 68
   #if HAS_LCD_MENU && ENABLED(MMU2_MENUS)
69
-    static void loadToNozzle();
70
-    static void filamentRamming();
71
-    static void executeExtruderSequence(const E_Step * sequence, int steps);
69
+    static void load_to_nozzle();
70
+    static void filament_ramming();
71
+    static void execute_extruder_sequence(const E_Step * sequence, int steps);
72 72
   #endif
73 73
 
74
-  static void filamentRunout();
74
+  static void filament_runout();
75 75
 
76 76
   static bool enabled, ready, mmu_print_saved;
77 77
   static uint8_t cmd, cmd_arg, last_cmd, extruder;
78 78
   static int8_t state;
79 79
   static volatile int8_t finda;
80
-  static volatile bool findaRunoutValid;
80
+  static volatile bool finda_runout_valid;
81 81
   static int16_t version, buildnr;
82 82
   static millis_t last_request, next_P0_request;
83 83
   static char rx_buffer[16], tx_buffer[16];
84 84
 
85 85
   static inline void set_runout_valid(const bool valid) {
86
-    findaRunoutValid = valid;
86
+    finda_runout_valid = valid;
87 87
     #if HAS_FILAMENT_SENSOR
88 88
       if (valid) runout.reset();
89 89
     #endif

+ 1
- 1
Marlin/src/gcode/control/T.cpp View File

@@ -55,7 +55,7 @@ void GcodeSuite::T(const uint8_t tool_index) {
55 55
 
56 56
   #if ENABLED(PRUSA_MMU2)
57 57
     if (parser.string_arg) {
58
-      mmu2.toolChange(parser.string_arg);   // Special commands T?/Tx/Tc
58
+      mmu2.tool_change(parser.string_arg);   // Special commands T?/Tx/Tc
59 59
       return;
60 60
     }
61 61
   #endif

+ 1
- 1
Marlin/src/gcode/feature/pause/M701_M702.cpp View File

@@ -84,7 +84,7 @@ void GcodeSuite::M701() {
84 84
 
85 85
   // Load filament
86 86
   #if ENABLED(PRUSA_MMU2)
87
-    mmu2.loadFilamentToNozzle(target_extruder);
87
+    mmu2.load_filament_to_nozzle(target_extruder);
88 88
   #else
89 89
     constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH;
90 90
     const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS)

+ 1
- 1
Marlin/src/gcode/feature/prusa_MMU2/M403.cpp View File

@@ -41,7 +41,7 @@ void GcodeSuite::M403() {
41 41
          type = parser.intval('F', -1);
42 42
 
43 43
   if (WITHIN(index, 0, 4) && WITHIN(type, 0, 2))
44
-    mmu2.setFilamentType(index, type);
44
+    mmu2.set_filament_type(index, type);
45 45
   else
46 46
     SERIAL_ECHO_MSG("M403 - bad arguments.");
47 47
 }

+ 59
- 59
Marlin/src/lcd/menu/menu_mmu2.cpp View File

@@ -35,60 +35,60 @@ bool mmuMenuWait;
35 35
 // Load Filament
36 36
 //
37 37
 
38
-void _mmu2_loadFilamentToNozzle(uint8_t index) {
38
+void _mmu2_load_filamentToNozzle(uint8_t index) {
39 39
   ui.reset_status();
40 40
   ui.return_to_status();
41 41
   ui.status_printf_P(0,  PSTR(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
42
-  if (mmu2.loadFilamentToNozzle(index)) ui.reset_status();
42
+  if (mmu2.load_filament_to_nozzle(index)) ui.reset_status();
43 43
 }
44 44
 
45
-inline void action_mmu2_loadFilamentToNozzle(const uint8_t tool) {
46
-  _mmu2_loadFilamentToNozzle(tool);
45
+inline void action_mmu2_load_filament_to_nozzl_e(const uint8_t tool) {
46
+  _mmu2_load_filamentToNozzle(tool);
47 47
   ui.return_to_status();
48 48
 }
49
-inline void action_mmu2_loadFilamentToNozzle0() { action_mmu2_loadFilamentToNozzle(0); }
50
-inline void action_mmu2_loadFilamentToNozzle1() { action_mmu2_loadFilamentToNozzle(1); }
51
-inline void action_mmu2_loadFilamentToNozzle2() { action_mmu2_loadFilamentToNozzle(2); }
52
-inline void action_mmu2_loadFilamentToNozzle3() { action_mmu2_loadFilamentToNozzle(3); }
53
-inline void action_mmu2_loadFilamentToNozzle4() { action_mmu2_loadFilamentToNozzle(4); }
49
+inline void action_mmu2_load_filament_to_nozzle_0() { action_mmu2_load_filament_to_nozzl_e(0); }
50
+inline void action_mmu2_load_filament_to_nozzle_1() { action_mmu2_load_filament_to_nozzl_e(1); }
51
+inline void action_mmu2_load_filament_to_nozzle_2() { action_mmu2_load_filament_to_nozzl_e(2); }
52
+inline void action_mmu2_load_filament_to_nozzle_3() { action_mmu2_load_filament_to_nozzl_e(3); }
53
+inline void action_mmu2_load_filament_to_nozzle_4() { action_mmu2_load_filament_to_nozzl_e(4); }
54 54
 
55
-void _mmu2_loadFilament(uint8_t index) {
55
+void _mmu2_load_filament(uint8_t index) {
56 56
   ui.return_to_status();
57 57
   ui.status_printf_P(0, PSTR(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
58
-  mmu2.loadFilament(index);
58
+  mmu2.load_filament(index);
59 59
   ui.reset_status();
60 60
 }
61
-void action_mmu2_loadAll() {
61
+void action_mmu2_load_all() {
62 62
   for (uint8_t i = 0; i < EXTRUDERS; i++)
63
-    _mmu2_loadFilament(i);
63
+    _mmu2_load_filament(i);
64 64
   ui.return_to_status();
65 65
 }
66
-inline void action_mmu2_loadFilament0() { _mmu2_loadFilament(0); }
67
-inline void action_mmu2_loadFilament1() { _mmu2_loadFilament(1); }
68
-inline void action_mmu2_loadFilament2() { _mmu2_loadFilament(2); }
69
-inline void action_mmu2_loadFilament3() { _mmu2_loadFilament(3); }
70
-inline void action_mmu2_loadFilament4() { _mmu2_loadFilament(4); }
66
+inline void action_mmu2_load_filament_0() { _mmu2_load_filament(0); }
67
+inline void action_mmu2_load_filament_1() { _mmu2_load_filament(1); }
68
+inline void action_mmu2_load_filament_2() { _mmu2_load_filament(2); }
69
+inline void action_mmu2_load_filament_3() { _mmu2_load_filament(3); }
70
+inline void action_mmu2_load_filament_4() { _mmu2_load_filament(4); }
71 71
 
72
-void menu_mmu2_loadFilament() {
72
+void menu_mmu2_load_filament() {
73 73
   START_MENU();
74 74
   MENU_BACK(MSG_MMU2_MENU);
75
-  MENU_ITEM(function, MSG_MMU2_ALL, action_mmu2_loadAll);
76
-  MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_loadFilament0);
77
-  MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_loadFilament1);
78
-  MENU_ITEM(function, MSG_MMU2_FILAMENT2, action_mmu2_loadFilament2);
79
-  MENU_ITEM(function, MSG_MMU2_FILAMENT3, action_mmu2_loadFilament3);
80
-  MENU_ITEM(function, MSG_MMU2_FILAMENT4, action_mmu2_loadFilament4);
75
+  MENU_ITEM(function, MSG_MMU2_ALL, action_mmu2_load_all);
76
+  MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_load_filament_0);
77
+  MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_load_filament_1);
78
+  MENU_ITEM(function, MSG_MMU2_FILAMENT2, action_mmu2_load_filament_2);
79
+  MENU_ITEM(function, MSG_MMU2_FILAMENT3, action_mmu2_load_filament_3);
80
+  MENU_ITEM(function, MSG_MMU2_FILAMENT4, action_mmu2_load_filament_4);
81 81
   END_MENU();
82 82
 }
83 83
 
84
-void menu_mmu2_loadToNozzle() {
84
+void menu_mmu2_load_to_nozzle() {
85 85
   START_MENU();
86 86
   MENU_BACK(MSG_MMU2_MENU);
87
-  MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_loadFilamentToNozzle0);
88
-  MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_loadFilamentToNozzle1);
89
-  MENU_ITEM(function, MSG_MMU2_FILAMENT2, action_mmu2_loadFilamentToNozzle2);
90
-  MENU_ITEM(function, MSG_MMU2_FILAMENT3, action_mmu2_loadFilamentToNozzle3);
91
-  MENU_ITEM(function, MSG_MMU2_FILAMENT4, action_mmu2_loadFilamentToNozzle4);
87
+  MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_load_filament_to_nozzle_0);
88
+  MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_load_filament_to_nozzle_1);
89
+  MENU_ITEM(function, MSG_MMU2_FILAMENT2, action_mmu2_load_filament_to_nozzle_2);
90
+  MENU_ITEM(function, MSG_MMU2_FILAMENT3, action_mmu2_load_filament_to_nozzle_3);
91
+  MENU_ITEM(function, MSG_MMU2_FILAMENT4, action_mmu2_load_filament_to_nozzle_4);
92 92
   END_MENU();
93 93
 }
94 94
 
@@ -96,19 +96,19 @@ void menu_mmu2_loadToNozzle() {
96 96
 // Eject Filament
97 97
 //
98 98
 
99
-void _mmu2_ejectFilament(uint8_t index) {
99
+void _mmu2_eject_filament(uint8_t index) {
100 100
   ui.reset_status();
101 101
   ui.return_to_status();
102 102
   ui.status_printf_P(0, PSTR(MSG_MMU2_EJECTING_FILAMENT), int(index + 1));
103
-  if (mmu2.ejectFilament(index, true)) ui.reset_status();
103
+  if (mmu2.eject_filament(index, true)) ui.reset_status();
104 104
 }
105
-inline void action_mmu2_ejectFilament0() { _mmu2_ejectFilament(0); }
106
-inline void action_mmu2_ejectFilament1() { _mmu2_ejectFilament(1); }
107
-inline void action_mmu2_ejectFilament2() { _mmu2_ejectFilament(2); }
108
-inline void action_mmu2_ejectFilament3() { _mmu2_ejectFilament(3); }
109
-inline void action_mmu2_ejectFilament4() { _mmu2_ejectFilament(4); }
105
+inline void action_mmu2_eject_filament_0() { _mmu2_eject_filament(0); }
106
+inline void action_mmu2_eject_filament_1() { _mmu2_eject_filament(1); }
107
+inline void action_mmu2_eject_filament_2() { _mmu2_eject_filament(2); }
108
+inline void action_mmu2_eject_filament_3() { _mmu2_eject_filament(3); }
109
+inline void action_mmu2_eject_filament_4() { _mmu2_eject_filament(4); }
110 110
 
111
-void action_mmu2_unloadFilament() {
111
+void action_mmu2_unload_filament() {
112 112
   ui.reset_status();
113 113
   ui.return_to_status();
114 114
   LCD_MESSAGEPGM(MSG_MMU2_UNLOADING_FILAMENT);
@@ -116,14 +116,14 @@ void action_mmu2_unloadFilament() {
116 116
   if (mmu2.unload()) ui.reset_status();
117 117
 }
118 118
 
119
-void menu_mmu2_ejectFilament() {
119
+void menu_mmu2_eject_filament() {
120 120
   START_MENU();
121 121
   MENU_BACK(MSG_MMU2_MENU);
122
-  MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_ejectFilament0);
123
-  MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_ejectFilament1);
124
-  MENU_ITEM(function, MSG_MMU2_FILAMENT2, action_mmu2_ejectFilament2);
125
-  MENU_ITEM(function, MSG_MMU2_FILAMENT3, action_mmu2_ejectFilament3);
126
-  MENU_ITEM(function, MSG_MMU2_FILAMENT4, action_mmu2_ejectFilament4);
122
+  MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_eject_filament_0);
123
+  MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_eject_filament_1);
124
+  MENU_ITEM(function, MSG_MMU2_FILAMENT2, action_mmu2_eject_filament_2);
125
+  MENU_ITEM(function, MSG_MMU2_FILAMENT3, action_mmu2_eject_filament_3);
126
+  MENU_ITEM(function, MSG_MMU2_FILAMENT4, action_mmu2_eject_filament_4);
127 127
   END_MENU();
128 128
 }
129 129
 
@@ -139,10 +139,10 @@ void action_mmu2_reset() {
139 139
 void menu_mmu2() {
140 140
   START_MENU();
141 141
   MENU_BACK(MSG_MAIN);
142
-  MENU_ITEM(submenu, MSG_MMU2_LOAD_FILAMENT, menu_mmu2_loadFilament);
143
-  MENU_ITEM(submenu, MSG_MMU2_LOAD_TO_NOZZLE, menu_mmu2_loadToNozzle);
144
-  MENU_ITEM(submenu, MSG_MMU2_EJECT_FILAMENT, menu_mmu2_ejectFilament);
145
-  MENU_ITEM(function, MSG_MMU2_UNLOAD_FILAMENT, action_mmu2_unloadFilament);
142
+  MENU_ITEM(submenu, MSG_MMU2_LOAD_FILAMENT, menu_mmu2_load_filament);
143
+  MENU_ITEM(submenu, MSG_MMU2_LOAD_TO_NOZZLE, menu_mmu2_load_to_nozzle);
144
+  MENU_ITEM(submenu, MSG_MMU2_EJECT_FILAMENT, menu_mmu2_eject_filament);
145
+  MENU_ITEM(function, MSG_MMU2_UNLOAD_FILAMENT, action_mmu2_unload_filament);
146 146
   MENU_ITEM(function, MSG_MMU2_RESET, action_mmu2_reset);
147 147
   END_MENU();
148 148
 }
@@ -161,7 +161,7 @@ inline void action_mmu2_choose2() { action_mmu2_choose(2); }
161 161
 inline void action_mmu2_choose3() { action_mmu2_choose(3); }
162 162
 inline void action_mmu2_choose4() { action_mmu2_choose(4); }
163 163
 
164
-void menu_mmu2_chooseFilament() {
164
+void menu_mmu2_choose_filament() {
165 165
   START_MENU();
166 166
   #if LCD_HEIGHT > 2
167 167
     STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, true, true);
@@ -178,21 +178,21 @@ void menu_mmu2_chooseFilament() {
178 178
 // MMU2 Filament Runout
179 179
 //
180 180
 
181
-inline void action_mmu2_M600_loadCurrentFilament()         { mmu2.loadFilament(currentTool); }
182
-inline void action_mmu2_M600_loadCurrentFilamentToNozzle() { mmu2.loadFilamentToNozzle(currentTool); }
183
-inline void action_mmu2_M600_unloadFilament()              { mmu2.unload(); }
181
+inline void action_mmu2_M600_load_current_filament()         { mmu2.load_filament(currentTool); }
182
+inline void action_mmu2_M600_load_current_filament_to_nozzle() { mmu2.load_filament_to_nozzle(currentTool); }
183
+inline void action_mmu2_M600_unload_filament()              { mmu2.unload(); }
184 184
 inline void action_mmu2_M600_resume()                      { mmuMenuWait = false; }
185 185
 
186 186
 void menu_mmu2_pause() {
187
-  currentTool = mmu2.getCurrentTool();
187
+  currentTool = mmu2.get_current_tool();
188 188
   START_MENU();
189 189
   #if LCD_HEIGHT > 2
190 190
     STATIC_ITEM(MSG_MMU2_FILAMENT_CHANGE_HEADER, true, true);
191 191
   #endif
192 192
   MENU_ITEM(function, MSG_MMU2_RESUME, action_mmu2_M600_resume);
193
-  MENU_ITEM(function, MSG_MMU2_UNLOAD_FILAMENT, action_mmu2_M600_unloadFilament);
194
-  MENU_ITEM(function, MSG_MMU2_LOAD_FILAMENT, action_mmu2_M600_loadCurrentFilament);
195
-  MENU_ITEM(function, MSG_MMU2_LOAD_TO_NOZZLE, action_mmu2_M600_loadCurrentFilamentToNozzle);
193
+  MENU_ITEM(function, MSG_MMU2_UNLOAD_FILAMENT, action_mmu2_M600_unload_filament);
194
+  MENU_ITEM(function, MSG_MMU2_LOAD_FILAMENT, action_mmu2_M600_load_current_filament);
195
+  MENU_ITEM(function, MSG_MMU2_LOAD_TO_NOZZLE, action_mmu2_M600_load_current_filament_to_nozzle);
196 196
   END_MENU();
197 197
 }
198 198
 
@@ -203,9 +203,9 @@ void mmu2_M600() {
203 203
   while (mmuMenuWait) idle();
204 204
 }
205 205
 
206
-uint8_t mmu2_chooseFilament() {
206
+uint8_t mmu2_choose_filament() {
207 207
   ui.defer_status_screen();
208
-  ui.goto_screen(menu_mmu2_chooseFilament);
208
+  ui.goto_screen(menu_mmu2_choose_filament);
209 209
   mmuMenuWait = true;
210 210
   while (mmuMenuWait) idle();
211 211
   ui.return_to_status();

+ 1
- 1
Marlin/src/lcd/menu/menu_mmu2.h View File

@@ -25,4 +25,4 @@
25 25
 
26 26
 void menu_mmu2();
27 27
 void mmu2_M600();
28
-uint8_t mmu2_chooseFilament();
28
+uint8_t mmu2_choose_filament();

+ 2
- 2
Marlin/src/module/tool_change.cpp View File

@@ -577,7 +577,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
577 577
 
578 578
     UNUSED(fr_mm_s); UNUSED(no_move);
579 579
 
580
-    mmu2.toolChange(tmp_extruder);
580
+    mmu2.tool_change(tmp_extruder);
581 581
 
582 582
   #elif EXTRUDERS < 2
583 583
 
@@ -777,7 +777,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
777 777
       #endif
778 778
 
779 779
       #if ENABLED(PRUSA_MMU2)
780
-        mmu2.toolChange(tmp_extruder);
780
+        mmu2.tool_change(tmp_extruder);
781 781
       #endif
782 782
 
783 783
       #if SWITCHING_NOZZLE_TWO_SERVOS

Loading…
Cancel
Save