Commit Graph

5957 Commits

Author SHA1 Message Date
Guðni Már Gilbert
37c9dcbe53 Optimise calculations to use hypot() where possible
flash: -122
RAM: 0

It is defined: hypot(x,y) = sqrtf(x*x + y*y)
2022-08-26 19:36:28 +03:00
Alex Voinea
7d72f0ee2e better lcd printing for IP address
flash: -46
RAM: 0
2022-08-26 19:33:53 +03:00
Guðni Már Gilbert
4e798c9ed1 Remove unused variable maxlimit_status
flash: 0
RAM: -1
2022-08-26 19:29:32 +03:00
Guðni Már Gilbert
7711969e57 ftostr12ns: change xx from long to int
flash: -44
RAM: 0

Largest expected number is 999 after the multiplication by 100.

I measured the execution time drops from ~170us to ~73us.
2022-08-26 19:28:36 +03:00
Guðni Már Gilbert
88e0e33fb2 Use set_destination_to_current instead of memcpy
flash: -14
RAM: 0
2022-08-26 19:27:16 +03:00
Guðni Már Gilbert
7d86a0d121 Reduce a few magic numbers for FILENAME_LENGTH
flash: 0
RAM: 0
2022-08-26 19:26:26 +03:00
Guðni Már Gilbert
22582e560e Remove one redundant st_synchronize() call
flash: -4
RAM: 0

st_synchronize() is called just before leaving gcode_G28() so we don't need to call it again just after leaving gcode_G28()
2022-08-26 19:25:07 +03:00
Guðni Már Gilbert
89fc9f7a62 Optimise lcd_menu_show_sensors_state()
flash: -22
RAM: 0

menu_lcd_lcdupdate_func() takes care of starting lcd_timeoutToStatus if the knob is clicked.

When the knob is clicked we only want to back out of the menu.
This changes makes the menus slightly more conistant behind the scenes.
2022-08-26 19:22:23 +03:00
Guðni Már Gilbert
c2340d3648 lcd_babystep_z should not start lcd_timeoutToStatus
flash: -8
RAM: 0

When the menu is entered and left the function
menu_lcd_lcdupdate_func() takes care of resetting the timer.

Currently the firmware will reset the timer twice when the lcd_babystep_z menu is entered. This commit fixes that.
2022-08-26 19:20:22 +03:00
Guðni Már Gilbert
74d6aead2f Optimise if statements in lcd_tune_menu
flash: -10
RAM: 0

I am basically combining two if statements if(SilentModeMenu == SILENT_MODE_NORMAL)
2022-08-26 19:17:07 +03:00
Alex Voinea
25350dfbbc Remove unused variable bFilamentFirstRun
flash: 0
RAM: -1
2022-08-26 19:14:40 +03:00
Alex Voinea
4ded6f195e Move string to progmem
flash: -52
RAM: -6
2022-08-26 18:59:53 +03:00
Alex Voinea
2b2b499063
Merge pull request #3573 from gudnimg/ifdef_M851
Don't include M851 in build if Auto Bed Leveling is not enabled
2022-08-26 18:59:09 +03:00
Guðni Már Gilbert
f7ae3039f8 Don't include M851 in build if Auto Bed Leveling is not enabled
The variable cs.zprobe_zoffset is not used unless
auto bed leveling is enabled
2022-08-26 15:35:28 +00:00
Guðni Már Gilbert
d87999a020 workDirDepth can be one byte
We set the max working directory depth to 6 (see MAX_DIR_DEPTH)

Changes save 1 byte of SRAM and 50 bytes of flash
2022-08-26 10:56:02 +02:00
Alex Voinea
c7762386df
Merge pull request #3565 from wavexx/m115_respect_settings
Do not prompt on M115 if FW version check has been disabled
2022-08-25 19:43:12 +03:00
Yuri D'Elia
06e3c1946c
Merge pull request #3570 from wavexx/tm_report_fan_speed
Report correct fan speeds in M155 during calibration
2022-08-25 18:33:03 +02:00
Yuri D'Elia
cf1edc85c3 Set a few function attributes to conserve space 2022-08-25 16:50:06 +02:00
Yuri D'Elia
7c8539a9f9 Report correct fan speeds in M155 during calibration 2022-08-25 16:15:51 +02:00
DRracer
2f07e383d6
Merge pull request #3566 from leptun/fix_multi_segment_pause_resume
Fix multi segment pause-resume
2022-08-24 19:36:50 +02:00
Alex Voinea
78534f3b48 Start at the first segment, not the last segment 2022-08-24 20:19:26 +03:00
Alex Voinea
671519caf3 Optimize by hand since the lto is still stooopit
saves ~100B
2022-08-24 20:19:26 +03:00
Alex Voinea
b27c8b50e0 Fix power panic handling 2022-08-24 20:19:26 +03:00
Alex Voinea
05bd1ba57f Multi-segment pause resume initial 2022-08-24 20:19:26 +03:00
DRracer
2e677ea3ee
Merge pull request #3569 from leptun/fix_card_removed
Fix "Card removed" on startup
2022-08-24 19:17:24 +02:00
DRracer
0933fdb6fe
Merge pull request #3552 from wavexx/temp_model_check
Thermal Model protection
2022-08-24 19:16:48 +02:00
Alex Voinea
ef8be4dfca Fix "Card removed" on startup 2022-08-24 20:10:09 +03:00
Alex Voinea
f2f136e014 Use timer3 instead of timer5 on miniRambo 2022-08-24 10:18:45 +03:00
Yuri D'Elia
7907e14cbf Resync planner position upon exiting xyzcal
Split the planner sync code out of planner_abort_hard() so that we can
independently resync the planner position from the counters.

