Browse Source

Update MMU2 code style

Scott Lahteine 6 years ago
parent
commit
fae2b7edc3

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

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

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

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

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

36
 
36
 
37
   static void init();
37
   static void init();
38
   static void reset();
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
   #if HAS_LCD_MENU && ENABLED(MMU2_MENUS)
45
   #if HAS_LCD_MENU && ENABLED(MMU2_MENUS)
46
     static bool unload();
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
   #endif
51
   #endif
52
 
52
 
53
 private:
53
 private:
59
 
59
 
60
   static bool rx_ok();
60
   static bool rx_ok();
61
   static bool rx_start();
61
   static bool rx_start();
62
-  static void checkVersion();
62
+  static void check_version();
63
 
63
 
64
   static void command(const uint8_t cmd);
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
   #if HAS_LCD_MENU && ENABLED(MMU2_MENUS)
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
   #endif
72
   #endif
73
 
73
 
74
-  static void filamentRunout();
74
+  static void filament_runout();
75
 
75
 
76
   static bool enabled, ready, mmu_print_saved;
76
   static bool enabled, ready, mmu_print_saved;
77
   static uint8_t cmd, cmd_arg, last_cmd, extruder;
77
   static uint8_t cmd, cmd_arg, last_cmd, extruder;
78
   static int8_t state;
78
   static int8_t state;
79
   static volatile int8_t finda;
79
   static volatile int8_t finda;
80
-  static volatile bool findaRunoutValid;
80
+  static volatile bool finda_runout_valid;
81
   static int16_t version, buildnr;
81
   static int16_t version, buildnr;
82
   static millis_t last_request, next_P0_request;
82
   static millis_t last_request, next_P0_request;
83
   static char rx_buffer[16], tx_buffer[16];
83
   static char rx_buffer[16], tx_buffer[16];
84
 
84
 
85
   static inline void set_runout_valid(const bool valid) {
85
   static inline void set_runout_valid(const bool valid) {
86
-    findaRunoutValid = valid;
86
+    finda_runout_valid = valid;
87
     #if HAS_FILAMENT_SENSOR
87
     #if HAS_FILAMENT_SENSOR
88
       if (valid) runout.reset();
88
       if (valid) runout.reset();
89
     #endif
89
     #endif

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

55
 
55
 
56
   #if ENABLED(PRUSA_MMU2)
56
   #if ENABLED(PRUSA_MMU2)
57
     if (parser.string_arg) {
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
       return;
59
       return;
60
     }
60
     }
61
   #endif
61
   #endif

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

84
 
84
 
85
   // Load filament
85
   // Load filament
86
   #if ENABLED(PRUSA_MMU2)
86
   #if ENABLED(PRUSA_MMU2)
87
-    mmu2.loadFilamentToNozzle(target_extruder);
87
+    mmu2.load_filament_to_nozzle(target_extruder);
88
   #else
88
   #else
89
     constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH;
89
     constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH;
90
     const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS)
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
          type = parser.intval('F', -1);
41
          type = parser.intval('F', -1);
42
 
42
 
43
   if (WITHIN(index, 0, 4) && WITHIN(type, 0, 2))
43
   if (WITHIN(index, 0, 4) && WITHIN(type, 0, 2))
44
-    mmu2.setFilamentType(index, type);
44
+    mmu2.set_filament_type(index, type);
45
   else
45
   else
46
     SERIAL_ECHO_MSG("M403 - bad arguments.");
46
     SERIAL_ECHO_MSG("M403 - bad arguments.");
47
 }
47
 }

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

35
 // Load Filament
35
 // Load Filament
36
 //
36
 //
37
 
37
 
