Browse Source

Patch some DGUS warnings

Scott Lahteine 4 years ago
parent
commit
319e93f55d
1 changed files with 11 additions and 18 deletions
  1. 11
    18
      Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp

+ 11
- 18
Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp View File

907
 }
907
 }
908
 
908
 
909
 #if ENABLED(DGUS_PREHEAT_UI)
909
 #if ENABLED(DGUS_PREHEAT_UI)
910
+
910
   void DGUSScreenVariableHandler::HandlePreheat(DGUS_VP_Variable &var, void *val_ptr) {
911
   void DGUSScreenVariableHandler::HandlePreheat(DGUS_VP_Variable &var, void *val_ptr) {
911
     DEBUG_ECHOLNPGM("HandlePreheat");
912
     DEBUG_ECHOLNPGM("HandlePreheat");
912
 
913
 
913
     uint8_t e_temp = 0;
914
     uint8_t e_temp = 0;
914
-    uint8_t bed_temp = 0;
915
+    TERN_(HAS_HEATED_BED, uint8_t bed_temp = 0);
915
     const uint16_t preheat_option = swap16(*(uint16_t*)val_ptr);
916
     const uint16_t preheat_option = swap16(*(uint16_t*)val_ptr);
916
     switch (preheat_option) {
917
     switch (preheat_option) {
918
+      default:
917
       case 0: // Preheat PLA
919
       case 0: // Preheat PLA
918
         #if defined(PREHEAT_1_TEMP_HOTEND) && defined(PREHEAT_1_TEMP_BED)
920
         #if defined(PREHEAT_1_TEMP_HOTEND) && defined(PREHEAT_1_TEMP_BED)
919
           e_temp = PREHEAT_1_TEMP_HOTEND;
921
           e_temp = PREHEAT_1_TEMP_HOTEND;
920
-          bed_temp = PREHEAT_1_TEMP_BED;
922
+          TERN_(HAS_HEATED_BED, bed_temp = PREHEAT_1_TEMP_BED);
921
         #endif
923
         #endif
922
         break;
924
         break;
923
       case 1: // Preheat ABS
925
       case 1: // Preheat ABS
924
         #if defined(PREHEAT_2_TEMP_HOTEND) && defined(PREHEAT_2_TEMP_BED)
926
         #if defined(PREHEAT_2_TEMP_HOTEND) && defined(PREHEAT_2_TEMP_BED)
925
           e_temp = PREHEAT_2_TEMP_HOTEND;
927
           e_temp = PREHEAT_2_TEMP_HOTEND;
926
-          bed_temp = PREHEAT_2_TEMP_BED;
928
+          TERN_(HAS_HEATED_BED, bed_temp = PREHEAT_2_TEMP_BED);
927
         #endif
929
         #endif
928
         break;
930
         break;
929
       case 2: // Preheat PET
931
       case 2: // Preheat PET
930
         #if defined(PREHEAT_3_TEMP_HOTEND) && defined(PREHEAT_3_TEMP_BED)
932
         #if defined(PREHEAT_3_TEMP_HOTEND) && defined(PREHEAT_3_TEMP_BED)
931
           e_temp = PREHEAT_3_TEMP_HOTEND;
933
           e_temp = PREHEAT_3_TEMP_HOTEND;
932
-          bed_temp = PREHEAT_3_TEMP_BED;
934
+          TERN_(HAS_HEATED_BED, bed_temp = PREHEAT_3_TEMP_BED);
933
         #endif
935
         #endif
934
         break;
936
         break;
935
       case 3: // Preheat FLEX
937
       case 3: // Preheat FLEX
936
         #if defined(PREHEAT_4_TEMP_HOTEND) && defined(PREHEAT_4_TEMP_BED)
938
         #if defined(PREHEAT_4_TEMP_HOTEND) && defined(PREHEAT_4_TEMP_BED)
937
           e_temp = PREHEAT_4_TEMP_HOTEND;
939
           e_temp = PREHEAT_4_TEMP_HOTEND;
938
-          bed_temp = PREHEAT_4_TEMP_BED;
939
-        #endif
940
-        break;
941
-      case 7: // Custom preheat
942
-        break;
943
-      case 9: // Cool down
944
-        e_temp = 0;
945
-        bed_temp = 0;
946
-        break;
947
-      default:
948
-        #if defined(PREHEAT_1_TEMP_HOTEND) && defined(PREHEAT_1_TEMP_BED)
949
-          e_temp = PREHEAT_1_TEMP_HOTEND;
950
-          bed_temp = PREHEAT_1_TEMP_BED;
940
+          TERN_(HAS_HEATED_BED, bed_temp = PREHEAT_4_TEMP_BED);
951
         #endif
941
         #endif
952
         break;
942
         break;
943
+      case 7: break; // Custom preheat
944
+      case 9: break; // Cool down
953
     }
945
     }
954
 
946
 
955
     switch (var.VP) {
947
     switch (var.VP) {
971
     // Go to the preheat screen to show the heating progress
963
     // Go to the preheat screen to show the heating progress
972
     GotoScreen(DGUSLCD_SCREEN_PREHEAT);
964
     GotoScreen(DGUSLCD_SCREEN_PREHEAT);
973
   }
965
   }
966
+
974
 #endif
967
 #endif
975
 
968
 
976
 #if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
969
 #if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
1306
         |           Command          DataLen (in Words) */
1299
         |           Command          DataLen (in Words) */
1307
         if (command == DGUS_CMD_READVAR) {
1300
         if (command == DGUS_CMD_READVAR) {
1308
           const uint16_t vp = tmp[0] << 8 | tmp[1];
1301
           const uint16_t vp = tmp[0] << 8 | tmp[1];
1309
-          const uint8_t dlen = tmp[2] << 1;  // Convert to Bytes. (Display works with words)
1302
+          //const uint8_t dlen = tmp[2] << 1;  // Convert to Bytes. (Display works with words)
1310
           //DEBUG_ECHOPAIR(" vp=", vp, " dlen=", dlen);
1303
           //DEBUG_ECHOPAIR(" vp=", vp, " dlen=", dlen);
1311
           DGUS_VP_Variable ramcopy;
1304
           DGUS_VP_Variable ramcopy;
1312
           if (populate_VPVar(vp, &ramcopy)) {
1305
           if (populate_VPVar(vp, &ramcopy)) {

Loading…
Cancel
Save