Commit Graph

214 Commits

Author SHA1 Message Date
Alex Voinea
97c371e5e8 Make the "ln" functions no-inline.
Save 348B of flash
2022-02-27 20:58:56 +01:00
Alex Voinea
a6331d22c8 Remove ancient SNMM code in the MK3 branch 2022-02-15 15:58:33 +01:00
Alex Voinea
4ec8781df2 Fix usb print timer 2022-02-13 22:52:49 +01: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
9bf45773f9 Merge remote-tracking branch 'upstream/MK3' into rebase-testing-ground-v2 2022-01-30 11:43:16 +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
a940c364c9 Create enum class for heating_status variable 2022-01-30 11:39:27 +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
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
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
DRracer
0be90dc5d1
Merge pull request #3320 from prusa3d/MK3_3.10.1
Merge MK3_3.10.1 into MK3 after release
2021-12-17 14:02:13 +01:00
Yuri D'Elia
a3915b57b9 Improve temp_runaway_stop robustness
Remove most of the duplicated code inside temp_runaway_stop(),
making it identical to the other temperature handlers.

Move the lower-level functions required to stop the entirety of the
machine into UnconditionalStop(). Reuse this function inside
lcd_print_stop().

Set the LCD alert message before calling Stop(), as done in other safety
handlers, so that the error is visible while the printer is stopping.

This also avoids other temporary status messages to appear before
the real issue is shown and/or STEALING the first CRITICAL alert
level before we do.
2021-12-07 19:25:34 +01:00
Guðni Már Gilbert
2554d21925 Use uint8_t when using axis enum
Saves 76 bytes of flash memory
2021-08-02 12:20:10 +00:00
Guðni Már Gilbert
6aee17b4ca lcd_change_fil_state has two extern's in Marlin.h, only one needed. 2021-07-20 09:12:14 +02:00
Guðni Már Gilbert
eb9c8c8c20 Improve mc_arc() parameters
- Make the mc_arc() function declaration consistent with the definition
- isclockwise is supposed to be bool type, given how it is used.
2021-07-20 09:03:50 +02:00
Yuri D'Elia
050cf72e98 Move stack checking to the temperature ISR
Now that the stack_error function is truly minimal,
we can check for stack errors much more frequently.

