Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions Marlin/AnycubicTFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void AnycubicTFTClass::HandleSpecialMenu()
{
if(strcmp(SelectedDirectory, "<special menu>")==0) {
SpecialMenu=true;
} else if (strcmp(SelectedDirectory, "<auto tune hotend pid>")==0) {
} else if (strcmp(SelectedDirectory, "<auto tune pid>")==0) {
SERIAL_PROTOCOLLNPGM("Special Menu: Auto Tune PID");
enqueue_and_echo_commands_P(PSTR("M303 C8 S200 U1"));
} else if (strcmp(SelectedDirectory, "<auto bed leveling>")==0) {
Expand All @@ -209,6 +209,9 @@ void AnycubicTFTClass::HandleSpecialMenu()
} else if (strcmp(SelectedDirectory, "<preheat 200 60>")==0) {
SERIAL_PROTOCOLLNPGM("Special Menu: PreHeat 200 60");
enqueue_and_echo_commands_P(PSTR("M140 S60\nM104 S200 T0"));
} else if (strcmp(SelectedDirectory, "<outage recover>")==0) {
SERIAL_PROTOCOLLNPGM("Special Menu: Outage Recover");
enqueue_and_echo_commands_P(PSTR("G8"));
} else if (strcmp(SelectedDirectory, "<exit>")==0) {
SpecialMenu=false;
}
Expand All @@ -234,9 +237,11 @@ void AnycubicTFTClass::Ls()
ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Read EEPROM>");
ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Save EEPROM>");
ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Save EEPROM>");
ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Auto Tune Hotend PID>");
ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Auto Tune Hotend PID>");
break;
ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Auto Tune PID>");
ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Auto Tune PID>");
ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Outage Recover>");
ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Outage Recover>");
break;

default:
break;
Expand Down Expand Up @@ -875,11 +880,11 @@ void AnycubicTFTClass::GetCommandFromTFT()
case 30: // A30 assist leveling, the original function was canceled
if(CodeSeen('S')) {
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLNPGM("TFT Entering level menue...");
SERIAL_ECHOLNPGM("TFT Entering level menu...");
#endif
} else if(CodeSeen('O')) {
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLNPGM("TFT Leveling started and movint to front left...");
SERIAL_ECHOLNPGM("TFT Leveling started and moving to front left...");
#endif
enqueue_and_echo_commands_P(PSTR("G91\nG1 Z10 F240\nG90\nG28\nG29\nG1 X20 Y20 F6000\nG1 Z0 F240"));
} else if(CodeSeen('T')) {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@
#define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y))

// Add commands that need sub-codes to this list
#define USE_GCODE_SUBCODES ENABLED(G38_PROBE_TARGET) || ENABLED(CNC_COORDINATE_SYSTEMS)
#define USE_GCODE_SUBCODES ENABLED(G38_PROBE_TARGET) || ENABLED(CNC_COORDINATE_SYSTEMS) || ENABLED(POWER_LOSS_RECOVERY)

// Parking Extruder
#if ENABLED(PARKING_EXTRUDER)
Expand Down
25 changes: 14 additions & 11 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_CONFIG_H_AUTHOR "(Systemic, OriginalTFT)" // Who made the changes.
#define SHOW_BOOTSCREEN
#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2
//#define SHOW_BOOTSCREEN
//#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1
//#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2

//
// *** VENDORS PLEASE READ *****************************************************
Expand Down Expand Up @@ -586,8 +586,8 @@
* When changing speed and direction, if the difference is less than the
* value set here, it may happen instantaneously.
*/
#define DEFAULT_XJERK 10.0
#define DEFAULT_YJERK 10.0
#define DEFAULT_XJERK 8.0
#define DEFAULT_YJERK 8.0
#define DEFAULT_ZJERK 0.4
#define DEFAULT_EJERK 5.0

Expand Down Expand Up @@ -745,7 +745,7 @@
#define Z_PROBE_OFFSET_RANGE_MAX 20

// Enable the M48 repeatability test to test probe accuracy
#define Z_MIN_PROBE_REPEATABILITY_TEST
// #define Z_MIN_PROBE_REPEATABILITY_TEST

// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{ 0:'Low', 1:'High' }
Expand Down Expand Up @@ -790,7 +790,9 @@

//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed

#define Z_HOMING_HEIGHT 30 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off.

#define Z_HOMING_HEIGHT 10 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
// Be sure you have this distance over your Z_MAX_POS in case.

// Direction of endstops when homing; 1=MAX, -1=MIN
Expand Down Expand Up @@ -893,7 +895,7 @@
*/
//#define AUTO_BED_LEVELING_3POINT
//#define AUTO_BED_LEVELING_LINEAR
#define AUTO_BED_LEVELING_BILINEAR
//#define AUTO_BED_LEVELING_BILINEAR
//#define AUTO_BED_LEVELING_UBL
//#define MESH_BED_LEVELING

Expand All @@ -919,7 +921,7 @@
/**
* Enable the G26 Mesh Validation Pattern tool.
*/
#define G26_MESH_VALIDATION // Enable G26 mesh validation
//#define G26_MESH_VALIDATION // Enable G26 mesh validation
#if ENABLED(G26_MESH_VALIDATION)
#define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle.
#define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool.
Expand Down Expand Up @@ -1805,6 +1807,7 @@
// Enable Anycubic TFT
#define ANYCUBIC_TFT_MODEL
#define ANYCUBIC_FILAMENT_RUNOUT_SENSOR
#define ANYCUBIC_TFT_DEBUG

//#define ANYCUBIC_TFT_DEBUG
#define POWER_LOSS_RECOVERY
#define DEBUG_POWER_LOSS_RECOVERY
#endif // CONFIGURATION_H
20 changes: 11 additions & 9 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@
#if ENABLED(THERMAL_PROTECTION_HOTENDS)
#define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius

// I3 Mega Protection settings :

//#if ENABLED(THERMAL_PROTECTION_HOTENDS)
// #define THERMAL_PROTECTION_PERIOD 250 // Seconds-
// #define THERMAL_PROTECTION_HYSTERESIS 45 // Degrees Celsius

// I3 MEGA END

/**
* Whenever an M104, M109, or M303 increases the target temperature, the
Expand Down Expand Up @@ -536,6 +528,16 @@
// Add an option in the menu to run all auto#.g files
//#define MENU_ADDAUTOSTART

/**
* Continue after Power-Loss (Creality3D)
*
* Store the current state to the SD Card at the start of each layer
* during SD printing. If the recovery file is found at boot time, present
* an option on the LCD screen to continue the print from the last-known
* point in the file.
*/
#define POWER_LOSS_RECOVERY

/**
* Sort SD file listings in alphabetical order.
*
Expand Down Expand Up @@ -694,7 +696,7 @@
* K=0 means advance disabled.
* See Marlin documentation for calibration instructions.
*/
#define LIN_ADVANCE
//#define LIN_ADVANCE

#if ENABLED(LIN_ADVANCE)
#define LIN_ADVANCE_K 0
Expand Down
43 changes: 43 additions & 0 deletions Marlin/Marlin.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,4 +539,47 @@ void do_blocking_move_to_xy(const float &x, const float &y, const float &fr_mm_s

#endif // CARTESIAN

#if ENABLED(POWER_LOSS_RECOVERY)

#include "cardreader.h"

typedef struct {
uint8_t valid_head;

// Machine state
float current_position[NUM_AXIS], feedrate;
int16_t target_temperature[HOTENDS],
target_temperature_bed,
fanSpeeds[FAN_COUNT];

#if HAS_LEVELING
bool leveling;
float fade;
#endif

// Command queue
uint8_t cmd_queue_index_r, commands_in_queue;
char command_queue[BUFSIZE][MAX_CMD_SIZE];

// SD File position
char sd_filename[MAXPATHNAMELENGTH];
uint32_t sdpos;

// Job elapsed time
millis_t print_job_elapsed;

uint8_t valid_foot;
} job_recovery_info_t;

extern job_recovery_info_t job_recovery_info;
extern uint8_t job_recovery_commands_count;
enum JobRecoveryPhase : unsigned char {
JOB_RECOVERY_IDLE,
JOB_RECOVERY_MAYBE,
JOB_RECOVERY_YES
};
extern JobRecoveryPhase job_recovery_phase;

#endif // POWER_LOSS_RECOVERY

#endif // MARLIN_H
Loading