Commit Graph

4235 Commits

Author SHA1 Message Date
Alex Voinea
e358cb2b78 Fix DEBUG_SEC_LANG 2022-02-10 20:19:52 +01:00
Alex Voinea
882a73b867 VERBOSE_CHECK_HIT_ENDSTOPS 2022-02-10 16:42:02 +01:00
Alex Voinea
18dde3fb61 Faster code when endstops/probe are not enabled 2022-02-10 16:24:52 +01:00
Alex Voinea
42b91a83cd Merge branch 'MK3' into MK3_3.12_Optimizations 2022-02-10 10:36:31 +01:00
Alex Voinea
dee8da61f6 Optimize endstop flags even more 2022-02-10 10:35:25 +01:00
Alex Voinea
380377db0f Add static assert 2022-02-10 09:47:37 +01:00
Alex Voinea
060581962c Fix sizeof array look 2022-02-10 09:33:55 +01:00
Alex Voinea
e35b21569d
Merge pull request #3005 from wavexx/remove_mres_limits
Allow all microstep resolutions for all axes
2022-02-09 13:48:51 +01:00
Alex Voinea
6aaf784975
Merge pull request #3251 from gudnimg/farm-mode-setup-gudni
Optimize `farm_mode` initialisation in `setup()`
2022-02-09 13:48:12 +01:00
Alex Voinea
916212b597 Add ALLOW_ALL_MRES as requested in PR 2022-02-09 10:28:45 +01:00
Guðni Már Gilbert
c4f1023924 Add back second call to prusa_statistics(8) when farm_mode is enabled.
Adds 18 bytes of flash
2022-02-09 07:30:50 +00:00
Guðni Már Gilbert
caf496e996 Optimise FanCheck initialisation when farm mode is on
Saves 12 bytes of flash memory (Arduino IDE 1.8.19)
2022-02-09 07:26:34 +00:00
Alex Voinea
1342db3532
Merge pull request #3257 from gudnimg/lcd-optimisation-gudni
Remove redundant operations on LCD CGRAM
2022-02-09 08:09:48 +01:00
Alex Voinea
aab094ff4f
Merge pull request #3292 from gudnimg/fix-pinda-thermistor-build-fail
Fix build error if `PINDA_THERMISTOR` is not defined
2022-02-09 07:54:42 +01:00
3d-gussner
e6703125ec
Merge pull request #3268 from gudnimg/lcd_button_update_gudni
Remove one call to `lcd_timeoutToStatus.start`
2022-02-09 07:37:36 +01:00
Alex Voinea
0b7aa31b2a Fix MUL24x24R24 comment 2022-02-09 00:26:46 +01:00
Alex Voinea
234add3c58 Merge branch 'MK3' into lcd-optimisation-gudni 2022-02-08 00:14:59 +01:00
Guðni Már Gilbert
121324d20b Revert "Remove one space from Support -> Temperatures menu"
This reverts commit 158877e736.
2022-02-08 00:09:09 +01:00
Alex Voinea
2b18357fef
Merge pull request #3375 from leptun/MK3_arduino_1.8.13
Fix arduino 1.8.13 warnings
2022-02-07 17:27:13 +01:00
Alex Voinea
9c3c47ea29
Merge pull request #3253 from gudnimg/sd-sub-dir-fix
Fix edge case when SD card is inserted while user is inside the 'No SD card' submenu
2022-02-07 17:09:14 +01:00
3d-gussner
75d6942d81
Merge pull request #2836 from wavexx/remove_jerk_limits
Remove hard-coded X/Y jerk limits
2022-02-07 17:04:49 +01:00
3d-gussner
0d4d386991
Merge pull request #3228 from gudnimg/remove-mmu_lcd
Remove a few redundant lines from ultralcd code
2022-02-07 17:04:34 +01:00
Guðni Már Gilbert
ff00988303 Revert "Replace hardcoded values and optimise strings"
This reverts commit e62bc4686f.
2022-02-06 11:09:45 +01:00
Alex Voinea
670214a30b Fix indentation 2022-02-06 11:01:35 +01:00
Guðni Már Gilbert
c6ecc0dfc9
Merge branch 'prusa3d:MK3' into lcd-optimisation-gudni 2022-02-06 09:54:58 +00:00
Guðni Már Gilbert
c2bad473dc Optimise _menu_edit_P
If the first if statement is true, then we don't need to check the next if statement.

Saves 64 bytes of flash memory
2022-02-06 09:01:16 +00:00
Alex Voinea
70cb30208c Also change MUL24x24R24 to the new format and fix rounding 2022-02-06 01:11:22 +01:00
Alex Voinea
d06e74dd6f Fix Welcome message and language flashing 2022-02-05 23:44:24 +01:00
Guðni Már Gilbert
a22a7ea9d7 Change LCD_STR_UPLEVEL to LCD_STR_UPLEVEL[0] for consistency
Saves 4 bytes of flash and 2 bytes of SRAM (Arduino IDE 1.8.19)
2022-02-05 19:58:31 +00:00
Guðni Már Gilbert
d5b666d260 Add LCD_STR_SOLID_BLOCK to represent \xFF 2022-02-05 19:53:42 +00:00
Guðni Már Gilbert
976c8c4902 Change message from .c to .cpp
The allows us to include lcd.h and replace hardcoded value with define LCD_STR_REFRESH

Also deleted a #define for bool which does not seem to be used.
2022-02-05 18:57:18 +00:00
Guðni Már Gilbert
e62bc4686f Replace hardcoded values and optimise strings
This commit saves 64 bytes of flash memory on my end
2022-02-05 18:28:17 +00:00
Guðni Már Gilbert
19dc05597d Fix identation in PR
Also combined the if statements that check farm_mode
If farm_mode is 0xFF then we can skip the next if statment.

No change in memory footprint
2022-02-05 11:24:04 +00:00
Alex Voinea
274f198188 Fix typo from long ago 2022-02-04 16:28:49 +01:00
Alex Voinea
58867f6c06 Fix arduino 1.8.13 warnings 2022-02-04 15:53:49 +01:00
Alex Voinea
f068c3258f Pack endstop flags 2022-02-04 15:24:43 +01:00
Alex Voinea
21a0b53647 remove firstrun 2022-02-04 13:27:43 +01:00
Alex Voinea
858984ef35 SD sorting entries instead of positions 2022-02-04 10:47:56 +01:00
Guðni Már Gilbert
1f3640ab26 Merge branch 'MK3_3.12_Optimizations' of https://github.com/leptun/Prusa-Firmware into MK3_3.12_Optimizations 2022-02-02 20:49:41 +00:00
Guðni Már Gilbert
43bf33e791 Optimise usage of code_value()
code_value() is float but in some cases we can save memory when the expected output is only 1 or 2 bytes.

Changes save 182 bytes of flash memory on my end.
2022-02-02 20:48:36 +00:00
Alex Voinea
f25bddce35 Simplify GETPC() 2022-02-02 21:06:58 +01:00
Alex Voinea
6ce7792045 Remove "hh" in fmt where it makes no difference 2022-02-02 20:58:21 +01:00
Guðni Már Gilbert
146b008186 Remove redundant variable farm_status
It is unused and status_number variable can be used instead.
2022-02-02 18:37:55 +00:00
Guðni Már Gilbert
459570ab66 Change prusa_stat_printerstatus parameter to uint8_t
Also changes status_number global variable to uint8_t

Changes save 80 bytes of flash and 1 byte of SRAM (Arduino IDE 1.8.19)
2022-02-02 18:35:52 +00:00
Guðni Már Gilbert
e525bcb7f5 Optimise lcd_selftest_screen input parameters and return type
* _progress_scale is max 3 so it can be uint8_t
* _progress is max 6 so it can be uint8_t
* Change _delay type to uint16_t to be explicit

Changes save 102 bytes of flash memory (Arduino IDE 1.8.19)
2022-02-01 18:57:43 +00:00
Guðni Már Gilbert
8681d84c44 Merge branch 'MK3_3.12_Optimizations' of https://github.com/leptun/Prusa-Firmware into MK3_3.12_Optimizations 2022-02-01 18:37:57 +00:00
Guðni Már Gilbert
53dfcf9d6f Optimise if-statments in world2machine_clamp
Only one of the statements can be true: tmpx < X_MIN_POS or tmpx > X_MAX_POS.
So we can be a little bit smarter here and skip the second if statement if the first was true.

This saves 6 bytes of flash memory and potential some clock cycles
2022-02-01 18:37:41 +00:00
Alex Voinea
aec2db7683 Optimize MUL8x16R8 2022-02-01 18:12:13 +01:00
Guðni Már Gilbert
c0e7e17fc3 Fix type of nrFiles 2022-01-30 13:07:09 +00:00
Alex Voinea
1523194d3b Fix build (merge conflict) 2022-01-30 13:18:07 +01:00
Alex Voinea
67e6361ff1 Fix temperature runaway variable types (merge conflict) 2022-01-30 13:16:05 +01:00
Guðni Már Gilbert
9bf45773f9 Merge remote-tracking branch 'upstream/MK3' into rebase-testing-ground-v2 2022-01-30 11:43:16 +00:00
Alex Voinea
aae562e480 Fix G81 for loop 2022-01-30 11:39:29 +00:00
Guðni Már Gilbert
c081e1a5ae Loop index can be unsigned
Saves 4 bytes of flash memory
2022-01-30 11:39:29 +00:00
Guðni Már Gilbert
49693a9fb3 Remove undefined function
No change in memory footprint.
2022-01-30 11:39:29 +00:00
Guðni Már Gilbert
c705d4aa10 Change set_z() parameters to uin8_t
Saves 24 bytes of flash
2022-01-30 11:39:28 +00:00
Guðni Már Gilbert
581188ce2c Fix an issue found in code review
Unfortunately this increases flash usages by 212 bytes (same usage as in current release) It seems it is most memory effcient to use int16_t (int). int8_t requires more memory.
2022-01-30 11:39:28 +00:00
Guðni Már Gilbert
f8847edca6 Remove one unused variable
Saves 1 byte of SRAM

The variable is only assigned a value but is never used.
2022-01-30 11:39:28 +00:00
Guðni Már Gilbert
d8723c0eac Use code_value_uint8() in get_command()
The if statement is simplified as the value is never negative
and we can get rid of one variable

Saves 12 bytes of flash memory
2022-01-30 11:39:27 +00:00
Guðni Már Gilbert
ac049c7e3c Use code_value_short() in get_command()
Same code but uses a defined function

Saves 28 bytes of flash memory
2022-01-30 11:39:27 +00:00
Guðni Már Gilbert
052ecc3782 G81: Change for loop variables x and y to uint8_t
Saves 198 bytes of flash, that's crazy
2022-01-30 11:39:27 +00:00
Guðni Már Gilbert
7787f17139 Smaller code in G28
Replace two blocks of code with already defined functions.

Change saves 100 bytes of flash memory and 11 lines of code.
2022-01-30 11:39:27 +00:00
Guðni Már Gilbert
b835f31904 Remove variable move_menu_scale
The variable is just set to 1.0 and is never modified, I also
removed the function lcd_move_menu_1mm()

Changes save 96 bytes of flash memory and 4 bytes of SRAM
2022-01-30 11:39:27 +00:00
Guðni Már Gilbert
a940c364c9 Create enum class for heating_status variable 2022-01-30 11:39:27 +00:00
Guðni Már Gilbert
2013295f94 Change farm_timer to uint8_t
Remove extern declaration of farm_timer and farm_status as they
are only used in one file.

Saves 26 bytes of flash
2022-01-30 11:39:26 +00:00
Guðni Már Gilbert
a687173e02 Change custom_message_state_old and custom_message_state to uint8_t
I see max value as 7*7+10 = 59

Saves 100 byte of flash and 1 byte of SRAM
2022-01-30 11:39:26 +00:00
Guðni Már Gilbert
60c9640602 Change heating_status_counter to uint8_t
It has a max value of 14

Saves 28 bytes of flash and 1 byte of SRAM
2022-01-30 11:39:26 +00:00
Guðni Már Gilbert
22f23dff36 Change heating_status to uint8_t
Saves 66 byte of flash and 1 byte of SRAM
2022-01-30 11:39:26 +00:00
Guðni Már Gilbert
2d614a8d41 Change usb_printing_counter to uint8_t
It is assigned max value of 10

Saves 26 byte of flash and 1 byte of SRAM
2022-01-30 11:39:26 +00:00
Guðni Már Gilbert
aa0a86bf13 Remove internal Prusa command 'Beat'
It doesn't seem to do anything.

Saves 22 bytes of flash
2022-01-30 11:39:25 +00:00
Guðni Már Gilbert
42778cae83 Remove unused kicktime timer
The variable is only set and never actually used

Saves 8 bytes of flash and 4  bytes of SRAM
2022-01-30 11:39:25 +00:00
Guðni Már Gilbert
ef8083a148 crashDetTimer can be ShortTimer
Expired value is less than 65535

Saves 8 bytes of flash and 2 bytes of SRAM
2022-01-30 11:39:25 +00:00
Guðni Már Gilbert
6a9bab02f7 Convert display_time to ShortTimer
Saves 24 bytes of flash, 1 byte of SRAM
2022-01-30 11:39:25 +00:00
Guðni Már Gilbert
802b8860c8 Convert mmu_last_finda_response to ShortTimer
Saves 48 bytes of Flash, 1 byte of SRAM
2022-01-30 11:39:25 +00:00
Guðni Már Gilbert
37fd9d1b11 Convert NcTime to ShortTimer
The variable is only used in ultralcd.cpp so I made it static there
and deleted it from Marlin_main.cpp

Saves 24 bytes of flash and 1 byte of SRAM
2022-01-30 11:39:25 +00:00
Guðni Már Gilbert
a1abd094dd Convert autostart_atmillis to ShortTimer
Saves 34 bytes of flash and 1 byte of SRAM
2022-01-30 11:39:24 +00:00
Guðni Már Gilbert
762a5db125 Convert previous_millis_cmd to LongTimer
Saves 196 bytes of Flash but adds 1 byte of SRAM
2022-01-30 11:39:24 +00:00
Guðni Már Gilbert
1cd9ecb2c7 Convert mmu_last_request and mmu_last_response to ShortTimer
Saves 180 bytes of flash and 2 byte of SRAM
2022-01-30 11:39:24 +00:00
Guðni Már Gilbert
66782e9c9d setTargetHotend expect an uint8_t, not int for second parameter
also change _usb_timer to ShortTimer

Saves 28 bytes of Flash and 1 byte of SRAM
2022-01-30 11:39:24 +00:00
Guðni Már Gilbert
77cce1fc05 Replace three lines by one function call which does the same thing
Saves 42 bytes of flash memory
2022-01-30 11:39:24 +00:00
Guðni Már Gilbert
a26651e7aa Change return types of two functions uint8_t
These functions aren't used but they should return the appropriate type.
2022-01-30 11:39:24 +00:00
Guðni Már Gilbert
800f44509d Change row_offsets[] to uint8_t
Saves 10 bytes of flash, and 4 bytes of SRAM
2022-01-30 11:39:24 +00:00
Guðni Már Gilbert
58213814cf Replace for-loop with memcpy
Saves 22 bytes of flash memory
2022-01-30 11:39:23 +00:00
Guðni Már Gilbert
52aa5a5f00 Use inlined function set_destination_to_current() in more places
Saves 70 bytes of flash memory
2022-01-30 11:39:23 +00:00
Guðni Már Gilbert
a8d16d2949 Use memset to zero previous_speed array
Saves 150 bytes of flash memory
2022-01-30 11:39:23 +00:00
Alex Voinea
cdd7ea30f4 Fix LUT loop 2022-01-30 11:39:23 +00:00
Alex Voinea
fb10b4398e Merge pull request #6 from gudnimg/gudni-PR1
Purged some `int`s for `uint8_t` when using the axis enum
2022-01-30 11:30:25 +00:00
Guðni Már Gilbert
f81db56793 temp_runaway_check() parameter _heater_id should be uint8_t
Saves 58 bytes of flash
2022-01-30 11:22:45 +00:00
Guðni Már Gilbert
261f311825 Change two arrays from int to uint8_t
__preheat_counter has max value of 16
__preheat_errors has max value of 5

Saves 58 bytes of flash memory and 4 bytes of SRAM
2022-01-30 11:22:45 +00:00
Guðni Már Gilbert
7535fa3a44 Remove unused variable
Saves 2 bytes of SRAM
2022-01-30 11:22:45 +00:00
Voinea Dragos
623762bd50 Fix build 2022-01-30 11:22:44 +00:00
Voinea Dragos
42a5f7dc20 Fix M226 2022-01-30 11:22:44 +00:00
Voinea Dragos
4aae88afdf M42 optimization 2022-01-30 11:22:44 +00:00
Voinea Dragos
a5cd99a917 Disable unimplemented PID_ADD_EXTRUSION_RATE 2022-01-30 11:22:44 +00:00
Voinea Dragos
9951e3da52 Sound enums as uint8_t 2022-01-30 11:22:44 +00:00
Voinea Dragos
6dd59985ee Disable PRUSA M28 2022-01-30 11:22:44 +00:00
Voinea Dragos
f22b9260ae Fix build 2022-01-30 11:22:44 +00:00
Voinea Dragos
9abae2fd97 Remove maxlimit_status 2022-01-30 11:22:43 +00:00
Voinea Dragos
9684806e00 Change arduino IO to fastio where possible 2022-01-30 11:22:43 +00:00
Voinea Dragos
42c393764f Adjust temperature runaway extruder count 2022-01-30 11:22:43 +00:00