Commit Graph

7172 Commits

Author SHA1 Message Date
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 d08302bf0c Remove colon character from translation 2023-04-12 17:37:57 +00: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
Alex Voinea 7e18e88cbe
Merge pull request #4137 from leptun/optimization_menu_click_return 2023-04-12 19:29:15 +02: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
Alex Voinea e88c92a8dc
Merge pull request #4132 from leptun/fix_autoload_filament_prompt 2023-04-07 13:21:47 +02:00
Alex Voinea 449e83c7ff
Fix filament autoloading 2023-04-07 10:36:44 +02:00
Alex Voinea 72fbf3546d
Merge pull request #4131 from leptun/fix_toggle_menu_items_rendering
Fix toggle menu items rendering
2023-04-07 09:51:01 +02:00
Alex Voinea 2a3e4cac75
Fix toggle menu items rendering 2023-04-07 09:35:31 +02:00
Alex Voinea 75d0c87d57
Merge pull request #4130 from leptun/fix_sd_menu_click
SD menu do not consume click in _scrolling state
2023-04-07 09:28:15 +02:00
Alex Voinea 49096f14c3
SD menu do not consume click in _scrolling state 2023-04-07 09:11:49 +02:00
Alex Voinea ddb5a6e7b1
Merge pull request #4127 from leptun/fix_menu_choice_encoder_rotation
Fix knob rotation
2023-04-07 00:14:42 +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