38
-void _mmu2_loadFilamentToNozzle(uint8_t index) {
38
+void _mmu2_load_filamentToNozzle(uint8_t index) {
39
   ui.reset_status();
39
   ui.reset_status();
40
   ui.return_to_status();
40
   ui.return_to_status();
41
   ui.status_printf_P(0,  PSTR(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
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
   ui.return_to_status();
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
   ui.return_to_status();
56
   ui.return_to_status();
57
   ui.status_printf_P(0, PSTR(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
57
   ui.status_printf_P(0, PSTR(MSG_MMU2_LOADING_FILAMENT), int(index + 1));
58
-  mmu2.loadFilament(index);
58
+  mmu2.load_filament(index);
59
   ui.reset_status();
59
   ui.reset_status();
60
 }
60
 }
61
-void action_mmu2_loadAll() {
61
+void action_mmu2_load_all() {
62
   for (uint8_t i = 0; i < EXTRUDERS; i++)
62
   for (uint8_t i = 0; i < EXTRUDERS; i++)
63
-    _mmu2_loadFilament(i);
63
+    _mmu2_load_filament(i);
64
   ui.return_to_status();
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
   START_MENU();
73
   START_MENU();
74
   MENU_BACK(MSG_MMU2_MENU);
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
   END_MENU();
81
   END_MENU();
82
 }
82
 }
83
 
83
 
84
-void menu_mmu2_loadToNozzle() {
84
+void menu_mmu2_load_to_nozzle() {
85
   START_MENU();
85
   START_MENU();
86
   MENU_BACK(MSG_MMU2_MENU);
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
   END_MENU();
92
   END_MENU();
93
 }
93
 }
94
 
94
 
96
 // Eject Filament
96
 // Eject Filament
97
 //
97
 //
98
 
98
 
99
-void _mmu2_ejectFilament(uint8_t index) {
99
+void _mmu2_eject_filament(uint8_t index) {
100
   ui.reset_status();
100
   ui.reset_status();
101
   ui.return_to_status();
101
   ui.return_to_status();
102
   ui.status_printf_P(0, PSTR(MSG_MMU2_EJECTING_FILAMENT), int(index + 1));
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
   ui.reset_status();
112
   ui.reset_status();
113
   ui.return_to_status();
113
   ui.return_to_status();
114
   LCD_MESSAGEPGM(MSG_MMU2_UNLOADING_FILAMENT);
114
   LCD_MESSAGEPGM(MSG_MMU2_UNLOADING_FILAMENT);
116
   if (mmu2.unload()) ui.reset_status();
116
   if (mmu2.unload()) ui.reset_status();
117
 }
117
 }
118
 
118
 
119
-void menu_mmu2_ejectFilament() {
119
+void menu_mmu2_eject_filament() {
120
   START_MENU();
120
   START_MENU();
121
   MENU_BACK(MSG_MMU2_MENU);
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
   END_MENU();
127
   END_MENU();
128
 }
128
 }
129
 
129
 
139
 void menu_mmu2() {
139
 void menu_mmu2() {
140
   START_MENU();
140
   START_MENU();
141
   MENU_BACK(MSG_MAIN);
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
   MENU_ITEM(function, MSG_MMU2_RESET, action_mmu2_reset);
146
   MENU_ITEM(function, MSG_MMU2_RESET, action_mmu2_reset);
147
   END_MENU();
147
   END_MENU();
148
 }
148
 }
161
 inline void action_mmu2_choose3() { action_mmu2_choose(3); }
161
 inline void action_mmu2_choose3() { action_mmu2_choose(3); }
162
 inline void action_mmu2_choose4() { action_mmu2_choose(4); }
162
 inline void action_mmu2_choose4() { action_mmu2_choose(4); }
163
 
163
 
164
-void menu_mmu2_chooseFilament() {
164
+void menu_mmu2_choose_filament() {
165
   START_MENU();
165
   START_MENU();
166
   #if LCD_HEIGHT > 2
166
   #if LCD_HEIGHT > 2
167
     STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, true, true);
167
     STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, true, true);
178
 // MMU2 Filament Runout
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
 inline void action_mmu2_M600_resume()                      { mmuMenuWait = false; }
184
 inline void action_mmu2_M600_resume()                      { mmuMenuWait = false; }
185
 
185
 
186
 void menu_mmu2_pause() {
186
 void menu_mmu2_pause() {
187
-  currentTool = mmu2.getCurrentTool();
187
+  currentTool = mmu2.get_current_tool();
188
   START_MENU();
188
   START_MENU();
189
   #if LCD_HEIGHT > 2
189
   #if LCD_HEIGHT > 2
190
     STATIC_ITEM(MSG_MMU2_FILAMENT_CHANGE_HEADER, true, true);
190
     STATIC_ITEM(MSG_MMU2_FILAMENT_CHANGE_HEADER, true, true);
191
   #endif
191
   #endif
192
   MENU_ITEM(function, MSG_MMU2_RESUME, action_mmu2_M600_resume);
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
   END_MENU();
196
   END_MENU();
197
 }
197
 }
198
 
198
 
203
   while (mmuMenuWait) idle();
203
   while (mmuMenuWait) idle();
204
 }
204
 }
205
 
205
 
206
-uint8_t mmu2_chooseFilament() {
206
+uint8_t mmu2_choose_filament() {
207
   ui.defer_status_screen();
207
   ui.defer_status_screen();
208
-  ui.goto_screen(menu_mmu2_chooseFilament);
208
+  ui.goto_screen(menu_mmu2_choose_filament);
209
   mmuMenuWait = true;
209
   mmuMenuWait = true;
210
   while (mmuMenuWait) idle();
210
   while (mmuMenuWait) idle();
211
   ui.return_to_status();
211
   ui.return_to_status();

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

25
 
25
 
26
 void menu_mmu2();
26
 void menu_mmu2();
27
 void mmu2_M600();
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
 
577
 
578
     UNUSED(fr_mm_s); UNUSED(no_move);
578
     UNUSED(fr_mm_s); UNUSED(no_move);
579
 
579
 
580
-    mmu2.toolChange(tmp_extruder);
580
+    mmu2.tool_change(tmp_extruder);
581
 
581
 
582
   #elif EXTRUDERS < 2
582
   #elif EXTRUDERS < 2
583
 
583
 
777
       #endif
777
       #endif
778
 
778
 
779
       #if ENABLED(PRUSA_MMU2)
779
       #if ENABLED(PRUSA_MMU2)
780
-        mmu2.toolChange(tmp_extruder);
780
+        mmu2.tool_change(tmp_extruder);
781
       #endif
781
       #endif
782
 
782
 
783
       #if SWITCHING_NOZZLE_TWO_SERVOS
783
       #if SWITCHING_NOZZLE_TWO_SERVOS

Loading…
Cancel
Save