Browse Source

Minor patches to POWER_LOSS_RECOVERY

Scott Lahteine 7 years ago
parent
commit
4b2af6ab48

+ 17
- 8
Marlin/src/feature/power_loss_recovery.cpp View File

@@ -66,15 +66,20 @@ static char sd_filename[MAXPATHNAMELENGTH];
66 66
           if (e < HOTENDS - 1) SERIAL_CHAR(',');
67 67
         }
68 68
         SERIAL_EOL();
69
-        SERIAL_PROTOCOLPGM("fanSpeeds: ");
70
-        for (uint8_t i = 0; i < FAN_COUNT; i++) {
71
-          SERIAL_PROTOCOL(job_recovery_info.fanSpeeds[i]);
72
-          if (i < FAN_COUNT - 1) SERIAL_CHAR(',');
73
-        }
74
-        SERIAL_EOL();
69
+
75 70
         #if HAS_HEATED_BED
76 71
           SERIAL_PROTOCOLLNPAIR("target_temperature_bed: ", job_recovery_info.target_temperature_bed);
77 72
         #endif
73
+
74
+        #if FAN_COUNT
75
+          SERIAL_PROTOCOLPGM("fanSpeeds: ");
76
+          for (int8_t i = 0; i < FAN_COUNT; i++) {
77
+            SERIAL_PROTOCOL(job_recovery_info.fanSpeeds[i]);
78
+            if (i < FAN_COUNT - 1) SERIAL_CHAR(',');
79
+          }
80
+          SERIAL_EOL();
81
+        #endif
82
+
78 83
         #if HAS_LEVELING
79 84
           SERIAL_PROTOCOLPAIR("leveling: ", int(job_recovery_info.leveling));
80 85
           SERIAL_PROTOCOLLNPAIR(" fade: ", int(job_recovery_info.fade));
@@ -180,7 +185,7 @@ void do_print_job_recovery() {
180 185
 }
181 186
 
182 187
 /**
183
- * Save the current machine state to the "bin" file
188
+ * Save the current machine state to the power-loss recovery file
184 189
  */
185 190
 void save_job_recovery_info() {
186 191
   #if SAVE_INFO_INTERVAL_MS > 0
@@ -209,10 +214,14 @@ void save_job_recovery_info() {
209 214
     COPY(job_recovery_info.current_position, current_position);
210 215
     job_recovery_info.feedrate = feedrate_mm_s;
211 216
     COPY(job_recovery_info.target_temperature, thermalManager.target_temperature);
217
+
212 218
     #if HAS_HEATED_BED
213 219
       job_recovery_info.target_temperature_bed = thermalManager.target_temperature_bed;
214 220
     #endif
215
-    COPY(job_recovery_info.fanSpeeds, fanSpeeds);
221
+
222
+    #if FAN_COUNT
223
+      COPY(job_recovery_info.fanSpeeds, fanSpeeds);
224
+    #endif
216 225
 
217 226
     #if HAS_LEVELING
218 227
       job_recovery_info.leveling = planner.leveling_active;

+ 5
- 2
Marlin/src/feature/power_loss_recovery.h View File

@@ -40,13 +40,16 @@ typedef struct {
40 40
 
41 41
   // Machine state
42 42
   float current_position[NUM_AXIS], feedrate;
43
-  int16_t target_temperature[HOTENDS],
44
-          fanSpeeds[FAN_COUNT];
43
+  int16_t target_temperature[HOTENDS];
45 44
 
46 45
   #if HAS_HEATED_BED
47 46
     int16_t target_temperature_bed;
48 47
   #endif
49 48
 
49
+  #if FAN_COUNT
50
+    int16_t fanSpeeds[FAN_COUNT];
51
+  #endif
52
+
50 53
   #if HAS_LEVELING
51 54
     bool leveling;
52 55
     float fade;

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

@@ -1016,7 +1016,7 @@ void CardReader::printingHasFinished() {
1016 1016
     const bool success = jobRecoveryFile.remove(&root, job_recovery_file_name);
1017 1017
     #if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
1018 1018
       SERIAL_PROTOCOLPGM("Power-loss file delete");
1019
-      serialprintPGM(success ? PSTR("d.") : PSTR(" failed."))
1019
+      serialprintPGM(success ? PSTR("d.\n") : PSTR(" failed.\n"));
1020 1020
     #else
1021 1021
       UNUSED(success);
1022 1022
     #endif

Loading…
Cancel
Save