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
           if (e < HOTENDS - 1) SERIAL_CHAR(',');
66
           if (e < HOTENDS - 1) SERIAL_CHAR(',');
67
         }
67
         }
68
         SERIAL_EOL();
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
         #if HAS_HEATED_BED
70
         #if HAS_HEATED_BED
76
           SERIAL_PROTOCOLLNPAIR("target_temperature_bed: ", job_recovery_info.target_temperature_bed);
71
           SERIAL_PROTOCOLLNPAIR("target_temperature_bed: ", job_recovery_info.target_temperature_bed);
77
         #endif
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
         #if HAS_LEVELING
83
         #if HAS_LEVELING
79
           SERIAL_PROTOCOLPAIR("leveling: ", int(job_recovery_info.leveling));
84
           SERIAL_PROTOCOLPAIR("leveling: ", int(job_recovery_info.leveling));
80
           SERIAL_PROTOCOLLNPAIR(" fade: ", int(job_recovery_info.fade));
85
           SERIAL_PROTOCOLLNPAIR(" fade: ", int(job_recovery_info.fade));
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
 void save_job_recovery_info() {
190
 void save_job_recovery_info() {
186
   #if SAVE_INFO_INTERVAL_MS > 0
191
   #if SAVE_INFO_INTERVAL_MS > 0
209
     COPY(job_recovery_info.current_position, current_position);
214
     COPY(job_recovery_info.current_position, current_position);
210
     job_recovery_info.feedrate = feedrate_mm_s;
215
     job_recovery_info.feedrate = feedrate_mm_s;
211
     COPY(job_recovery_info.target_temperature, thermalManager.target_temperature);
216
     COPY(job_recovery_info.target_temperature, thermalManager.target_temperature);
217
+
212
     #if HAS_HEATED_BED
218
     #if HAS_HEATED_BED
213
       job_recovery_info.target_temperature_bed = thermalManager.target_temperature_bed;
219
       job_recovery_info.target_temperature_bed = thermalManager.target_temperature_bed;
214
     #endif
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
     #if HAS_LEVELING
226
     #if HAS_LEVELING
218
       job_recovery_info.leveling = planner.leveling_active;
227
       job_recovery_info.leveling = planner.leveling_active;

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

40
 
40
 
41
   // Machine state
41
   // Machine state
42
   float current_position[NUM_AXIS], feedrate;
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
   #if HAS_HEATED_BED
45
   #if HAS_HEATED_BED
47
     int16_t target_temperature_bed;
46
     int16_t target_temperature_bed;
48
   #endif
47
   #endif
49
 
48
 
49
+  #if FAN_COUNT
50
+    int16_t fanSpeeds[FAN_COUNT];
51
+  #endif
52
+
50
   #if HAS_LEVELING
53
   #if HAS_LEVELING
51
     bool leveling;
54
     bool leveling;
52
     float fade;
55
     float fade;

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

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

Loading…
Cancel
Save