Commit Graph

2150 Commits

Author SHA1 Message Date
Guðni Már Gilbert ff6fd8cf4b Allow statistiscs menu while running 1st Layer cal
There is no problem with opening the menu during first layer
calibration. Removing this condition simplifies the code a little bit.

Change in memory:
Flash: -8 bytes
SRAM: 0 bytes
2023-09-12 20:26:43 +02:00
3d-gussner 019126778d
Merge pull request #1790 from jiri-jirus/MK3
y-axis self-test hack cleanup
2023-09-12 16:31:34 +02:00
Yuri D'Elia 334bfe4d29 build: Set all version data based on git tags
Drop the ALPHA/BETA/custom version handling. Set the version string and
firmware date based on the current tree description which has all the
required details.

Allow to override the repository information via cmake.

Use a truncated commit hash to set the internal commit number for
compatibility.

Rebase and fix issues
2023-09-04 08:35:15 -04:00
3d-gussner 77a4b99f5e Fix Calibration menu shown during resuming 2023-09-01 16:18:57 +02:00
Yuri D'Elia 2bfd56cd30 lang/mmu: Translate MMU menu strings within caller
This fixes the undefined _T(label) reference, at the expense of a few
extra bytes.

I would argue this is worth the cost for the ability to check
translation references for the future. The warning happens because
`lang-check` cannot check a reference which is not _directly_ a catalog
entry.

