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
   }
45
   }
46
 
46
 
47
   stored_position[slot] = current_position;
47
   stored_position[slot] = current_position;
48
-  SBI(saved_slots, slot);
48
+  SBI(saved_slots[slot >> 3], slot & 0b00000111);
49
 
49
 
50
   #if ENABLED(SAVED_POSITIONS_DEBUG)
50
   #if ENABLED(SAVED_POSITIONS_DEBUG)
51
     const xyze_pos_t &pos = stored_position[slot];
51
     const xyze_pos_t &pos = stored_position[slot];

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

25
 #if SAVED_POSITIONS
25
 #if SAVED_POSITIONS
26
 
26
 
27
 #include "../../../core/language.h"
27
 #include "../../../core/language.h"
28
-#include "../../module/planner.h"
28
+#include "../../../module/planner.h"
29
 #include "../../gcode.h"
29
 #include "../../gcode.h"
30
 #include "../../../module/motion.h"
30
 #include "../../../module/motion.h"
31
 
31
 
48
   #endif
48
   #endif
49
 
49
 
50
   // No saved position? No axes being restored?
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
   // Apply any given feedrate over 0.0
53
   // Apply any given feedrate over 0.0
54
   const float fr = parser.linearval('F');
54
   const float fr = parser.linearval('F');

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

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

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

67
 
67
 
68
 // G60/G61 Position Save and Return
68
 // G60/G61 Position Save and Return
69
 #if SAVED_POSITIONS
69
 #if SAVED_POSITIONS
70
-  extern uint8_t saved_slots;
70
+  extern uint8_t saved_slots[(SAVED_POSITIONS + 7) >> 3];
71
   extern xyz_pos_t stored_position[SAVED_POSITIONS];
71
   extern xyz_pos_t stored_position[SAVED_POSITIONS];
72
 #endif
72
 #endif
73
 
73
 

Loading…
Cancel
Save