Commit Graph

1873 Commits

Author SHA1 Message Date
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
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
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