Browse Source

Misc. code cleanup

Scott Lahteine 4 years ago
parent
commit
206d495ba4

+ 2
- 2
Marlin/src/MarlinCore.cpp View File

@@ -390,8 +390,8 @@ void startOrResumeJob() {
390 390
   }
391 391
 
392 392
   inline void finishSDPrinting() {
393
-    if (queue.enqueue_one_P(PSTR("M1001"))) {
394
-      marlin_state = MF_RUNNING;
393
+    if (queue.enqueue_one_P(PSTR("M1001"))) { // Keep trying until it gets queued
394
+      marlin_state = MF_RUNNING;              // Signal to stop trying
395 395
       TERN_(PASSWORD_AFTER_SD_PRINT_END, password.lock_machine());
396 396
       TERN_(DGUS_LCD_UI_MKS, ScreenHandler.SDPrintingFinished());
397 397
     }

+ 3
- 7
Marlin/src/gcode/queue.cpp View File

@@ -501,13 +501,9 @@ void GCodeQueue::get_serial_commands() {
501 501
           char* gpos = strchr(command, 'G');
502 502
           if (gpos) {
503 503
             switch (strtol(gpos + 1, nullptr, 10)) {
504
-              case 0: case 1:
505
-              #if ENABLED(ARC_SUPPORT)
506
-                case 2: case 3:
507
-              #endif
508
-              #if ENABLED(BEZIER_CURVE_SUPPORT)
509
-                case 5:
510
-              #endif
504
+              case 0 ... 1:
505
+              TERN_(ARC_SUPPORT, case 2 ... 3:)
506
+              TERN_(BEZIER_CURVE_SUPPORT, case 5:)
511 507
                 PORT_REDIRECT(SERIAL_PORTMASK(p));     // Reply to the serial port that sent the command
512 508
                 SERIAL_ECHOLNPGM(STR_ERR_STOPPED);
513 509
                 LCD_MESSAGEPGM(MSG_STOPPED);

+ 2
- 2
Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp View File

@@ -1477,7 +1477,7 @@ void DGUSScreenHandler::DGUS_ExtrudeLoadInit(void) {
1477 1477
 
1478 1478
 void DGUSScreenHandler::DGUS_RunoutInit(void) {
1479 1479
   #if PIN_EXISTS(MT_DET_1)
1480
-    pinMode(MT_DET_1_PIN, INPUT_PULLUP);
1480
+    SET_INPUT_PULLUP(MT_DET_1_PIN);
1481 1481
   #endif
1482 1482
   runout_mks.de_count      = 0;
1483 1483
   runout_mks.de_times      = 10;
@@ -1496,7 +1496,7 @@ void DGUSScreenHandler::DGUS_Runout_Idle(void) {
1496 1496
         GotoScreen(MKSLCD_SCREEN_PAUSE);
1497 1497
 
1498 1498
         sendinfoscreen(PSTR("NOTICE"), nullptr, PSTR("Please change filament!"), nullptr, true, true, true, true);
1499
-        // SetupConfirmAction(nullptr);
1499
+        //SetupConfirmAction(nullptr);
1500 1500
         GotoScreen(DGUSLCD_SCREEN_POPUP);
1501 1501
         break;
1502 1502
 

+ 1
- 3
Marlin/src/lcd/extui/mks_ui/draw_ui.cpp View File

@@ -645,9 +645,7 @@ char *creat_title_text() {
645 645
         gcode_preview_over = false;
646 646
 
647 647
         card.closefile();
648
-        char *cur_name;
649
-
650
-        cur_name = strrchr(list_file.file_name[sel_id], '/');
648
+        char *cur_name = strrchr(list_file.file_name[sel_id], '/');
651 649
 
652 650
         SdFile file;
653 651
         SdFile *curDir;

+ 4
- 8
Marlin/src/lcd/extui/mks_ui/wifi_module.cpp View File

@@ -1789,18 +1789,14 @@ void get_wifi_commands() {
1789 1789
         char* command = wifi_line_buffer;
1790 1790
         while (*command == ' ') command++; // skip any leading spaces
1791 1791
 
1792
-          // Movement commands alert when stopped
1793
-          if (IsStopped()) {
1792
+        // Movement commands alert when stopped
1793
+        if (IsStopped()) {
1794 1794
           char* gpos = strchr(command, 'G');
1795 1795
           if (gpos) {
1796 1796
             switch (strtol(gpos + 1, nullptr, 10)) {
1797 1797
               case 0 ... 1:
1798
-              #if ENABLED(ARC_SUPPORT)
1799
-                case 2 ... 3:
1800
-              #endif
1801
-              #if ENABLED(BEZIER_CURVE_SUPPORT)
1802
-                case 5:
1803
-              #endif
1798
+              TERN_(ARC_SUPPORT, case 2 ... 3:)
1799
+              TERN_(BEZIER_CURVE_SUPPORT, case 5:)
1804 1800
                 SERIAL_ECHOLNPGM(STR_ERR_STOPPED);
1805 1801
                 LCD_MESSAGEPGM(MSG_STOPPED);
1806 1802
                 break;

Loading…
Cancel
Save