Guðni Már Gilbert
ccabf1fa31
Remove random //-// comments
2023-04-22 13:39:08 +00:00
Alex Voinea
e516d8a0c4
Merge pull request #4156 from leptun/lcd_status_screen_block
...
Fix `M0` click not consumed
2023-04-22 15:01:16 +02:00
Guðni Már Gilbert
4ce3fa53a1
Optimise M0/M1 code size
...
Replace two bool variables with one.
It's not obvious but (!hasP && !hasS) is equal to
!(hasP || hasS)
Note: expiration_time_set = hasP || hasS
Truth table:
|--------------------------------------------------|
| hasP| hasS| (!hasP && !hasS)| !(hasP || hasS) |
|------|-----|--------------------|-----------------|
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 |
|--------------------------------------------------|
Change in memory:
Flash: -36 bytes
SRAM: 0 bytes
2023-04-21 17:42:55 +00:00
3d-gussner
360f234b98
Merge pull request #4146 from gudnimg/fan-check-opt
...
Reduce code size in fan check selftest
2023-04-21 14:24:04 +02:00
Alex Voinea
91b913e997
Fix `M0` click not consumed
...
Fix the need to click the knob twice to dismiss `M0`.
Flash: -54B
SRAM: -2B
2023-04-21 12:59:40 +02:00
Guðni Már Gilbert
2ad916a2c3
Fix manual fan check menu
...
lcd_encoder was not being updated
we need to call manage_inactivity
Tested on MK3S+
Change in memory:
Flash: +6 bytes
SRAM: 0 bytes
2023-04-19 15:41:36 +00:00
Guðni Már Gilbert
18c389543b
Fix lcd_update() FW crashes
...
Change in memory:
Flash: +10 bytes
SRAM: 0 bytes
2023-04-19 15:41:36 +00:00
3d-gussner
20e73e3c4f
Merge pull request #4067 from scottmudge/MK3_3.12-meatpack-pr
...
Add support for g-code compression/packing over serial connection (MeatPack)
2023-04-19 09:20:07 +02:00
Alex Voinea
2dcaae80d5
Merge pull request #4027 from gudnimg/minor-optimisation-gudni
...
Many minor optimisations for 3.13/3.14
2023-04-17 21:27:48 +02:00
Alex Voinea
ea97ca7920
Use `EXTRUDERS` instead of hardcoded value in string
2023-04-17 21:12:59 +02:00
Alex Voinea
b67063f14a
Remove empty lines
2023-04-17 21:10:20 +02:00
Guðni Már Gilbert
43d41ddd2b
cleanup: static variables in Marlin_main.cpp
2023-04-16 23:23:31 +00:00
Guðni Már Gilbert
4b54cd1f30
Remove unused LoadingToNozzleRAII
...
The variable is not used anywhere.
Change in memory:
Flash: -14 bytes
SRAM: -1 byte
2023-04-16 17:23:28 +00:00
Guðni Már Gilbert
01df65882f
cleanup: remove commented code
2023-04-16 15:25:43 +00:00
Alex Voinea
f6135f2ed1
Enable Analog IR sensor again
2023-04-16 13:58:18 +00:00
Guðni Már Gilbert
f5b9d2ac2e
cleanup: Remove unused Developer define
2023-04-16 13:13:16 +00:00
Guðni Már Gilbert
2ed4a75894
cleanup: remove unused settings
2023-04-16 13:13:16 +00:00
Guðni Már Gilbert
559e1bb21a
Remove unused MMU configs
...
- MMU_IDLER_SENSOR_ATTEMPTS_NR
- MMU_REQUIRED_FW_BUILDNR
These are no longer used
2023-04-16 13:13:16 +00:00
Guðni Már Gilbert
9b6e1babcb
many more lcd_putc_at optimisations
...
Changes in
lcd_implementation_drawmenu_sdfile
and
lcd_implementation_drawmenu_sddirectory
seem to save the most.
Change in memory:
Flash: -72 bytes
SRAM: 0 bytes
2023-04-15 13:45:10 +00:00
Guðni Már Gilbert
dea7f2b26c
Resolve PR review
...
Initialise EEPROM_CHECK_MODE always
But if farm mode is detected, update the Check mode to Strict
Initialise EEPROM_NOZZLE_DIAMETER on farm mode.
When opening the menus this value is set automatically to
_Diameter_400 anyway so this should be fine.
No change in memory on Multilang build
2023-04-15 13:45:10 +00:00
Guðni Már Gilbert
9f66eceb29
optimisation: belt test new values
...
use lcd_print instead of lcd_printf_P
to print the number only
Tested on MK3S+
Change in memory:
Flash: -34 bytes
SRAM: 0 bytes
2023-04-15 13:45:10 +00:00
Guðni Már Gilbert
87e40f1cee
optimisation: lcd_putc_at in belt test
...
Change in memory:
Flash: -4 bytes
SRAM: 0 bytes
2023-04-15 13:45:10 +00:00
Guðni Már Gilbert
583c46a63f
Simplify two fan_check_error checks
...
There are only 3 possible values. No need to check for two of them
to rule of the last value. Instead simply check for the last value only.
Change in memory:
Flash: -16 bytes
SRAM: 0 bytes
2023-04-15 13:45:10 +00:00
Guðni Már Gilbert
b67c359129
Move fan_state to fancheck.cpp and make it static
...
No change in memory
2023-04-15 13:45:10 +00:00
Guðni Már Gilbert
ebdcfbec50
cleanup: tmc2130: make variables static where applicable
...
No change in memory
2023-04-15 13:45:10 +00:00
Guðni Már Gilbert
7c23d8b00c
cleanup: make cancel_heatup static in Marlin_main
2023-04-15 13:45:10 +00:00
Alex Voinea
d148c08991
Remove dead code from get_coordinates()
2023-04-15 13:45:10 +00:00
Alex Voinea
c7de1b1416
optimize get_coordinates() axis mask
2023-04-15 13:45:10 +00:00
Alex Voinea
ea7b395852
Remove useless parantheses
...
Found these a few months ago when I was trying some other optimization. Don't want to make a PR just for this, so I'll just slide it here in this existing PR.
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
d175dba669
optimisation: use expired_cont is specific places
...
!variable.running() || variable.expired()
is equal to
variable.expired_cont()
The latter required less flash memory
Change in memory:
Flash: -28 bytes
SRAM: 0 bytes
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
00ffab8f62
optimisation: combine if statements in Sensors menu
...
FINDA status is always 0 or 1
Change in memory:
Flash: -28 bytes
SRAM: 0 bytes
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
7ff514621c
cleanup: remove unused global variable
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
69b4696114
use lcd_puts_P instead of lcd_printf_P
...
Change in memory:
Flash: -8 bytes
SRAM: 0 bytes
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
66bb9bcfe4
optimisation: lcd_temp_cal_show_result
...
result is boolean so always update the EEPROM
Change in memory:
Flash: -20 bytes
SRAM: 0 bytes
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
bd796a2cb3
optimisation: more lcd_putc_at
...
Change in memory:
Flash: -18 bytes
SRAM: 0 bytes
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
70dadc4202
M115: Extruder count is always 1
...
Change in memory:
Flash: -8 bytes
SRAM: 0 bytes
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
62cbc829f6
optimisation: use new eeprom methods in check_printer_version()
...
Change in memory:
Flash: -48 bytes
SRAM: 0 bytes
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
cd8a22d6b3
optimisation: utils: don't initialise global variables
...
They will be set by fCheckModeInit() by reading from EEPROM
Change in memory:
Flash: -2 bytes
SRAM: -1 byte
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
7a8dfdae53
optimisation: use new EEPROM init method for fCheckModeInit
...
Change in memory:
Flash: -90 bytes
SRAM: 0 bytes
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
6aafbe69a8
cleanup: remove unused function declaration
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
6e02a082e2
cleanup: make heating_status_counter static
...
Change in memory:
Flash: 0 bytes
SRAM: 0 bytes
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
ab934f8ba5
optimisation: make clock_interval static and 1 byte
...
Change in memory:
Flash: -16 bytes
SRAM: -1 byte
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
66e629ba74
cleanup: remove unused variable FSensorStateMenu
2023-04-15 13:45:09 +00:00
Guðni Már Gilbert
3cd97a5e8f
optimsation: draw cursor and set position with one function
...
Change in memory:
Flash: -4 bytes
SRAM: 0 bytes
2023-04-15 13:45:08 +00:00
Guðni Már Gilbert
2120d17912
optimisation: simplify T-code response for single material
...
Extruder is always 0
Change in memory:
Flash: -12 bytes
SRAM: 0 bytes
2023-04-15 13:45:08 +00:00
Guðni Már Gilbert
420f745bed
optimisation: mmu: combine if statements
...
Change in memory:
Flash: -6 bytes
SRAM: 0 bytes
2023-04-15 13:45:08 +00:00
Guðni Már Gilbert
4d90ecbcc4
cleanup: remove ctype include
...
We don't use any function from this header
No change in code size
2023-04-15 13:45:08 +00:00
Guðni Már Gilbert
3dda8b5c00
optimise fan check selftest code
...
Tested on MK3S+
Change in memory:
Flash: -174 bytes
SRAM: 0 bytes
2023-04-15 11:11:16 +00:00
Guðni Már Gilbert
d6c81dab62
Fix manual fan check menu
...
lcd_encoder was not being updated
we need to call manage_inactivity
Tested on MK3S+
Change in memory:
Flash: +6 bytes
SRAM: 0 bytes
2023-04-15 10:59:58 +00:00
Guðni Már Gilbert
95acdba5fa
Fix lcd_update() FW crashes
...
Change in memory:
Flash: +10 bytes
SRAM: 0 bytes
2023-04-14 21:31:12 +00:00
Guðni Már Gilbert
f34c1ffeac
Fix an issue where visualisation is overwritten by SD file name
...
We should let EndReport set the custom message type state to Status
This will ensure the SD file name is shown correctly AFTER we've shown
the visualisation
Currently the visualisation is cut off in the middle by ReportProgressHook
Change in memory:
Flash: -6 bytes
SRAM: 0 bytes
2023-04-14 09:32:41 +02:00
Guðni Már Gilbert
4b3dc65598
Don't always set MSG_WELCOME at end of toolchange
...
This should only be set when NOT printing
Change in memory:
Flash: +8 bytes
SRAM: 0 bytes
2023-04-14 09:32:41 +02:00
Alex Voinea
41b8279805
Fix eeprom table addresses
2023-04-13 11:34:18 +02:00
Alex Voinea
af4a3f3328
Reorder eeprom reads
...
Saves 4B of flash
2023-04-13 11:15:17 +02:00
Alex Voinea
f333d36e47
Use a different location as a kill message pending flag
...
The old implementation would fail if the message was in progmem at address 0xffff or 0x0000 (both unlikely). It would also fail if the eeprom was initialized to some other random value, which could have been dangerous when displayed as a full screen message.
2023-04-13 10:57:00 +02:00
Alex Voinea
4b65d49512
Move kill check earlier during startup
2023-04-13 10:57:00 +02:00
Alex Voinea
2aca89d6dc
Update eeprom documentation
2023-04-13 10:57:00 +02:00
Alex Voinea
f388d8abb6
postponed kill() message with softReset
2023-04-13 10:57:00 +02:00
Alex Voinea
82343184e7
Merge pull request #4036 from gudnimg/optimise-mmu-silent-mode
...
optimisation: MMU silent mode toggling & init
2023-04-13 10:54:21 +02:00
Alex Voinea
193bce7f20
Merge pull request #4037 from gudnimg/optimisation-tmc2130-stuff
...
Optimisation: Disable M351 when using TMC2130 and code related to it
2023-04-13 10:54:08 +02:00
Scott Mudge
3cd125c566
MeatPack gcode compression support
2023-04-13 10:50:15 +02:00
3d-gussner
3b9d1b8980
Merge pull request #4138 from gudnimg/menu-fixes-gudni
...
Fix broken editing menu
2023-04-13 10:16:19 +02:00
Alex Voinea
e4bedf0523
Merge pull request #4133 from gudnimg/xyzcal-opt
...
Reduce XYZ cal code size
2023-04-12 21:35:58 +02:00
Alex Voinea
6c6f98fb03
Merge pull request #4134 from gudnimg/tmc2130_home_exit-opt
...
tmc2130: simplify parsing axis mask
2023-04-12 21:35:46 +02:00
Alex Voinea
c16e7733e9
Merge pull request #4141 from gudnimg/double-feedback-xyz-cal-menu
...
menu: Fix an issue with feedback double triggering in XYZ cal menu on knob click
2023-04-12 21:29:24 +02:00
Guðni Már Gilbert
225999b79d
Remove redundant colon characters
...
The Edit menu already applies a colon to the label string
no need to render it twice.
Change in memory:
Flash: -4 bytes
SRAM: 0 bytes
2023-04-12 17:37:57 +00:00
Guðni Már Gilbert
b91941f354
Fix broken editing menu
...
- currentValue must be initialised when entering the menu
- Consume lcd_encoder value when editing an item
Change in memory:
Flash: +40 bytes
SRAM: 0 bytes
2023-04-12 17:37:56 +00:00
Guðni Már Gilbert
53e3193252
Fix bug with uint8_t not shown correctly on LCD
...
Change in memory:
Flash: +8 bytes
SRAM: 0 bytes
2023-04-12 17:37:23 +00:00
Guðni Már Gilbert
2fc810289a
Fix an issue with feedback double triggering in XYZ cal menu
...
The feedback is produced due to the user clicking the knob
the menu_goto call should therefore not trigger additional feedback when
switching between menus.
No change in memory
2023-04-12 16:46:33 +00:00
Alex Voinea
d688f6ec6f
Menu item code: optimize return
2023-04-10 15:29:58 +02:00
Guðni Már Gilbert
b735c3d040
optimisation: extract common code into SETTINGS_FANS_CHECK
...
Implement it as a function instead of preprocessor macro
this allows us to control inlining
Change in memory:
Flash: -34 bytes
SRAM: 0 bytes
2023-04-10 13:24:39 +02:00
Alex Voinea
9a1eb7b239
Prevent rendering of the remaining menu items if the menu is clicked
...
Also prevent clicking
2023-04-10 13:02:22 +02:00
Alex Voinea
d3d201730e
Do not return early if the menu item is clicked
...
Just let the menu draw till the end even if an item is clicked. The worst this can do is waste some clock cycles
flash: -1222B
ram: 0B
2023-04-10 13:02:22 +02:00
Alex Voinea
bfdef3af9f
Fix menu items optimizations when extracting to functions.
...
Properly increment menu_item when the menu item is clicked so that you don't get multiple menu items clicked if in view (when the menu code is deduplicated to functions)
2023-04-10 13:02:22 +02:00
Alex Voinea
339c080b19
tmc2130: optimize mask when iterating over axes
...
Change in memory:
Flash: -28 bytes
SRAM: 0 bytes
2023-04-09 17:49:28 +02:00
Guðni Már Gilbert
c4b4cbfc7b
Make the function static
2023-04-09 13:40:10 +00:00
Alex Voinea
afd4f1d5bc
Iterate over axis bits
2023-04-09 15:17:01 +02:00
Guðni Már Gilbert
4e31bb94ef
tmc2130: simplify parsing axis mask
...
There is no need to check if every axis bit with each for-loop
iteration. We just need to check if a given axit bit is set.
Change in memory:
Flash: -6 bytes
SRAM: 0 bytes
2023-04-09 13:12:22 +00:00
Guðni Már Gilbert
e70344dc94
Reduce XYZ cal code size
...
Change in memory:
Flash: -120 bytes
SRAM: 0 bytes
2023-04-09 12:23:42 +00:00
Guðni Már Gilbert
902780a929
Disable M351 when using TMC2130 and code related to it
...
Change in memory (MK3S+ multilang build)
Flash: -250 bytes
SRAM: 0 bytes
2023-04-07 21:07:26 +02:00
Alex Voinea
449e83c7ff
Fix filament autoloading
2023-04-07 10:36:44 +02:00
Alex Voinea
2a3e4cac75
Fix toggle menu items rendering
2023-04-07 09:35:31 +02:00
Alex Voinea
49096f14c3
SD menu do not consume click in _scrolling state
2023-04-07 09:11:49 +02:00
Alex Voinea
10ba758bf7
Fix menu encoder rotation
2023-04-06 21:35:30 +02:00
Alex Voinea
373fab883d
Fix fsensor runout conditions
...
And also reorder autoload and runout conditions
2023-04-06 10:37:29 +02:00
D.R.racer
dfe6ea6470
Fixup after rebase
2023-04-06 07:44:16 +02:00
D.R.racer
c16db4e607
Remove lcd_encoder clamp check
...
as proposed by @leptun
2023-04-06 07:44:16 +02:00
Guðni Már Gilbert
6d2a66c1e8
match menu_goto's encoder type to lcd_encoder type
...
Change in memory:
Flash: -20 bytes
SRAM: 0 bytes
2023-04-06 07:44:16 +02:00
Guðni Már Gilbert
4ca7f8ce2d
cleanup: drop lcd_encoder in _menu_edit_P
...
Taken from PR 3985 by adding currentValue infrastructure
Change in memory:
Flash: 0 bytes
SRAM: 0 bytes
2023-04-06 07:44:16 +02:00
Guðni Már Gilbert
062ea1cf25
optimisation: make lcd_encoder two bytes (int16_t)
...
lcd_encoder was int32_t (4 bytes) because of the menu code
when editing through the menus, the menus only accept
int16_t so it doesnt make sense to use int32_t.
Change in memory:
Flash: -892 bytes
SRAM: -2 bytes
2023-04-06 07:44:16 +02:00
Guðni Már Gilbert
c754c8dd5f
Remove menu code in favor of simplicity
...
This change needs to be approved of course due to it affecting UI
The affect UI is only one menu
lcd_settings_linearity_correction_menu
I doubt many users are using this menu except very advanced users.
I propose we delete the variant of menu_draw_P which was used for
uint8_t but renders them as floats.
Instead treat
uint8_t same as int16_t i.e. just render integers.
Keeping it simple :) Solve our fanSpeed problem.
Change in memory:
Flash: -140 bytes
SRAM: -2 bytes
2023-04-06 06:05:59 +02:00
Guðni Már Gilbert
876ea6c228
Change block buffer fan speed to one byte
...
It's only assigned to variables which are uint8_t
Change in memory:
Flash: -10 bytes
SRAM: -16 bytes
2023-04-06 06:05:59 +02:00
Guðni Már Gilbert
2ced00f21c
Convert fanSpeed and saved_fan_speed to uint8_t
...
These variables only range from 0 to 255
For the menus we currently need to convert fanSpeed to int16_t.
Change in memory:
Flash: -160 bytes
SRAM: -2 bytes
2023-04-06 06:05:59 +02:00
Guðni Már Gilbert
76a8c80ef0
Fix issue with size being wrong at runtime
...
Change in memory:
Flash: +40 bytes
SRAM: 0 bytes
2023-04-05 17:52:48 +02:00
Guðni Már Gilbert
7ad137e570
Add preheat_cmd into PROGMEM
...
Change in memory:
Flash: -30 bytes
SRAM: 0 bytes
2023-04-05 17:52:48 +02:00
Guðni Már Gilbert
5ef00fb78a
Reduce code size in first layer calibration
...
Pull out common enqueuing loop into one function
Change in memory:
Flash: -70 bytes
SRAM: 0 bytes
2023-04-05 17:52:48 +02:00
Guðni Már Gilbert
5b04812017
Eliminate subtraction in print time statistic
...
Change in memory:
Flash: -20 bytes
SRAM: 0 bytes
2023-04-05 11:16:54 +02:00
Guðni Már Gilbert
ee39cb4e90
remove one global variable
2023-04-05 11:16:54 +02:00
Guðni Már Gilbert
768319f1e7
optimisation: cleanup print statistics
...
Change in memory:
Flash: -104 bytes
SRAM: 0 bytes
2023-04-05 11:16:54 +02:00
Guðni Már Gilbert
b9717b03e7
Make bFilament variables static and move to top of file
2023-04-05 11:16:14 +02:00
Guðni Már Gilbert
68d902c4e1
Take FilamentAction as parameter
...
Change in memory:
Flash: -28 bytes
SRAM: 0 bytes
2023-04-05 11:16:14 +02:00
Guðni Már Gilbert
210bbe9764
Remove dead code
2023-04-05 11:16:14 +02:00
Guðni Már Gilbert
301b2e4384
Optimisation: Move filAutoLoad to ultralcd
...
We can reuse preheat_or_continue() function
Change in memory:
Flash: -22 bytes
SRAM: 0 bytes
2023-04-05 11:16:14 +02:00
Alex Voinea
1b9379b328
PSU_DELTA alternative
2023-04-05 11:12:17 +02:00
Guðni Már Gilbert
ffc34edf4c
Pull in changes from PR 4080
...
Additionally make lcd_encoder_bits static
since it's not used outside the ISR context
2023-04-05 10:30:59 +02:00
Guðni Már Gilbert
a7e9ccfb57
Major refactoring
...
Fixes all the issues I've found so far.
Roughly 60B of flash saved. Need to double check that later.
2023-04-05 10:30:59 +02:00
Guðni Már Gilbert
d89e6de040
Update lcd_encoder in lcd_update
...
This fixes the spurious feedback when rotating the knob
because lcd_update is called much often than the interval
at which the lcd rendering is updated
Change in memory
Flash: -88 bytes
SRAM: -9 bytes
2023-04-05 10:30:59 +02:00
Guðni Már Gilbert
67c206ea5c
Remove menu_back_if_clicked_fb
...
Since feedback is always produced on knob click
we can use menu_back_if_clicked instead
Change in memory:
Flash: -18 bytes
SRAM: 0 bytes
2023-04-05 10:30:59 +02:00
Guðni Már Gilbert
0cac7612db
optimisation: Always make sound when knob is clicked or rotated
...
This commit adds the ability for firmware to make sounds when the
knob is clicked or rotated, when LCD updates are disabled.
The improvement here is the sound is being made with one line of code
whether or not LCD updates are enabled or disabled.
Change in memory:
Flash: -24 bytes
SRAM: 0 bytes
2023-04-05 10:30:59 +02:00
Guðni Már Gilbert
7de725f840
G80: Change 'correction' data type to int8_t
...
Valid values range from -100 to 100. Storing this value as four bytes
(int32_t) is not efficient.
Instead we can store G80 user input temporarily as int32_t and check
if the value is within the allowed range. If it is, then we convert the
int32_t (4 bytes) to int8_t (1 byte).
Change in memory:
Flash: -78 bytes
SRAM: 0 bytes
2023-04-05 10:13:27 +02:00
Guðni Már Gilbert
956efde822
G80: Re-implement optimisation from user espr14
...
Original Pull Request:
https://github.com/prusa3d/Prusa-Firmware/pull/3061
Change in memory:
Flash: -292 bytes
SRAM: 0 bytes
2023-04-05 10:13:27 +02:00
D.R.racer
7f921b4071
Limit some of the float formatting to fit 30 bytes buffer in enquecommandf_P
2023-04-05 09:10:39 +02:00
Guðni Már Gilbert
b9ce7637df
Rename enquecommandf() into enquecommandf_P()
2023-04-05 09:10:39 +02:00
Guðni Már Gilbert
7e119f733f
Implement variant of enquecommand which accepts format string
...
This eliminates many local buffers
Change in memory:
Flash: -450 bytes
SRAM: 0 bytes
2023-04-05 09:10:39 +02:00
Guðni Már Gilbert
687c14808a
optimisation: MMU silent mode toggling & init
...
Change in memory:
Flash: -16 bytes
SRAM: -2 bytes
2023-04-04 17:07:55 +00:00
3d-gussner
4cf46893fc
Revert "Fix a few ambiguous overloaded calls"
...
This reverts commit b7c42e83cf .
2023-04-04 16:12:41 +02:00
Guðni Már Gilbert
46852e9941
M862: determine decimal through math rather than checking for null byte/pointer.
...
This way doesn't add any more flash memory.
Calculating the string length or checking for a null byte
will end up increasing flash consumption overall.
2023-04-04 15:22:21 +02:00
Guðni Már Gilbert
478627b6bc
Simplify parsing M862
...
This gets rid of float conversion.
We just need to check the 6th character when M862 is detected. This
character gives us the digit after the dot.
Change in memory:
Flash: -20 bytes
SRAM: 0 bytes
2023-04-04 15:22:21 +02:00
Guðni Már Gilbert
b9fecab239
Reduce calls to __divsf3 when calculating feedrate
...
For non-time critical code it is more effcient to call a function
rather inlining each division operation.
Change in memory:
Flash: -122 bytes
SRAM: 0 bytes
2023-04-04 15:16:56 +02:00
Guðni Már Gilbert
65750b9a4c
accel is uint32_t, drop float in comparsion
...
Change in memory:
Flash: -24 bytes
SRAM: 0 bytes
2023-04-04 15:11:29 +02:00
Guðni Már Gilbert
c0e21563e7
planner: optimise acceleration limits
...
Rename acceleration_st to acceleration_steps_per_s2 to be same as Marlin 2
Store the accelerator in local variable accel
while we are performing the limit checks.
When limit checks are done we can assign
the block it's acceleration. Especially
block->acceleration_steps_per_s2 is now only written to once, instead of direcly in the limit checks.
Change in memory:
Flash: -118 bytes
SRAM: 0 bytes
2023-04-04 15:11:29 +02:00
3d-gussner
a1234b3670
Merge pull request #4122 from leptun/mmu2_fix_ptfe_check_distance
...
Fix MMU2_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH for MMU2
2023-04-04 15:04:58 +02:00
Guðni Már Gilbert
b7c42e83cf
Fix a few ambiguous overloaded calls
...
Noticed this when exploring another optimisation
By specification exactly which overloaded function to use
we save some memory
Seems to have something to do with doing arithmetic in the function argument
Change in memory:
Flash: -156 bytes
SRAM: 0 bytes
2023-04-04 15:03:48 +02:00
3d-gussner
3b049a1b91
Merge pull request #4111 from gudnimg/E-cool-gudni
...
Fix clicking noise during Toolchange when E-cool mode is enabled
2023-04-04 15:03:37 +02:00
3d-gussner
eb3421f0f2
Merge pull request #4021 from gudnimg/cleanup_crashdet_detected
...
cleanup: remove unnecessary LCD update in `crashdet_detected()`
2023-04-04 14:58:30 +02:00
3d-gussner
91ad87b5a7
Merge pull request #4096 from gudnimg/msg-btn-more-translation
...
Remove `MSG_BTN_MORE` from translation list
2023-04-04 14:57:30 +02:00
Guðni Már Gilbert
3e4592b7fd
Don't duplicate silent mode menu
...
Create a common function for the menu
This saves a lot of memory and 50 lines of code!
Change in memory:
Flash: -110 bytes
SRAM: 0 bytes
2023-04-04 14:47:45 +02:00
Alex Voinea
ebf8b16df5
Fix MMU2_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH for MMU2
2023-04-02 11:35:17 +02:00
Guðni Már Gilbert
5be4504fea
Re-use G28 W string in PROGMEM
...
Change in memory:
Flash: -12 bytes
SRAM: 0 bytes
2023-03-27 18:14:28 +00:00
Guðni Már Gilbert
138654e207
Add comment
...
Note we cannot use too long extrusions
2023-03-26 09:16:07 +00:00
Guðni Már Gilbert
4342217159
Add comment about planner_aborted = false
2023-03-26 09:00:34 +00:00
Guðni Már Gilbert
6bdc3c5cfb
Improve MMU toolchange when E-cool mode is enabled
...
Currently we are queuing many small 2 mm E-moves until the filament
sensor triggers. We do this because we never abort any queued moves,
so making small 2 mm moves ensures we do not move the E-motor more than
2 mm past the filament sensor.
Unfortunately, when E-cool mode is enabled, the E-motor will create
audible clicking sounds (similar one hears during jam or a loose grub
screw). A workaround for this is to queue one or more very long moves.
Where very long is something of the order of hundreds of millimeters. I
have it set to 350 mm but it's just a random constant really. Keep in
mind the firmware will block too large E-moves, if I recall correctly
it was anything above > 450 mm (see PREVENT_LENGTHY_EXTRUDE)
In order to use very long moves, we must somehow stop the E-motor from
moving once the filament sensor triggers. In other words, throw away
what's left of the current E-motor move. For this simple purpose we can
use planner_abort_hard() but we must set planner_aborted to false
afterwards because the code architecture does not allow the main loop()
to run until the Toolchange command is done processing.
Change in memory:
Flash: +18 bytes
SRAM: 0 bytes
2023-03-26 08:57:59 +00:00
3d-gussner
6dbf35f6e6
Merge pull request #4062 from gudnimg/cleanup_move_planned
...
remove duplicate function in planner
2023-03-24 14:06:19 +01:00
3d-gussner
34ec1ff190
Merge pull request #4098 from gudnimg/PFW-1515
...
PFW-1515 Fix an issue with Thermal Anomaly message
2023-03-24 14:04:21 +01:00
3d-gussner
6959b372ec
Merge pull request #4063 from gudnimg/PFW-1503
...
PFW-1503 Improve live Z babystep menu handling
2023-03-24 14:01:15 +01:00
3d-gussner
b9103a113c
Merge pull request #4102 from 3d-gussner/MK3_fix_Hbed_MMULoadingTest
...
Fix HBed on Load for MMU Loading test
2023-03-24 13:59:58 +01:00
3d-gussner
4feacfe822
Merge pull request #4093 from gudnimg/Restore-default-M701-M702-Z-lift
...
Restore previous Z-lift in M701/M702 + other PROGMEM optimisations
2023-03-24 13:59:47 +01:00
3d-gussner
7e0bf88431
Use `G28 W` only
2023-03-22 12:30:16 +01:00
3d-gussner
5536873eca
Fix HBed on Load for MMU Loading test
2023-03-22 09:50:59 +01:00
Guðni Már Gilbert
c5fc1168ed
PFW-1515 Fix an issue with Thermal Anomaly message
...
Issue introduced with PFW-1504
Change in memory:
Flash: +40 bytes
SRAM: 0 bytes
2023-03-20 20:35:49 +00:00
Guðni Már Gilbert
178c1f4aa6
Header cleanup
2023-03-20 13:57:20 +00:00
Guðni Már Gilbert
e2b58d8724
Don't translate the more button
2023-03-19 16:50:42 +00:00
Guðni Már Gilbert
5643d16c01
cleanup: remove redundant lcd_update in cashdet_detected
...
There is no need to repeat:
lcd_update_enable(true);
lcd_update(2);
Also lcd_clear() is redundant because lcd_update(2) will clear the LCD
Change in memory:
Flash: -16 bytes
SRAM: 0 bytes
2023-03-18 19:52:08 +00:00
Guðni Már Gilbert
bc27b71729
Pull one common G1 gcode into PROGMEM
...
Change in memory:
Flash: -32 bytes
SRAM: 0 bytes
2023-03-18 17:37:27 +00:00
Guðni Már Gilbert
f296b3f826
G21 is not implemented, don't queue it
...
It's just a single 'break', will likely not be implemented
Change in memory:
Flash: -6 bytes
SRAM: 0 bytes
2023-03-18 17:23:01 +00:00
Guðni Már Gilbert
6edd8b0719
Add M220 into PROGMEM
...
Change in memory:
Flash: -10 bytes
SRAM: 0 bytes
2023-03-18 17:09:43 +00:00
Guðni Már Gilbert
00515a975d
Add M107 into PROGMEM
...
Change in memory:
Flash: -4 bytes
SRAM: 0 bytes
2023-03-18 17:05:35 +00:00
Guðni Már Gilbert
5ade1716bf
Add M500 into PROGMEM
...
Change in memory:
Flash: -6 bytes
SRAM: 0 bytes
2023-03-18 17:01:59 +00:00
Guðni Már Gilbert
733bc874fb
Move G28W0 to messages
...
No change in memory
2023-03-18 16:48:30 +00:00
Guðni Már Gilbert
466a6a8fc3
Add M600 into PROGMEM
...
Change in memory:
Flash: -10 bytes
SRAM: 0 bytes
2023-03-18 16:33:13 +00:00
Guðni Már Gilbert
129cc18cbf
Add M23 %s into PROGMEM
...
Change in memory:
Flash: -14 bytes
SRAM: 0 bytes
2023-03-18 16:18:05 +00:00
Guðni Már Gilbert
7c0ead7bc2
Add M24 into PROGMEM
...
Change in memory:
Flash: -8 bytes
SRAM: 0 bytes
2023-03-18 16:15:10 +00:00
Guðni Már Gilbert
5f8fc64a32
Restore previous Z-lift in M701/M702
...
Previously when the firmware called M701/M702 manually
there was no Z lift. But after we added support for the Z
parameter we set the default to 50mm.
Change strings "M701" to "M701 Z0" and "M702" to "M702 Z0"
to restore the previous behavior from before 3.13.
Also pulled the gcodes into PROGMEM in message.cpp
along with M83 and M84 to save memory.
Change in memory:
Flash: -34 bytes
SRAM: 0 bytes
2023-03-18 15:34:47 +00:00
Guðni Már Gilbert
942021cb2b
PFW-1503 Fix an issue where the menu is dismissed in First layer calibraiton
...
When the extruder lifts up after completing the Purge line,
the baby stepping is not allowed for a short time. This dismisses
the menu. We don't want this behavior, so only apply the Z-axis requirement
when printing.
Change in memory:
Flash: +8 bytes
SRAM: 0 bytes
2023-03-18 12:47:40 +00:00
Guðni Már Gilbert
e40d8ebbcc
Implement printJobOngoing()
...
This makes the if statments a little bit more readable
Change in memory:
Flash: -88 bytes
SRAM: 0 bytes
2023-03-18 12:18:43 +00:00
Guðni Már Gilbert
561d8599d2
PFW-1503 drop {} for consistency
2023-03-18 11:56:06 +00:00
Guðni Már Gilbert
59314a41c1
PFW-1503 only allow babystepping on the first couple of layers
...
Change in memory:
Flash: +28 bytes
SRAM: 0 bytes
2023-03-18 11:56:06 +00:00
Guðni Már Gilbert
09d918ce5d
PFW-1503 Change BABYSTEP_ALLOWED to babystep_allowed
...
I initially started with a preprocessor macro
called BABYSTEP_ALLOWED, but now it is a function.
It more common to use lower case for function names
2023-03-18 11:56:06 +00:00
Guðni Már Gilbert
bb614f669d
PFW-1503 Add additional check
...
Add lcd_commands_type == LcdCommands::Layer1Cal
just in case blocks_queued() is 0 for one instant between
lcd_command steps
Change in memory:
Flash: +8 bytes
SRAM: 0 bytes
2023-03-18 11:56:06 +00:00
Guðni Már Gilbert
bc2366cd8d
PFW-1503 Improve live Z babystep menu handling
...
Fixes an issue with running first layer calibration twice in a row.
Improvements:
Now the Z baby step menu closes automatically when first layer calibration is done.
No need to wait for a timeout or close the menu manually by setting a variable
If the baby stepping menu is open, and suddenly
the printer enters a state where baby stepping
is not allowed.
The printer will save the last value before closing the menu.
When LcdCommands != Idle, don't dismiss
the Z baby step menu. This saves 20B
Change in memory:
Flash: -130 bytes
SRAM: 0 bytes
2023-03-18 11:56:05 +00:00
Guðni Már Gilbert
5c010a3aaa
PFW-1509 Fix an issue with unload when nozzle is cold
...
Change in memory:
Flash: -2 bytes
SRAM: 0 bytes
2023-03-18 10:43:23 +00:00
3d-gussner
c3235386a1
Bump up commit number
2023-03-15 07:52:01 +01:00
3d-gussner
8b49d241d2
revert BTN_MORE non-translated
2023-03-15 07:03:41 +01:00
3d-gussner
00309f42c3
Bump up fw version
...
6508 from t3.13.0-BETA1
+50 commits
+1 for this commit
+1 for merge
2023-03-14 15:18:13 +01:00
D.R.racer
3fe2f25c9f
Disable reading MMU register 0x21
...
It has proven to be too unreliable and may confuse end users.
2023-03-14 15:12:50 +01:00
3d-gussner
68b4a8a6cb
Last minute changes need a revert of the fw bump up
2023-03-14 11:22:43 +01:00
3d-gussner
e87e1630e2
Bump up version
...
t3.13.0-BETA1 commit nr 6508
+46 commits between
+1 commit for this PR
+1 commit for the merge
=6556
2023-03-14 09:09:38 +01:00
3d-gussner
e951a106d6
Messages fit to pages
2023-03-14 08:56:46 +01:00
3d-gussner
8604c93ccc
Shorten messages as users will contact support anyway
2023-03-14 08:32:16 +01:00
3d-gussner
616cf61583
Revert
2023-03-14 08:31:21 +01:00
3d-gussner
22e70faa71
Remove `MMU2` and `MMU unit` messages
...
Saves 26byte of flash
Saves -368 byte in trasnlations
2023-03-14 08:30:15 +01:00
3d-gussner
7676df88a4
Rename forgotten `MMU2` message to `MMU`
2023-03-14 08:30:03 +01:00
3d-gussner
235c4ae943
Do not `MSG_BTN_MORE` translate
2023-03-14 08:26:39 +01:00
3d-gussner
9721a87ef2
Raname `MMU2` message to `MMU` as everywhere
2023-03-14 08:24:50 +01:00
3d-gussner
03778226ca
Remove `Select Extruder:` message
...
Post fix PR4064 for update.po*.py scripts
2023-03-14 08:24:12 +01:00
3d-gussner
93598ef00d
Change some messages to be max three rows instead of two
...
Yes|No are now located at the 4th row and so messages can
use three rows. This should allow improvement in some translations.
2023-03-14 08:23:40 +01:00
Guðni Már Gilbert
ebf94c572f
PFW-1504 Minor optimisation
...
Change in memory:
Flash: -4 bytes
SRAM: 0 bytes
2023-03-13 06:47:08 +01:00
Guðni Már Gilbert
42878341af
PFW-1504 More correct solution to the pixel count issue
...
The fact that the relationship between
machine position and pixel index is not linear
means we cannot simply rely on comparing
the previous position to the next machine position. i.e derivative of E_AXIS
Because around the max amplitude of the triangle wave
the slope will suddenly change sign and will create a deadzone
which has width 2*mm_per_pixel.
For MMU2S this is ~10mm (or two pixels).
Instead we should split the moves.
And only plan the 2nd move once we're
at the top of the triangle wave. That way we don't really care about the position delta.
Now we just calculate the current y(x)
position relative to current position and divide by mm_per_pixel.
If there is a delta measured with unit 'pixel' then that means
its time to render the next pixel.
This solution seems to work well so far on my end.
Change in memory:
Flash: +2 bytes
SRAM: 0 bytes
2023-03-13 06:47:08 +01:00
Guðni Már Gilbert
b5e323e67c
PFW-1504 rename length_step_mm to mm_per_pixel
...
Its more descriptive
2023-03-13 06:47:08 +01:00
Guðni Már Gilbert
9865d4a38a
PFW-1504 Add precision error
...
This fixes an issue where sometimes
not all 20 pixels are rendered.
It is better to render 1 too many pixels (sometimes), rather than rendering too few.
Change in memory:
Flash: +18 bytes
SRAM: 0 bytes
2023-03-13 06:47:08 +01:00
Guðni Már Gilbert
f2157c6f1d
Fixup
...
We're always setting the cursor position when rendering now
Saves 8 bytes of flash
2023-03-13 06:47:08 +01:00
Guðni Már Gilbert
c518bfdb73
PFW-1504 Set cursor position each time to be safe
...
Change in memory:
Flash: +18 bytes
SRAM: 0 bytes
2023-03-13 06:47:08 +01:00
Guðni Már Gilbert
59e1ac0396
PFW-1504 implement stepper_get_machine_position_E_mm()
...
This function should be used when reading the current machine
position while a move is ongoing
No change in memory
2023-03-13 06:47:08 +01:00
Guðni Már Gilbert
690d83a94a
fixup
2023-03-13 06:47:08 +01:00
Guðni Már Gilbert
9145c8f59f
PFW-1504 too much?
...
I'm not happy with the current solution, I think we can improve it
by using the fact that this is a triangle wave. Need to think about it.
2023-03-13 06:47:08 +01:00
Guðni Már Gilbert
73c76579af
PFW-1504 Add init for progress bar
...
In case we are running a retry, the firmware
should clear the old rendering before
starting on a new one
Change in memory:
Flash: +6 bytes
SRAM: 0 bytes
2023-03-13 06:47:08 +01:00
Guðni Már Gilbert
51f1aa14a5
PFW-1504 Update last position as quickly as possible
...
0.1mm extrusion may happen while updating the LCD
No change in memory
2023-03-13 06:47:08 +01:00
Guðni Már Gilbert
bbfc4b9f78
PFW-1504 initial commit
...
Change in memory:
Flash: +162 bytes
SRAM: 0 bytes
2023-03-13 06:47:08 +01:00
3d-gussner
04d440a9c8
Fix AutoLoad filament menu not shown when FSensor is [Off] ( #4072 )
...
Fix AutoLoad filament menu not shown when FSensor if [Off]
2023-03-10 14:23:56 +01:00
3d-gussner
ba41b2bb0b
Fix M706 lcd message stuck
2023-03-09 07:00:40 +01:00
DRracer
e787111922
Add MMU error code: MCU_UNDERVOLTAGE_VCC ( #4069 )
...
+ read bandgap voltage periodically
+ correct wording of ERR_ELECTRICAL_MCU_UNDERVOLTAGE_VCC (as requested in Prusa-Error-Codes PR#81)
2023-03-08 15:42:25 +01:00
Guðni Már Gilbert
a20a7232a8
Change "Extruder N" to "Filament N"
...
Change in memory:
Flash: -52 bytes
SRAM: 0 bytes
2023-03-06 10:26:12 +01:00
Guðni Már Gilbert
0b261ad4de
remove duplicate function in planner
...
moves_planned() should be used instead
No change in memory
2023-03-03 21:11:16 +00:00
3d-gussner
03280c48d5
Merge pull request #4059 from gudnimg/planner-opt-subtraction
...
planner: calculate step difference once
2023-03-03 14:42:47 +01:00
3d-gussner
474d489c39
Merge pull request #4033 from gudnimg/improve-preheat-target
...
preheat: improve target temperature threshold
2023-03-03 14:41:58 +01:00
D.R.racer
bc818636b0
Increase MMU FW version to 2.1.8
...
in relation to MMU-218
2023-03-02 19:58:00 +01:00
Guðni Már Gilbert
d487254806
planner: calculate step difference once
...
Change in memory:
Flash:-158 bytes
SRAM: 0 bytes
2023-03-01 22:28:08 +00:00
vintagepc
13f7ba81ff
Cleanup, share more M914/5/FORCE code
2023-02-25 15:49:15 -05:00
vintagepc
7214584723
Fixed conflict with force_z, added P flags
2023-02-25 15:24:59 -05:00
vintagepc
487c7d63e1
Partial
2023-02-25 15:02:26 -05:00
vintagepc
6dfbdd3735
Enable M914/5, Show in settings if overloaded
2023-02-25 14:49:40 -05:00
3d-gussner
051054b0db
Bump up FW version and build number
2023-02-24 16:42:36 +01:00
D.R.racer
303a67cd6f
Introduce MMU EEPROM reset feature
...
This new feature requires MMU FW v 2.1.7 (which brings some more small changes)
2023-02-24 15:26:07 +01:00
3d-gussner
31bfbb4ed0
Merge pull request #4023 from DRracer/rename-eject-mmu
...
PFW-1497 Change Eject filament -> Eject from MMU
2023-02-23 10:48:35 +01:00
3d-gussner
afc866e756
Merge pull request #4010 from gudnimg/improve-backlight-control
...
backlight: always allow backlight to dim/wake
2023-02-21 10:00:03 +01:00
Guðni Már Gilbert
8a926fad10
backlight: set rotation flag when certain amount of pulses are detected
...
We don't want to trigger a backlight wakeup randomly, for example
due to background noise.
2023-02-20 18:26:43 +00:00
3d-gussner
36c6b323c4
Set `Is filament loaded? Yes|No` default to `No` without a timeout.
2023-02-20 16:31:23 +01:00
3d-gussner
791b9b4d39
Merge pull request #4028 from DRracer/pr3322-updated
...
Merge duplicate strings in cmdqueue.cpp
2023-02-20 13:51:09 +01:00
Guðni Már Gilbert
496b52b819
preheat: sync temperature threshold in M600 and Wizard
...
* M600 used 1°C threshold, which may increase the waiting time a bit
* Wizard used 3°C
Sync both to use TEMP_HYSTERESIS for consistancy
No change in memory footprint
2023-02-19 13:23:31 +00:00
Guðni Már Gilbert
6ad126ef0b
optimisation: preheat menu always uses integers for target temperature
...
Let's drop the float comparison since it not needed
Change in memory:
Flash : -16 bytes
SRAM: 0 bytes
2023-02-19 13:21:30 +00:00
Guðni Már Gilbert
319fec47f0
preheat: improve target temperature threshold
...
Use 5°C threshold to be consistant with other parts
of the firmware.
Relying on 95% of the target temperature creates
a dependency on the temperature:
PLA: Target = 215°C, threshold = 10.75°C
PETG: Target = 230°C, threshold = 11.5°C
ABS: Target = 255°C, threshold = 12.75°C
ASA: Target =260°C, threshold = 13.0°C
PC: Target = 275°C, threshold = 13.75°C
My proposal is we instead use a constant
TEMP_HYSTERESIS = 5, which is consistent with
M109, and behavior when restoring print from RAM
and some of the MMU code (like unload function)
Change in memory:
Flash: +2 bytes
SRAM: 0 bytes
2023-02-19 12:59:58 +00:00
Guðni Már Gilbert
db878c9996
backlight: always allow backlight to dim/wake
...
This commit adds the ability for the firmware to dim and wake the
backlight when LCD updates are disabled. Such as in the MMU error screen
or when rendering full screen messages which typically
disable the LCD updates to prevent the status screen from rendering.
Fixes #2777
Change in memory:
Flash: -26 bytes
SRAM: +1 byte
2023-02-18 17:08:35 +00:00
D.R.racer
5cd60636f9
Add missing translations + shorten to 16 chars
2023-02-18 17:39:30 +01:00
D.R.racer
98e7c15928
Change Eject filament -> Eject from MMU
...
PFW-1497
2023-02-18 17:39:30 +01:00
Guðni Már Gilbert
05662a5c0a
optimsation: reduce code size in LCD rendering
...
Change in memory (MK3S+ Multilang):
Flash: -62 bytes
SRAM: -6 bytes
2023-02-18 16:32:08 +01:00
Guðni Már Gilbert
074057c110
Fix an issue where LCD freezes during loading test
...
It may be useful to view the Sensors menu
while the toolchange loading test is taking
place. For example to see if the reading is flickering
The firmware needs to call lcd_update(0) to update the screen rendering.
Change in memory:
Flash: -2 bytes
SRAM: 0 bytes
2023-02-18 13:16:40 +01:00
Guðni Már Gilbert
555e766296
optimisation: only update mm when i > 0
...
Change in memory:
Flash: -24 bytes
SRAM: 0 bytes
2023-02-18 12:39:44 +01:00
Guðni Már Gilbert
e41b6d106d
optimisation: use more string from PROGMEM
...
Change in memory:
Flash: -10 bytes
SRAM: 0 bytes
2023-02-18 12:39:44 +01:00
Guðni Már Gilbert
9f4a7adb9a
optimisation: extract common M861 code
...
Change in memory:
Flash: -128 bytes
SRAM: 0 bytes
2023-02-18 12:39:44 +01:00
D.R.racer
ee23d6c62a
Merge duplicate strings in cmdqueue.cpp
...
Original idea from @GilesBathgate, PR #3322 . This is just a rework on top of current MK3 branch.
2023-02-18 11:37:48 +01:00
3d-gussner
3381bf2f7e
Merge pull request #2201 from vintagepc/2091_2153_sheet_Mcode
...
Add M850 code for setting sheet label and offsets
2023-02-17 15:12:22 +01:00
Yuri D'Elia
1b3fa8bfe9
TM: Move headers to support the legacy build system
2023-02-17 15:01:59 +01:00
Yuri D'Elia
a8f219259a
TM: Split default model parameters into a separate header
...
Preparation to support multiple default model parameter sets
2023-02-17 15:01:59 +01:00
Yuri D'Elia
d1ff728e4f
TM: future-proofing for incompatible model upgrades
...
Introduce a model version. This is initialized at "1" and doesn't
require any upgrade/downgrade checks since it's currently
retro-compatible.
2023-02-17 15:01:59 +01:00
Yuri D'Elia
9bd03cedb9
TM: Fix UV identity
2023-02-17 15:01:59 +01:00
Yuri D'Elia
ddf5147f9f
TM: Optimize temp_model_set_lag
...
Save about 20 bytes by rewriting the sample count check
2023-02-17 15:01:59 +01:00
Yuri D'Elia
b676d395e3
TM: Handle L/TEMP_MODEL_LAG
2023-02-17 15:01:59 +01:00
Yuri D'Elia
0bf6a5bc4b
TM: Handle UV (PTC loss)
...
Model UV as power-invariant, so that scaling P doesn't change the
intercept location (that is, the zero point remains at the same
temperature even for more powerful heaters).
NOTE: It's not clear to me whether this is generally true (couldn't
find a datasheet from the same heater in diffent power variants
showing the efficiency loss)
2023-02-17 15:01:59 +01:00
Yuri D'Elia
ba96c8d457
TM: Handle D/TEMP_MODEL_fS
2023-02-17 15:01:59 +01:00
Yuri D'Elia
eb88b720ac
TM: Handle UVDL set/load/report/upgrade
...
- Expose TEMP_MODEL_fS and TEMP_MODEL_LAG as D and L respectively,
initializing the default values based on the previous hard-coded
values.
- Always round L to the effective sample lag to future-proof model
upgrades or changes (the stored value _is_ the effective value).
- Introduce UV as a new linear term for PTC heaters, defaulting
to an identity for model backward-compatibility.
2023-02-17 15:01:59 +01:00
Yuri D'Elia
38b1e64687
TM: Allocate new eeprom parameters for PTC handling
2023-02-17 15:01:59 +01:00
vintagepc
235ce62cd3
Update Marlin_main.cpp
...
Remove more stale code
2023-02-17 08:58:17 -05:00
vintagepc
032d5ebe5b
Update Marlin_main.cpp
...
Fix use of removed function
2023-02-17 08:31:27 -05:00
Guðni Már Gilbert
d0e0b51497
Optimisation: lcd_commands "M702 C" should be "M702"
...
Change in memory:
Flash: -2 bytes
SRAM: 0 bytes
2023-02-17 14:30:20 +01:00
Giles Bathgate
952b1af60b
Consistent use of noinline attribute
2023-02-17 14:30:20 +01:00
Giles Bathgate
754b2d03c3
Remove extraneous line added during merge conflict resolution
2023-02-17 14:30:20 +01:00
Giles Bathgate
25f9728e09
Add noinline attribute to count_e
2023-02-17 14:30:20 +01:00
Giles Bathgate
620b19bbab
Roll up lay1cal_square loops
2023-02-17 14:30:20 +01:00
Giles Bathgate
f92d2279d5
Re-use duplicated strings
2023-02-17 14:30:20 +01:00
Giles Bathgate
8129a14f19
Move layer calibration finish commands into first_layer_cal.cpp
2023-02-17 14:30:20 +01:00
Giles Bathgate
39160bc4ae
Free up some progmem
2023-02-17 14:30:20 +01:00
Giles Bathgate
568eec5ee0
Implement first layer cal with calculated extrusion widths
2023-02-17 14:30:20 +01:00
vintagepc
20eef890a6
Merge branch 'MK3' into 2091_2153_sheet_Mcode
2023-02-17 08:24:49 -05:00
D.R.racer
9b64d122dc
Disable MMU2S by default
...
On printers without the MMU no error screen should occur and no attempts of communication with the MMU should be performed -> EEPROM_MMU_ENABLED should default to 0.
PFW-1418
2023-02-17 12:53:07 +01:00
Guðni Már Gilbert
6745b2c766
Shorten Reset MMU button to fit LCD
...
Button strings are limited to 8 characters
2023-02-13 07:08:54 +01:00
Guðni Már Gilbert
b63f5433df
Don't show Pause/Stop menus while processing T-codes
...
PFW-1449
Change in memory:
Flash: +18 bytes
SRAM: +1 bytes
2023-02-12 15:58:07 +01:00
Guðni Már Gilbert
504099bd6c
optimisation: reduce code size in rendering cursor
...
Change in memory:
Flash: -62 bytes
SRAM: 0 bytes
2023-02-11 19:06:14 +01:00
Guðni Már Gilbert
c51aa10087
optimisation: spooljoin: use new eeprom init method
...
Change in memory:
Flash: -40 bytes
SRAM: -1 byte
2023-02-11 15:58:07 +01:00
Guðni Már Gilbert
982b1bb4bd
optimisation: backlight: use new eeprom_init function
...
Change in memory:
Flash: -56 bytes
SRAM: 0 bytes
2023-02-11 15:56:46 +01:00
Guðni Már Gilbert
c2a952cee5
optimisation: sound: use new eeprom_init function
...
Change in memory:
Flash: -18 bytes
SRAM: 0 bytes
2023-02-11 15:56:46 +01:00
Guðni Már Gilbert
8794ab2f71
respect Once sound mode
...
Change in memory:
Flash: +4 bytes
SRAM: 0 bytes
2023-02-11 15:54:33 +01:00
Guðni Már Gilbert
96fc90c80b
Revert a change in the MMU error screen logic
...
We can pull this code into a common function in a separate PR
2023-02-11 15:54:33 +01:00
Guðni Már Gilbert
5b4bc8bcdb
Tune louder beeps to match previous M600 behavior
2023-02-11 15:54:33 +01:00
Guðni Már Gilbert
b4f9f6d0b5
fixup: make sure to start the timer
...
Change in memory:
Flash: +10 bytes
SRAM: 0 bytes
2023-02-11 15:54:33 +01:00
Guðni Már Gilbert
8db2fbc97f
Improve sound handling for MMU error screen
...
Change in memory:
Flash: -174 bytes
SRAM: +4 bytes
2023-02-11 15:54:33 +01:00
Guðni Már Gilbert
e34faee389
optimisation: don't inline Sound_MakeCustom
...
Change in memory:
Flash: -32 bytes
SRAM: 0 bytes
2023-02-11 12:42:47 +01:00
Guðni Már Gilbert
7799853a05
optimisation: remove duplicate code
...
Sound_MakeCustom should play the sound
if critical = true OR the sound is not Silent
Change in memory:
Flash: -16 bytes
SRAM: 0 bytes
2023-02-11 12:42:47 +01:00
D.R.racer
c826ae989f
Remove Done button on FINDA-related MMU error screens
...
Follows the requirements from Prusa-Error-Codes yaml definition.
Saves a fwe bytes as well as the button switch() statement got simplified.
PFW-1494
2023-02-10 14:38:18 +01:00
3d-gussner
8b1b632164
Fix copy/paste typo thanks to @gudnimg
2023-02-10 14:35:36 +01:00
3d-gussner
4f8dbb19fd
Fix `M862.x` LCD messages
...
As the new menue adds a Yes/No option the messages
need to be limited to c=20 r=3
Updated/shortened all translations
2023-02-10 14:35:36 +01:00
3d-gussner
b02e8d9961
Fix First layer cal being stored without confirming with knob
2023-02-10 14:34:16 +01:00
RoboMagus
c3cfc86094
Fix #3977
2023-02-10 14:27:04 +01:00
Yuri D'Elia
d403d58b19
TM: Do not emit an "error:" on the serial for recoverable errors
...
Use "echo:" for thermal model error reporting to avoid octoprint
automatically sending a M112 kill.
Keep using "error:" instead for other thermal errors (MAXTEMP/etc).
This should allow resuming a thermal mode pause with the default
octoprint settings.
2023-02-10 14:24:50 +01:00
Guðni Már Gilbert
ea7e717204
Cleanup: Remove various dead code
2023-02-10 08:17:36 +01:00
3d-gussner
ca978080c4
Change to Thermal model
...
Add prusa.io/tm-cal link
and update all TM related translations
2023-02-08 15:36:59 +01:00
D.R.racer
26126906ef
Hardcode expected MMU FW version into the error message v2
...
This is an 80% solution to PFW-1488 which should be somewhat compatible with the existing languages/translations infrastructure.
I don't see a point in extending the infrastructure a great deal to support some compile-time replacement in order to patch just MSG_DESC_FW_UPDATE_NEEDED.
Related PR: https://github.com/prusa3d/Prusa-Firmware/pull/3993
2023-02-08 10:50:33 +01:00
Guðni Már Gilbert
99761bdff7
optimisation: re-use adjust_bed_reset()
...
Move the code into eeprom.cpp since we're only working with EEPROM
Change in memory:
Flash: -42 bytes
SRAM: 0 bytes
2023-02-08 08:01:55 +01:00
D.R.racer
3ddc2cf86d
Add ResetMMU and DisableMMU buttons to specific error screens
...
- MMU not responding/Communication error: add DisableMMU
- MMU FW update needed: add ResetMMU
Flash: +8B
RAM: +0B
2023-02-08 06:48:11 +01:00
D.R.racer
296b0414af
Optimize execute_extruder_sequence
...
Save 64B by refactoring of execute_extruder_sequence.
2023-02-08 06:47:50 +01:00
Guðni Már Gilbert
e34ed479ef
PFW-831 Add single buzzer beep when an MMU error screen is shown for the first time
...
If the user has the sound settings set to 'Silent' then this beep should be silent
Change in memory:
Flash: +4 bytes
SRAM: 0 bytes
2023-02-06 08:35:08 +01:00
Guðni Már Gilbert
b28aa6f42a
PFW-1471 Rename 'Toolchange count' to 'Material changes'
...
Added the string to our message so it can be translated
Change in memory:
Flash: -10 bytes
SRAM: 0 bytes
2023-02-06 08:33:40 +01:00
D.R.racer
ba34661b62
Fixup after rebase onto MK3
2023-02-01 08:28:23 +01:00
Guðni Már Gilbert
d66e2b66c2
Cleanup: use setTargetHotend consistently for one extruder
...
Main changes:
* setAllTargetHotends() is removed
* setTargetHotendSafe() is removed
* Extruder parameter on setTargetHotend() is dropped
Change in memory:
Flash: -192 bytes
SRAM: 0 bytes
2023-02-01 08:28:23 +01:00
D.R.racer
ed80defc2c
Shorten the Try-Load-Unload sequence
...
... and allow easier future tweking in case of need
Also, save ~30B of code by returning the previous E-motor position.
2023-02-01 06:38:19 +01:00
Guðni Már Gilbert
e597be2cb5
PFW-1381 Optimise initialisation
...
Change in memory:
Flash: -2 bytes
SRAM: -1 byte
2023-01-31 10:02:15 +01:00
Guðni Már Gilbert
a35e7d543f
Fix bug with button choice on MMU error screen isn't reset
...
PFW-1381
2023-01-31 10:02:15 +01:00
D.R.racer
d2f3835b2c
Fixup after review
2023-01-31 09:35:22 +01:00
Guðni Már Gilbert
8720602b0e
Fix an issue with corrupt serial messages
2023-01-31 09:35:22 +01:00
D.R.racer
43ae2c78e5
Fix cmake build
2023-01-31 09:35:22 +01:00
D.R.racer
528abcb8d8
clang-format
2023-01-31 09:35:22 +01:00
D.R.racer
0555376502
Refactor mmu2.cpp and related interfaces
...
The general idea is to keep platform specific implementation away from the MMU state machines as much as we can.
That would enable unit testing the top level MMU state machine and integration into other project as well (if needed).
2023-01-31 09:35:22 +01:00
Yuri D'Elia
e39f2d132e
TM: Check for PC parameters more carefully
2023-01-27 14:57:59 +01:00
3d-gussner
216b935488
Minor typo
2023-01-26 12:20:43 +01:00
3d-gussner
05cd50e2ef
Update M214 description with link to RepRap wiki
2023-01-26 12:20:43 +01:00
Guðni Már Gilbert
da63d73585
optimisation: don't print floats with lcd_print()
...
Change in memory:
Flash: -442 bytes
SRAM: 0 bytes
2023-01-25 18:21:22 +00:00
Guðni Már Gilbert
a5f7f1d735
optimisation: change index from uint32_t to uint8_t
...
Change in memory:
Flash: -152 bytes
SRAM: 0 bytes
2023-01-25 18:21:22 +00:00
Guðni Már Gilbert
8c4cd11ae0
Cleanup: remove code_value_float()
...
The function adds a bit of overhead compared to code_value()
I suspect this function is a relic of the past.
Change in memory:
Flash: -82 bytes
SRAM: 0 bytes
2023-01-25 16:51:10 +00:00
Guðni Már Gilbert
17e6f1b75e
optimisation: remove conv2str.cpp
...
Change in memory:
Flash: -288 bytes
SRAM: -8 bytes
2023-01-25 06:28:00 +00:00
Guðni Már Gilbert
79a10868fe
cleanup: FILWIDTH_PIN doesn't exist
...
raw_filwidth_value variable is never used
2023-01-24 19:41:45 +00:00
3d-gussner
7b163cf464
Merge pull request #3936 from wavexx/tm_cal_htemp
...
TM: Do not restrict autotune temperature
2023-01-24 14:20:55 +01:00
3d-gussner
fab4165f4a
Merge pull request #3920 from wavexx/selftest_ok_alert
...
wizard: Do no set "Self test OK" as an alert message
2023-01-24 14:16:44 +01:00
3d-gussner
1f54dfd0b2
Merge pull request #3941 from wavexx/tm_wizard_nowarn
...
wizard: Disable TM warnings during calibration
2023-01-24 14:15:04 +01:00
Alex Voinea
53fb4c3e3f
Move altfan eeprom initialization to extruder_altfan_detect()
...
flash: -16B
RAM: 0B
2023-01-23 19:47:03 +00:00
Guðni Már Gilbert
7245c76094
Fix an issue where Altfan Override setting in EEPROM is not respected at boot-up
2023-01-23 19:47:03 +00:00
Yuri D'Elia
c9f3a4cfce
wizard: Disable TM warnings during calibration
...
During calibration model warnings are possible/normal. This is
apparently leading some into thinking the hotend might be faulty
and abort the calibration with a hard reset.
Disable warnings/beeps during calibration.
Rely on the error threshold only.
2023-01-23 16:52:27 +01:00
Yuri D'Elia
679208b29e
TM: Do not restrict autotune temperature
...
Fix a wrong type that prevents running TM autotune at temps >127
2023-01-20 19:18:19 +01:00
Guðni Már Gilbert
39f9979655
optimisation: Combine if statement in M600
...
Change in memory:
Flash: -52 bytes
SRAM: 0 bytes
2023-01-18 09:44:27 +01:00
D.R.racer
6298722f9a
Disable E-motor before the MMU starts doing something
...
It may seem counterintuitive to disable the E-motor, but it gets enabled in the planner whenever the E-motor is to move.
The idea behind disbling the E-motor when it won't be needed for some time is to save power and lower the heat of the motor.
Therefore it is especially important to disable the motor before the printer pauses a print due to some MMU error screen.
2023-01-18 09:42:57 +01:00
Alex Voinea
0c352ac2d1
Disable M47 if TMC2130 drivers are used
...
flash: -126B
RAM: 0B
2023-01-17 20:37:27 +01:00
Guðni Már Gilbert
d83c0f6c40
Fix an issue with indexing PROGMEM pointer
...
Using array index 'pointer[index]' doesn't work properly.
Instead using "pointer + index" works fine.
No change in memory footprint
2023-01-16 12:36:57 +01:00