Browse Source

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

pull/1/head
chgi 4 years ago
committed by GitHub
parent
commit
99b6a132bc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Marlin/src/gcode/feature/pause/G60.cpp
  2. 4
      Marlin/src/gcode/feature/pause/G61.cpp
  3. 2
      Marlin/src/module/motion.cpp
  4. 2
      Marlin/src/module/motion.h

2
Marlin/src/gcode/feature/pause/G60.cpp

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

4
Marlin/src/gcode/feature/pause/G61.cpp

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

2
Marlin/src/module/motion.cpp

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

2
Marlin/src/module/motion.h

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

Loading…
Cancel
Save