Commit Graph

2110 Commits

Author SHA1 Message Date
Alex Voinea 100a8e3b33 Dynamic characters initial
Fix more hardcoded characters

Finally optimize the lcd printf with custom characters

FontGen.py script

Add arguments and action

Fix build

Fix conflicts
2023-10-03 08:19:48 +02:00
gudnimg 016db6a6e8 Hide menus more consistently when the printer is busy
lcd_calibration_menu: Remove redundant if (!isPrintPaused). The menu
is never called unless this condition is true.

eeprom_switch_to_next_sheet: Don't show this menu if the printer
is busy doing work!

Do not allow these menus to run while a print is paused or
when we're recovering a print:

- Preload to MMU
- Load to Nozzle
- Unload filament
- Eject from MMU
- Cut filament
- Autoload filament
- Settings
- Calibration
2023-09-23 15:42:03 +00:00
gudnimg 06d34b4398 Fix an issue where print can't be stopped under specific circumstances
There is a bug where if the printer is recovering a print, it run a
blocking loop to restore the extruder and bed temperatures.
But if a Fan error is triggered in this loop, then the user can't
abort the print via LCD.

If the fan error resolves on its own the 'Resume print' menu will
appear in a few seconds. But if not, then the user can't resume the print
(which is normal). But with the bug above the user can't abort the print either!

The problem is essentially isPrintPaused variable is cleared too early.
We should wait until the print is completely restored first.

Steps to reproduce:
1. Start a print
2. Pause the print
3. Wait for extruder temperature to fall at lest 180°C
4. Click 'Resume' print
5. While heating, stop the hotend fan and wait for a few seconds until an error is raised
6. Observe issue => 'Stop print' menu item is gone!

PFW-1542
2023-09-23 14:18:52 +00:00
Guðni Már Gilbert 6187b7eecf optimisation: use disable_heater() in more places
Change in memory:
Flash: -84 bytes
SRAM: 0 bytes
2023-09-16 14:26:09 +00:00
3d-gussner 2e70697fa7
Merge pull request #4183 from leptun/mbl_print_area
MBL print area
2023-09-13 10:28:08 +02:00
3d-gussner 0aa380b931
Merge pull request #4206 from gudnimg/sd-card-menu-opt
optimisation: `menu_item == menu_line` is always true in `menu_item_sddir()` and `menu_item_sdfile()`
2023-09-13 07:49:43 +02:00
3d-gussner 73118dd4e2
Merge pull request #2474 from vintagepc/#2161-tune-x-y-rehome
Add X-Y home to tune menu if print is paused
2023-09-13 07:49:23 +02:00
vintagepc b7daac3b70 Direct home instead of G28 2023-09-12 18:41:14 -04:00
vintagepc b75e3b5233 facepalm commit
... I somehow managed to lose a bracket. DERP.
2023-09-12 18:33:27 -04:00
vintagepc ebc6663210 Add auto-home to tune menu 2023-09-12 18:33:27 -04:00
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