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

optimisation: Simplify saving linearity correction #4767

Merged
merged 2 commits into from
Sep 2, 2024

Conversation

gudnimg
Copy link
Collaborator

@gudnimg gudnimg commented Sep 1, 2024

Found this optimisation when cleaning up my fork. It looks like it's still relevant.


Keep in mind that the EEPROM addresses are in descending order. This means we can't use eeprom_read_block() or eeprom_update_block()

Address --> Axis
3831 --> X-axis
3830 --> Y-axis
3829 --> Z-axis
3828 --> E-axis

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

Keep in mind that the EEPROM addresses are in descending order. This means we
can't use eeprom_read_block() or eeprom_update_block()

Address --> Axis
3831 --> X-axis
3830 --> Y-axis
3829 --> Z-axis
3828 --> E-axis

Change in memory:
Flash: -118 bytes
SRAM: 0 bytes
Copy link

github-actions bot commented Sep 1, 2024

All values in bytes. Δ Delta to base

Target ΔFlash ΔSRAM Used Flash Used SRAM Free Flash Free SRAM
MK3S_MULTILANG -140 0 247888 5654 6064 2538
MK3_MULTILANG -140 0 247266 5663 6686 2529

Firmware/ultralcd.cpp Outdated Show resolved Hide resolved
Change in memory:
Flash: -22 bytes
SRAM: 0 bytes
@gudnimg gudnimg requested a review from leptun September 1, 2024 22:19
@3d-gussner 3d-gussner added this to the FW 3.14.1 milestone Sep 2, 2024
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.

Tested with MK404 and behaves the same as before 👍
With DEBUG_EEPROM_CHANGES enabled

Test: Settings -> Lin. correction and change from XYZE all 0 to X 34 Y 33 Z 32 E 31

before

[2024-09-02 10:55:31.951287] RECV EEPROMChng b  3831 255 -> 34
[2024-09-02 10:55:31.953469] RECV EEPROMChng b  3830 255 -> 33
[2024-09-02 10:55:31.955096] RECV EEPROMChng b  3829 255 -> 32
[2024-09-02 10:55:31.956794] RECV EEPROMChng b  3828 255 -> 31

after factory reset and with this PR

[2024-09-02 11:09:35.037897] RECV EEPROMChng b  3831 255 -> 34
[2024-09-02 11:09:35.039573] RECV EEPROMChng b  3830 255 -> 33
[2024-09-02 11:09:35.041767] RECV EEPROMChng b  3829 255 -> 32
[2024-09-02 11:09:35.043484] RECV EEPROMChng b  3828 255 -> 31

@3d-gussner 3d-gussner merged commit 83c43fb into prusa3d:MK3 Sep 2, 2024
4 checks passed
@gudnimg gudnimg deleted the linearity-correction-opt-v2 branch September 2, 2024 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants