Commit Graph

63 Commits

Author SHA1 Message Date
Yuri D'Elia 719db8f537 Optimize menu editing by reducing template duplication
Avoid instantiating multiple copies of menu_item_edit_P/_menu_edit_P:
perform type switching at runtime.
2023-08-01 12:41:38 +02:00
Yuri D'Elia 5ad21550c7 Jump to PLA temps in LCD settings when starting from zero
Allow the LCD menu update function to preset an initial value during the
first encoder increase from the minimal (usually zero) value.

This is useful to jump to a more sensible initial value when turning on
an heater which is currently disabled. The user is still allowed to
decrease the value after the jump, so there's no functional restriction.
2023-07-31 16:04:16 +02:00
3d-gussner 6feab85252 Rebase update REVO and solve @wavexx comments 2023-07-25 17:24:02 +02:00
3d-gussner 44ae8033eb Rename upper case `TEMP_MODEL` to `THERMAL_MODEL` 2023-07-25 17:13:07 +02:00
Guðni Már Gilbert 570b360413 Fix menu_draw_P for negative values
The new code did not take into account the minus sign.

The template for menu_draw_P is removed since there is no benefit in
uint8_t version of this function since the value
is converted to two bytes anyway by lcd_printf_P.

Change in memory:
Flash: -92 bytes
SRAM: 0 bytes
2023-05-05 17:24:14 +00: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
Alex Voinea d688f6ec6f
Menu item code: optimize return 2023-04-10 15:29:58 +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
D.R.racer dfe6ea6470 Fixup after rebase 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 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 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 76a164e651 fixup 2022-11-08 13:49:40 +01:00
Guðni Már Gilbert 08460bd403 PFW-1397 Drop ON_MENU_ENTER
Using _menu_data_t turns out to save *just* a little bit more flash. So for now just use it.
2022-11-08 13:49:40 +01:00
Guðni Már Gilbert 390f69a82f PFW-1397 Fix: ON_MENU_ENTER was always run 2022-11-08 13:49:40 +01:00
Guðni Már Gilbert 82bd9db1d6 PFW-1397 Implement ON_MENU_ENTER to simplify code
ON_MENU_ENTER runs code within the brackets only once
after a new menu is entered.

For the tool change menu, this allows us to display the data and
read from EEPROM only once.
2022-11-08 13:49:40 +01:00
Yuri D'Elia 41abe1689c Block LCD during temperature model autocalibration 2022-07-25 17:30:22 +02:00
Yuri D'Elia 374b829fb6 Generalize menu_block_entering_on_serious_errors for menu lockout
Call this variable menu_block_mask instead. We don't need to know the
exact reason of why we're locking the menu.

We will be able to reuse this to prevent menu entry during more
activities in a cleaner way than testing for each condition as it's
currently done for both menu entry and longpress.
2022-07-25 17:30:22 +02:00
Alex Voinea 8821439878
Cardreader progressbar code 2021-02-25 20:25:32 +02:00
Alex Voinea 4c977cc335 Merge branch 'MK3' into MK3_NEW_SD_COMPILATION 2021-02-03 18:28:18 +02:00
D.R.racer 0eb7261e29 Save ~100B on menu implementation 2021-01-26 09:29:17 +01:00
Alex Voinea 355b003b7f
menu_data_reset() 2020-03-04 22:20:53 +02:00
Alex Voinea f35e553373
Code cleanup 2020-03-04 20:33:43 +02:00
Alex Voinea 53e130fc6d
Merge branch 'MK3' into MK3_NEW_SD_COMPILATION 2020-03-03 14:14:43 +02:00
Yuri D'Elia 0b9123ce24 Fix Live K, allow "Advance K" to be translated 2019-12-05 15:18:24 +01:00
Yuri D'Elia 5122f79a39 Merge remote-tracking branch 'upstream/MK3' into MK3_LA15 2019-12-04 17:27:23 +01:00
Alex Voinea 6538262e75 First build that actually works 2019-11-21 19:04:45 +02:00
Alex Voinea b3a587f5a4 SD first attempt. Broken 2019-11-20 20:25:51 +02:00
leptun e828798209 Fixes after merge and line buffer
General fixes to the lcd_edit_off item and improved way to generate the toggles.
The old process is this: Write '>' if required -> print base -> pad everything before the last character with spaces -> write the eol character -> jump back and print the toggle over the blank characters. This resulted in noticeable flickering when the toggle was redrawn and was showing the same thing. Now the process is similar, except that everything happens in a "line buffer" (a char buffer that holds an entire line) and gets printed in one go, avoiding jump instructions for the lcd and prevents flickering since it doesn't write ' ' and the letters afterwards.
This should get even better when the lcd_buffer gets implemented since the line_buffer will get compared to the existing data on the screen and avoid overwriting what is on the lcd with the same thing.
2019-09-13 21:21:42 +03:00
leptun 3c4fffef60 Merge branch 'MK3' into MK3_Translations 2019-08-31 15:30:51 +03:00
leptun 6a8330a43b Toggle "HW Setup"*
All toggles from "HW Setup" were changed.
This includes:
-"Nozzle d."
-all "Checks"
Also added an option to provide a string from sram (not from progmem) as the toggle argument. This can be useful when toggling numbers or even when toggling sheets in the future.
2019-08-30 17:36:21 +03:00
Marek Bel d647cdc02c Convert sheet switcher from sub menu to function. Handle null characters in sheet name. 2019-08-29 20:13:10 +02:00
leptun 505deb28fd Toggle menu item 2019-08-10 08:42:33 +03:00
Yuri D'Elia 18b8dc89e5 Merge remote-tracking branch 'upstream/MK3' into MK3_LA15 2019-08-04 17:06:34 +02:00
NotaRobotexe 9c95f8c015 sheet menu 2019-07-19 18:34:46 +02:00
Marek Bel d344e514c4 Rename functions and macro to match with naming convention - remove 'P' where there is no pointer to progmem. 2019-06-26 15:51:58 +02:00
Marek Bel d879794922 Remove first parameter of macro menu_format_sheet_P_E, of function menu_format_sheet_P_E and menu_item_submenu_P as it was always called with the same parameter. Saves 66B of FLASH. 2019-06-26 15:47:06 +02:00
Marek Bel 53dbcdd852 Display sheet name when adjusting Z. Costs 130B of flash. 2019-06-26 15:33:54 +02:00
Marek Bel e6fbac08ed Move sheet selector to submenu. 2019-06-21 15:44:56 +02:00
Marek Bel 0a48082609 Add steel sheet profile selector. 2019-06-20 16:40:53 +02:00
Marek Bel 6717590631 Merge branch 'MK3' into MK3_LA15 2019-06-13 15:39:50 +02:00
Yuri D'Elia 0a26de1e7f Allow to live-tune K during a print 2019-05-25 18:41:21 +02:00
DRracer 9cb0bc7bcf Fix MINTEMP errors and fsensor runout 2019-05-24 08:46:44 +02:00
DRracer a453c6fc9d Save 236B by improving functions in menu.cpp. Beware - the label now has
to come with a ':' as its last character. Changed language files along
with this commit too.
2019-05-16 16:43:44 +02:00
Marek Bel 7c4f66181f Generate menu item texts Load filament <nr.> and Eject filament <nr.> during runtime to conserve flash. 2019-05-14 15:47:25 +02:00
Marek Bel 1a0370e1c7 Make macro ON_MENU_LEAVE() usage similar to macros MENU_ITEM_BACK_P() and MENU_ITEM_FUNCTION_P(). 2019-05-06 17:39:00 +02:00
DRracer 0794430208 Fix for linearity correction not being stored to EEPROM when doing MENU-
UP
2019-05-06 15:33:13 +02:00