Commit Graph

92 Commits

Author SHA1 Message Date
3d-gussner d5d77ee243 Cleanup documentation 2023-11-22 07:58:17 +01:00
3d-gussner 516ae1b952 Update state 2023-11-22 07:58:17 +01:00
3d-gussner 514607318e Add printer_state.cpp/.h 2023-11-22 07:58:17 +01:00
3d-gussner d276695ce7 Set Ready 2023-11-22 07:58:13 +01:00
gudnimg 331ceaf044 M77: Save statistics when timer is stopped
For remote hosts, when the timer is stopped, then also save the statistics.

Slightly refactored save_statistics function by removing the parameters.
The function parameters are always the same.

Change in memory:
Flash: -40 bytes
SRAM: 0 bytes
2023-11-21 18:38:40 +00:00
gudnimg 423f98ff6e Implement Marlin's print job timer
I changed the code a bit so it would compile
in Prusa Firmware.

The paused duration is no longer included in the
print time statistics.

Change in memory:
Flash: -122 bytes
SRAM: 0 bytes
2023-11-21 18:38:40 +00:00
Guðni Már Gilbert b0ff5f45f3 Cleanup language.h includes
Remove a few redundant language.h includes

Also remove language.h include from cmdqueue.h to prevent including language.h unnecessarily

Fix missing message.h includes in a few files
2023-07-13 09:57:52 +02:00
3d-gussner 20e73e3c4f
Merge pull request #4067 from scottmudge/MK3_3.12-meatpack-pr
Add support for g-code compression/packing over serial connection (MeatPack)
2023-04-19 09:20:07 +02:00
Alex Voinea f388d8abb6
postponed kill() message with softReset 2023-04-13 10:57:00 +02:00
Scott Mudge 3cd125c566
MeatPack gcode compression support 2023-04-13 10:50:15 +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 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
D.R.racer ee23d6c62a Merge duplicate strings in cmdqueue.cpp
Original idea from @GilesBathgate, PR #3322 . This is just a rework on top of current MK3 branch.
2023-02-18 11:37:48 +01:00
RoboMagus c3cfc86094 Fix #3977 2023-02-10 14:27:04 +01:00
Yuri D'Elia 9105573ac9 Handle/strip leading whitespace in gcode stream 2022-12-30 14:06:48 +01:00
Yuri D'Elia 6651f5ce8b Strip the line number from the command queue
This increases the number of commands that can be queued and at the same
time it avoids a considerable amount of rescanning in a critical path.
2022-12-30 14:06:48 +01:00
Yuri D'Elia 001876a807 Parenthesize IS_SD_PRINTING defensively 2022-12-15 08:13:38 +01:00
Yuri D'Elia 3066fd1db3 Replace two expressions with cmd_head 2022-12-15 08:13:02 +01:00
Yuri D'Elia a588a5f695 Allow M310 to bypass the Stopped state for recovery
Since M310 cannot change the heaters, allowing M310 S0 (and changing
parameters) allows to recover a usb-controlled printer which has been
locked-out due to bad model settings.
2022-12-14 13:47:11 +01:00
Yuri D'Elia c7865a83f2 Keep a pointer past the line number in cmdqueue
This allows to skip line numbers transparently and perform faster
checks on the actual command to process.
2022-12-14 13:47:11 +01:00
Alex Voinea 29882b625b Remove LcdCommands::FarmModeConfirm 2022-11-17 05:46:33 +01:00
DRracer f7d4095479
Merge branch 'MK3' into MK3_MMU2_fix1 2022-09-21 15:18:44 +02:00
3d-gussner 183e21aa0b
Merge pull request #3599 from 3d-gussner/MK3_MMU2_messages
PFW-1339 - Update MMU2 translations
2022-09-21 10:27:01 +02:00
Yuri D'Elia 129df6dd4a Do not reset line on serial commands without N
Fix regression introduced in fc10ca3146.

Accept incoming serial commands without line numbers (assumed to be
injected by the host), but do not reset the last line count when doing
so.
2022-09-21 10:19:16 +02:00
Guðni Már Gilbert eb7de5149b Don't inline the function
Change in memory:
Flash: -44 bytes
SRAM: 0 bytes
2022-09-20 06:34:24 +02:00
Guðni Már Gilbert c8a8484ca7 Remove atomic_update parameter
Change in memory:
Flash: +24 bytes
SRAM: -0 byte
2022-09-20 06:34:24 +02:00
Guðni Már Gilbert 76fb4610ea Optimisation: Remove duplicated code in cmdqueue_could_enqueue_back()
Code is 28 lines shorter :)

Change in memory:
Flash: -42 bytes
SRAM: 0 bytes
2022-09-20 06:34:24 +02:00
3d-gussner 539cdbfeea Lower MSG_ rows 2022-09-17 08:48:56 +02:00
Alex Voinea bef7b086e3 Isolate the entire farm and statistics code 2022-08-30 13:57:43 +02:00
Alex Voinea 7d597eb8b0 Move farm mode to separate file 2022-08-30 13:57:43 +02:00
Alex Voinea 4ded6f195e Move string to progmem
flash: -52
RAM: -6
2022-08-26 18:59:53 +03:00
DRracer 0933fdb6fe
Merge pull request #3552 from wavexx/temp_model_check
Thermal Model protection
2022-08-24 19:16:48 +02:00
Yuri D'Elia c0b5fea525 Prevent re-entry in EOF command processing
cmdqueue will run commands when EOF is reached without returning to the
main loop, which is already incorrect.

However, since it needs to ensure the queue is empty, an st_synchronize
call can result in a re-entrant call to get_command, which will
reprocess EOF again. Even if we removed st_synchronize, another command
could be picked by an unsuspecting manage_inactivity() somewhere else.

Short-circuit EOF processing by closing the file early and checking for
the file state early in get_command.

This should fix #3549
2022-07-29 15:55:54 +02:00
Yuri D'Elia fc10ca3146 Change how "Stopped" is handled internally, do not inhibit motion
Do not inhibit motion when Stopped is set.

We actually do need to move to move away the extruder from the bed, and
setting Stopped breaks it without adding any sort of security (M*
commands, such as M600 could still perform moves and still pass
through, while M104 would still set heaters).

During a hard error the internal queue is cleared (and sd file closed,
if any), so no new "unforeseen" command can be read.

Handle "Stopped" instead as a flag to inhibit serial processing and
automatically switch to "paused for user" state. While in this state
simply drop any input without incrementing the processed gcode line
number, behaving as-if the last command was still being processed.

This allows "Stopped" to correctly handle a printer-initiated paused
state and recover as expected by requesting a resend when resuming.
2022-07-25 17:30:22 +02:00
Yuri D'Elia e37435b53f Merge remote-tracking branch 'upstream/MK3_3.11.1' into mk311_sync 2022-07-04 16:14:23 +02:00
Alex Voinea 91c71da810 Convert some more suspicious timers to LongTimer 2022-02-17 08:48:29 +01:00
Alex Voinea 4ec8781df2 Fix usb print timer 2022-02-13 22:52:49 +01:00
Alex Voinea ed8252527c Add a uart RX timeout 2022-02-11 12:49:11 +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 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 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
Voinea Dragos a5f1f23fe2 TimeNow && TimeSent 2022-01-30 11:22:43 +00:00
Guðni Már Gilbert 3cfd706fff Remove useless extern in cmdqueue.cpp 2021-07-20 09:12:14 +02:00
Guðni Már Gilbert 16602f4003 change boolean to bool 2021-07-20 08:03:17 +02:00
Yuri D'Elia 23c75da727 Fix Crash/PP recovery position on instructions with comments
PR #2967 altered the way ``sdpos_atomic`` was set, causing issues in the
crashdetect/powerpanic recovery offset if the instruction being
recovered happens to contain a comment.

Previously ``sdpos`` was assumed to be a single byte prior to the last
read character. sdpos+1 would thus position the index to the next
instruction. With gcode-filtering in place, sdpos is left just before
the comment, while the actual read position is at the newline. This
causes to parser to resume in the middle of the comment.

Change the value returned by cardreader::get_sdpos() to always return
the last read position, as everybody expects (!!).

This avoids the +1, and correctly sets the resume position to the next
valid instruction without overhead.
2021-04-19 06:30:37 +02:00
Yuri D'Elia 461d3f6749 Remove duplicate function is_buffer_empty()
Use cmd_buffer_empty() instead
2021-02-19 17:06:00 +01:00
D.R.racer c1ead75a73 Remove commented debug code
the whole PR is ready for review after successfull tests
2021-02-10 11:18:59 +01:00