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
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
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
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
7de725f840
G80: Change 'correction' data type to int8_t
...
Valid values range from -100 to 100. Storing this value as four bytes
(int32_t) is not efficient.
Instead we can store G80 user input temporarily as int32_t and check
if the value is within the allowed range. If it is, then we convert the
int32_t (4 bytes) to int8_t (1 byte).
Change in memory:
Flash: -78 bytes
SRAM: 0 bytes
2023-04-05 10:13:27 +02:00
Guðni Már Gilbert
956efde822
G80: Re-implement optimisation from user espr14
...
Original Pull Request:
https://github.com/prusa3d/Prusa-Firmware/pull/3061
Change in memory:
Flash: -292 bytes
SRAM: 0 bytes
2023-04-05 10:13:27 +02:00
D.R.racer
7f921b4071
Limit some of the float formatting to fit 30 bytes buffer in enquecommandf_P
2023-04-05 09:10:39 +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
46852e9941
M862: determine decimal through math rather than checking for null byte/pointer.
...
This way doesn't add any more flash memory.
Calculating the string length or checking for a null byte
will end up increasing flash consumption overall.
2023-04-04 15:22:21 +02:00