Browse Source

Initial conflict resolution of SD_REPRINT_LAST_SELECTED_FILE (#8104)

* Initial conflict resolution

All previous items resolved:
- Use of ELAPSED() on timer code
- Switch to use of defer_return_to_status=true as much as possible
- Update & Clean Up of Max7219 routines

* Resolve non-SD case in ultralcd.cpp
Roxy-3D 6 years ago
parent
commit
2e746f2b8b
35 changed files with 805 additions and 267 deletions
  1. 14
    3
      Marlin/Configuration_adv.h
  2. 302
    144
      Marlin/Max7219_Debug_LEDs.cpp
  3. 33
    31
      Marlin/Max7219_Debug_LEDs.h
  4. 21
    0
      Marlin/cardreader.cpp
  5. 14
    3
      Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h
  6. 14
    3
      Marlin/example_configurations/Anet/A6/Configuration_adv.h
  7. 14
    3
      Marlin/example_configurations/Anet/A8/Configuration_adv.h
  8. 14
    3
      Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h
  9. 14
    3
      Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h
  10. 14
    3
      Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h
  11. 14
    3
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  12. 14
    3
      Marlin/example_configurations/Creality/CR-10/Configuration_adv.h
  13. 14
    3
      Marlin/example_configurations/Felix/Configuration_adv.h
  14. 0
    0
      Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h
  15. 14
    3
      Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h
  16. 14
    3
      Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h
  17. 14
    3
      Marlin/example_configurations/Malyan/M150/Configuration_adv.h
  18. 14
    3
      Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h
  19. 14
    3
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  20. 14
    3
      Marlin/example_configurations/SCARA/Configuration_adv.h
  21. 14
    3
      Marlin/example_configurations/Sanguinololu/Configuration_adv.h
  22. 14
    3
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  23. 14
    3
      Marlin/example_configurations/Velleman/K8200/Configuration_adv.h
  24. 14
    3
      Marlin/example_configurations/Velleman/K8400/Configuration_adv.h
  25. 14
    3
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  26. 14
    3
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  27. 14
    3
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  28. 14
    3
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  29. 14
    3
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  30. 14
    3
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  31. 14
    3
      Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h
  32. 14
    3
      Marlin/example_configurations/makibox/Configuration_adv.h
  33. 14
    3
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  34. 14
    3
      Marlin/example_configurations/wt150/Configuration_adv.h
  35. 29
    2
      Marlin/ultralcd.cpp

+ 14
- 3
Marlin/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 302
- 144
Marlin/Max7219_Debug_LEDs.cpp View File

@@ -39,12 +39,14 @@
39 39
  * void Max7219_init();
40 40
  * void Max7219_PutByte(uint8_t data);
41 41
  * void Max7219(uint8_t reg, uint8_t data);
42
- * void Max7219_LED_On(uint8_t row, uint8_t col);
43
- * void Max7219_LED_Off(uint8_t row, uint8_t col);
44
- * void Max7219_LED_Toggle(uint8_t row, uint8_t col);
42
+ * void Max7219_LED_On(uint8_t col, uint8_t row);
43
+ * void Max7219_LED_Off(uint8_t col, uint8_t row);
44
+ * void Max7219_LED_Toggle(uint8_t col, uint8_t row);
45 45
  * void Max7219_Clear_Row(uint8_t row);
46 46
  * void Max7219_Clear_Column(uint8_t col);
47 47
  * void Max7219_Set_Row(uint8_t row, uint8_t val);
48
+ * void Max7219_Set_2_Rows(uint8_t row, uint16_t val);
49
+ * void Max7219_Set_4_Rows(uint8_t row, uint32_t val);
48 50
  * void Max7219_Set_Column(uint8_t col, uint8_t val);
49 51
  * void Max7219_idle_tasks();
50 52
  */
@@ -53,184 +55,340 @@
53 55
 
54 56
 #if ENABLED(MAX7219_DEBUG)
55 57
 
56
-  #include "Marlin.h"
57
-  #include "planner.h"
58
-  #include "stepper.h"
59
-  #include "Max7219_Debug_LEDs.h"
58
+#include "Max7219_Debug_LEDs.h"
60 59
 
61
-  static uint8_t LEDs[8] = { 0 };
60
+#include "planner.h"
61
+#include "stepper.h"
62
+#include "Marlin.h"
62 63
 
63
-  void Max7219_PutByte(uint8_t data) {
64
-    for (uint8_t i = 8; i--;) {
64
+static uint8_t LEDs[8] = { 0 };
65
+
66
+void Max7219_PutByte(uint8_t data) {
67
+  CRITICAL_SECTION_START
68
+  for (uint8_t i = 8; i--;) {
69
+    #ifdef CPU_32_BIT                    // The 32-bit processors are so fast, a small delay in the code is needed
70
+      delayMicroseconds(5);              // to let the signal wires stabilize.
65 71
       WRITE(MAX7219_CLK_PIN, LOW);       // tick
72
+      delayMicroseconds(5);
66 73
       WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW);  // send 1 or 0 based on data bit
74
+      delayMicroseconds(5);
67 75
       WRITE(MAX7219_CLK_PIN, HIGH);      // tock
68
-      data <<= 1;
69
-    }
76
+      delayMicroseconds(5);
77
+    #else
78
+      WRITE(MAX7219_CLK_PIN, LOW);       // tick
79
+      WRITE(MAX7219_DIN_PIN, (data & 0x80) ? HIGH : LOW);  // send 1 or 0 based on data bit
80
+      WRITE(MAX7219_CLK_PIN, HIGH);      // tock
81
+    #endif
82
+
83
+    data <<= 1;
70 84
   }
85
+  CRITICAL_SECTION_END
86
+}
87
+
88
+void Max7219(const uint8_t reg, const uint8_t data) {
89
+  #ifdef CPU_32_BIT
90
+    delayMicroseconds(5);
91
+  #endif
92
+  CRITICAL_SECTION_START
93
+  WRITE(MAX7219_LOAD_PIN, LOW);  // begin
94
+  #ifdef CPU_32_BIT              // The 32-bit processors are so fast, a small delay in the code is needed
95
+    delayMicroseconds(5);        // to let the signal wires stabilize.
96
+  #endif
97
+  Max7219_PutByte(reg);          // specify register
98
+  #ifdef CPU_32_BIT
99
+    delayMicroseconds(5);
100
+  #endif
101
+  Max7219_PutByte(data);         // put data
102
+  #ifdef CPU_32_BIT
103
+    delayMicroseconds(5);
104
+  #endif
105
+  WRITE(MAX7219_LOAD_PIN, LOW);  // and tell the chip to load the data
106
+  #ifdef CPU_32_BIT
107
+    delayMicroseconds(5);
108
+  #endif
109
+  WRITE(MAX7219_LOAD_PIN, HIGH);
110
+  CRITICAL_SECTION_END
111
+  #ifdef CPU_32_BIT
112
+    delayMicroseconds(5);
113
+  #endif
114
+}
71 115
 
72
-  void Max7219(const uint8_t reg, const uint8_t data) {
73
-    WRITE(MAX7219_LOAD_PIN, LOW);  // begin
74
-    Max7219_PutByte(reg);          // specify register
75
-    Max7219_PutByte(data);         // put data
76
-    WRITE(MAX7219_LOAD_PIN, LOW);  // and tell the chip to load the data
77
-    WRITE(MAX7219_LOAD_PIN, HIGH);
116
+void Max7219_LED_Set(const uint8_t row, const uint8_t col, const bool on) {
117
+  if (row > 7 || col > 7) {
118
+    int r,c;
119
+    r = row;
120
+    c = col;
121
+    SERIAL_ECHOPAIR("??? Max7219_LED_Set(",r);
122
+    SERIAL_ECHOPAIR(",",c);
123
+    SERIAL_ECHO(")\n");
124
+    return;
78 125
   }
126
+  if (TEST(LEDs[row], col) == on) return; // if LED is already on/off, leave alone
127
+  if (on) SBI(LEDs[row], col); else CBI(LEDs[row], col);
128
+  Max7219(8 - row, LEDs[row]);
129
+}
79 130
 
80
-  void Max7219_LED_Set(const uint8_t row, const uint8_t col, const bool on) {
81
-    if (row > 7 || col > 7) return;
82
-    if (TEST(LEDs[row], col) == on) return; // if LED is already on/off, leave alone
83
-    if (on) SBI(LEDs[row], col); else CBI(LEDs[row], col);
84
-    Max7219(8 - row, LEDs[row]);
131
+void Max7219_LED_On(const uint8_t col, const uint8_t row) {
132
+  if (row > 7 || col > 7) {
133
+    int r,c;
134
+    r = row;
135
+    c = col;
136
+    SERIAL_ECHOPAIR("??? Max7219_LED_On(",c);
137
+    SERIAL_ECHOPAIR(",",r);
138
+    SERIAL_ECHO(")\n");
139
+    return;
85 140
   }
141
+  Max7219_LED_Set(col, row, true);
142
+}
86 143
 
87
-  void Max7219_LED_On(const uint8_t row, const uint8_t col) {
88
-    Max7219_LED_Set(row, col, true);
144
+void Max7219_LED_Off(const uint8_t col, const uint8_t row) {
145
+  if (row > 7 || col > 7) {
146
+    int r,c;
147
+    r = row;
148
+    c = col;
149
+    SERIAL_ECHOPAIR("??? Max7219_LED_Off(",r);
150
+    SERIAL_ECHOPAIR(",",c);
151
+    SERIAL_ECHO(")\n");
152
+    return;
89 153
   }
154
+  Max7219_LED_Set(col, row, false);
155
+}
90 156
 
91
-  void Max7219_LED_Off(const uint8_t row, const uint8_t col) {
92
-    Max7219_LED_Set(row, col, false);
157
+void Max7219_LED_Toggle(const uint8_t col, const uint8_t row) {
158
+  if (row > 7 || col > 7) {
159
+    int r,c;
160
+    r = row;
161
+    c = col;
162
+    SERIAL_ECHOPAIR("??? Max7219_LED_Toggle(",r);
163
+    SERIAL_ECHOPAIR(",",c);
164
+    SERIAL_ECHO(")\n");
165
+    return;
93 166
   }
167
+  if (TEST(LEDs[row], col))
168
+    Max7219_LED_Off(col, row);
169
+  else
170
+    Max7219_LED_On(col, row);
171
+}
94 172
 
95
-  void Max7219_LED_Toggle(const uint8_t row, const uint8_t col) {
96
-    if (row > 7 || col > 7) return;
97
-    if (TEST(LEDs[row], col))
98
-      Max7219_LED_Off(row, col);
99
-    else
100
-      Max7219_LED_On(row, col);
173
+void Max7219_Clear_Column(const uint8_t col) {
174
+  if (col > 7) {
175
+    int c;
176
+    c = col;
177
+    SERIAL_ECHOPAIR("??? Max7219_Clear_Column(",c);
178
+    SERIAL_ECHO(")\n");
179
+    return;
101 180
   }
181
+  LEDs[col] = 0;
182
+  Max7219(8 - col, LEDs[col]);
183
+}
102 184
 
103
-  void Max7219_Clear_Column(const uint8_t col) {
104
-    if (col > 7) return;
105
-    LEDs[col] = 0;
106
-    Max7219(8 - col, LEDs[col]);
185
+void Max7219_Clear_Row(const uint8_t row) {
186
+  if (row > 7) {
187
+    int r;
188
+    r = row;
189
+    SERIAL_ECHOPAIR("??? Max7219_Clear_Row(",r);
190
+    SERIAL_ECHO(")\n");
191
+    return;
107 192
   }
193
+  for (uint8_t c = 0; c <= 7; c++)
194
+    Max7219_LED_Off(c, row);
195
+}
108 196
 
109
-  void Max7219_Clear_Row(const uint8_t row) {
110
-    if (row > 7) return;
111
-    for (uint8_t c = 0; c <= 7; c++)
112
-      Max7219_LED_Off(c, row);
197
+void Max7219_Set_Row(const uint8_t row, const uint8_t val) {
198
+  if (row > 7 || val>255) {
199
+    int r, v;
200
+    r = row;
201
+    v = val;
202
+    SERIAL_ECHOPAIR("??? Max7219_Set_Row(",r);
203
+    SERIAL_ECHOPAIR(",",v);
204
+    SERIAL_ECHO(")\n");
205
+    return;
113 206
   }
207
+  for (uint8_t b = 0; b <= 7; b++)
208
+    if (TEST(val, b))
209
+      Max7219_LED_On(7 - b, row);
210
+    else
211
+      Max7219_LED_Off(7 - b, row);
212
+}
114 213
 
115
-  void Max7219_Set_Row(const uint8_t row, const uint8_t val) {
116
-    if (row > 7) return;
117
-    for (uint8_t b = 0; b <= 7; b++)
118
-      if (TEST(val, b))
119
-        Max7219_LED_On(7 - b, row);
120
-      else
121
-        Max7219_LED_Off(7 - b, row);
214
+void Max7219_Set_2_Rows(const uint8_t row, const uint16_t val) {
215
+  if (row > 6 || val>65535) {
216
+    int r, v;
217
+    r = row;
218
+    v = val;
219
+    SERIAL_ECHOPAIR("??? Max7219_Set_2_Rows(",r);
220
+    SERIAL_ECHOPAIR(",",v);
221
+    SERIAL_ECHO(")\n");
222
+    return;
122 223
   }
224
+  Max7219_Set_Row(row+1, (val & 0xff00) >> 8 );
225
+  Max7219_Set_Row(row+0, (val & 0xff));
226
+}
123 227
 
124
-  void Max7219_Set_Column(const uint8_t col, const uint8_t val) {
125
-    if (col > 7) return;
126
-    LEDs[col] = val;
127
-    Max7219(8 - col, LEDs[col]);
228
+void Max7219_Set_4_Rows(const uint8_t row, const uint32_t val) {
229
+  if (row > 4 ) {
230
+    int r;
231
+    long v;
232
+    r = row;
233
+    v = val;
234
+    SERIAL_ECHOPAIR("??? Max7219_Set_4_Rows(",r);
235
+    SERIAL_ECHOPAIR(",",v);
236
+    SERIAL_ECHO(")\n");
237
+    return;
128 238
   }
239
+  Max7219_Set_Row(row+3, (val & 0xff000000) >> 24);
240
+  Max7219_Set_Row(row+2, (val & 0xff0000) >> 16);
241
+  Max7219_Set_Row(row+1, (val & 0xff00) >> 8);
242
+  Max7219_Set_Row(row+0, (val & 0xff));
243
+}
129 244
 
130
-  void Max7219_init() {
131
-    uint8_t i, x, y;
245
+void Max7219_Set_Column(const uint8_t col, const uint8_t val) {
246
+  if (val > 255 || col > 7) {
247
+    int v,c;
248
+    v = val;
249
+    c = col;
250
+    SERIAL_ECHOPAIR("??? Max7219_Column(",c);
251
+    SERIAL_ECHOPAIR(",",v);
252
+    SERIAL_ECHO(")\n");
253
+    return;
254
+  }
255
+  LEDs[col] = val;
256
+  Max7219(8 - col, LEDs[col]);
257
+}
132 258
 
133
-    SET_OUTPUT(MAX7219_DIN_PIN);
134
-    SET_OUTPUT(MAX7219_CLK_PIN);
259
+void Max7219_init() {
260
+  uint8_t i, x, y;
135 261
 
136
-    OUT_WRITE(MAX7219_LOAD_PIN, HIGH);
262
+  SET_OUTPUT(MAX7219_DIN_PIN);
263
+  SET_OUTPUT(MAX7219_CLK_PIN);
137 264
 
138
-    //initiation of the max 7219
139
-    Max7219(max7219_reg_scanLimit, 0x07);
140
-    Max7219(max7219_reg_decodeMode, 0x00);  // using an led matrix (not digits)
141
-    Max7219(max7219_reg_shutdown, 0x01);    // not in shutdown mode
142
-    Max7219(max7219_reg_displayTest, 0x00); // no display test
143
-    Max7219(max7219_reg_intensity, 0x01 & 0x0F); // the first 0x0F is the value you can set
144
-                                                 // range: 0x00 to 0x0F
145
-    for (i = 0; i <= 7; i++) {      // empty registers, turn all LEDs off
146
-      LEDs[i] = 0x00;
147
-      Max7219(i + 1, 0);
148
-    }
265
+  OUT_WRITE(MAX7219_LOAD_PIN, HIGH);
266
+  delay(1);
149 267
 
150
-    for (x = 0; x <= 7; x++)        // Do an aesthetically pleasing pattern to fully test
151
-      for (y = 0; y <= 7; y++) {    // the Max7219 module and LEDs. First, turn them
152
-        Max7219_LED_On(x, y);       // all on.
153
-        delay(3);
154
-      }
155
-
156
-    for (x = 0; x <= 7; x++)        // Now, turn them all off.
157
-      for (y = 0; y <= 7; y++) {
158
-        Max7219_LED_Off(x, y);
159
-        delay(3);                   // delay() is OK here. Max7219_init() is only called from
160
-      }                             // setup() and nothing is running yet.
161
-
162
-    delay(150);
163
-
164
-    for (x = 8; x--;)               // Now, do the same thing from the opposite direction
165
-      for (y = 0; y <= 7; y++) {
166
-        Max7219_LED_On(x, y);
167
-        delay(2);
168
-      }
169
-
170
-    for (x = 8; x--;)
171
-      for (y = 0; y <= 7; y++) {
172
-        Max7219_LED_Off(x, y);
173
-        delay(2);
174
-      }
268
+  //initiation of the max 7219
269
+  Max7219(max7219_reg_scanLimit, 0x07);
270
+  Max7219(max7219_reg_decodeMode, 0x00);  // using an led matrix (not digits)
271
+  Max7219(max7219_reg_shutdown, 0x01);    // not in shutdown mode
272
+  Max7219(max7219_reg_displayTest, 0x00); // no display test
273
+  Max7219(max7219_reg_intensity, 0x01 & 0x0F); // the first 0x0F is the value you can set
274
+                                               // range: 0x00 to 0x0F
275
+  for (i = 0; i <= 7; i++) {      // empty registers, turn all LEDs off
276
+    LEDs[i] = 0x00;
277
+    Max7219(i + 1, 0);
175 278
   }
176 279
 
280
+  for (x = 0; x <= 7; x++)        // Do an aesthetically pleasing pattern to fully test
281
+    for (y = 0; y <= 7; y++) {    // the Max7219 module and LEDs. First, turn them
282
+      Max7219_LED_On(x, y);       // all on.
283
+      delay(3);
284
+    }
285
+
286
+  for (x = 0; x <= 7; x++)        // Now, turn them all off.
287
+    for (y = 0; y <= 7; y++) {
288
+      Max7219_LED_Off(x, y);
289
+      delay(3);                   // delay() is OK here. Max7219_init() is only called from
290
+    }                             // setup() and nothing is running yet.
291
+
292
+  delay(150);
293
+
294
+  for (x = 8; x--;)               // Now, do the same thing from the opposite direction
295
+    for (y = 0; y <= 7; y++) {
296
+      Max7219_LED_On(x, y);
297
+      delay(2);
298
+    }
299
+
300
+  for (x = 8; x--;)
301
+    for (y = 0; y <= 7; y++) {
302
+      Max7219_LED_Off(x, y);
303
+      delay(2);
304
+    }
305
+}
306
+
177 307
 /**
178
- * These are sample debug features to demonstrate the usage of the 8x8 LED Matrix for debug purposes.
179
- * There is very little CPU burden added to the system by displaying information within the idle()
180
- * task.
181
- *
182
- * But with that said, if your debugging can be facilitated by making calls into the library from
183
- * other places in the code, feel free to do it.  The CPU burden for a few calls to toggle an LED
184
- * or clear a row is not very significant.
185
- */
186
-  void Max7219_idle_tasks() {
187
-    #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE)
188
-      static int debug_cnt = 0;
189
-      if (debug_cnt++ > 100) {
308
+* These are sample debug features to demonstrate the usage of the 8x8 LED Matrix for debug purposes.
309
+* There is very little CPU burden added to the system by displaying information within the idle()
310
+* task.
311
+*
312
+* But with that said, if your debugging can be facilitated by making calls into the library from
313
+* other places in the code, feel free to do it.  The CPU burden for a few calls to toggle an LED
314
+* or clear a row is not very significant.
315
+*/
316
+void Max7219_idle_tasks() {
317
+#if MAX7219_DEBUG_STEPPER_HEAD || MAX7219_DEBUG_STEPPER_TAIL || MAX7219_DEBUG_STEPPER_QUEUE
318
+  CRITICAL_SECTION_START
319
+  #if MAX7219_DEBUG_STEPPER_HEAD || MAX7219_DEBUG_STEPPER_QUEUE
320
+    uint8_t head;
321
+    head = planner.block_buffer_head;
322
+  #endif
323
+  #if MAX7219_DEBUG_STEPPER_TAIL || MAX7219_DEBUG_STEPPER_QUEUE
324
+    uint8_t tail;
325
+    tail = planner.block_buffer_tail;
326
+  #endif
327
+  CRITICAL_SECTION_END
328
+#endif
329
+
330
+  #if ENABLED(MAX7219_DEBUG_PRINTER_ALIVE)
331
+    static millis_t next_blink = 0;
332
+
333
+    if (ELAPSED(millis(), next_blink)) {
190 334
         Max7219_LED_Toggle(7, 7);
191
-        debug_cnt = 0;
192
-      }
193
-    #endif
335
+        next_blink = millis() + 750;
336
+    }
337
+  #endif
194 338
 
195
-    #ifdef MAX7219_DEBUG_STEPPER_HEAD
196
-      Max7219_Clear_Row(MAX7219_DEBUG_STEPPER_HEAD);
197
-      Max7219_Clear_Row(MAX7219_DEBUG_STEPPER_HEAD + 1);
198
-      if ( planner.block_buffer_head < 8)
199
-        Max7219_LED_On( planner.block_buffer_head, MAX7219_DEBUG_STEPPER_HEAD);
339
+  #ifdef MAX7219_DEBUG_STEPPER_HEAD
340
+    static int16_t last_head_cnt=0;
341
+    if (last_head_cnt != head) {
342
+      if ( last_head_cnt < 8)
343
+        Max7219_LED_Off( last_head_cnt, MAX7219_DEBUG_STEPPER_HEAD);
200 344
       else
201
-        Max7219_LED_On( planner.block_buffer_head-8, MAX7219_DEBUG_STEPPER_HEAD+1);
202
-    #endif
345
+        Max7219_LED_Off( last_head_cnt-8, MAX7219_DEBUG_STEPPER_HEAD+1);
203 346
 
204
-    #ifdef MAX7219_DEBUG_STEPPER_TAIL
205
-      Max7219_Clear_Row(MAX7219_DEBUG_STEPPER_TAIL);
206
-      Max7219_Clear_Row(MAX7219_DEBUG_STEPPER_TAIL + 1);
207
-      if ( planner.block_buffer_tail < 8)
208
-        Max7219_LED_On( planner.block_buffer_tail, MAX7219_DEBUG_STEPPER_TAIL );
347
+      last_head_cnt = head;
348
+      if ( head < 8)
349
+        Max7219_LED_On(head, MAX7219_DEBUG_STEPPER_HEAD);
209 350
       else
210
-        Max7219_LED_On( planner.block_buffer_tail-8, MAX7219_DEBUG_STEPPER_TAIL+1 );
211
-    #endif
351
+        Max7219_LED_On(head-8, MAX7219_DEBUG_STEPPER_HEAD+1);
352
+    }
353
+  #endif
212 354
 
213
-    #ifdef MAX7219_DEBUG_STEPPER_QUEUE
214
-      static int16_t last_depth = 0;
215
-      int16_t current_depth = planner.block_buffer_head - planner.block_buffer_tail;
216
-      if (current_depth != last_depth) {  // usually, no update will be needed.
217
-        if (current_depth < 0) current_depth += BLOCK_BUFFER_SIZE;
218
-        NOMORE(current_depth, BLOCK_BUFFER_SIZE);
219
-        NOMORE(current_depth, 16);        // if the BLOCK_BUFFER_SIZE is greater than 16, two lines
220
-                                          // of LEDs is enough to see if the buffer is draining
221
-
222
-        const uint8_t st = min(current_depth, last_depth),
223
-                      en = max(current_depth, last_depth);
224
-        if (current_depth < last_depth)
225
-          for (uint8_t i = st; i <= en; i++)   // clear the highest order LEDs
226
-            Max7219_LED_Off(i >> 1, MAX7219_DEBUG_STEPPER_QUEUE + (i & 1));
227
-        else
228
-          for (uint8_t i = st; i <= en; i++)   // set the highest order LEDs
229
-            Max7219_LED_On(i >> 1, MAX7219_DEBUG_STEPPER_QUEUE + (i & 1));
230
-
231
-        last_depth = current_depth;
232
-      }
233
-    #endif
234
-  }
355
+  #ifdef MAX7219_DEBUG_STEPPER_TAIL
356
+    static int16_t last_tail_cnt=0;
357
+    if (last_tail_cnt != tail) {
358
+      if ( last_tail_cnt < 8)
359
+        Max7219_LED_Off( last_tail_cnt, MAX7219_DEBUG_STEPPER_TAIL);
360
+      else
361
+        Max7219_LED_Off( last_tail_cnt-8, MAX7219_DEBUG_STEPPER_TAIL+1);
362
+
363
+      last_tail_cnt = tail;
364
+      if ( tail < 8)
365
+        Max7219_LED_On(tail, MAX7219_DEBUG_STEPPER_TAIL);
366
+      else
367
+        Max7219_LED_On(tail-8, MAX7219_DEBUG_STEPPER_TAIL+1);
368
+    }
369
+  #endif
370
+
371
+  #ifdef MAX7219_DEBUG_STEPPER_QUEUE
372
+    static int16_t last_depth = 0;
373
+    int16_t current_depth = head - tail;
374
+    if (current_depth != last_depth) {  // usually, no update will be needed.
375
+      if (current_depth < 0) current_depth += BLOCK_BUFFER_SIZE;
376
+      NOMORE(current_depth, BLOCK_BUFFER_SIZE);
377
+      NOMORE(current_depth, 16);        // if the BLOCK_BUFFER_SIZE is greater than 16, two lines
378
+                                        // of LEDs is enough to see if the buffer is draining
379
+
380
+      const uint8_t st = min(current_depth, last_depth),
381
+                    en = max(current_depth, last_depth);
382
+      if (current_depth < last_depth)
383
+        for (uint8_t i = st; i <= en; i++)   // clear the highest order LEDs
384
+            Max7219_LED_Off(i/2, MAX7219_DEBUG_STEPPER_QUEUE + (i & 1));
385
+      else
386
+          for (uint8_t i = st; i <= en; i++)   // set the LEDs to current depth
387
+            Max7219_LED_On(i/2, MAX7219_DEBUG_STEPPER_QUEUE + (i & 1));
388
+
389
+      last_depth = current_depth;
390
+    }
391
+  #endif
392
+}
235 393
 
236 394
 #endif // MAX7219_DEBUG

+ 33
- 31
Marlin/Max7219_Debug_LEDs.h View File

@@ -40,12 +40,14 @@
40 40
  * void Max7219_PutByte(uint8_t data);
41 41
  * void Max7219(uint8_t reg, uint8_t data);
42 42
  * void Max7219_LED_Set(uint8_t row, uint8_t col, bool on);
43
- * void Max7219_LED_On(uint8_t row, uint8_t col);
44
- * void Max7219_LED_Off(uint8_t row, uint8_t col);
43
+ * void Max7219_LED_On(uint8_t col, uint8_t row);
44
+ * void Max7219_LED_Off(uint8_t col, uint8_t row);
45 45
  * void Max7219_LED_Toggle(uint8_t row, uint8_t col);
46 46
  * void Max7219_Clear_Row(uint8_t row);
47 47
  * void Max7219_Clear_Column(uint8_t col);
48 48
  * void Max7219_Set_Row(uint8_t row, uint8_t val);
49
+ * void Max7219_Set_2_Rows(uint8_t row, uint16_t val);
50
+ * void Max7219_Set_4_Rows(uint8_t row, uint32_t val);
49 51
  * void Max7219_Set_Column(uint8_t col, uint8_t val);
50 52
  * void Max7219_idle_tasks();
51 53
  */
@@ -53,36 +55,36 @@
53 55
 #ifndef __MAX7219_DEBUG_LEDS_H__
54 56
 #define __MAX7219_DEBUG_LEDS_H__
55 57
 
56
-  //
57
-  // define max7219 registers
58
-  //
59
-  #define max7219_reg_noop        0x00
60
-  #define max7219_reg_digit0      0x01
61
-  #define max7219_reg_digit1      0x02
62
-  #define max7219_reg_digit2      0x03
63
-  #define max7219_reg_digit3      0x04
64
-  #define max7219_reg_digit4      0x05
65
-  #define max7219_reg_digit5      0x06
66
-  #define max7219_reg_digit6      0x07
67
-  #define max7219_reg_digit7      0x08
58
+//
59
+// define max7219 registers
60
+//
61
+#define max7219_reg_noop        0x00
62
+#define max7219_reg_digit0      0x01
63
+#define max7219_reg_digit1      0x02
64
+#define max7219_reg_digit2      0x03
65
+#define max7219_reg_digit3      0x04
66
+#define max7219_reg_digit4      0x05
67
+#define max7219_reg_digit5      0x06
68
+#define max7219_reg_digit6      0x07
69
+#define max7219_reg_digit7      0x08
68 70
 
69
-  #define max7219_reg_intensity   0x0A
70
-  #define max7219_reg_displayTest 0x0F
71
-  #define max7219_reg_decodeMode  0x09
72
-  #define max7219_reg_scanLimit   0x0B
73
-  #define max7219_reg_shutdown    0x0C
71
+#define max7219_reg_intensity   0x0A
72
+#define max7219_reg_displayTest 0x0F
73
+#define max7219_reg_decodeMode  0x09
74
+#define max7219_reg_scanLimit   0x0B
75
+#define max7219_reg_shutdown    0x0C
74 76
 
75
-  void Max7219_init();
76
-  void Max7219_PutByte(uint8_t data);
77
-  void Max7219(const uint8_t reg, const uint8_t data);
78
-  void Max7219_LED_Set(const uint8_t row, const uint8_t col, const bool on);
79
-  void Max7219_LED_On(const uint8_t row, const uint8_t col);
80
-  void Max7219_LED_Off(const uint8_t row, const uint8_t col);
81
-  void Max7219_LED_Toggle(const uint8_t row, const uint8_t col);
82
-  void Max7219_Clear_Row(const uint8_t row);
83
-  void Max7219_Clear_Column(const uint8_t col);
84
-  void Max7219_Set_Row(const uint8_t row, const uint8_t val);
85
-  void Max7219_Set_Column(const uint8_t col, const uint8_t val);
86
-  void Max7219_idle_tasks();
77
+void Max7219_init();
78
+void Max7219_PutByte(uint8_t data);
79
+void Max7219(const uint8_t reg, const uint8_t data);
80
+void Max7219_LED_Set(const uint8_t row, const uint8_t col, const bool on);
81
+void Max7219_LED_On(const uint8_t row, const uint8_t col);
82
+void Max7219_LED_Off(const uint8_t row, const uint8_t col);
83
+void Max7219_LED_Toggle(const uint8_t row, const uint8_t col);
84
+void Max7219_Clear_Row(const uint8_t row);
85
+void Max7219_Clear_Column(const uint8_t col);
86
+void Max7219_Set_Row(const uint8_t row, const uint8_t val);
87
+void Max7219_Set_Column(const uint8_t col, const uint8_t val);
88
+void Max7219_idle_tasks();
87 89
 
88 90
 #endif // __MAX7219_DEBUG_LEDS_H__

+ 21
- 0
Marlin/cardreader.cpp View File

@@ -860,6 +860,15 @@ void CardReader::updir() {
860 860
 
861 861
 #endif // SDCARD_SORT_ALPHA
862 862
 
863
+#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
864
+  typedef void (*screenFunc_t)();
865
+  extern void lcd_sdcard_menu();
866
+  extern void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0);
867
+  extern uint32_t saved_encoderPosition;
868
+  extern bool screen_changed, drawing_screen, defer_return_to_status;
869
+  void _lcd_synchronize();  // Not declared in any LCD header file.  Probably, that should be changed.
870
+#endif
871
+
863 872
 void CardReader::printingHasFinished() {
864 873
   stepper.synchronize();
865 874
   file.close();
@@ -879,6 +888,18 @@ void CardReader::printingHasFinished() {
879 888
     #if ENABLED(SDCARD_SORT_ALPHA)
880 889
       presort();
881 890
     #endif
891
+
892
+    #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
893
+      lcdDrawUpdate  = LCDVIEW_CALL_REDRAW_NEXT;
894
+      _lcd_synchronize();
895
+      safe_delay(50);
896
+      _lcd_synchronize();
897
+      lcdDrawUpdate  = LCDVIEW_CALL_REDRAW_NEXT;
898
+      drawing_screen = screen_changed = true;
899
+      lcd_goto_screen(lcd_sdcard_menu, saved_encoderPosition);
900
+      defer_return_to_status = true;
901
+      lcd_update();
902
+    #endif
882 903
   }
883 904
 }
884 905
 

+ 14
- 3
Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/Anet/A6/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/Anet/A8/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h View File

@@ -545,11 +545,22 @@
545 545
   // Enable this option to scroll long filenames in the SD card menu
546 546
   //#define SCROLL_LONG_FILENAMES
547 547
 
548
-  // This option allows you to abort SD printing when any endstop is triggered.
549
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
550
-  // To have any effect, endstops must be enabled during SD printing.
548
+  /**
549
+   * This option allows you to abort SD printing when any endstop is triggered.
550
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
551
+   * To have any effect, endstops must be enabled during SD printing.
552
+   */
551 553
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
552 554
 
555
+  /**
556
+   * This option allows you to easily reprint the same SD Card file as
557
+   * was last printed.  At the end of a print, the LCD Menu will jump
558
+   * straight to the file previously selected.  A single click of the encoder
559
+   * wheel will restart the print.  Another file or LCD option can be
560
+   * selected by using the encoder wheel to navigate through the menu structure.
561
+   */
562
+  //#define SD_REPRINT_LAST_SELECTED_FILE
563
+
553 564
 #endif // SDSUPPORT
554 565
 
555 566
 /**

+ 14
- 3
Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/Cartesio/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/Creality/CR-10/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/Felix/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

Marlin/example_configurations/Folger Tech/i3-2020/Configuration.h → Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h View File


Marlin/example_configurations/Folger Tech/i3-2020/Configuration_adv.h → Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/Malyan/M150/Configuration_adv.h View File

@@ -545,11 +545,22 @@
545 545
   // Enable this option to scroll long filenames in the SD card menu
546 546
   //#define SCROLL_LONG_FILENAMES
547 547
 
548
-  // This option allows you to abort SD printing when any endstop is triggered.
549
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
550
-  // To have any effect, endstops must be enabled during SD printing.
548
+  /**
549
+   * This option allows you to abort SD printing when any endstop is triggered.
550
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
551
+   * To have any effect, endstops must be enabled during SD printing.
552
+   */
551 553
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
552 554
 
555
+  /**
556
+   * This option allows you to easily reprint the same SD Card file as
557
+   * was last printed.  At the end of a print, the LCD Menu will jump
558
+   * straight to the file previously selected.  A single click of the encoder
559
+   * wheel will restart the print.  Another file or LCD option can be
560
+   * selected by using the encoder wheel to navigate through the menu structure.
561
+   */
562
+  //#define SD_REPRINT_LAST_SELECTED_FILE
563
+
553 564
 #endif // SDSUPPORT
554 565
 
555 566
 /**

+ 14
- 3
Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h View File

@@ -549,11 +549,22 @@
549 549
   // Enable this option to scroll long filenames in the SD card menu
550 550
   //#define SCROLL_LONG_FILENAMES
551 551
 
552
-  // This option allows you to abort SD printing when any endstop is triggered.
553
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
554
-  // To have any effect, endstops must be enabled during SD printing.
552
+  /**
553
+   * This option allows you to abort SD printing when any endstop is triggered.
554
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
555
+   * To have any effect, endstops must be enabled during SD printing.
556
+   */
555 557
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
556 558
 
559
+  /**
560
+   * This option allows you to easily reprint the same SD Card file as
561
+   * was last printed.  At the end of a print, the LCD Menu will jump
562
+   * straight to the file previously selected.  A single click of the encoder
563
+   * wheel will restart the print.  Another file or LCD option can be
564
+   * selected by using the encoder wheel to navigate through the menu structure.
565
+   */
566
+  //#define SD_REPRINT_LAST_SELECTED_FILE
567
+
557 568
 #endif // SDSUPPORT
558 569
 
559 570
 /**

+ 14
- 3
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/Sanguinololu/Configuration_adv.h View File

@@ -537,11 +537,22 @@
537 537
   // Enable this option to scroll long filenames in the SD card menu
538 538
   //#define SCROLL_LONG_FILENAMES
539 539
 
540
-  // This option allows you to abort SD printing when any endstop is triggered.
541
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
542
-  // To have any effect, endstops must be enabled during SD printing.
540
+  /**
541
+   * This option allows you to abort SD printing when any endstop is triggered.
542
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
543
+   * To have any effect, endstops must be enabled during SD printing.
544
+   */
543 545
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
544 546
 
547
+  /**
548
+   * This option allows you to easily reprint the same SD Card file as
549
+   * was last printed.  At the end of a print, the LCD Menu will jump
550
+   * straight to the file previously selected.  A single click of the encoder
551
+   * wheel will restart the print.  Another file or LCD option can be
552
+   * selected by using the encoder wheel to navigate through the menu structure.
553
+   */
554
+  //#define SD_REPRINT_LAST_SELECTED_FILE
555
+
545 556
 #endif // SDSUPPORT
546 557
 
547 558
 /**

+ 14
- 3
Marlin/example_configurations/TinyBoy2/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/Velleman/K8200/Configuration_adv.h View File

@@ -556,11 +556,22 @@
556 556
   // Enable this option to scroll long filenames in the SD card menu
557 557
   //#define SCROLL_LONG_FILENAMES
558 558
 
559
-  // This option allows you to abort SD printing when any endstop is triggered.
560
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
561
-  // To have any effect, endstops must be enabled during SD printing.
559
+  /**
560
+   * This option allows you to abort SD printing when any endstop is triggered.
561
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
562
+   * To have any effect, endstops must be enabled during SD printing.
563
+   */
562 564
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
563 565
 
566
+  /**
567
+   * This option allows you to easily reprint the same SD Card file as
568
+   * was last printed.  At the end of a print, the LCD Menu will jump
569
+   * straight to the file previously selected.  A single click of the encoder
570
+   * wheel will restart the print.  Another file or LCD option can be
571
+   * selected by using the encoder wheel to navigate through the menu structure.
572
+   */
573
+  //#define SD_REPRINT_LAST_SELECTED_FILE
574
+
564 575
 #endif // SDSUPPORT
565 576
 
566 577
 /**

+ 14
- 3
Marlin/example_configurations/Velleman/K8400/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h View File

@@ -550,11 +550,22 @@
550 550
   // Enable this option to scroll long filenames in the SD card menu
551 551
   //#define SCROLL_LONG_FILENAMES
552 552
 
553
-  // This option allows you to abort SD printing when any endstop is triggered.
554
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
555
-  // To have any effect, endstops must be enabled during SD printing.
553
+  /**
554
+   * This option allows you to abort SD printing when any endstop is triggered.
555
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
556
+   * To have any effect, endstops must be enabled during SD printing.
557
+   */
556 558
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
557 559
 
560
+  /**
561
+   * This option allows you to easily reprint the same SD Card file as
562
+   * was last printed.  At the end of a print, the LCD Menu will jump
563
+   * straight to the file previously selected.  A single click of the encoder
564
+   * wheel will restart the print.  Another file or LCD option can be
565
+   * selected by using the encoder wheel to navigate through the menu structure.
566
+   */
567
+  //#define SD_REPRINT_LAST_SELECTED_FILE
568
+
558 569
 #endif // SDSUPPORT
559 570
 
560 571
 /**

+ 14
- 3
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h View File

@@ -550,11 +550,22 @@
550 550
   // Enable this option to scroll long filenames in the SD card menu
551 551
   //#define SCROLL_LONG_FILENAMES
552 552
 
553
-  // This option allows you to abort SD printing when any endstop is triggered.
554
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
555
-  // To have any effect, endstops must be enabled during SD printing.
553
+  /**
554
+   * This option allows you to abort SD printing when any endstop is triggered.
555
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
556
+   * To have any effect, endstops must be enabled during SD printing.
557
+   */
556 558
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
557 559
 
560
+  /**
561
+   * This option allows you to easily reprint the same SD Card file as
562
+   * was last printed.  At the end of a print, the LCD Menu will jump
563
+   * straight to the file previously selected.  A single click of the encoder
564
+   * wheel will restart the print.  Another file or LCD option can be
565
+   * selected by using the encoder wheel to navigate through the menu structure.
566
+   */
567
+  //#define SD_REPRINT_LAST_SELECTED_FILE
568
+
558 569
 #endif // SDSUPPORT
559 570
 
560 571
 /**

+ 14
- 3
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

@@ -550,11 +550,22 @@
550 550
   // Enable this option to scroll long filenames in the SD card menu
551 551
   //#define SCROLL_LONG_FILENAMES
552 552
 
553
-  // This option allows you to abort SD printing when any endstop is triggered.
554
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
555
-  // To have any effect, endstops must be enabled during SD printing.
553
+  /**
554
+   * This option allows you to abort SD printing when any endstop is triggered.
555
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
556
+   * To have any effect, endstops must be enabled during SD printing.
557
+   */
556 558
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
557 559
 
560
+  /**
561
+   * This option allows you to easily reprint the same SD Card file as
562
+   * was last printed.  At the end of a print, the LCD Menu will jump
563
+   * straight to the file previously selected.  A single click of the encoder
564
+   * wheel will restart the print.  Another file or LCD option can be
565
+   * selected by using the encoder wheel to navigate through the menu structure.
566
+   */
567
+  //#define SD_REPRINT_LAST_SELECTED_FILE
568
+
558 569
 #endif // SDSUPPORT
559 570
 
560 571
 /**

+ 14
- 3
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

@@ -550,11 +550,22 @@
550 550
   // Enable this option to scroll long filenames in the SD card menu
551 551
   //#define SCROLL_LONG_FILENAMES
552 552
 
553
-  // This option allows you to abort SD printing when any endstop is triggered.
554
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
555
-  // To have any effect, endstops must be enabled during SD printing.
553
+  /**
554
+   * This option allows you to abort SD printing when any endstop is triggered.
555
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
556
+   * To have any effect, endstops must be enabled during SD printing.
557
+   */
556 558
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
557 559
 
560
+  /**
561
+   * This option allows you to easily reprint the same SD Card file as
562
+   * was last printed.  At the end of a print, the LCD Menu will jump
563
+   * straight to the file previously selected.  A single click of the encoder
564
+   * wheel will restart the print.  Another file or LCD option can be
565
+   * selected by using the encoder wheel to navigate through the menu structure.
566
+   */
567
+  //#define SD_REPRINT_LAST_SELECTED_FILE
568
+
558 569
 #endif // SDSUPPORT
559 570
 
560 571
 /**

+ 14
- 3
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

@@ -555,11 +555,22 @@
555 555
   // Enable this option to scroll long filenames in the SD card menu
556 556
   //#define SCROLL_LONG_FILENAMES
557 557
 
558
-  // This option allows you to abort SD printing when any endstop is triggered.
559
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
560
-  // To have any effect, endstops must be enabled during SD printing.
558
+  /**
559
+   * This option allows you to abort SD printing when any endstop is triggered.
560
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
561
+   * To have any effect, endstops must be enabled during SD printing.
562
+   */
561 563
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
562 564
 
565
+  /**
566
+   * This option allows you to easily reprint the same SD Card file as
567
+   * was last printed.  At the end of a print, the LCD Menu will jump
568
+   * straight to the file previously selected.  A single click of the encoder
569
+   * wheel will restart the print.  Another file or LCD option can be
570
+   * selected by using the encoder wheel to navigate through the menu structure.
571
+   */
572
+  //#define SD_REPRINT_LAST_SELECTED_FILE
573
+
563 574
 #endif // SDSUPPORT
564 575
 
565 576
 /**

+ 14
- 3
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h View File

@@ -550,11 +550,22 @@
550 550
   // Enable this option to scroll long filenames in the SD card menu
551 551
   //#define SCROLL_LONG_FILENAMES
552 552
 
553
-  // This option allows you to abort SD printing when any endstop is triggered.
554
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
555
-  // To have any effect, endstops must be enabled during SD printing.
553
+  /**
554
+   * This option allows you to abort SD printing when any endstop is triggered.
555
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
556
+   * To have any effect, endstops must be enabled during SD printing.
557
+   */
556 558
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
557 559
 
560
+  /**
561
+   * This option allows you to easily reprint the same SD Card file as
562
+   * was last printed.  At the end of a print, the LCD Menu will jump
563
+   * straight to the file previously selected.  A single click of the encoder
564
+   * wheel will restart the print.  Another file or LCD option can be
565
+   * selected by using the encoder wheel to navigate through the menu structure.
566
+   */
567
+  //#define SD_REPRINT_LAST_SELECTED_FILE
568
+
558 569
 #endif // SDSUPPORT
559 570
 
560 571
 /**

+ 14
- 3
Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 14
- 3
Marlin/example_configurations/wt150/Configuration_adv.h View File

@@ -548,11 +548,22 @@
548 548
   // Enable this option to scroll long filenames in the SD card menu
549 549
   //#define SCROLL_LONG_FILENAMES
550 550
 
551
-  // This option allows you to abort SD printing when any endstop is triggered.
552
-  // This feature must be enabled with "M540 S1" or from the LCD menu.
553
-  // To have any effect, endstops must be enabled during SD printing.
551
+  /**
552
+   * This option allows you to abort SD printing when any endstop is triggered.
553
+   * This feature must be enabled with "M540 S1" or from the LCD menu.
554
+   * To have any effect, endstops must be enabled during SD printing.
555
+   */
554 556
   //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
555 557
 
558
+  /**
559
+   * This option allows you to easily reprint the same SD Card file as
560
+   * was last printed.  At the end of a print, the LCD Menu will jump
561
+   * straight to the file previously selected.  A single click of the encoder
562
+   * wheel will restart the print.  Another file or LCD option can be
563
+   * selected by using the encoder wheel to navigate through the menu structure.
564
+   */
565
+  //#define SD_REPRINT_LAST_SELECTED_FILE
566
+
556 567
 #endif // SDSUPPORT
557 568
 
558 569
 /**

+ 29
- 2
Marlin/ultralcd.cpp View File

@@ -3752,9 +3752,24 @@ void kill_screen(const char* lcd_msg) {
3752 3752
      * "Print from SD" submenu
3753 3753
      *
3754 3754
      */
3755
+    #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
3756
+      uint32_t saved_encoderPosition = 0;
3757
+      static millis_t assume_print_finished = 0;
3758
+    #endif
3759
+
3755 3760
     void lcd_sdcard_menu() {
3756 3761
       ENCODER_DIRECTION_MENUS();
3757
-      if (!lcdDrawUpdate && !lcd_clicked) return; // nothing to do (so don't thrash the SD card)
3762
+  
3763
+      #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
3764
+        if (ELAPSED(millis(), assume_print_finished)) { // if the printer has been busy printing, lcd_sdcard_menu() should not 
3765
+          lcdDrawUpdate = LCDVIEW_REDRAW_NOW;           // have been active for 5 seconds.  In this case, restore the previous
3766
+          encoderPosition = saved_encoderPosition;      // encoderPosition to the last selected item.
3767
+          assume_print_finished = millis() + 5000;
3768
+        }
3769
+        saved_encoderPosition = encoderPosition;
3770
+        defer_return_to_status = true;
3771
+      #endif
3772
+      
3758 3773
       const uint16_t fileCnt = card.getnrfilenames();
3759 3774
       START_MENU();
3760 3775
       MENU_BACK(MSG_MAIN);
@@ -4403,6 +4418,9 @@ void kill_screen(const char* lcd_msg) {
4403 4418
   #if ENABLED(SDSUPPORT)
4404 4419
 
4405 4420
     void menu_action_sdfile(const char* filename, char* longFilename) {
4421
+      #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
4422
+        saved_encoderPosition = encoderPosition;  // Save which file was selected for later use
4423
+      #endif
4406 4424
       UNUSED(longFilename);
4407 4425
       card.openAndPrintFile(filename);
4408 4426
       lcd_return_to_status();
@@ -4710,7 +4728,11 @@ void lcd_update() {
4710 4728
     uint16_t bbr2 = planner.block_buffer_runtime() >> 1;
4711 4729
 
4712 4730
     #if ENABLED(DOGLCD)
4713
-      if ((lcdDrawUpdate || drawing_screen) && (!bbr2 || (bbr2 > max_display_update_time)))
4731
+      if ((lcdDrawUpdate || drawing_screen) && (!bbr2 || (bbr2 > max_display_update_time)
4732
+      #if ENABLED(SDSUPPORT)
4733
+        || (currentScreen == lcd_sdcard_menu)
4734
+      #endif
4735
+      ))
4714 4736
     #else
4715 4737
       if (lcdDrawUpdate && (!bbr2 || (bbr2 > max_display_update_time)))
4716 4738
     #endif
@@ -4764,7 +4786,12 @@ void lcd_update() {
4764 4786
 
4765 4787
       // Return to Status Screen after a timeout
4766 4788
       if (currentScreen == lcd_status_screen || defer_return_to_status)
4789
+        #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
4790
+          if (currentScreen != lcd_sdcard_menu)                // lcd_sdcard_menu() does not time out if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
4791
+            return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;  // When the printer finishes a file, it will wait with the file selected for 
4792
+        #else                                                  // a re-print.
4767 4793
         return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
4794
+        #endif
4768 4795
       else if (ELAPSED(ms, return_to_status_ms))
4769 4796
         lcd_return_to_status();
4770 4797
 

Loading…
Cancel
Save