AnHardt / Marlin

Reprap FW with look ahead. SDcard and LCD support. It works on Gen6, Ultimaker, RAMPS and Sanguinololu
GNU General Public License v3.0
1 stars 1 forks source link

Add a emergency-command parser in MarlinSerial and add M108 #40

Closed AnHardt closed 8 years ago

AnHardt commented 8 years ago

Add a emergency-command parser in MarlinSerial located in MarlinSerial's RX interrupt.

The parser tries to find and execute M112,M108,M410 before the commands disappear in the RX-buffer. To avoid false positives M117, comments and commands followed by filenames (M23, M28, M30, M32, M33) are recognized.

This enables Marlin to receive and react on the Emergency command at every time - regardless of if the buffers are full or not. Remains the task to convince the hosts to send the commands. To inform the hosts about the new feature a new entry in the M115-report was made. "EMERGENCY_CODES:M112,M108,M410;".

The parser is fast. It allways only needs two switch decisions and one assignment of the new state for every character.

One proble remains. If the host has send a incomplete line before sending an emergency command the emergency commamd could be omittet when the parser is in state_IGNORE. In that case the host should send "\ncommand\n"

Also introducing M108 to break the waiting for the heaters in M109, M190 and M303.

Rename cancel_heatup to cancel_heatup_wait to better see the purpose.

scalez commented 8 years ago

@AnHardt do you have plans on making a PR for upstream?

AnHardt commented 8 years ago

@scalez Yes - but not during RC phase.