Browse Source

Fix G60/G61 slots > 8 and compile error (#16715)

chgi 5 years ago
parent
commit
99b6a132bc
No account linked to committer's email address

+ 1
- 1
Marlin/src/gcode/feature/pause/G60.cpp View File

@@ -45,7 +45,7 @@ void GcodeSuite::G60() {
45 45
   }
46 46
 
47 47
   stored_position[slot] = current_position;
48
-  SBI(saved_slots, slot);
48
+  SBI(saved_slots[slot >> 3], slot & 0b00000111);
49 49
 
50 50
   #if ENABLED(SAVED_POSITIONS_DEBUG)
51 51
     const xyze_pos_t &pos = stored_position[slot];

+ 2
- 2
Marlin/src/gcode/feature/pause/G61.cpp View File

@@ -25,7 +25,7 @@
25 25
 #if SAVED_POSITIONS
26 26
 
27 27
 #include "../../../core/language.h"
28
-#include "../../module/planner.h"
28
+#include "../../../module/planner.h"
29 29
 #include "../../gcode.h"
30 30
 #include "../../../module/motion.h"
31 31
 
@@ -48,7 +48,7 @@ void GcodeSuite::G61(void) {
48 48
   #endif
49 49
 
50 50
   // No saved position? No axes being restored?
51
-  if (!TEST(saved_slots, slot) || !parser.seen("XYZ")) return;
51
+  if (!TEST(saved_slots[slot >> 3], slot & 0b00000111) || !parser.seen("XYZ")) return;
52 52
 
53 53
   // Apply any given feedrate over 0.0
54 54
   const float fr = parser.linearval('F');

+ 1
- 1
Marlin/src/module/motion.cpp View File

@@ -111,7 +111,7 @@ xyze_pos_t destination; // {0}
111 111
 
112 112
 // G60/G61 Position Save and Return
113 113
 #if SAVED_POSITIONS
114
-  uint8_t saved_slots;
114
+  uint8_t saved_slots[(SAVED_POSITIONS + 7) >> 3];
115 115
   xyz_pos_t stored_position[SAVED_POSITIONS];
116 116
 #endif
117 117
 

+ 1
- 1
Marlin/src/module/motion.h View File

@@ -67,7 +67,7 @@ extern xyze_pos_t current_position,  // High-level current tool position
67 67
 
68 68
 // G60/G61 Position Save and Return
69 69
 #if SAVED_POSITIONS
70
-  extern uint8_t saved_slots;
70
+  extern uint8_t saved_slots[(SAVED_POSITIONS + 7) >> 3];
71 71
   extern xyz_pos_t stored_position[SAVED_POSITIONS];
72 72
 #endif
73 73
 

Loading…
Cancel
Save