We could introduce a method to suppress this warning (either a new macro
or some ///IGNORE comment), but that would mean that the additional
translation check is completely bypassed, defeating the purpose.
2023-08-30 18:54:57 +02:00
3d-gussner 0bbec5626c Update and fix translations 2023-08-21 16:28:36 +02:00
Guðni Már Gilbert 5bf9bf7507 optimisation: reduce code size in MMU filament menus
Change in memory:
Flash: -156 bytes
SRAM: 0 bytes
2023-08-21 07:29:43 +02:00
Guðni Már Gilbert 1881c5f086 Fix filament actions not cleared properly
We can't clear eFilamentAction in every case in mFilamentItem()

mFilamentItem() can trigger a call to M701 and M702 e.g. for Autoloading
and eFilamentAction must be cleared by the gcode to prevent
the user from triggering another Autoload (which will crashe the FW)

The same applies to submenus. Now the MMU submenus clear eFilamentAction
only when the action is done.

For MMU Unload Filament item, eFilamentAction is only cleared after
the unload_filament() call is done running. This fixes an issue where
the menu item can be selected again while the first unload is still
running.
2023-08-21 07:29:43 +02:00
sarusani c4c26050d3 Fix screen update after PFW-1531 2023-08-21 06:36:25 +02:00
sarusani 0d097d5a62 Fix TEMP_HYSTERESIS calculation 2023-08-21 06:35:32 +02:00
Guðni Már Gilbert cabc44194a optimisation: menu_item == menu_line is always true
The if statement is checked in lcd_sdcard_menu()

so checking it again these functions is
redundant since it's always going to be true.

Tested on MK3S+

Change in memory:
Flash: -22 bytes
SRAM: 0 bytes
2023-08-20 08:19:01 +00:00
Alex Voinea 7740a81edb
Do not store a global mbl_z_probe_nr
flash: -6
sram: 0? (somehow)
2023-08-17 07:53:39 +02:00
Guðni Már Gilbert 0e469c054f Fix disappearing menu items when Filament Action completes
An example is when Unloading filament with MMU.

After the unload completes successfully, some menu items disappeared.
Because mFilamentBack() was not called

Change in memory:
Flash: -56 bytes
SRAM: 0 bytes
2023-08-16 08:22:03 +02:00
Guðni Már Gilbert 1bf33bd1aa Fix a bug where Load filament menu disappears
Kudos to @3d-gussner for finding the issue

Steps to reproduce:
1. reset printer
2. select Load filament
3. go back to main
4. LCD menu is very limited
5. To get all menus back select 6. Preheat
7. back to main

This commit is my proposed fix.

When eFilamentAction is equal to
FilamentAction::Load we must reset it to FilamentAction::None
when the Back button in Load Filament is selected

Change in memory:
Flash: -26 bytes
SRAM: 0 bytes
2023-08-16 08:22:03 +02:00
VintagePC ea5bcc5eea Implement #2089 2023-08-05 12:19:51 -04:00
Guðni Már Gilbert 95d8711469 PFW-1531 Fix #4300
No change in memory
2023-08-04 17:02:03 +00:00
3d-gussner b1da06859c
Merge pull request #3494 from wavexx/lcd_temperature_jumping
Jump to PLA temps in LCD temperature settings when starting from zero
2023-08-02 14:21:53 +02:00
Yuri D'Elia 92202249d9 Make temperature jumping configurable in the variant file
Use this new feature in the Settings -> Temperature menus.
2023-07-31 16:04:33 +02:00
Guðni Már Gilbert 7e025894d1 Echo the result onto serial
Example:
MMU2:1111111111111110011
1 means filament present (solid block)
0 means otherwise (dash)

Change in memory:
Flash: +94 bytes
SRAM: 0 bytes
2023-07-27 16:44:34 +00:00
Guðni Már Gilbert 940e626f3a Previously we called cleared the LCD, no need to change that
Change in memory:
Flash: -6 bytes
SRAM: 0 bytes
2023-07-27 16:44:34 +00:00
Guðni Már Gilbert 28f6cebfd2 PFW-1504 Cleanup
Only set cursor with lcd_status_message_idx where the variable
is used.

No change in memory
2023-07-27 16:44:34 +00:00
Guðni Már Gilbert 63775dfabb PFW-1504 fix conflicting UI issues
Proposal to fix some of the issues with the initial implementation
it is safer to use the status line code to print the message so
there aren't any conflicts in the LCD cursor position.

Allow inserting a byte into any position in the LCD status message

Also, add a variable to control from which index in the array
should the message start printing. This is very useful for progress
bars and messages which continually update. I think we can save some
memory by applying this to Mesh Bed Leveling later.

Change in memory:
Flash: +106 bytes
SRAM: +1 byte
2023-07-27 16:44:34 +00:00
vintagepc a2eafc587a
Merge branch 'MK3' into 2477-redux 2023-07-26 12:34:38 -04:00
3d-gussner ce141a2fa1
Merge pull request #3564 from wavexx/fil_loading_state
Filament loading state fixes
2023-07-26 16:38:29 +02:00
3d-gussner 78ed427166 Rename `TempModel` to `ThermalModel` 2023-07-25 17:13:07 +02:00
3d-gussner 44ae8033eb Rename upper case `TEMP_MODEL` to `THERMAL_MODEL` 2023-07-25 17:13:07 +02:00
3d-gussner dac07d11ba Rename lower case `temp_model` to `thermal_model` 2023-07-25 17:13:07 +02:00
Guðni Már Gilbert 21faa52aab Rename axis_steps_per_unit to axis_steps_per_mm 2023-07-25 17:10:44 +02:00
Guðni Már Gilbert 7029af05fa optimisation: reduce code size in pid_extruder()
Author: leptun

Change in memory:
Flash: -14 bytes
SRAM: 0 bytes
2023-07-25 15:02:49 +00:00
Guðni Már Gilbert 5288d615f8 optimisation: lcd avoid streams
Author: leptun

Change in memory:
Flash: -124 bytes
SRAM: 0 bytes
2023-07-25 15:02:49 +00:00
Yuri D'Elia 074b5d380f Consistently replace loading_flag with eFilamentAction
Remove loading_flag and check for eFilamentAction instead which already
flags both load/unload (in addition to mmu actions).

Correctly transition from AutoLoad to Load as soon as the operation
cannot be cancelled anymore as opposed to resetting it.
2023-07-25 14:30:20 +00:00
Yuri D'Elia 05b536947b Refuse to start a SD print until filament loading is complete
Do not blidnly clear the loading_flag, check for it!

Just disallowing the SD menu while loading is being performed is not
sufficient, since the menu can be entered also by inserting card while
loading is taking place.

This is also nicer in behavior, as we allow to navigate the SD card
while loading.
2023-07-25 14:28:46 +00:00
Yuri D'Elia e3fd6a4902 Do not allow filament actions while an existing one is taking place 2023-07-25 14:28:45 +00:00
Yuri D'Elia 170dddfd71 Set/clear loading_flag also during unload 2023-07-25 14:28:13 +00:00
Yuri D'Elia dece5d268f Consider any lcd_custom_command to be "ACTIVE"
All custom commands are transitory and eventually switch back to Idle
state by themselves.

It doesn't make any sense to explicitly check for Layer1Cal: any
non-idle state is active by design.

Fix this check in the main menu. This is probably incomplete (Layer1Cal
is incorrectly used in several other places).
2023-07-25 14:27:00 +00:00
Guðni Már Gilbert c067318427 cleanup language menu
Change in memory:
Flash: -50 bytes
SRAM: 0 bytes
2023-07-25 08:58:52 +02:00
Guðni Már Gilbert 57d780ccf9 PFW-1519 Hide Preload to MMU menu item if filament is detected
This is by far the simplest solution to prevent the user from sending
a Load command to the MMU when the FINDA or Filament sensor
is detecting a filament. This may even happen if the sensors are poorly positioned.

Either way a Load in this scenario will make the MMU seem to hang as the
state machine will reject the command.

We could add a full screen message to let the use know
but it would require some memory resources.

For now, just hide the menu item.

Change in memory:
Flash: +16 bytes
SRAM: 0 bytes
2023-07-24 08:05:50 +02:00
Guðni Már Gilbert 6784c6919b cleanup: remove TMC2130 ifdef in lcd_selfcheck_axis
This function is no longer included in the firmware
when using TMC2130

Also removed commented code
2023-07-13 10:06:21 +02:00
Guðni Már Gilbert 9cc9af14bd Remove unnecessary la10compat include 2023-07-13 09:57:52 +02:00
3d-gussner 56dd8f09e7 Fix too long message `MSG_BABYSTEPPING_Z`from c=15 to c=13
Had to remove `:` and update NL translation to fit
2023-05-26 08:17:02 +02:00
3d-gussner 3c678122f6
Merge pull request #4222 from 3d-gussner/PFW1520-pofiles
PFW-1520: Add new message `Preload to MMU` to po files
2023-05-24 06:57:48 +02:00
3d-gussner 135247c3b7
Merge pull request #4214 from 3d-gussner/MK3_Fix_MMU_IRsensor
Fix IRsensor with MMU
2023-05-24 06:57:05 +02:00
3d-gussner 9b4c8e9c9d Thanks to @gudnimg 2023-05-23 10:39:05 +02:00
3d-gussner f43451f80b Update `MSG_EJECT_FILAMENT` and `MSG_CUT_FILAMENT` to `c=16`
Had to shorten SK translation
2023-05-23 09:50:27 +02:00
3d-gussner a37bcbfd8c Fix `Load filament` to c=16 2023-05-23 09:45:07 +02:00
Guðni Már Gilbert 467158eb49 MMU: Fix 0°C target temperature when loading to nozzle
bFilamentAction variable is never reset, even after
disabling the heaters.

Steps to reproduce:
1. Boot-up printer
2. Select Load to Nozzle.
3. Select PLA (215°C) target
4. Select Filament 1
5. Wait for load to be successful
6. Go to Preheat submenu and select Cooldown (last menu item)
7. Observe target temperature on the status screen is now 0°C
8. Select Load to Nozzle again.
9. Select Filament 2.
* Expected behavior target temperature IS NOT 0°C
* Actual behavior target temperature IS 0°C

Change in memory:
Flash: -26 bytes
SRAM: 0 bytes
2023-05-22 22:00:00 +00:00
Guðni Már Gilbert 9d5453a41e PFW-1520 Rename Load Filament menu to Preload to MMU
Change in memory:
Flash: +18 bytes
SRAM: 0 bytes
2023-05-22 07:53:26 +02:00
3d-gussner 91a23e27e1 Fix IRsensor with MMU
saves 38bytes
2023-05-19 13:35:28 +02:00
3d-gussner 0c453b53cd
Merge pull request #4193 from gudnimg/unload-sequence-improvements
Fix unload sequence for users without MMU
2023-05-10 07:29:16 +02:00
Guðni Már Gilbert 3c79e77220 Create define for two hardcoded values 2023-05-08 19:50:51 +00:00
Guðni Már Gilbert e24c2200f1 Set FILAMENTCHANGE_FINALRETRACT instead of hardcoded 0 2023-05-08 19:33:42 +00:00
3d-gussner 8d1abf772d
Merge pull request #4192 from gudnimg/PFW-1506
PFW-1506 Load to nozzle: Fix too short purge distance
2023-05-08 13:14:47 +02:00
Guðni Már Gilbert d781dae35b Combine two moves since they have the same feedrate
Change in memory:
Flash: -60 bytes
SRAM: 0 bytes
2023-05-06 15:24:54 +00:00
Guðni Már Gilbert 8556336185 Fix unload sequence for users without MMU
Restores 3.12 sequence which was working well before.

M600 "L" parameter now works like M702 "U" parameter.

Removed a lot of the unused parameters which were copied
from Marlin 2.

Change in memory:
Flash: +96 bytes
2023-05-06 15:24:54 +00:00
VintagePC e336e2ad08 Fix merge conflict/resync 2023-05-06 11:22:31 -04:00
Guðni Már Gilbert dd9df36375 Load to nozzle: Fix too short purge distance
PFW-1506

Change in memory:
Flash: +8 bytes
SRAM: 0 bytes
2023-05-06 13:19:57 +00:00
Guðni Már Gilbert 462535ef7f Restore 3.12 live Z-adjust menu behavior
Code size increases  a bit but keep in mind the PR
that broke the behavior "saved" 182 bytes:
https://github.com/prusa3d/Prusa-Firmware/pull/4063
So I think this code size increase is OK

Change in memory:
Flash: +84 bytes
SRAM: 0 bytes
2023-05-06 12:08:06 +00:00
Alex Voinea 1d87789641 Always allow Live Adjust Z in Settings 2023-05-05 19:19:11 +00:00
3d-gussner bf6c0919e1
Merge pull request #4166 from gudnimg/gudnimg-patch-1
M701/M702: Set default Z value to 0
2023-05-05 12:38:37 +02:00
3d-gussner 12d9070c03
Merge pull request #4181 from gudnimg/status-screen-feedrate
optimisation: only check feedrate if knob is rotated
2023-05-05 12:37:46 +02:00
3d-gussner bdd958fe5e
Merge pull request #4157 from leptun/menu_optimizations
Menu optimizations
2023-05-05 11:51:12 +02:00
3d-gussner e3a57c9947
Merge pull request #4169 from 3d-gussner/MK3_TMcal_mid
Move nozzle to center during Thermal model cal.
2023-05-05 11:48:41 +02:00
Guðni Már Gilbert fc15f5a6ef Select correct MMU slot in lcd_wizard_load
Change in memory:
Flash: +8 bytes
SRAM: 0 bytes
2023-05-02 22:38:54 +00:00
Guðni Már Gilbert 5b75886a55 Fix regression where feedrate can overflow on status screen
If the remaining print time is more than 10.9 hours at 100%
then increasing the feedrate multiplier
to 101% or more will yield an unrealistic time due to overflow occuring.

Change in memory:
Flash +2 bytes
SRAM: 0 bytes
2023-05-01 12:48:21 +00:00
Guðni Már Gilbert b3f52f95c7 optimisation: only check feedrate if knob is rotated
Guard the feedmultiply code with
lcd_encoder.

if lcd_encoder = 0, then there is no need to check if
feedmultiply should be updated.

Also set lcd_encoder to zero in one line to consume the rotation event.

Change in memory:
Flash: -40 bytes
SRAM: 0 bytes
2023-04-30 23:31:16 +00:00
Guðni Már Gilbert 26369ac540 Restore old M701/M702 behavior
If the new Z parameter is not given,
assume that the old Z-lift behavior is desired.

Change in memory:
Flash: -28 bytes
SRAM: 0 bytes
2023-04-29 16:22:28 +00:00
3d-gussner e11555392e Save some bytes.
Thanks to @leptun
2023-04-26 09:18:47 +02:00
3d-gussner 686f92b243 Move nozzle to center during Thermal model cal. 2023-04-25 20:41:17 +02:00
Alex Voinea e662ef276e
Deduplicate temperature settings
Flash: -52B
SRAM: 0B
2023-04-24 11:56:53 +02:00
Alex Voinea c83646743f
Deduplicate MMU settings
Flash: -58B
SRAM: 0B
2023-04-24 11:56:53 +02:00
Alex Voinea 4a2a89cb74
Remove stupid comments from older bad code 2023-04-24 11:56:53 +02:00
Alex Voinea 67f0fe0fce
Remove AUTOTEMP menu items
They are commented out and broken anyway
2023-04-24 11:56:53 +02:00
Guðni Már Gilbert 5b7266fdf1
Don't render message when printer is idle
Guard the lcd_display_message_fullscreen_P call by blocks_queued(). If there are no planned moves, there is no need to render this message, it creates a weird LCD draw noticable by the user.

Change in memory:
Flash: +10 bytes
SRAM: 0 bytes
2023-04-23 12:25:10 +02:00
Guðni Már Gilbert 9de2cbfe8e
Fix an issue with crash_mode_switch toggling
Proposed changes
2023-04-23 12:25:10 +02:00
Alex Voinea 9272545deb
Dead code cleanup 2023-04-23 12:25:10 +02:00
Alex Voinea 02a0f6a35a
Correctly utilize the menu stack in the Mode select message
Flash: -34B
SRAM: 0B
2023-04-23 12:25:10 +02:00
Alex Voinea 6390b3b69b
Remove duplicate separator string
Flash: -14B
SRAM: 0B
2023-04-23 12:25:10 +02:00
Alex Voinea ee8b95b556
Merge pull request #4158 from gudnimg/remove-dead-code-gudni-e1e2
Cleanup: remove unused extruder macros
2023-04-23 09:26:26 +02:00
Alex Voinea 9662bb11d4
Merge pull request #4144 from gudnimg/double-feedback-bugs
Double feedback bugs
2023-04-23 09:14:01 +02:00
Guðni Már Gilbert 3509791943 Drop sound feedback in lcd_v2_calibration
Drop the sound feedback in lcd_v2_calibration
when switching to lcd_generic_preheat_menu

If a single filament setup (no MMU) has filament loaded, it will jump
immediately to lcd_generic_preheat_menu
this created double feedback.

Let's just drop the feedback since the transition
between menus is very fast.

Change in memory:
Flash: -8 bytes
2023-04-22 15:28:27 +00:00
Guðni Már Gilbert fcabcd2804 Remove TEMP_SENSOR_1 and TEMP_SENSOR_2
Hopefully I didn't miss anything
2023-04-22 15:15:21 +00:00
Guðni Már Gilbert 4935191335 Cleanup remove unused macros
enable_e1
enable_e2
disable_e1
disable_e2

The firmware doesn't support multiple extruders

No change in memory
2023-04-22 15:15:21 +00:00
Guðni Már Gilbert 51da6065c8
Merge pull request #4159 from gudnimg/cleanup-gudni-comments
Remove random `//-//` comments
2023-04-22 13:53:13 +00:00
Guðni Már Gilbert b8f8348e77
Fix double feedback in Z-offset menu 2023-04-22 15:53:06 +02:00
Guðni Már Gilbert b6e228d5a5
Fix double feedback in First Layer Calibration
For MMU users: This happens when the user
selects a filament to load from 1 to 5

For non-MMU: this happens when clicking
the knob within 2 seconds.

Additionally fixed the code indendation
it was a mix of spaces and tabs
2023-04-22 15:53:06 +02:00
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
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
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 f6135f2ed1 Enable Analog IR sensor again 2023-04-16 13:58:18 +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 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 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 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 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 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
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
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 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 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 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
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 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
D.R.racer dfe6ea6470 Fixup after rebase 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 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 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
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 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 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 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
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
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
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 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 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 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 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 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 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 e951a106d6 Messages fit to pages 2023-03-14 08:56:46 +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 9721a87ef2 Raname `MMU2` message to `MMU` as everywhere 2023-03-14 08:24:50 +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 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 474d489c39
Merge pull request #4033 from gudnimg/improve-preheat-target
preheat: improve target temperature threshold
2023-03-03 14:41:58 +01: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 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
3d-gussner 36c6b323c4 Set `Is filament loaded? Yes|No` default to `No` without a timeout. 2023-02-20 16:31:23 +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
Giles Bathgate 620b19bbab Roll up lay1cal_square loops 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 568eec5ee0 Implement first layer cal with calculated extrusion widths 2023-02-17 14:30:20 +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
3d-gussner b02e8d9961 Fix First layer cal being stored without confirming with knob 2023-02-10 14:34:16 +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
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
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
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
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 17e6f1b75e optimisation: remove conv2str.cpp
Change in memory:
Flash: -288 bytes
SRAM: -8 bytes
2023-01-25 06:28:00 +00: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
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
Alex Voinea 0c352ac2d1 Disable M47 if TMC2130 drivers are used
flash: -126B
RAM: 0B
2023-01-17 20:37:27 +01:00
Yuri D'Elia 16a89b9215 wizard: Return to status after calibration 2023-01-16 11:38:56 +01:00
Yuri D'Elia 7529652dca TM: Restore extruder autofan state when stopping/resuming
During thermal errors all fans are set to full speed.

When the print is resumed or stopped *and* the thermal error is gone,
also restore the autofan state.

Fixes #3893
2023-01-16 08:43:36 +01:00
Yuri D'Elia 204df90d6d TM: Set the cal status bit when running `M310 A` directly
Running `M310 A` should set the TM calibration bit status if the
autotune procedure was successful.

Partially addresses #3891 and #3890, since running `M310 A F0` should
*still* count as valid calibration data and is not something that can be
replicated by using the LCD (which enforces self-test).
2023-01-16 07:32:57 +01:00
3d-gussner 2d34535977 Move Z to top during Nozzle change 2023-01-16 07:27:53 +01:00