This is needed in xyzcal as we directly modify the stepper counters
(bypassing both planner and stepper).

Call this new function instead of planner_abort_hard() when leaving, so
that motion can resume in the middle of the gcode_M45 instruction.
2022-08-23 17:25:24 +02:00
Yuri D'Elia
35708a61fe No longer disable temperature management in xyzcal
We already disable the heaters upon entering, and the new temperature
isr doesn't perform any direct movement until we return to the main
loop.

This allows us to remove direct control of the soft_pwm interrupt from
the header, which is dangerous.
2022-08-23 17:19:23 +02:00
Yuri D'Elia
7cd888cd0a Update documentation of ThermalStop() 2022-08-21 15:22:46 +02:00
Yuri D'Elia
b672be90b2 Do not overwrite saved values if TM error occurs while paused 2022-08-21 14:53:42 +02:00
Yuri D'Elia
d8d085287e Re-enable bed temperature automatically for transitory errors 2022-08-21 14:49:12 +02:00
Yuri D'Elia
30dccb3252 Switch to ATOMIC sections instead of cli/sei/CRITICAL_SECTION 2022-08-21 14:49:12 +02:00
Yuri D'Elia
ee12cbd58e Do not prompt on M115 if FW version check has been disabled
As done for M862.4, do now show an upgrade prompt if FW version check as
been disabled in the Settings -> HW Setup -> Checks menu.
2022-08-20 16:55:32 +02:00
DRracer
3ebd8b88a4
Merge pull request #3486 from gudnimg/gudni-optimisation
Flash optimizations in loop() and status screen menu
2022-08-19 17:21:17 +02:00
DRracer
0a8d2a3224
Merge pull request #3456 from wavexx/filament_load_consistency
Cleanup: use more constants in M701
2022-08-19 17:14:54 +02:00
DRracer
84888507e3
Merge pull request #3557 from wavexx/fix_g28_code_value
G28: check for X/Y/Z parameters before calling code_value_long
2022-08-19 17:12:07 +02:00
DRracer
2a0989c440
Merge pull request #3551 from wavexx/eof_crash_reentry
Prevent re-entry in EOF command processing
2022-08-19 17:07:21 +02:00
Yuri D'Elia
06d19b472a G28: check for X/Y/Z parameters before calling code_value_long
Fixes #3555, thanks to @toombaumarkt
2022-08-07 00:36:54 +02:00
Yuri D'Elia
3a1914f2fb Simplify printingHasFinished
Unswitch the call to file.close().

Do not call quickStop(): motion has already completed due to
st_synchronize.
2022-08-06 23:29:34 +02:00
Yuri D'Elia
4f22de2333 Do *not* shorten the current command in printer_smodel_check
printer_smodel_check was incorrectly substituting the final " with a
null in the command to simplify the model string comparison, but in
doing so was also corrupting the next pop from the cmdqueue.

We can modify the current strchr_pointer as long as we *don't* change
it's length. This can cause an incorrect extra read from the queue,
resulting in the last command to be completely ignored.
2022-08-06 23:15:46 +02:00
Yuri D'Elia
68c04ca2f6 Switch a few pointers that don't manipute strings to const 2022-08-06 23:08:03 +02:00
Yuri D'Elia
a533ba3574 Reset sdpos_atomic when starting a new SD print
Fix an incorrect SD offset on the first G-Code command when the second
SD print is started.
2022-08-06 22:16:50 +02:00
3d-gussner
8cbe69e285 Update RepRap documentation 2022-08-02 17:56:53 +02:00
3d-gussner
e60bb935e5 Remove test.sh from travis build 2022-08-02 07:38:53 +02:00
3d-gussner
9633f34e89
Merge pull request #3544 from 3d-gussner/MK3_Fix_po_for-MK25s
Sync PF-build.sh and MK404-build.sh with MK3_3.11.1 branch
2022-07-29 16:13:59 +02:00
Yuri D'Elia
c0b5fea525 Prevent re-entry in EOF command processing
cmdqueue will run commands when EOF is reached without returning to the
main loop, which is already incorrect.

However, since it needs to ensure the queue is empty, an st_synchronize
call can result in a re-entrant call to get_command, which will
reprocess EOF again. Even if we removed st_synchronize, another command
could be picked by an unsuspecting manage_inactivity() somewhere else.

Short-circuit EOF processing by closing the file early and checking for
the file state early in get_command.

This should fix #3549
2022-07-29 15:55:54 +02:00
Guðni Már Gilbert
ca8d47a6da If lcd_draw_update is set outside lcd_status_screen
then render the sceen without delay

This adds only 10 bytes of flash
2022-07-27 11:55:08 +00:00
Guðni Már Gilbert
f6fd91a235 Optimise lcd_status_screen
Saves 20 bytes of flash
2022-07-27 11:14:18 +00:00