Marlin-Ai3M-2.0.x icon indicating copy to clipboard operation
Marlin-Ai3M-2.0.x copied to clipboard

[BUG] Replace calls to enqueue_now_P in anycubic_TFT.cpp with inject_P

Open hub-jba opened this issue 4 years ago • 1 comments

Bug Description

In your 1.4.6 codebase you use the command enqueue_and_echo_commands_P() to send commands to the printer. From the comments in the code of Marlin 1.1.9 enqueue_and_echo_commands_P() actually aborts the current queue and queues your specified command immediately (see code snippet below). But in your Marlin 2.0 codebase you use the command queue.enqueue_now_P(). But from tracing this funciton it appears that enqueue_now_P() will enqueue this command on the end of the command queue, and if the queue is full (which happens if trying to do anything during an sdcard print) then the function just throws out any commands that don't fit on the queue silently.

The Marlin 2.0 code that does the closest thing to enqueue_and_echo_commands_P() is actually queue.inject_P(). Basically enqueue_now_P() will work for any commands from the TFT executed while the printer is not printing from SDCard (like say performing a bed levelling), but it won't work during an SDcard print.

My Configurations

Unchanged from your repository master

Steps to Reproduce

  1. Install Marlin 2.0 codebase
  2. Do an M502 and M500
  3. Load backed up M92 ,G29, M301, M304 values and store with m500
  4. Feed filament into the extruder but bypass filament sensor
  5. Add a small strip of filament in the filament sensor so that it does indicate filament outage
  6. Start any 3d print
  7. Pull the small strip of filament out of the filament sensor to trigger a filament runout

Expected behavior:

  1. Filament runout beeps
  2. Print head parks
  3. A prompt on screen telling you the filament runout has been triggered

Actual behavior:

  1. Printhead stops moving.
  2. No prompt on screen, no beep and no parked head

Additional Information

Code signature of original call in Marlin 1.1.9

/**
*   Record one or many commands to run from program memory.
*   Aborts the current queue, if any.
*   Note: drain_injected_commands_P() must be called repeatedly to drain the commands afterwards
*/
void enqueue_and_echo_commands_P(const char const pgcode) {

hub-jba avatar Dec 27 '19 11:12 hub-jba

This issue is stale because it has been open 30 days with no activity. Remove stale label / comment or this will be closed in 5 days.

github-actions[bot] avatar Jul 06 '20 01:07 github-actions[bot]