Add fast binary file transfer to SD card option (#12249)

This commit is contained in:
Chris Pepper
2018-10-31 00:44:12 +00:00
committed by Scott Lahteine
parent 72d8adfd1e
commit 66d44c72c3
65 changed files with 524 additions and 21 deletions

View File

@ -31,7 +31,8 @@
#include "emergency_parser.h"
// Static data members
bool EmergencyParser::killed_by_M112; // = false
bool EmergencyParser::killed_by_M112, // = false
EmergencyParser::enabled;
// Global instance
EmergencyParser emergency_parser;

View File

@ -19,13 +19,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* emergency_parser.h - Intercept special commands directly in the serial stream
*/
#ifndef _EMERGENCY_PARSER_H_
#define _EMERGENCY_PARSER_H_
#define FORCE_INLINE __attribute__((always_inline)) inline
// External references
extern volatile bool wait_for_user, wait_for_heatup;
@ -53,11 +53,13 @@ public:
static bool killed_by_M112;
EmergencyParser() {}
EmergencyParser() { enable(); }
__attribute__((always_inline)) inline
static void update(State &state, const uint8_t c) {
FORCE_INLINE static void enable() { enabled = true; }
FORCE_INLINE static void disable() { enabled = false; }
FORCE_INLINE static void update(State &state, const uint8_t c) {
switch (state) {
case EP_RESET:
switch (c) {
@ -118,7 +120,7 @@ public:
default:
if (c == '\n') {
switch (state) {
if (enabled) switch (state) {
case EP_M108:
wait_for_user = wait_for_heatup = false;
break;
@ -136,8 +138,8 @@ public:
}
}
private:
static bool enabled;
};
extern EmergencyParser emergency_parser;
#endif // _EMERGENCY_PARSER_H_

View File

@ -56,7 +56,7 @@ public:
#if ENABLED(FWRETRACT_AUTORETRACT)
static bool autoretract_enabled; // M209 S - Autoretract switch
#else
constexpr static bool autoretract_enabled = false;
static constexpr bool autoretract_enabled = false;
#endif
static bool retracted[EXTRUDERS]; // Which extruders are currently retracted