Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M600: reduce stack usage #4419

Merged
merged 1 commit into from
Nov 24, 2023
Merged

Conversation

gudnimg
Copy link
Collaborator

@gudnimg gudnimg commented Oct 1, 2023

To handle power panic in M600 we started saving relevant data at the start of M600 gcode in RAM (starting with 3.13.2). We are currently also saving the same data within gcode_M600() which is saved on the stack. I propose we just use the data already saved in SRAM to reduce stack usage.

Change in memory:
Flash: -64 bytes
SRAM: 0 bytes

@gudnimg gudnimg added this to the FW 3.14.0 milestone Oct 1, 2023
@gudnimg gudnimg requested review from 3d-gussner and DRracer October 1, 2023 12:28
@github-actions
Copy link

github-actions bot commented Oct 1, 2023

All values in bytes. Δ Delta to base

Target ΔFlash ΔSRAM Used Flash Used SRAM Free Flash Free SRAM
MK3S_MULTILANG -70 0 246050 5629 7902 2563
MK3_MULTILANG -66 0 245340 5638 8612 2554

@gudnimg gudnimg force-pushed the reduce-stack-m600-opt branch from a9e5e75 to 7af3e0c Compare November 3, 2023 17:08
To handle power panic in M600 we started saving
relevant data at the start of M600 gcode.

We are currently also saving the same data within
gcode_M600 which is saved on the stack. I propose
we just use the data already saved in SRAM to reduce
stack usage.

Change in memory:
Flash: -64 bytes
SRAM: 0 bytes
Copy link
Collaborator

@3d-gussner 3d-gussner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to mea and MK404 Test passed ✔️

@3d-gussner 3d-gussner merged commit 9f9bb12 into prusa3d:MK3 Nov 24, 2023
5 checks passed
@3d-gussner 3d-gussner removed their assignment Nov 29, 2023
@gudnimg gudnimg deleted the reduce-stack-m600-opt branch September 1, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants