Skip to content

Commit

Permalink
try to reduce stack usage in park and increase stack size by 512 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfmanjm committed Dec 24, 2020
1 parent 2f4e7e3 commit a75cb5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/makefile
Expand Up @@ -19,7 +19,7 @@ WRITE_BUFFER_DISABLE=0
# specific amount of space for the stack. The heap's growth will be
# constrained to reserve this much space for the stack and the stack won't be
# able to grow larger than this amount.
STACK_SIZE=3072
STACK_SIZE=3584

# Set to 1 to allow MRI debug monitor to take full control of UART0 and use it
# as a dedicated debug channel. If you are using the USB based serial port for
Expand Down
10 changes: 4 additions & 6 deletions src/modules/tools/endstops/Endstops.cpp
Expand Up @@ -519,7 +519,7 @@ void Endstops::move_to_origin(axis_bitmap_t axis)

// Move to center using a regular move, use slower of X and Y fast rate in mm/sec
float rate = std::min(homing_axis[X_AXIS].fast_rate, homing_axis[Y_AXIS].fast_rate) * 60.0F;
char buf[32];
char buf[28];
THEROBOT->push_state();
THEROBOT->absolute_mode = true;
snprintf(buf, sizeof(buf), "G53 G0 X0 Y0 F%1.4f", THEROBOT->from_millimeters(rate)); // must use machine coordinates in case G92 or WCS is in effect
Expand Down Expand Up @@ -1029,11 +1029,9 @@ void Endstops::handle_park()
// TODO: spec says if XYZ specified move to them first then move to MCS of specifed axis
THEROBOT->push_state();
THEROBOT->absolute_mode = true;
char buf[32];
snprintf(buf, sizeof(buf), "G53 G0 X%f Y%f", THEROBOT->from_millimeters(saved_position[X_AXIS]), THEROBOT->from_millimeters(saved_position[Y_AXIS])); // must use machine coordinates in case G92 or WCS is in effect
struct SerialMessage message;
message.message = buf;
message.stream = &(StreamOutput::NullStream);
char buf[30];
snprintf(buf, sizeof(buf), "G53 G0 X%1.4f Y%1.4f", THEROBOT->from_millimeters(saved_position[X_AXIS]), THEROBOT->from_millimeters(saved_position[Y_AXIS])); // must use machine coordinates in case G92 or WCS is in effect
struct SerialMessage message{&StreamOutput::NullStream, buf};
THEKERNEL->call_event(ON_CONSOLE_LINE_RECEIVED, &message ); // as it is a multi G code command
// Wait for above to finish
THECONVEYOR->wait_for_idle();
Expand Down

0 comments on commit a75cb5a

Please sign in to comment.