Also move away stack_error from ultralcd to Marlin_main.
2021-06-12 15:23:33 +02:00
DRracer
8ac1d5b95e
Attempt to workaround the M73 C0|D0 visual issue (#3067)
Attempt to workaround the M73 C0|D0 visual issue

This is an attempt to enable alternation of time to print finish and time
to color change even in the last minute of time to color change, i.e. be
able to print "0:00C".

The proposed solution leverages the capability of the current FW to read
float values from the C|D parameter. This could have the raw benefit of
being able still to alternate this time on the LCD as "0:00C" (or
"<1min") if the slicer sends a non-zero but <1 time right before the
color change.

Co-authored-by: D.R.racer <drracer@drracer.eu>
Co-authored-by: 3d-gussner <3d.gussner@gmail.com>
2021-03-19 10:18:28 +01:00
Yuri D'Elia
14a1a93bc8 Include probing/MBL in the PRINTER_ACTIVE check
This prevents to perform disruptive actions during homing or between MBL
probes, which would result in a failure.
2021-02-25 17:33:59 +01:00
3d-gussner
d063ffb141 Add parameter D to gcode M73 for silent/stealth mode 2021-02-11 07:47:43 +01:00
3d-gussner
91c767b0f2 Reduce code size 2021-02-11 07:47:43 +01:00
3d-gussner
cb61436093 Add remaining time to change/pause/user interaction to LCD Info screen
- Add parameter `C` to gcode `M73`
- LCD Info screen switches to change time if last `M73` gcode contains `C` parameter
  - Examples:
    - `M73 P5 R120` will display on LCD ` SD  5%      02:00R ` if it is printing at 100% speed
    - `M73 P5 R120 C60` will display on LCD ` SD  5%      01:00C ` if it is printing at 100% speed

Slicers can generate "Time to change/pause/user interaction" using `C<mins:0-65535>` parameter to "overwrite" the remaining print time.
To switch between time to change and remaining time just send in intervals `M73` with or without `C` parameter.
2021-02-11 07:47:43 +01:00
Voinea Dragos
52f7a71dce More fixes that were extracted from #2405 2021-02-06 14:59:11 +02:00
Alex Voinea
896f4e1dd1 Fix compile error 2021-02-02 19:14:05 +02:00
Alex Voinea
f6ae379077 Fix dir_names array definition. Prevents overrun 2021-02-02 19:08:44 +02:00
Alex Voinea
2f4119a6d7 M552 - Printer IP address 2021-02-02 13:21:16 +02:00
3d-gussner
9264454d3a Gcode M123 only if FANCHECK and TACHOs are defined
Gcode `M155` added parameter "C" to activate auto-report for temperatures, fans and positions
Updated doxygen
@todo Update RepRap Wiki
@todo improve code
2021-01-19 09:01:46 +01:00
3d-gussner
a064ce4722 Add gcode M123 Tachometer value 2021-01-10 15:15:44 +01:00
Alex Voinea
4abf1f436a Gracefully dump the queue + fixes to fancheck 2020-11-09 21:49:56 +02:00
Alex Voinea
ff56ece6f8 Remove redundant get_command prototype 2020-11-09 21:49:56 +02:00
Alex Voinea
eb007c35d2
Macros initial 2020-09-11 16:12:49 +03:00
DRracer
772844678f
Merge pull request #2809 from leptun/PFW-1134-ALTFAN_KILLSWITCH
Pfw 1134
2020-08-20 15:42:03 +02:00
Alex Voinea
8d9dc73d1b
Fix compile error
fix compile


Fix compile error
2020-08-12 17:25:49 +03:00
Alex Voinea
5530b99882
Reboot after factory reset 2020-08-12 12:46:35 +03:00
Yuri D'Elia
9b8f642b28 Account for flow adjustments in LA
The e/D ratio should be calculated using the extrusion length.

As such, purify the e_D_ratio from the current extruder multiplier in
order to account correctly for flow adjustments.
2020-07-19 17:41:38 +02:00
Marek Bel
bbe9e3b4ea Remove temp_cal_active variable.
This saves 18B of FLASH and 1B of RAM memory. This variable was duplicate to EEPROM variable of the same name.
2020-06-11 20:00:55 +02:00
Yuri D'Elia
5082f2a36e Move reset LA state from G80 to M84
Move la10c_reset into finishAndDisableStepper, which is called in both
via lcd_print_stop() and indirectly via M84, saving some space.

M84 is checked-for to determine a complete file, so it's a superior
candidate to G80 (which some people avoid due to MBL issues).
2020-04-29 22:51:23 +02:00
Alex Voinea
fd1d05ab48
♻️Code optimization 2020-04-02 14:44:44 +03:00
DRracer
5106831ba2
Merge pull request #2526 from leptun/MK3_decouple_XYZE_relative_mode
Mk3 decouple XYZE relative modes
2020-03-26 18:58:20 +01:00
DRracer
c085ecaa11
Merge pull request #2264 from leptun/MK3_fix_selftest_Z_crash2
PFW-1048: fix selftest Z crash. Use stallGuard when testing Z
2020-03-26 18:22:35 +01:00
Alex Voinea
d0c51b9e73
int -> bool 2020-03-26 19:06:35 +02:00
Alex Voinea
5fcf18718f
Decouple XYZ relative from E relative. 2020-03-05 11:22:35 +02:00
Yuri D'Elia
3da20db024 Really poweroff Z motors when PSU_Delta is defined
enable/disable_z behave differently when PSU_Delta is defined.

During powerpanic and kill however we do *really* need to save energy
and poweroff the motors.

Rename enable/disable_z as poweron/poweroff_z and define some aliases so
that we can use the low-level function where needed.
2020-01-27 18:50:17 +01:00
Yuri D'Elia
eb2ca78167 Rewrite uvlo handling for accurate Z re/positioning
- In both uvlo_ and uvlo_tiny, calculate Z usteps properly and adjust
  the Z position to a true fullstep before disabling the motor. This
  avoids shifs during recovery.
- In uvlo_tiny, instead of moving up indefinitely, adjust Z just
  once using the smallest move possible (new def UVLO_TINY_Z_AXIS_SHIFT)
- Perform all the uvlo/recovery processing in physical coordinates
  and MBL off: there should be no automatic Z movement!
- Disable heaters in both handlers to conserve more power.
- Add timing information to uvlo_tiny too.
- During recovery, to switch between physical and logical positioning
  introduce a new "PRUSA MBL" gcode as most of the procedure is
  enqueued, and no existing gcode was available.
2020-01-26 17:46:50 +01:00
Alex Voinea
2e50954710
Merge branch 'MK3' into MK3_fix_selftest_Z_crash2 2020-01-22 14:56:54 +02:00
DRracer
43870c4028
Merge pull request #2368 from wavexx/unretract_after_lcd_pause
Unretract when resuming a paused print
2020-01-15 12:47:24 +01:00
Yuri D'Elia
0cc68228f8 Unretract when resuming a paused print 2019-12-16 16:33:11 +01:00
Yuri D'Elia
faa76df2fe Fix the "Stop print" behavior from the LCD
Correctly cleanup the printer state when stopping the current print:

- Disable interrupts while aborting the planner/queue to ensure
  new serial commands are not inserted while aborting
- _Always_ call planner_abort_hard() to interrupt any pending move!
- Clear the saved_target, which might be set when calling stop
  from within a paused state. Create a new function to clear the
  paused state for future use.
- Do not disable/reset the MBL: doing so will destroy the ability to
  restart correctly using M999.
2019-12-16 15:52:37 +01:00
Yuri D'Elia
dbe2ed4150 Fix pause/resume when using M25/M601
Remove the conflicting and mostly useless card.paused flag (the printing
is either paused, or not) and switch to isPrintPaused only which
accounts for both cases (SD/USB) correctly.

Fix M27/getStatus to show the current real status of the SD print.

Synchronize the queue on M601, as required to precisely pause the print
at the correct instruction.

Alias M25 to M601, which when combined with PR #1899 fixes issue #1614.

Guard against incorrect usage in M601, M602 and M603.
2019-11-28 17:37:58 +01:00