diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8fd17498b..5cb97d4cb 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -74,10 +74,10 @@ // User-specified version info of this build to display in [Pronterface, etc] terminal window during // 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 "(none, default config)" // Who made the changes. +#define STRING_CONFIG_H_AUTHOR "(Ender-5)" // 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 STRING_SPLASH_LINE1 DETAILED_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 ***************************************************** @@ -111,7 +111,7 @@ * * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] */ -#define BAUDRATE 250000 +#define BAUDRATE 115200 // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH @@ -119,12 +119,12 @@ // The following define selects which electronics board you have. // Please choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_RAMPS_14_EFB + #define MOTHERBOARD BOARD_MELZI_CREALITY #endif // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message -//#define CUSTOM_MACHINE_NAME "3D Printer" +#define CUSTOM_MACHINE_NAME "Ender-5" // Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines) // You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4) @@ -223,7 +223,7 @@ * * :{ 0:'No power switch', 1:'ATX', 2:'X-Box 360' } */ -#define POWER_SUPPLY 0 +//#define POWER_SUPPLY 0 #if POWER_SUPPLY > 0 // Enable this option to leave the PSU off at startup. @@ -288,7 +288,7 @@ #define TEMP_SENSOR_2 0 #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 -#define TEMP_SENSOR_BED 0 +#define TEMP_SENSOR_BED 1 // Dummy thermistor constant temperature readings, for use with 998 and 999 #define DUMMY_THERMISTOR_998_VALUE 25 @@ -327,7 +327,7 @@ #define HEATER_2_MAXTEMP 275 #define HEATER_3_MAXTEMP 275 #define HEATER_4_MAXTEMP 275 -#define BED_MAXTEMP 150 +#define BED_MAXTEMP 125 //=========================================================================== //============================= PID Settings ================================ @@ -352,9 +352,10 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ultimaker - #define DEFAULT_Kp 22.2 - #define DEFAULT_Ki 1.08 - #define DEFAULT_Kd 114 + // Stock CR-10S Hotend fan 100% + #define DEFAULT_Kp 20.84 + #define DEFAULT_Ki 1.96 + #define DEFAULT_Kd 55.47 // MakerGear //#define DEFAULT_Kp 7.0 @@ -396,6 +397,7 @@ //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) + // Stock bed tuned for 50C #define DEFAULT_bedKp 10.00 #define DEFAULT_bedKi .023 #define DEFAULT_bedKd 305.4 @@ -525,14 +527,14 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 } +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80.00, 80.00, 400.00, 93.00 } /** * Default Max Feed Rate (mm/s) * Override with M203 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +#define DEFAULT_MAX_FEEDRATE { 500, 500, 5, 25 } /** * Default Max Acceleration (change/s) change = mm/s @@ -540,7 +542,7 @@ * Override with M201 * X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]] */ -#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 1000 } /** * Default Acceleration (change/s) change = mm/s @@ -550,9 +552,9 @@ * M204 R Retract Acceleration * M204 T Travel Acceleration */ -#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration for printing moves -#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts -#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves +#define DEFAULT_ACCELERATION 500 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 500 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves /** * Default Jerk (mm/s) @@ -562,8 +564,8 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define DEFAULT_XJERK 20.0 -#define DEFAULT_YJERK 20.0 +#define DEFAULT_XJERK 10.0 +#define DEFAULT_YJERK 10.0 #define DEFAULT_ZJERK 0.4 #define DEFAULT_EJERK 5.0 @@ -679,12 +681,12 @@ * O-- FRONT --+ * (0,0) */ -#define X_PROBE_OFFSET_FROM_EXTRUDER 10 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 10 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] +#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // X offset: -left +right [of the nozzle] +#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] +#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] // X and Y axis travel speed (mm/m) between probes -#define XY_PROBE_SPEED 8000 +#define XY_PROBE_SPEED 3000 // Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z @@ -743,8 +745,8 @@ // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. #define INVERT_X_DIR false -#define INVERT_Y_DIR true -#define INVERT_Z_DIR false +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true // Enable this option for Toshiba stepper drivers //#define CONFIG_STEPPERS_TOSHIBA @@ -752,7 +754,7 @@ // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. -#define INVERT_E0_DIR false +#define INVERT_E0_DIR true #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false @@ -774,8 +776,8 @@ // @section machine // The size of the print bed -#define X_BED_SIZE 200 -#define Y_BED_SIZE 200 +#define X_BED_SIZE 230 +#define Y_BED_SIZE 225 // Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS 0 @@ -783,7 +785,7 @@ #define Z_MIN_POS 0 #define X_MAX_POS X_BED_SIZE #define Y_MAX_POS Y_BED_SIZE -#define Z_MAX_POS 200 +#define Z_MAX_POS 305 // If enabled, axes won't move below MIN_POS in response to movement commands. #define MIN_SOFTWARE_ENDSTOPS @@ -875,10 +877,10 @@ #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). - #define LEFT_PROBE_BED_POSITION 15 - #define RIGHT_PROBE_BED_POSITION 170 - #define FRONT_PROBE_BED_POSITION 20 - #define BACK_PROBE_BED_POSITION 170 + #define LEFT_PROBE_BED_POSITION 50 + #define RIGHT_PROBE_BED_POSITION 180 + #define FRONT_PROBE_BED_POSITION 50 + #define BACK_PROBE_BED_POSITION 180 // The Z probe minimum outer margin (to validate G29 parameters). #define MIN_PROBE_EDGE 10 @@ -1015,9 +1017,9 @@ // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). // M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. // -//#define EEPROM_SETTINGS // Enable for M500 and M501 commands +#define EEPROM_SETTINGS // Enable for M500 and M501 commands //#define DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! -#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +//#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. // // Host Keepalive @@ -1047,13 +1049,13 @@ // @section temperature // Preheat Constants -#define PREHEAT_1_TEMP_HOTEND 180 -#define PREHEAT_1_TEMP_BED 70 -#define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 +#define PREHEAT_1_TEMP_HOTEND 185 +#define PREHEAT_1_TEMP_BED 45 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 #define PREHEAT_2_TEMP_HOTEND 240 -#define PREHEAT_2_TEMP_BED 110 -#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +#define PREHEAT_2_TEMP_BED 70 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 /** * Nozzle Park -- EXPERIMENTAL @@ -1229,7 +1231,7 @@ * you must uncomment the following option or it won't work. * */ -//#define SDSUPPORT +#define SDSUPPORT /** * SD CARD: SPI SPEED @@ -1522,7 +1524,7 @@ // This is RAMPS-compatible using a single 10-pin connector. // (For CR-10 owners who want to replace the Melzi Creality board but retain the display) // -//#define CR10_STOCKDISPLAY +#define CR10_STOCKDISPLAY // // MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER @@ -1681,7 +1683,7 @@ */ //#define FILAMENT_WIDTH_SENSOR -#define DEFAULT_NOMINAL_FILAMENT_DIA 3.00 // (mm) Diameter of the filament generally used (3.0 or 1.75mm), also used in the slicer. Used to validate sensor reading. +#define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 // (mm) Diameter of the filament generally used (3.0 or 1.75mm), also used in the slicer. Used to validate sensor reading. #if ENABLED(FILAMENT_WIDTH_SENSOR) #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor (0,1,2,3) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 3ed2a44b3..7e862ed3b 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -455,7 +455,7 @@ // @section lcd // Include a page of printer information in the LCD Main Menu -//#define LCD_INFO_MENU +#define LCD_INFO_MENU // Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING @@ -483,6 +483,9 @@ // using: //#define MENU_ADDAUTOSTART + // If power off, after power on, the printing can be resumed. + #define POWEROFF_SAVE_SD_FILE + /** * Sort SD file listings in alphabetical order. * @@ -599,11 +602,11 @@ * * Warning: Does not respect endstops! */ -//#define BABYSTEPPING +#define BABYSTEPPING #if ENABLED(BABYSTEPPING) //#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA! #define BABYSTEP_INVERT_Z false // Change if Z babysteps should go the other way - #define BABYSTEP_MULTIPLICATOR 100 // Babysteps are very small. Increase for faster motion. + #define BABYSTEP_MULTIPLICATOR 40 // Babysteps are very small. Increase for faster motion. //#define BABYSTEP_ZPROBE_OFFSET // Enable to combine M851 and Babystepping //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. @@ -816,11 +819,11 @@ * Requires an LCD display. * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. */ -//#define ADVANCED_PAUSE_FEATURE +#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) - #define PAUSE_PARK_X_POS 3 // X position of hotend - #define PAUSE_PARK_Y_POS 3 // Y position of hotend - #define PAUSE_PARK_Z_ADD 10 // Z addition of hotend (lift) + #define PAUSE_PARK_X_POS 0 // X position of hotend + #define PAUSE_PARK_Y_POS 0 // Y position of hotend + #define PAUSE_PARK_Z_ADD 0 // Z addition of hotend (lift) #define PAUSE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) #define PAUSE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) #define PAUSE_PARK_RETRACT_FEEDRATE 60 // Initial retract feedrate in mm/s diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index c341d98f3..b51747b21 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -414,6 +414,10 @@ extern uint8_t active_extruder; void calculate_volumetric_multipliers(); +#if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + void init_power_off_info(); +#endif + /** * Blocking movement and shorthand functions */ diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 3ac04338f..e261a271c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -665,6 +665,19 @@ float cartes[XYZ] = { 0 }; #endif static bool send_ok[BUFSIZE]; +#if ENABLED(SDSUPPORT) + #if ENABLED(POWEROFF_SAVE_SD_FILE) + #define SAVE_INFO_INTERVAL (1000 * 10) + #define APPEND_CMD_COUNT 5 + // #define SAVE_EACH_CMD_MODE + struct power_off_info_t power_off_info; + static char power_off_commands[BUFSIZE + APPEND_CMD_COUNT][MAX_CMD_SIZE]; + int power_off_commands_count = 0; + int power_off_type_yes = 0; + static int power_off_commands_index = 0; + #endif +#endif +bool drain_power_off_commands(); #if HAS_SERVOS Servo servo[NUM_SERVOS]; @@ -1254,6 +1267,11 @@ inline void get_serial_commands() { if (commands_in_queue == 0) stop_buffering = false; + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + /* translation: Priority reads the power-off saved command. */ + if (drain_power_off_commands()) return; + #endif + uint16_t sd_count = 0; bool card_eof = card.eof(); while (commands_in_queue < BUFSIZE && !card_eof && !stop_buffering) { @@ -5964,6 +5982,9 @@ inline void gcode_G92() { if (i != E_AXIS) { didXYZ = true; + if (i == Z_AXIS) { + axis_known_position[Z_AXIS] = true; + } #if HAS_POSITION_SHIFT position_shift[i] += v - p; // Offset the coordinate space update_software_endstops((AxisEnum)i); @@ -6493,7 +6514,13 @@ inline void gcode_M17() { /** * M21: Init SD Card */ - inline void gcode_M21() { card.initsd(); } + inline void gcode_M21() + { + card.initsd(); + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + init_power_off_info(); + #endif + } /** * M22: Release SD Card @@ -6513,6 +6540,10 @@ inline void gcode_M17() { * M24: Start or Resume SD Print */ inline void gcode_M24() { + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + card.removePowerOffFile(); + #endif + #if ENABLED(PARK_HEAD_ON_PAUSE) resume_print(); #endif @@ -7320,7 +7351,10 @@ inline void gcode_M104() { #endif if (parser.value_celsius() > thermalManager.degHotend(target_extruder)) - lcd_status_printf_P(0, PSTR("E%i %s"), target_extruder + 1, MSG_HEATING); + { + // lcd_status_printf_P(0, PSTR("E%i %s"), target_extruder + 1, MSG_HEATING); + lcd_status_printf_P(0, PSTR("Extruder %s"), MSG_HEATING); + } } #if ENABLED(AUTOTEMP) @@ -7507,7 +7541,6 @@ inline void gcode_M105() { #endif inline void gcode_M109() { - if (get_target_extruder_from_command(109)) return; if (DEBUGGING(DRYRUN)) return; @@ -7539,7 +7572,11 @@ inline void gcode_M109() { print_job_timer.start(); #endif - if (thermalManager.isHeatingHotend(target_extruder)) lcd_status_printf_P(0, PSTR("E%i %s"), target_extruder + 1, MSG_HEATING); + if (thermalManager.isHeatingHotend(target_extruder)) + { + // lcd_status_printf_P(0, PSTR("E%i %s"), target_extruder + 1, MSG_HEATING); + lcd_status_printf_P(0, PSTR("Extruder %s"), MSG_HEATING); + } } else return; @@ -7726,7 +7763,7 @@ inline void gcode_M109() { } now = millis(); - if (ELAPSED(now, next_temp_ms)) { //Print Temp Reading every 1 second while heating up. + if (ELAPSED(now, next_temp_ms)) { // Print Temp Reading every 1 second while heating up. next_temp_ms = now + 1000UL; print_heaterstates(); #if TEMP_BED_RESIDENCY_TIME > 0 @@ -8002,6 +8039,10 @@ inline void gcode_M81() { ZERO(paused_fanSpeeds); #endif #endif + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + card.removePowerOffFile(); + power_off_commands_count = 0; + #endif safe_delay(1000); // Wait 1 second before switching off @@ -13366,6 +13407,232 @@ void stop() { } } +/** + * Add about power off init information and confirm power off continue print + */ +#if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + void init_power_off_info () + { + int i = 0; + // if (power_off_commands_count > 0) return; + memset(&power_off_info, 0, sizeof(power_off_info)); + memset(power_off_commands, 0, sizeof(power_off_commands)); + if (!card.cardOK) + { + card.initsd(); + } + if (card.cardOK) + { + SERIAL_PROTOCOLLN("Init power off infomation."); + SERIAL_PROTOCOLLN("size: "); + SERIAL_PROTOCOLLN(sizeof(power_off_info)); + strncpy_P(power_off_info.power_off_filename, PSTR("bin"), sizeof(power_off_info.power_off_filename) - 1); + if (card.existPowerOffFile(power_off_info.power_off_filename)) + { + card.openPowerOffFile(power_off_info.power_off_filename, O_READ); + card.getPowerOffInfo(&power_off_info, sizeof(power_off_info)); + card.closePowerOffFile(); + // card.removePowerOffFile(); + SERIAL_PROTOCOLLN("init valid: "); + SERIAL_PROTOCOLLN((unsigned long)power_off_info.valid_head); + SERIAL_PROTOCOLLN((unsigned long)power_off_info.valid_foot); + if ((power_off_info.valid_head != 0) && (power_off_info.valid_head == power_off_info.valid_foot)) + { + /* --------------------------------------------------------------------- */ + enable_Z(); + SERIAL_PROTOCOLLN("current_position(X,Y,Z,E,F,T1..T4,B): "); + for (i = 0; i < NUM_AXIS; i++) + { + // current_position[i] = power_off_info.current_position[i]; + SERIAL_PROTOCOLLN(power_off_info.current_position[i]); + } + feedrate_mm_s = power_off_info.feedrate; + SERIAL_PROTOCOLLN(power_off_info.feedrate); + for (i = 0; i < 4; i++) + { + // target_temperature[i] = power_off_info.target_temperature[i]; + SERIAL_PROTOCOLLN(power_off_info.target_temperature[i]); + } + SERIAL_PROTOCOLLN(power_off_info.target_temperature_bed); + + // SERIAL_PROTOCOLLN(power_off_info.saved_extruder); + // SERIAL_PROTOCOLLN("power off info T number"); + /* --------------------------------------------------------------------- */ + SERIAL_PROTOCOLLN("cmd_queue(R,W,C,Q): "); + // cmd_queue_index_r = power_off_info.cmd_queue_index_r; + SERIAL_PROTOCOLLN(power_off_info.cmd_queue_index_r); + // cmd_queue_index_w = power_off_info.cmd_queue_index_w; + SERIAL_PROTOCOLLN(power_off_info.cmd_queue_index_w); + // commands_in_queue = power_off_info.commands_in_queue; + SERIAL_PROTOCOLLN(power_off_info.commands_in_queue); + // memcpy(command_queue, power_off_info.command_queue, sizeof(command_queue)); + for (i = 0; i < BUFSIZE; i++) + { + SERIAL_PROTOCOLLN(power_off_info.command_queue[i]); + } + char str_X[16]; + char str_Y[16]; + char str_Z[16]; + char str_E[16]; + char str_Z_up[16]; + memset(str_Z, 0, sizeof(str_X)); + memset(str_Z, 0, sizeof(str_Y)); + memset(str_Z, 0, sizeof(str_Z)); + memset(str_E, 0, sizeof(str_E)); + memset(str_Z_up, 0, sizeof(str_Z_up)); + dtostrf(power_off_info.current_position[0], 1, 3, str_X); + dtostrf(power_off_info.current_position[1], 1, 3, str_Y); + dtostrf(power_off_info.current_position[2], 1, 3, str_Z); + dtostrf(power_off_info.current_position[2] + 5, 1, 3, str_Z_up); + #if ENABLED(SAVE_EACH_CMD_MODE) + dtostrf(power_off_info.current_position[3] - 5, 1, 3, str_E); + #else + dtostrf(power_off_info.current_position[3], 1, 3, str_E); + #endif + + // sprintf_P(power_off_commands[0], PSTR("G0 Z%s"), tmp); + sprintf_P(power_off_commands[0], PSTR("G92 Z%s E%s"), str_Z, str_E); + enqueue_and_echo_command(power_off_commands[0]); + sprintf_P(power_off_commands[1], PSTR("G0 Z%s"), str_Z_up); + enqueue_and_echo_command(power_off_commands[1]); + sprintf_P(power_off_commands[2], PSTR("G28 X0 Y0")); + enqueue_and_echo_command(power_off_commands[2]); + sprintf_P(power_off_commands[3], PSTR("G0 Z%s"), str_Z); + enqueue_and_echo_command(power_off_commands[3]); + sprintf_P(power_off_commands[4], PSTR("M117 Printing...")); + enqueue_and_echo_command(power_off_commands[4]); + + power_off_commands_count = APPEND_CMD_COUNT; + i = APPEND_CMD_COUNT; + while (power_off_info.commands_in_queue > 0) + { + strcpy(power_off_commands[i++], power_off_info.command_queue[power_off_info.cmd_queue_index_r]); + power_off_commands_count++; + power_off_info.commands_in_queue--; + power_off_info.cmd_queue_index_r = (power_off_info.cmd_queue_index_r + 1) % BUFSIZE; + } + for (i = 0; i < power_off_commands_count; i++) + { + SERIAL_PROTOCOLLN(power_off_commands[i]); + } + /* --------------------------------------------------------------------- */ + SERIAL_PROTOCOLLN("sd file(start_time,file_name,sd_pos): "); + SERIAL_PROTOCOLLN(power_off_info.print_job_start_ms); + SERIAL_PROTOCOLLN(power_off_info.sd_filename); + SERIAL_PROTOCOLLN(power_off_info.sdpos); + previous_cmd_ms = power_off_info.print_job_start_ms; + card.openFile(power_off_info.sd_filename, true); + card.setIndex(power_off_info.sdpos); + /* --------------------------------------------------------------------- */ + } + else + { + if ((power_off_info.valid_head != 0) && (power_off_info.valid_head != power_off_info.valid_foot)) + { + enqueue_and_echo_commands_P(PSTR("M117 INVALID DATA.")); + } + memset(&power_off_info, 0, sizeof(power_off_info)); + strncpy_P(power_off_info.power_off_filename, PSTR("bin"), sizeof(power_off_info.power_off_filename) - 1); + } + } + } + } + + bool drain_power_off_commands() + { + if (power_off_commands_count > 0) + { + if(enqueue_and_echo_command(power_off_commands[power_off_commands_index])) + { + power_off_commands_index++; + power_off_commands_count--; + } + return true; + } + else + { + return false; + } + } + + void save_power_off_info () + { + int i = 0; + // static millis_t pre_time = millis(); + // static millis_t cur_time = millis(); + if (card.cardOK && card.sdprinting) + { + // cur_time = millis(); + if ( + #if ENABLED(SAVE_EACH_CMD_MODE) + (true) + #else + ((current_position[2] > 0) && (power_off_info.saved_z != current_position[2])) + #endif + // || ((cur_time - pre_time) > SAVE_INFO_INTERVAL) + ) + { + // pre_time = cur_time; + // SERIAL_PROTOCOLLN("Z : "); + // SERIAL_PROTOCOLLN(current_position[2]); + // SERIAL_PROTOCOLLN(power_off_info.saved_z); + power_off_info.valid_head = random(1,256); + power_off_info.valid_foot = power_off_info.valid_head; + // SERIAL_PROTOCOLLN("save valid: "); + // SERIAL_PROTOCOLLN((unsigned long)power_off_info.valid_head); + // SERIAL_PROTOCOLLN((unsigned long)power_off_info.valid_foot); + /* --------------------------------------------------------------------- */ + // SERIAL_PROTOCOLLN("current_position(X,Y,Z,SZ,E,F,T1..T4,B): "); + for (i = 0; i < NUM_AXIS; i++) + { + power_off_info.current_position[i] = current_position[i]; + // SERIAL_PROTOCOLLN(current_position[i]); + } + power_off_info.saved_z = current_position[Z_AXIS]; + // SERIAL_PROTOCOLLN(power_off_info.saved_z); + power_off_info.feedrate = feedrate_mm_s; + // SERIAL_PROTOCOLLN(power_off_info.feedrate); + for (i = 0; i < 4; i++) + { + power_off_info.target_temperature[i] = thermalManager.degTargetHotend(i); + // SERIAL_PROTOCOLLN(thermalManager.setTargetHotend[i]); + } + power_off_info.target_temperature_bed = thermalManager.degTargetBed(); + // power_off_info.saved_extruder = active_extruder; + // SERIAL_PROTOCOLLN(power_off_info.target_temperature_bed); + /* --------------------------------------------------------------------- */ + // SERIAL_PROTOCOLLN("cmd_queue(R,W,C,Q): "); + power_off_info.cmd_queue_index_r = cmd_queue_index_r; + // SERIAL_PROTOCOLLN(power_off_info.cmd_queue_index_r); + power_off_info.cmd_queue_index_w = cmd_queue_index_w; + // SERIAL_PROTOCOLLN(power_off_info.cmd_queue_index_w); + power_off_info.commands_in_queue = commands_in_queue; + // SERIAL_PROTOCOLLN(power_off_info.commands_in_queue); + memcpy(power_off_info.command_queue, command_queue, sizeof(power_off_info.command_queue)); + // for (i = 0; i < BUFSIZE; i++) + // { + // SERIAL_PROTOCOLLN(power_off_info.command_queue[i]); + // } + /* --------------------------------------------------------------------- */ + // SERIAL_PROTOCOLLN("sd file(start_time,file_name,sd_pos): "); + power_off_info.print_job_start_ms = previous_cmd_ms; + // SERIAL_PROTOCOLLN(power_off_info.print_job_start_ms); + // strcpy(power_off_info.sd_filename, + card.getAbsFilename(power_off_info.sd_filename); + // SERIAL_PROTOCOLLN(power_off_info.sd_filename); + power_off_info.sdpos = card.getIndex(); + // SERIAL_PROTOCOLLN(power_off_info.sdpos); + /* --------------------------------------------------------------------- */ + card.openPowerOffFile(power_off_info.power_off_filename, O_CREAT | O_WRITE | O_TRUNC | O_SYNC); + if (card.savePowerOffInfo(&power_off_info, sizeof(power_off_info)) == -1) + { + SERIAL_PROTOCOLLN("Write power off file failed."); + } + } + } + } +#endif + /** * Marlin entry-point: Set up before the program loop * - Set up the kill pin, filament runout, power hold @@ -13619,6 +13886,11 @@ void setup() { delay(1000); WRITE(LCD_PINS_RS, HIGH); #endif + + // init power off information + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + init_power_off_info(); + #endif } /** @@ -13669,7 +13941,12 @@ void loop() { } } else + { process_next_command(); + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + save_power_off_info(); + #endif + } #else diff --git a/Marlin/Version.h b/Marlin/Version.h index 3039da59b..888f327c0 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -35,20 +35,20 @@ /** * Marlin release version identifier */ - #define SHORT_BUILD_VERSION "1.1.6" + #define SHORT_BUILD_VERSION "1.1.6.1" /** * Verbose version identifier which should contain a reference to the location * from where the binary was downloaded or the source code was compiled. */ - #define DETAILED_BUILD_VERSION SHORT_BUILD_VERSION " (Github)" + #define DETAILED_BUILD_VERSION "Creality 3D" /** * The STRING_DISTRIBUTION_DATE represents when the binary file was built, * here we define this default string as the date where the latest release * version was tagged. */ - #define STRING_DISTRIBUTION_DATE "2017-10-10 12:00" + #define STRING_DISTRIBUTION_DATE "2018-11-28" /** * Required minimum Configuration.h and Configuration_adv.h file versions. @@ -89,6 +89,6 @@ * The WEBSITE_URL is the location where users can get more information such as * documentation about a specific Marlin release. */ - #define WEBSITE_URL "http://marlinfw.org" + #define WEBSITE_URL "www.creality3d.cn" #endif // USE_AUTOMATIC_VERSIONING diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index 89147d97b..953cb6399 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -310,6 +310,64 @@ void CardReader::openLogFile(char* name) { openFile(name, false); } +#if ENABLED(POWEROFF_SAVE_SD_FILE) + void CardReader::openPowerOffFile(char* name, uint8_t oflag) + { + if (!cardOK) return; + if (powerOffFile.isOpen()) return; + if (!powerOffFile.open(&root, name, oflag)) + { + SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL); + SERIAL_PROTOCOL(name); + SERIAL_PROTOCOLPGM(".\n"); + } + else + { + SERIAL_PROTOCOLPGM(MSG_SD_WRITE_TO_FILE); + SERIAL_PROTOCOLLN(name); + } + } + + void CardReader::closePowerOffFile() + { + powerOffFile.close(); + } + + bool CardReader::existPowerOffFile(char* name) + { + bool ret = powerOffFile.open(&root, name, O_READ); + // if (ret) + // { + // powerOffFile.close(); + // } + return ret; + } + + int16_t CardReader::savePowerOffInfo(const void* data, uint16_t size) + { + powerOffFile.seekSet(0); + return powerOffFile.write(data, size); + } + + int16_t CardReader::getPowerOffInfo(void* data, uint16_t size) + { + return powerOffFile.read(data, size); + } + + void CardReader::removePowerOffFile() + { + if (powerOffFile.remove(&root, power_off_info.power_off_filename)) + { + SERIAL_PROTOCOLPGM("File(bin) deleted"); + } + else + { + SERIAL_PROTOCOLPGM("Deletion(bin) failed"); + } + SERIAL_PROTOCOLPGM(".\n"); + } +#endif + void CardReader::getAbsFilename(char *t) { uint8_t cnt = 0; *t = '/'; t++; cnt++; @@ -871,6 +929,17 @@ void CardReader::printingHasFinished() { } else { sdprinting = false; + #if ENABLED(POWEROFF_SAVE_SD_FILE) + openPowerOffFile(power_off_info.power_off_filename, O_CREAT | O_WRITE | O_TRUNC | O_SYNC); + power_off_info.valid_head = 0; + power_off_info.valid_foot = 0; + if (savePowerOffInfo(&power_off_info, sizeof(power_off_info)) == -1) + { + SERIAL_PROTOCOLLN("Stop to Write power off file failed."); + } + closePowerOffFile(); + power_off_commands_count = 0; + #endif if (SD_FINISHED_STEPPERRELEASE) enqueue_and_echo_commands_P(PSTR(SD_FINISHED_RELEASECOMMAND)); print_job_timer.stop(); diff --git a/Marlin/cardreader.h b/Marlin/cardreader.h index 75674a8e5..ab1dd588e 100644 --- a/Marlin/cardreader.h +++ b/Marlin/cardreader.h @@ -46,6 +46,14 @@ public: void checkautostart(bool x); void openFile(char* name, bool read, bool push_current=false); void openLogFile(char* name); + #if ENABLED(POWEROFF_SAVE_SD_FILE) + void openPowerOffFile(char* name, uint8_t oflag); + void closePowerOffFile(); + bool existPowerOffFile(char* name); + int16_t savePowerOffInfo(const void* data, uint16_t size); + int16_t getPowerOffInfo(void* data, uint16_t size); + void removePowerOffFile(); + #endif void removeFile(char* name); void closefile(bool store_location=false); void release(); @@ -84,6 +92,8 @@ public: FORCE_INLINE bool eof() { return sdpos >= filesize; } FORCE_INLINE int16_t get() { sdpos = file.curPosition(); return (int16_t)file.read(); } FORCE_INLINE void setIndex(long index) { sdpos = index; file.seekSet(index); } + FORCE_INLINE uint32_t getIndex() { return sdpos; } + // FORCE_INLINE char* getCurrentPrintFileName() { return filenames[file_subcall_ctr]; } FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; } FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; } @@ -142,6 +152,9 @@ private: Sd2Card card; SdVolume volume; SdFile file; + #if ENABLED(POWEROFF_SAVE_SD_FILE) + SdFile powerOffFile; + #endif #define SD_PROCEDURE_DEPTH 1 #define MAXPATHNAMELENGTH (FILENAME_LENGTH*MAX_DIR_DEPTH + MAX_DIR_DEPTH + 1) @@ -165,6 +178,38 @@ private: }; extern CardReader card; +#if ENABLED(POWEROFF_SAVE_SD_FILE) +struct power_off_info_t +{ + /* header (1B + 7B = 8B) */ + uint8_t valid_head; + // uint8_t reserved1[8-1]; + /* Gcode related information. (44B + 20B = 64B) */ + float current_position[NUM_AXIS]; + float feedrate; + float saved_z; + int target_temperature[HOTENDS]; + int target_temperature_bed; + // uint8_t reserved2[64-44]; + /* print queue related information. (396B + 116B = 512B) */ + int cmd_queue_index_r; + int cmd_queue_index_w; + int commands_in_queue; + char command_queue[BUFSIZE][MAX_CMD_SIZE]; + // uint8_t reserved3[512-396]; + /* SD card related information. (165B + 91B = 256B)*/ + uint32_t sdpos; + millis_t print_job_start_ms; + char sd_filename[MAXPATHNAMELENGTH]; + char power_off_filename[16]; + // uint8_t reserved4[256-166]; + uint8_t valid_foot; +}; + +extern struct power_off_info_t power_off_info; +extern int power_off_commands_count; +extern int power_off_type_yes; +#endif #define IS_SD_PRINTING (card.sdprinting) #define IS_SD_FILE_OPEN (card.isFileOpen()) diff --git a/Marlin/dogm_bitmaps.h b/Marlin/dogm_bitmaps.h index 9a77ff785..6466e6bad 100644 --- a/Marlin/dogm_bitmaps.h +++ b/Marlin/dogm_bitmaps.h @@ -32,16 +32,17 @@ * Please note that using the high-res version takes 402Bytes of PROGMEM. */ -//#define START_BMPHIGH +#define START_BMPHIGH #if ENABLED(SHOW_BOOTSCREEN) #if ENABLED(START_BMPHIGH) - #define START_BMPWIDTH 112 - #define START_BMPHEIGHT 38 - #define START_BMPBYTEWIDTH 14 - #define START_BMPBYTES 532 // START_BMPWIDTH * START_BMPHEIGHT / 8 + #define START_BMPWIDTH 128 + #define START_BMPHEIGHT 64 + #define START_BMPBYTEWIDTH 16 + #define START_BMPBYTES 1024 // START_BMPWIDTH * START_BMPHEIGHT / 8 const unsigned char start_bmp[START_BMPBYTES] PROGMEM = { + /* 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, @@ -79,7 +80,144 @@ 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, - 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80 }; + 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80 + */ + + // Creality 3D + /* + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x00, + 0x01,0xFC,0x00,0x00,0x00,0x00,0x7C,0x03,0x80,0x00,0x00,0x00,0x00,0xC6,0x3F,0x80, + 0x03,0x1C,0x00,0x00,0x00,0x00,0x0C,0x03,0x80,0x30,0x00,0x00,0x00,0xC3,0x18,0xC0, + 0x06,0x0C,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x30,0x00,0x00,0x00,0xC3,0x18,0x60, + 0x06,0x0C,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x30,0x00,0x00,0x00,0x03,0x18,0x30, + 0x0C,0x00,0xF7,0x87,0xC1,0xF8,0x0C,0x07,0x80,0xFE,0x3D,0xE0,0x00,0x06,0x18,0x30, + 0x0C,0x00,0x3D,0x8C,0x63,0x0C,0x0C,0x01,0x80,0x30,0x18,0xC0,0x00,0x1E,0x18,0x30, + 0x0C,0x00,0x38,0x18,0x33,0x0C,0x0C,0x01,0x80,0x30,0x0D,0x80,0x00,0x03,0x18,0x30, + 0x0C,0x00,0x30,0x18,0x30,0x3C,0x0C,0x01,0x80,0x30,0x0D,0x80,0x00,0x01,0x98,0x30, + 0x0C,0x00,0x30,0x1F,0xF1,0xEC,0x0C,0x01,0x80,0x30,0x0D,0x80,0x00,0x01,0x98,0x30, + 0x0C,0x0C,0x30,0x18,0x03,0x0C,0x0C,0x01,0x80,0x30,0x07,0x80,0x00,0xC1,0x98,0x30, + 0x06,0x0C,0x30,0x18,0x33,0x0C,0x0C,0x01,0x80,0x30,0x07,0x00,0x00,0xC1,0x98,0x60, + 0x07,0x18,0x30,0x0C,0x63,0x1F,0x0C,0x01,0x80,0x33,0x03,0x00,0x00,0xC3,0x18,0xC0, + 0x01,0xF0,0xFC,0x07,0xC1,0xFF,0x7F,0x87,0xE0,0x1E,0x03,0x00,0x00,0x7E,0x3F,0x80, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + */ + + // ENDER + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEF,0xEF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE7,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE3,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF3,0xCF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE1,0xE1,0xCF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFE,0x78,0x00,0x00,0x03,0xDD,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFE,0xFF,0x80,0x7E,0x00,0x01,0xEE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFE,0x7D,0xCF,0xFC,0x00,0x00,0xF7,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0x8E,0x06,0x00,0x00,0x00,0x7B,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x7D,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFC,0x01,0xFE,0x00,0x00,0x3E,0xE7,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x03,0x1F,0x73,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x01,0x8F,0x81,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x83,0xF9,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xFC,0x00,0x00,0xF0,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x0F,0xFF,0xC0,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFE,0x03,0xFF,0xFF,0xC0,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF9,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x07,0xC0,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x07,0xE0,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x07,0xF1,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x07,0xF9,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x03,0xF9,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x83,0xF9,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE1,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0xF8,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF9,0xF8,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7E,0xF0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8E,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x7F,0xFF,0xFF,0xF8,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x7F,0xFF,0xFF,0xE0,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xC3,0xFC,0xFF,0xFF,0xFF,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xC3,0xFC,0xFF,0xFF,0xFF,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0x87,0xFD,0xFF,0xFF,0xFF,0xF1,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0x87,0xFF,0xFF,0xFF,0xFF,0xF1,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0x0F,0xE7,0xF3,0x0F,0xFC,0x23,0xFC,0x3F,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0x0F,0xEF,0x80,0x07,0xF0,0x03,0xF0,0x1E,0x00,0x7F,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFE,0x1F,0xCF,0x81,0x87,0xC7,0x87,0xC7,0x0C,0x00,0x7F,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFE,0x00,0x1F,0xC7,0xC7,0x8F,0xC7,0x9F,0x0F,0x0C,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFE,0x00,0x1F,0x87,0x8F,0x1F,0x8F,0x1F,0x0F,0x1F,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFC,0x3F,0x9F,0x8F,0x8F,0x1F,0x8E,0x00,0x1E,0x3F,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFC,0x7F,0x3F,0x0F,0x1E,0x3F,0x1E,0x3F,0xFE,0x3F,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xF8,0x7F,0xFF,0x1F,0x1C,0x3F,0x1C,0x7F,0xFC,0x7F,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xF8,0xFF,0xFF,0x1E,0x1C,0x7E,0x1C,0x7F,0xFC,0x7F,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xF0,0xFF,0xCE,0x3E,0x3C,0x7E,0x3C,0x7F,0xB8,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xF0,0xFF,0x9E,0x3C,0x38,0x7C,0x38,0x7E,0x78,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xE1,0xFF,0x3C,0x7C,0x78,0x7C,0x78,0x3C,0xF1,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xE1,0xF8,0x38,0x78,0x78,0x10,0x18,0x01,0xF1,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0x00,0x00,0x60,0x20,0x3C,0x00,0x7C,0x07,0x80,0x7F,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x1F,0xFE,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF + + }; #else #define START_BMPWIDTH 56 #define START_BMPHEIGHT 19 @@ -117,6 +255,7 @@ #if HAS_TEMP_BED #if HOTENDS == 1 + /* #define STATUS_SCREENWIDTH 115 //Width in pixels #define STATUS_SCREENHEIGHT 19 //Height in pixels #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes @@ -166,6 +305,110 @@ 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xE0, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00 }; + */ + #define STATUS_SCREENWIDTH 125 //Width in pixels + #define STATUS_SCREENHEIGHT 19 //Height in pixels + #define STATUS_SCREENBYTEWIDTH 15 //Width in bytes + const unsigned char status_screen0_bmp[] PROGMEM = + { + // AVR-GCC, WinAVR + // chuangxiang 3D + /* + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xF0, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x70, + 0x00,0x80,0x81,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x87,0x30, + 0x00,0xC0,0x81,0x1F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x27,0x87,0x90, + 0x01,0x20,0x81,0x10,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2F,0x87,0xD0, + 0x02,0x14,0x8F,0xDF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2F,0x87,0xD0, + 0x04,0x04,0x81,0x10,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2F,0x03,0xD0, + 0x0B,0xE4,0x83,0x9F,0x80,0x1F,0xE0,0x00,0x00,0x08,0x20,0x80,0x00,0x20,0x30,0x10, + 0x02,0x24,0x85,0x50,0x80,0x3F,0xF0,0x00,0x00,0x04,0x10,0x40,0x00,0x20,0x78,0x10, + 0x02,0x24,0x89,0x1F,0x80,0x3F,0xF0,0x00,0x00,0x04,0x10,0x40,0x00,0x20,0x78,0x10, + 0x02,0x24,0x81,0x10,0x00,0x3F,0xF0,0x00,0x00,0x08,0x20,0x80,0x00,0x20,0x30,0x10, + 0x02,0xC4,0x80,0xA1,0x00,0x1F,0xE0,0x00,0x00,0x10,0x41,0x00,0x00,0x2F,0x03,0xD0, + 0x02,0x00,0x82,0x90,0x80,0x1F,0xE0,0x00,0x00,0x20,0x82,0x00,0x00,0x2F,0x87,0xD0, + 0x02,0x10,0x82,0x8A,0x40,0x3F,0xF0,0x00,0x00,0x20,0x82,0x00,0x00,0x2F,0x87,0xD0, + 0x02,0x12,0x84,0x82,0x00,0x3F,0xF0,0x00,0x00,0x10,0x41,0x00,0x00,0x27,0x87,0x90, + 0x01,0xF1,0x00,0x7E,0x00,0x3F,0xF0,0x00,0x00,0x08,0x20,0x80,0x00,0x33,0x87,0x30, + 0x00,0x00,0x00,0x00,0x00,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x70, + 0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x00,0x00,0xFF,0xFF,0xC0,0x00,0x3F,0xFF,0xF0, + 0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00, + */ + + // Ender-5 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xF0, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x70, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x87,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x27,0x87,0x90, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2F,0x87,0xD0, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2F,0x87,0xD0, + 0xF8,0x00,0x80,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2F,0x03,0xD0, + 0x48,0x00,0x80,0x00,0x20,0x1F,0xE0,0x00,0x00,0x08,0x20,0x80,0x00,0x20,0x30,0x10, + 0x43,0xC3,0x99,0xA0,0x38,0x3F,0xF0,0x00,0x00,0x04,0x10,0x40,0x00,0x20,0x78,0x10, + 0x71,0x24,0xA4,0xCF,0x84,0x3F,0xF0,0x00,0x00,0x04,0x10,0x40,0x00,0x20,0x78,0x10, + 0x41,0x24,0xBC,0x80,0x04,0x3F,0xF0,0x00,0x00,0x08,0x20,0x80,0x00,0x20,0x30,0x10, + 0x49,0x24,0xA0,0x80,0x24,0x1F,0xE0,0x00,0x00,0x10,0x41,0x00,0x00,0x2F,0x03,0xD0, + 0xFB,0xB3,0x9D,0xC0,0x18,0x1F,0xE0,0x00,0x00,0x20,0x82,0x00,0x00,0x2F,0x87,0xD0, + 0x00,0x00,0x00,0x00,0x00,0x3F,0xF0,0x00,0x00,0x20,0x82,0x00,0x00,0x2F,0x87,0xD0, + 0x00,0x00,0x00,0x00,0x00,0x3F,0xF0,0x00,0x00,0x10,0x41,0x00,0x00,0x27,0x87,0x90, + 0x00,0x00,0x00,0x00,0x00,0x3F,0xF0,0x00,0x00,0x08,0x20,0x80,0x00,0x33,0x87,0x30, + 0x00,0x00,0x00,0x00,0x00,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x70, + 0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x00,0x00,0xFF,0xFF,0xC0,0x00,0x3F,0xFF,0xF0, + 0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00 + + }; + + #define STATUS_SCREENWIDTH 125 //Width in pixels + #define STATUS_SCREENHEIGHT 19 //Height in pixels + #define STATUS_SCREENBYTEWIDTH 16 //Width in bytes + const unsigned char status_screen1_bmp[] PROGMEM = + { + // AVR-GCC, WinAVR + // chuangxiang 3D + /* + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xF0, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x70, + 0x00,0x80,0x81,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0xFC,0x30, + 0x00,0xC0,0x81,0x1F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFC,0x10, + 0x01,0x20,0x81,0x10,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x78,0x10, + 0x02,0x14,0x8F,0xDF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x30,0x10, + 0x04,0x04,0x81,0x10,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2C,0x00,0xD0, + 0x0B,0xE4,0x83,0x9F,0x80,0x1F,0xE0,0x00,0x00,0x10,0x41,0x00,0x00,0x2E,0x31,0xD0, + 0x02,0x24,0x85,0x50,0x80,0x3F,0xF0,0x00,0x00,0x08,0x20,0x80,0x00,0x2F,0x7B,0xD0, + 0x02,0x24,0x89,0x1F,0x80,0x3F,0xF0,0x00,0x00,0x08,0x20,0x80,0x00,0x2F,0x7B,0xD0, + 0x02,0x24,0x81,0x10,0x00,0x3F,0xF0,0x00,0x00,0x10,0x41,0x00,0x00,0x2E,0x31,0xD0, + 0x02,0xC4,0x80,0xA1,0x00,0x1F,0xE0,0x00,0x00,0x20,0x82,0x00,0x00,0x2C,0x00,0xD0, + 0x02,0x00,0x82,0x90,0x80,0x1F,0xE0,0x00,0x00,0x41,0x04,0x00,0x00,0x20,0x30,0x10, + 0x02,0x10,0x82,0x8A,0x40,0x3F,0xF0,0x00,0x00,0x41,0x04,0x00,0x00,0x20,0x78,0x10, + 0x02,0x12,0x84,0x82,0x00,0x3F,0xF0,0x00,0x00,0x20,0x82,0x00,0x00,0x20,0xFC,0x10, + 0x01,0xF1,0x00,0x7E,0x00,0x3F,0xF0,0x00,0x00,0x10,0x41,0x00,0x00,0x30,0xFC,0x30, + 0x00,0x00,0x00,0x00,0x00,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x70, + 0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x00,0x00,0xFF,0xFF,0xC0,0x00,0x3F,0xFF,0xF0, + 0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00, + */ + + // Ender-5 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xF0, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x70, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0xFC,0x30, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xFC,0x10, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x78,0x10, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x30,0x10, + 0xF8,0x00,0x80,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2C,0x00,0xD0, + 0x48,0x00,0x80,0x00,0x20,0x1F,0xE0,0x00,0x00,0x10,0x41,0x00,0x00,0x2E,0x31,0xD0, + 0x43,0xC3,0x99,0xA0,0x38,0x3F,0xF0,0x00,0x00,0x08,0x20,0x80,0x00,0x2F,0x7B,0xD0, + 0x71,0x24,0xA4,0xCF,0x84,0x3F,0xF0,0x00,0x00,0x08,0x20,0x80,0x00,0x2F,0x7B,0xD0, + 0x41,0x24,0xBC,0x80,0x04,0x3F,0xF0,0x00,0x00,0x10,0x41,0x00,0x00,0x2E,0x31,0xD0, + 0x49,0x24,0xA0,0x80,0x24,0x1F,0xE0,0x00,0x00,0x20,0x82,0x00,0x00,0x2C,0x00,0xD0, + 0xFB,0xB3,0x9D,0xC0,0x18,0x1F,0xE0,0x00,0x00,0x41,0x04,0x00,0x00,0x20,0x30,0x10, + 0x00,0x00,0x00,0x00,0x00,0x3F,0xF0,0x00,0x00,0x41,0x04,0x00,0x00,0x20,0x78,0x10, + 0x00,0x00,0x00,0x00,0x00,0x3F,0xF0,0x00,0x00,0x20,0x82,0x00,0x00,0x20,0xFC,0x10, + 0x00,0x00,0x00,0x00,0x00,0x3F,0xF0,0x00,0x00,0x10,0x41,0x00,0x00,0x30,0xFC,0x30, + 0x00,0x00,0x00,0x00,0x00,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x70, + 0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x00,0x00,0xFF,0xFF,0xC0,0x00,0x3F,0xFF,0xF0, + 0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00 + + }; #elif HOTENDS == 2 #define STATUS_SCREENWIDTH 115 //Width in pixels #define STATUS_SCREENHEIGHT 19 //Height in pixels diff --git a/Marlin/language.h b/Marlin/language.h index 0ff6badef..e68ca7952 100644 --- a/Marlin/language.h +++ b/Marlin/language.h @@ -177,20 +177,20 @@ #define MSG_SOFT_MAX " Max: " #define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir " -#define MSG_SD_INIT_FAIL "SD init fail" +#define MSG_SD_INIT_FAIL "TF init fail" #define MSG_SD_VOL_INIT_FAIL "volume.init failed" #define MSG_SD_OPENROOT_FAIL "openRoot failed" -#define MSG_SD_CARD_OK "SD card ok" +#define MSG_SD_CARD_OK "TF card ok" #define MSG_SD_WORKDIR_FAIL "workDir open failed" #define MSG_SD_OPEN_FILE_FAIL "open failed, File: " #define MSG_SD_FILE_OPENED "File opened: " #define MSG_SD_SIZE " Size: " #define MSG_SD_FILE_SELECTED "File selected" #define MSG_SD_WRITE_TO_FILE "Writing to file: " -#define MSG_SD_PRINTING_BYTE "SD printing byte " -#define MSG_SD_NOT_PRINTING "Not SD printing" +#define MSG_SD_PRINTING_BYTE "TF printing byte " +#define MSG_SD_NOT_PRINTING "Not TF printing" #define MSG_SD_ERR_WRITE_TO_FILE "error writing to file" -#define MSG_SD_ERR_READ "SD read error" +#define MSG_SD_ERR_READ "TF read error" #define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: " #define MSG_STEPPER_TOO_HIGH "Steprate too high: " diff --git a/Marlin/language_cn.h b/Marlin/language_cn.h index f6230a013..e48064224 100644 --- a/Marlin/language_cn.h +++ b/Marlin/language_cn.h @@ -38,6 +38,7 @@ #define MSG_MAIN "\xae\xaf\xb0" #define MSG_AUTOSTART "\xb1\xb2\xb3\xb4" #define MSG_DISABLE_STEPPERS "\xb5\xb6\xb7\xb8\xb9\xba" +#define MSG_DISABLE_STEPPERS_XY "\xb5\xb6\xb7\xb8\xb9\xba XY" #define MSG_AUTO_HOME "\xbb\xbc\xbd" #define MSG_LEVEL_BED_HOMING "Homing XYZ" #define MSG_LEVEL_BED_WAITING "Click to Begin" @@ -53,7 +54,7 @@ #define MSG_PREHEAT_2 "\xc3\xc4 ABS" #define MSG_PREHEAT_2_N MSG_PREHEAT_2 " " #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 " \xc5\xc6" -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " \xbe\xc6" +#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 " \xc4\xc7" #define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 " \xbe\xbf" #define MSG_COOLDOWN "\xc8\xc9" #define MSG_SWITCH_PS_ON "\xb9\xcb\xca\xb3" @@ -61,7 +62,7 @@ #define MSG_EXTRUDE "\xcc\xad" #define MSG_RETRACT "\xbb\xcd" #define MSG_MOVE_AXIS "\xc1\xb2\xce" -#define MSG_BED_LEVELING "\xcf\xe0\xc4\xc7" +#define MSG_BED_LEVELING "\xb1\xb2\xcf\xd0" #define MSG_LEVEL_BED "\xcf\xe0\xc4\xc7" #define MSG_MOVE_X "\xc1\xb2 X" #define MSG_MOVE_Y "\xc1\xb2 Y" @@ -80,8 +81,8 @@ #define MSG_MAX LCD_STR_THERMOMETER " \xda\xdc" #define MSG_FACTOR LCD_STR_THERMOMETER " \xdd\xde" #define MSG_AUTOTEMP "\xb1\xb2\xd8\xc9" -#define MSG_ON "\xb3 " // intentional space to shift wide symbol to the left -#define MSG_OFF "\xb5 " // intentional space to shift wide symbol to the left +#define MSG_ON "On" // intentional space to shift wide symbol to the left +#define MSG_OFF "Off" // intentional space to shift wide symbol to the left #define MSG_PID_P "PID-P" #define MSG_PID_I "PID-I" #define MSG_PID_D "PID-D" @@ -142,8 +143,8 @@ #define MSG_CONTROL_RETRACT_RECOVERF "UnRet V" #define MSG_AUTORETRACT "AutoRetr." #define MSG_FILAMENTCHANGE "Change filament" -#define MSG_INIT_SDCARD "Init. SD card" -#define MSG_CNG_SDCARD "Change SD card" +#define MSG_INIT_SDCARD "Init. TF card" +#define MSG_CNG_SDCARD "Change TF card" #define MSG_ZPROBE_OUT "Z probe out. bed" #define MSG_HOME "Home" // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST #define MSG_FIRST "first" @@ -163,5 +164,5 @@ #define MSG_DELTA_CALIBRATE_Y "Calibrate Y" #define MSG_DELTA_CALIBRATE_Z "Calibrate Z" #define MSG_DELTA_CALIBRATE_CENTER "Calibrate Center" - +#define MSG_POWER_LOSS_RECOVERY "\xa4\xa5\xf4\xf5\xca\xf3 ?" #endif // LANGUAGE_CN_H diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 811b132fb..0466e51b1 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -54,6 +54,9 @@ #ifndef MSG_DISABLE_STEPPERS #define MSG_DISABLE_STEPPERS _UxGT("Disable steppers") #endif +#ifndef MSG_DISABLE_STEPPERS_XY + #define MSG_DISABLE_STEPPERS_XY _UxGT("Disable steppers XY axis") +#endif #ifndef MSG_DEBUG_MENU #define MSG_DEBUG_MENU _UxGT("Debug Menu") #endif @@ -564,10 +567,10 @@ #define MSG_STOP_PRINT _UxGT("Stop print") #endif #ifndef MSG_CARD_MENU - #define MSG_CARD_MENU _UxGT("Print from SD") + #define MSG_CARD_MENU _UxGT("Print from TF") #endif #ifndef MSG_NO_CARD - #define MSG_NO_CARD _UxGT("No SD card") + #define MSG_NO_CARD _UxGT("No TF card") #endif #ifndef MSG_DWELL #define MSG_DWELL _UxGT("Sleep...") @@ -621,10 +624,10 @@ #define MSG_FILAMENTCHANGE _UxGT("Change filament") #endif #ifndef MSG_INIT_SDCARD - #define MSG_INIT_SDCARD _UxGT("Init. SD card") + #define MSG_INIT_SDCARD _UxGT("Init. TF card") #endif #ifndef MSG_CNG_SDCARD - #define MSG_CNG_SDCARD _UxGT("Change SD card") + #define MSG_CNG_SDCARD _UxGT("Change TF card") #endif #ifndef MSG_ZPROBE_OUT #define MSG_ZPROBE_OUT _UxGT("Z probe out. bed") @@ -870,6 +873,9 @@ #ifndef MSG_ERR_PROBING_FAILED #define MSG_ERR_PROBING_FAILED _UxGT("Probing failed") #endif +#ifndef MSG_POWER_LOSS_RECOVERY + #define MSG_POWER_LOSS_RECOVERY _UxGT("Power-Loss Recovery ?") +#endif // // Filament Change screens show up to 3 lines on a 4-line display diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 83ce9d2fe..118b43545 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -162,9 +162,10 @@ uint16_t max_display_update_time = 0; #if ENABLED(PRINTCOUNTER) void lcd_info_stats_menu(); #endif - void lcd_info_thermistors_menu(); - void lcd_info_board_menu(); - void lcd_info_menu(); + // void lcd_info_thermistors_menu(); + // void lcd_info_board_menu(); + // void lcd_info_menu(); + void lcd_info_printer_menu(); #endif // LCD_INFO_MENU #if ENABLED(ADVANCED_PAUSE_FEATURE) @@ -199,6 +200,11 @@ uint16_t max_display_update_time = 0; extern void mesh_probing_done(); #endif + // Add power off cotinue print function. + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + static void lcd_resume_ok_menu(); + #endif + //////////////////////////////////////////// //////////// Menu System Actions /////////// //////////////////////////////////////////// @@ -750,9 +756,23 @@ void kill_screen(const char* lcd_msg) { #if ENABLED(SDSUPPORT) + int mytemphot = 0; + int mytempbed = 0; + float pause_z = 0; void lcd_sdcard_pause() { card.pauseSDPrint(); print_job_timer.pause(); + + pause_z = current_position[Z_AXIS]; + + mytemphot = thermalManager.degTargetHotend(0); + mytempbed = thermalManager.degTargetBed(); + + thermalManager.setTargetHotend(0, 0); + thermalManager.setTargetBed(0); + + enqueue_and_echo_commands_P(PSTR("G0 F1200 X0 Y0")); + #if ENABLED(PARK_HEAD_ON_PAUSE) enqueue_and_echo_commands_P(PSTR("M125")); #endif @@ -760,6 +780,44 @@ void kill_screen(const char* lcd_msg) { } void lcd_sdcard_resume() { + char cmd1[30]; + char pause_str_Z[16]; + + memset(pause_str_Z, 0, sizeof(pause_str_Z)); + dtostrf(pause_z, 3, 2, pause_str_Z); + SERIAL_PROTOCOLLN(pause_str_Z); + SERIAL_PROTOCOLLN("lcd_sdcard_resume() pause_str_Z"); + #if ENABLED(POWEROFF_SAVE_SD_FILE) + if (power_off_commands_count > 0) + { + sprintf_P(cmd1, PSTR("M190 S%i"), power_off_info.target_temperature_bed); + enqueue_and_echo_command(cmd1); + sprintf_P(cmd1, PSTR("M109 S%i"), power_off_info.target_temperature[0]); + enqueue_and_echo_command(cmd1); + enqueue_and_echo_commands_P(PSTR("M106 S255")); + // sprintf_P(cmd1, PSTR("T%i"), power_off_info.saved_extruder); + // enqueue_and_echo_command(cmd1); + power_off_type_yes = 1; + } + else + { + sprintf_P(cmd1, PSTR("M140 S%i"), mytempbed); + enqueue_and_echo_command(cmd1); + sprintf_P(cmd1, PSTR("M109 S%i"), mytemphot); + enqueue_and_echo_command(cmd1); + // enqueue_and_echo_commands_P(PSTR("G28 X0 Y0")); + sprintf_P(cmd1, PSTR("G0 Z%s"), pause_str_Z); + enqueue_and_echo_command(cmd1); + } + #else + sprintf_P(cmd1, PSTR("M140 S%i"), mytempbed); + enqueue_and_echo_command(cmd1); + sprintf_P(cmd1, PSTR("M109 S%i"), mytemphot); + enqueue_and_echo_command(cmd1); + // enqueue_and_echo_commands_P(PSTR("G28 X0 Y0")); + sprintf_P(cmd1, PSTR("G0 Z%s"), pause_str_Z); + enqueue_and_echo_command(cmd1); + #endif #if ENABLED(PARK_HEAD_ON_PAUSE) enqueue_and_echo_commands_P(PSTR("M24")); #else @@ -775,6 +833,18 @@ void kill_screen(const char* lcd_msg) { quickstop_stepper(); print_job_timer.stop(); thermalManager.disable_all_heaters(); + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + card.openPowerOffFile(power_off_info.power_off_filename, O_CREAT | O_WRITE | O_TRUNC | O_SYNC); + power_off_info.valid_head = 0; + power_off_info.valid_foot = 0; + if (card.savePowerOffInfo(&power_off_info, sizeof(power_off_info)) == -1) + { + SERIAL_PROTOCOLLN("Stop to Write power off file failed."); + } + card.closePowerOffFile(); + power_off_commands_count = 0; + #endif + #if FAN_COUNT > 0 for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0; #endif @@ -783,6 +853,32 @@ void kill_screen(const char* lcd_msg) { lcd_return_to_status(); } + static void lcd_sdcard_power_resume() + { + lcd_sdcard_resume(); + lcd_return_to_status(); + } + + static void lcd_sdcard_power_stop() + { + lcd_sdcard_stop(); + lcd_return_to_status(); + } + + /** + * "Resume yes or no" menu + */ + #if ENABLED(POWEROFF_SAVE_SD_FILE) + static void lcd_resume_ok_menu() + { + defer_return_to_status = true; + START_MENU(); + STATIC_ITEM(MSG_POWER_LOSS_RECOVERY); + MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_power_resume); + MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_power_stop); + END_MENU(); + } + #endif #endif // SDSUPPORT #if ENABLED(MENU_ITEM_CASE_LIGHT) @@ -952,7 +1048,9 @@ void kill_screen(const char* lcd_msg) { MENU_ITEM(submenu, MSG_CASE_LIGHT, case_light_menu); } else + { MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); + } #endif if (planner.movesplanned() || IS_SD_PRINTING) { @@ -966,11 +1064,35 @@ void kill_screen(const char* lcd_msg) { #if ENABLED(SDSUPPORT) if (card.cardOK) { if (card.isFileOpen()) { - if (card.sdprinting) - MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause); - else - MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume); - MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop); + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + if (power_off_commands_count > 0) + { + // MENU_ITEM(submenu, MSG_RESUME_PRINT_OK, lcd_resume_ok_menu); + if (card.sdprinting) + { + MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause); + } + else + { + MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume); + } + MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop); + } + else + { + #endif + if (card.sdprinting) + { + MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause); + } + else + { + MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume); + } + MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop); + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + } + #endif } else { MENU_ITEM(submenu, MSG_CARD_MENU, lcd_sdcard_menu); @@ -988,7 +1110,7 @@ void kill_screen(const char* lcd_msg) { #endif // SDSUPPORT #if ENABLED(LCD_INFO_MENU) - MENU_ITEM(submenu, MSG_INFO_MENU, lcd_info_menu); + MENU_ITEM(submenu, MSG_INFO_MENU, lcd_info_printer_menu); #endif END_MENU(); @@ -2501,6 +2623,29 @@ void kill_screen(const char* lcd_msg) { #endif // AUTO_BED_LEVELING_UBL + // lcd auto home + static void lcd_autohome() + { + enqueue_and_echo_commands_P(PSTR("G28")); // move all axis home + + disable_X(); + disable_Y(); + } + + void disable_xy_steppers() + { + disable_X(); + disable_Y(); + } + + static void lcd_disable_steppers() + { + START_MENU(); + MENU_ITEM(back, MSG_PREPARE, lcd_prepare_menu); + MENU_ITEM(function, MSG_DISABLE_STEPPERS_XY, disable_xy_steppers); + MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); + END_MENU(); + } /** * * "Prepare" submenu @@ -2526,7 +2671,8 @@ void kill_screen(const char* lcd_msg) { // // Auto Home // - MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); + // MENU_ITEM(gcode, msg_auto_home(), PSTR("G28")); + MENU_ITEM(function, MSG_AUTO_HOME, lcd_autohome); #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) MENU_ITEM(gcode, MSG_AUTO_HOME_X, PSTR("G28 X")); MENU_ITEM(gcode, MSG_AUTO_HOME_Y, PSTR("G28 Y")); @@ -2564,7 +2710,8 @@ void kill_screen(const char* lcd_msg) { // // Disable Steppers // - MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); + // MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); + MENU_ITEM(submenu, MSG_DISABLE_STEPPERS, lcd_disable_steppers); // // Change filament @@ -2602,11 +2749,13 @@ void kill_screen(const char* lcd_msg) { // // BLTouch Self-Test and Reset // +/* #if ENABLED(BLTOUCH) MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_ENDSTOP_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST))); if (!endstops.z_probe_enabled && TEST_BLTOUCH()) MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_ENDSTOP_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET))); #endif +*/ // // Switch power on/off @@ -3132,9 +3281,9 @@ void kill_screen(const char* lcd_msg) { MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); #endif - MENU_ITEM(function, MSG_RESTORE_FAILSAFE, lcd_factory_settings); + // MENU_ITEM(function, MSG_RESTORE_FAILSAFE, lcd_factory_settings); #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(submenu, MSG_INIT_EEPROM, lcd_init_eeprom_confirm); + MENU_ITEM(function, MSG_INIT_EEPROM, lcd_init_eeprom); #endif END_MENU(); @@ -3283,6 +3432,7 @@ void kill_screen(const char* lcd_msg) { // // Autotemp, Min, Max, Fact // +/* #if ENABLED(AUTOTEMP) && (TEMP_SENSOR_0 != 0) MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &planner.autotemp_enabled); MENU_ITEM_EDIT(float3, MSG_MIN, &planner.autotemp_min, 0, HEATER_0_MAXTEMP - 15); @@ -3340,7 +3490,7 @@ void kill_screen(const char* lcd_msg) { #endif // !PID_PARAMS_PER_HOTEND || HOTENDS == 1 #endif // PIDTEMP - +*/ // // Preheat Material 1 conf // @@ -3849,12 +3999,16 @@ void kill_screen(const char* lcd_msg) { void lcd_info_printer_menu() { if (lcd_clicked) { return lcd_goto_previous_menu(); } START_SCREEN(); - STATIC_ITEM(MSG_MARLIN, true, true); // Marlin + STATIC_ITEM(MSG_INFO_MENU, true, true); // Marlin + STATIC_ITEM(DETAILED_BUILD_VERSION, true); // Creality 3D STATIC_ITEM(SHORT_BUILD_VERSION, true); // x.x.x-Branch - STATIC_ITEM(STRING_DISTRIBUTION_DATE, true); // YYYY-MM-DD HH:MM - STATIC_ITEM(MACHINE_NAME, true); // My3DPrinter - STATIC_ITEM(WEBSITE_URL, true); // www.my3dprinter.com - STATIC_ITEM(MSG_INFO_EXTRUDERS ": " STRINGIFY(EXTRUDERS), true); // Extruders: 2 + // STATIC_ITEM(STRING_DISTRIBUTION_DATE, true); // YYYY-MM-DD HH:MM + STATIC_ITEM(MACHINE_NAME, true); // Ender-5 + STATIC_ITEM(WEBSITE_URL, true); // www.creality3d.cn + STATIC_ITEM(MSG_INFO_EXTRUDERS ": " STRINGIFY(EXTRUDERS), true); // Extruders: 1 + STATIC_ITEM(BOARD_NAME, true); // MyPrinterController + STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 115200 + /* #if ENABLED(AUTO_BED_LEVELING_3POINT) STATIC_ITEM(MSG_3POINT_LEVELING, true); // 3-Point Leveling #elif ENABLED(AUTO_BED_LEVELING_LINEAR) @@ -3866,6 +4020,7 @@ void kill_screen(const char* lcd_msg) { #elif ENABLED(MESH_BED_LEVELING) STATIC_ITEM(MSG_MESH_LEVELING, true); // Mesh Leveling #endif + */ END_SCREEN(); } @@ -4491,6 +4646,13 @@ void lcd_update() { lcd_buttons_update(); + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + if ((power_off_type_yes == 0) && (power_off_commands_count > 0)) + { + currentScreen = lcd_resume_ok_menu; + } + #endif + #if ENABLED(AUTO_BED_LEVELING_UBL) const bool UBL_CONDITION = !ubl.has_control_of_lcd_panel; #else @@ -4499,11 +4661,11 @@ void lcd_update() { // If the action button is pressed... if (UBL_CONDITION && LCD_CLICKED) { - if (!wait_for_unclick) { // If not waiting for a debounce release: - wait_for_unclick = true; // Set debounce flag to ignore continous clicks - lcd_clicked = !wait_for_user; // Keep the click if not waiting for a user-click - wait_for_user = false; // Any click clears wait for user - lcd_quick_feedback(); // Always make a click sound + if (!wait_for_unclick) { // If not waiting for a debounce release: + wait_for_unclick = true; // Set debounce flag to ignore continous clicks + lcd_clicked = !wait_for_user; // Keep the click if not waiting for a user-click + wait_for_user = false; // Any click clears wait for user + lcd_quick_feedback(); // Always make a click sound } } else wait_for_unclick = false; @@ -4513,10 +4675,12 @@ void lcd_update() { const bool sd_status = IS_SD_INSERTED; if (sd_status != lcd_sd_status && lcd_detected()) { - if (sd_status) { card.initsd(); if (lcd_sd_status != 2) LCD_MESSAGEPGM(MSG_SD_INSERTED); + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE) + init_power_off_info(); + #endif } else { card.release(); diff --git a/Marlin/ultralcd_impl_DOGM.h b/Marlin/ultralcd_impl_DOGM.h index 6f75143a0..d1d31f237 100644 --- a/Marlin/ultralcd_impl_DOGM.h +++ b/Marlin/ultralcd_impl_DOGM.h @@ -292,7 +292,6 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { #endif // SHOW_CUSTOM_BOOTSCREEN void lcd_bootscreen() { - static bool show_bootscreen = true; if (show_bootscreen) { @@ -304,15 +303,15 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) { constexpr uint8_t offy = DOG_CHAR_HEIGHT; #endif - const uint8_t offx = (u8g.getWidth() - (START_BMPWIDTH)) / 2, - txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH)) / 2; + const uint8_t offx = (u8g.getWidth() - (START_BMPWIDTH)) / 2; + // txt1X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE1) - 1) * (DOG_CHAR_WIDTH)) / 2; u8g.firstPage(); do { u8g.drawBitmapP(offx, offy, START_BMPBYTEWIDTH, START_BMPHEIGHT, start_bmp); lcd_setFont(FONT_MENU); #ifndef STRING_SPLASH_LINE2 - u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT), STRING_SPLASH_LINE1); + // u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT), STRING_SPLASH_LINE1); #else const uint8_t txt2X = (u8g.getWidth() - (sizeof(STRING_SPLASH_LINE2) - 1) * (DOG_CHAR_WIDTH)) / 2; u8g.drawStr(txt1X, u8g.getHeight() - (DOG_CHAR_HEIGHT) * 3 / 2, STRING_SPLASH_LINE1); @@ -492,8 +491,8 @@ static void lcd_implementation_status_screen() { // if (PAGE_UNDER(STATUS_SCREENHEIGHT + 1)) { - - u8g.drawBitmapP(9, 1, STATUS_SCREENBYTEWIDTH, STATUS_SCREENHEIGHT, + // u8g.drawBitmapP(9, 1, STATUS_SCREENBYTEWIDTH, STATUS_SCREENHEIGHT, + u8g.drawBitmapP(0, 1, STATUS_SCREENBYTEWIDTH, STATUS_SCREENHEIGHT, #if HAS_FAN0 blink && fanSpeeds[0] ? status_screen0_bmp : status_screen1_bmp #else @@ -509,11 +508,12 @@ static void lcd_implementation_status_screen() { if (PAGE_UNDER(28)) { // Extruders - HOTEND_LOOP() _draw_heater_status(5 + e * 25, e, blink); + // HOTEND_LOOP() _draw_heater_status(5 + e * 25, e, blink); + for(int e = 0; e < 1; e++) _draw_heater_status(38 + e * 25, e, blink); // Heated bed #if HOTENDS < 4 && HAS_TEMP_BED - _draw_heater_status(81, -1, blink); + _draw_heater_status(72, -1, blink); #endif #if HAS_FAN0 @@ -556,7 +556,7 @@ static void lcd_implementation_status_screen() { if (PAGE_CONTAINS(49, 52 - (TALL_FONT_CORRECTION))) // 49-52 (or 49-51) u8g.drawFrame( PROGRESS_BAR_X, 49, - PROGRESS_BAR_WIDTH, 4 - (TALL_FONT_CORRECTION) + PROGRESS_BAR_X - 1, 4 - (TALL_FONT_CORRECTION) ); if (IS_SD_PRINTING) { @@ -568,7 +568,7 @@ static void lcd_implementation_status_screen() { if (PAGE_CONTAINS(50, 51 - (TALL_FONT_CORRECTION))) // 50-51 (or just 50) u8g.drawBox( PROGRESS_BAR_X + 1, 50, - (uint16_t)((PROGRESS_BAR_WIDTH - 2) * card.percentDone() * 0.01), 2 - (TALL_FONT_CORRECTION) + (uint16_t)((PROGRESS_BAR_X - 1) * card.percentDone() * 0.01), 2 - (TALL_FONT_CORRECTION) ); // @@ -601,8 +601,24 @@ static void lcd_implementation_status_screen() { duration_t elapsed = print_job_timer.duration(); bool has_days = (elapsed.value > 60*60*24L); uint8_t len = elapsed.toDigital(buffer, has_days); - u8g.setPrintPos(SD_DURATION_X, 48); + u8g.setPrintPos(60, 48); lcd_print(buffer); + + if(previous_cmd_ms != 0) + { + // Displays the percentage of printing. + uint16_t progresssum=card.percentDone(); + u8g.setPrintPos(104,51); + u8g.print(itostr3(progresssum)); + u8g.print('%'); + } + else + { + // Shows the percentage of print progress. + u8g.setPrintPos(104,51); + u8g.print(itostr3(0)); + u8g.print('%'); + } } #endif @@ -727,7 +743,8 @@ static void lcd_implementation_status_screen() { u8g.setPrintPos(0, STATUS_BASELINE); #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) { //Display both Status message line and Filament display on the last line + if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) { + //Display both Status message line and Filament display on the last line lcd_implementation_status_message(blink); } else {