Преглед на файлове

Patch some DGUS warnings

Scott Lahteine преди 4 години
родител
ревизия
319e93f55d
променени са 1 файла, в които са добавени 11 реда и са изтрити 18 реда
  1. 11
    18
      Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp

+ 11
- 18
Marlin/src/lcd/extui/lib/dgus/DGUSDisplay.cpp Целия файл

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

Loading…
Отказ
Запис