Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/Configuration.h b/Configuration.h
- index 8fd1749..b1899f5 100644
- --- a/Configuration.h
- +++ b/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-3)" // 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-3"
- // 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
- @@ -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
- @@ -742,7 +744,7 @@
- // @section machine
- // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
- -#define INVERT_X_DIR false
- +#define INVERT_X_DIR true
- #define INVERT_Y_DIR true
- #define INVERT_Z_DIR false
- @@ -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 235
- +#define Y_BED_SIZE 235
- // 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 250
- // 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 210
- + #define FRONT_PROBE_BED_POSITION 50
- + #define BACK_PROBE_BED_POSITION 210
- // 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,12 +1049,12 @@
- // @section temperature
- // Preheat Constants
- -#define PREHEAT_1_TEMP_HOTEND 180
- -#define PREHEAT_1_TEMP_BED 70
- +#define PREHEAT_1_TEMP_HOTEND 185
- +#define PREHEAT_1_TEMP_BED 45
- #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255
- #define PREHEAT_2_TEMP_HOTEND 240
- -#define PREHEAT_2_TEMP_BED 110
- +#define PREHEAT_2_TEMP_BED 70
- #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255
- /**
- @@ -1229,7 +1231,10 @@
- * you must uncomment the following option or it won't work.
- *
- */
- -//#define SDSUPPORT
- +#define SDSUPPORT
- +
- +// If power off, after power on, the printing can be resumed.
- +#define POWEROFF_SAVE_SD_FILE
- /**
- * SD CARD: SPI SPEED
- @@ -1522,7 +1527,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 +1686,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/Configuration_adv.h b/Configuration_adv.h
- index 3ed2a44..d7c75eb 100644
- --- a/Configuration_adv.h
- +++ b/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
- @@ -599,7 +599,7 @@
- *
- * 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
- @@ -816,11 +816,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.h b/Marlin.h
- index c341d98..b51747b 100644
- --- a/Marlin.h
- +++ b/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_main.cpp b/Marlin_main.cpp
- index 3ac0433..4ce1a92 100644
- --- a/Marlin_main.cpp
- +++ b/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) {
- @@ -5943,14 +5961,17 @@ void home_all_axes() { gcode_G28(true); }
- /**
- * G92: Set current position to given X Y Z E
- */
- -inline void gcode_G92() {
- +inline void gcode_G92()
- +{
- bool didXYZ = false,
- didE = parser.seenval('E');
- if (!didE) stepper.synchronize();
- - LOOP_XYZE(i) {
- - if (parser.seenval(axis_codes[i])) {
- + LOOP_XYZE(i)
- + {
- + if (parser.seenval(axis_codes[i]))
- + {
- #if IS_SCARA
- current_position[i] = parser.value_axis_units((AxisEnum)i);
- if (i != E_AXIS) didXYZ = true;
- @@ -5962,8 +5983,13 @@ inline void gcode_G92() {
- current_position[i] = v;
- - if (i != E_AXIS) {
- + 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);
- @@ -6512,7 +6538,12 @@ inline void gcode_M17() {
- /**
- * M24: Start or Resume SD Print
- */
- - inline void gcode_M24() {
- + inline void gcode_M24()
- + {
- + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE)
- + card.removePowerOffFile();
- + #endif
- +
- #if ENABLED(PARK_HEAD_ON_PAUSE)
- resume_print();
- #endif
- @@ -7289,7 +7320,8 @@ inline void gcode_M77() { print_job_timer.stop(); }
- /**
- * M104: Set hot end temperature
- */
- -inline void gcode_M104() {
- +inline void gcode_M104()
- +{
- if (get_target_extruder_from_command(104)) return;
- if (DEBUGGING(DRYRUN)) return;
- @@ -7297,7 +7329,8 @@ inline void gcode_M104() {
- if (target_extruder != active_extruder) return;
- #endif
- - if (parser.seenval('S')) {
- + if (parser.seenval('S'))
- + {
- const int16_t temp = parser.value_celsius();
- thermalManager.setTargetHotend(temp, target_extruder);
- @@ -7313,14 +7346,18 @@ inline void gcode_M104() {
- * standby mode, for instance in a dual extruder setup, without affecting
- * the running print timer.
- */
- - if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) {
- + if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2)
- + {
- print_job_timer.stop();
- LCD_MESSAGEPGM(WELCOME_MSG);
- }
- #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)
- @@ -7506,8 +7543,8 @@ inline void gcode_M105() {
- #define MIN_COOLING_SLOPE_TIME 60
- #endif
- -inline void gcode_M109() {
- -
- +inline void gcode_M109()
- +{
- if (get_target_extruder_from_command(109)) return;
- if (DEBUGGING(DRYRUN)) return;
- @@ -7516,7 +7553,8 @@ inline void gcode_M109() {
- #endif
- const bool no_wait_for_cooling = parser.seenval('S');
- - if (no_wait_for_cooling || parser.seenval('R')) {
- + if (no_wait_for_cooling || parser.seenval('R'))
- + {
- const int16_t temp = parser.value_celsius();
- thermalManager.setTargetHotend(temp, target_extruder);
- @@ -7531,7 +7569,8 @@ inline void gcode_M109() {
- * standby mode, (e.g., in a dual extruder setup) without affecting
- * the running print timer.
- */
- - if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) {
- + if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2)
- + {
- print_job_timer.stop();
- LCD_MESSAGEPGM(WELCOME_MSG);
- }
- @@ -7539,7 +7578,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;
- @@ -7570,9 +7613,11 @@ inline void gcode_M109() {
- uint8_t old_blue = 0;
- #endif
- - do {
- + do
- + {
- // Target temperature might be changed during the loop
- - if (target_temp != thermalManager.degTargetHotend(target_extruder)) {
- + if (target_temp != thermalManager.degTargetHotend(target_extruder))
- + {
- wants_to_cool = thermalManager.isCoolingHotend(target_extruder);
- target_temp = thermalManager.degTargetHotend(target_extruder);
- @@ -7581,7 +7626,9 @@ inline void gcode_M109() {
- }
- now = millis();
- - if (ELAPSED(now, next_temp_ms)) { //Print temp & remaining time every 1s while waiting
- + if (ELAPSED(now, next_temp_ms))
- + {
- + // Print temp & remaining time every 1s while waiting
- next_temp_ms = now + 1000UL;
- print_heaterstates();
- #if TEMP_RESIDENCY_TIME > 0
- @@ -7601,9 +7648,11 @@ inline void gcode_M109() {
- #if ENABLED(PRINTER_EVENT_LEDS)
- // Gradually change LED strip from violet to red as nozzle heats up
- - if (!wants_to_cool) {
- + if (!wants_to_cool)
- + {
- const uint8_t blue = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 255, 0);
- - if (blue != old_blue) {
- + if (blue != old_blue)
- + {
- old_blue = blue;
- set_led_color(255, 0, blue
- #if ENABLED(NEOPIXEL_LED)
- @@ -7622,11 +7671,13 @@ inline void gcode_M109() {
- const float temp_diff = FABS(target_temp - temp);
- - if (!residency_start_ms) {
- + if (!residency_start_ms)
- + {
- // Start the TEMP_RESIDENCY_TIME timer when we reach target temp for the first time.
- if (temp_diff < TEMP_WINDOW) residency_start_ms = now;
- }
- - else if (temp_diff > TEMP_HYSTERESIS) {
- + else if (temp_diff > TEMP_HYSTERESIS)
- + {
- // Restart the timer whenever the temperature falls outside the hysteresis.
- residency_start_ms = now;
- }
- @@ -7634,10 +7685,12 @@ inline void gcode_M109() {
- #endif
- // Prevent a wait-forever situation if R is misused i.e. M109 R0
- - if (wants_to_cool) {
- + if (wants_to_cool)
- + {
- // break after MIN_COOLING_SLOPE_TIME seconds
- // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG
- - if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) {
- + if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms))
- + {
- if (old_temp - temp < MIN_COOLING_SLOPE_DEG) break;
- next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME;
- old_temp = temp;
- @@ -7646,7 +7699,8 @@ inline void gcode_M109() {
- } while (wait_for_heatup && TEMP_CONDITIONS);
- - if (wait_for_heatup) {
- + if (wait_for_heatup)
- + {
- LCD_MESSAGEPGM(MSG_HEATING_COMPLETE);
- #if ENABLED(PRINTER_EVENT_LEDS)
- #if ENABLED(RGB_LED) || ENABLED(BLINKM) || ENABLED(PCA9632) || ENABLED(RGBW_LED)
- @@ -7676,12 +7730,14 @@ inline void gcode_M109() {
- * M190: Sxxx Wait for bed current temp to reach target temp. Waits only when heating
- * Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
- */
- - inline void gcode_M190() {
- + inline void gcode_M190()
- + {
- if (DEBUGGING(DRYRUN)) return;
- LCD_MESSAGEPGM(MSG_BED_HEATING);
- const bool no_wait_for_cooling = parser.seenval('S');
- - if (no_wait_for_cooling || parser.seenval('R')) {
- + if (no_wait_for_cooling || parser.seenval('R'))
- + {
- thermalManager.setTargetBed(parser.value_celsius());
- #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
- if (parser.value_celsius() > BED_MINTEMP)
- @@ -7726,7 +7782,9 @@ 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
- @@ -7746,9 +7804,11 @@ inline void gcode_M109() {
- #if ENABLED(PRINTER_EVENT_LEDS)
- // Gradually change LED strip from blue to violet as bed heats up
- - if (!wants_to_cool) {
- + if (!wants_to_cool)
- + {
- const uint8_t red = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 0, 255);
- - if (red != old_red) {
- + if (red != old_red)
- + {
- old_red = red;
- set_led_color(red, 0, 255
- #if ENABLED(NEOPIXEL_LED)
- @@ -7766,11 +7826,13 @@ inline void gcode_M109() {
- const float temp_diff = FABS(target_temp - temp);
- - if (!residency_start_ms) {
- + if (!residency_start_ms)
- + {
- // Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time.
- if (temp_diff < TEMP_BED_WINDOW) residency_start_ms = now;
- }
- - else if (temp_diff > TEMP_BED_HYSTERESIS) {
- + else if (temp_diff > TEMP_BED_HYSTERESIS)
- + {
- // Restart the timer whenever the temperature falls outside the hysteresis.
- residency_start_ms = now;
- }
- @@ -7778,10 +7840,12 @@ inline void gcode_M109() {
- #endif // TEMP_BED_RESIDENCY_TIME > 0
- // Prevent a wait-forever situation if R is misused i.e. M190 R0
- - if (wants_to_cool) {
- + if (wants_to_cool)
- + {
- // Break after MIN_COOLING_SLOPE_TIME_BED seconds
- // if the temperature did not drop at least MIN_COOLING_SLOPE_DEG_BED
- - if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms)) {
- + if (!next_cool_check_ms || ELAPSED(now, next_cool_check_ms))
- + {
- if (old_temp - temp < MIN_COOLING_SLOPE_DEG_BED) break;
- next_cool_check_ms = now + 1000UL * MIN_COOLING_SLOPE_TIME_BED;
- old_temp = temp;
- @@ -8002,6 +8066,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 +13434,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[2];
- + // 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 +13913,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
- }
- /**
- @@ -13631,20 +13930,22 @@ void setup() {
- * - Call endstop manager
- * - Call LCD update
- */
- -void loop() {
- +void loop()
- +{
- if (commands_in_queue < BUFSIZE) get_available_commands();
- #if ENABLED(SDSUPPORT)
- card.checkautostart(false);
- #endif
- - if (commands_in_queue) {
- -
- + if (commands_in_queue)
- + {
- #if ENABLED(SDSUPPORT)
- -
- - if (card.saving) {
- + if (card.saving)
- + {
- char* command = command_queue[cmd_queue_index_r];
- - if (strstr_P(command, PSTR("M29"))) {
- + if (strstr_P(command, PSTR("M29")))
- + {
- // M29 closes the file
- card.closefile();
- SERIAL_PROTOCOLLNPGM(MSG_FILE_SAVED);
- @@ -13659,7 +13960,8 @@ void loop() {
- ok_to_send();
- }
- - else {
- + else
- + {
- // Write the string from the read buffer to SD
- card.write_command(command);
- if (card.logging)
- @@ -13669,7 +13971,12 @@ void loop() {
- }
- }
- else
- + {
- process_next_command();
- + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE)
- + save_power_off_info();
- + #endif
- + }
- #else
- @@ -13678,9 +13985,13 @@ void loop() {
- #endif // SDSUPPORT
- // The queue may be reset by a command handler or by code invoked by idle() within a handler
- - if (commands_in_queue) {
- + if (commands_in_queue)
- + {
- --commands_in_queue;
- - if (++cmd_queue_index_r >= BUFSIZE) cmd_queue_index_r = 0;
- + if (++cmd_queue_index_r >= BUFSIZE)
- + {
- + cmd_queue_index_r = 0;
- + }
- }
- }
- endstops.report_state();
- diff --git a/Version.h b/Version.h
- index 3039da5..71521bd 100644
- --- a/Version.h
- +++ b/Version.h
- @@ -35,20 +35,20 @@
- /**
- * Marlin release version identifier
- */
- - #define SHORT_BUILD_VERSION "1.1.6"
- + #define SHORT_BUILD_VERSION "Marlin 1.1.6"
- /**
- * 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/cardreader.cpp b/cardreader.cpp
- index 89147d9..5871170 100644
- --- a/cardreader.cpp
- +++ b/cardreader.cpp
- @@ -310,6 +310,64 @@ void CardReader::openLogFile(char* name) {
- openFile(name, false);
- }
- +#if ENABLED(SDSUPPORT) && 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++;
- @@ -860,17 +918,32 @@ void CardReader::updir() {
- #endif // SDCARD_SORT_ALPHA
- -void CardReader::printingHasFinished() {
- +void CardReader::printingHasFinished()
- +{
- stepper.synchronize();
- file.close();
- - if (file_subcall_ctr > 0) { // Heading up to a parent file that called current as a procedure.
- + if (file_subcall_ctr > 0)
- + {
- + // Heading up to a parent file that called current as a procedure.
- file_subcall_ctr--;
- openFile(proc_filenames[file_subcall_ctr], true, true);
- setIndex(filespos[file_subcall_ctr]);
- startFileprint();
- }
- - else {
- + else
- + {
- sdprinting = false;
- + #if ENABLED(SDSUPPORT) && 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/cardreader.h b/cardreader.h
- index 75674a8..d276f12 100644
- --- a/cardreader.h
- +++ b/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(SDSUPPORT) && 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(SDSUPPORT) && 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(SDSUPPORT) && 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[4];
- + 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/configuration_store.cpp b/configuration_store.cpp
- index 4fa9db9..955d54a 100644
- --- a/configuration_store.cpp
- +++ b/configuration_store.cpp
- @@ -545,7 +545,8 @@ void MarlinSettings::postprocess() {
- EEPROM_WRITE(volumetric_enabled);
- // Save filament sizes
- - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
- + for (uint8_t q = 0; q < MAX_EXTRUDERS; q++)
- + {
- if (q < COUNT(filament_size)) dummy = filament_size[q];
- EEPROM_WRITE(dummy);
- }
- @@ -930,7 +931,8 @@ void MarlinSettings::postprocess() {
- EEPROM_READ(volumetric_enabled);
- - for (uint8_t q = 0; q < MAX_EXTRUDERS; q++) {
- + for (uint8_t q = 0; q < MAX_EXTRUDERS; q++)
- + {
- EEPROM_READ(dummy);
- if (q < COUNT(filament_size)) filament_size[q] = dummy;
- }
- diff --git a/dogm_bitmaps.h b/dogm_bitmaps.h
- index 9a77ff7..ff11c54 100644
- --- a/dogm_bitmaps.h
- +++ b/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,14 +80,121 @@
- 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,0x10,
- + 0x08,0x08,0x00,0x00,0x00,0x04,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x08,0x08,
- + 0xF8,0x00,0x00,0x04,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x08,0x08,0x88,0x3F,
- + 0xFE,0x08,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x48,0x7E,0x88,0x00,0x00,0x09,
- + 0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x42,0x48,0x08,0xF8,0x00,0x00,0x11,0x44,0x00,
- + 0x00,0x00,0x00,0x00,0x00,0x81,0x48,0x18,0x88,0x00,0x00,0x3E,0xC4,0x00,0x00,0x00,
- + 0x00,0x00,0x01,0x7C,0x48,0x1C,0xF8,0x00,0x00,0x05,0x7F,0x00,0x00,0x00,0x00,0x00,
- + 0x00,0x44,0x48,0x2A,0x88,0x1F,0xFC,0x08,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x44,
- + 0x48,0x48,0x88,0x00,0x00,0x10,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x48,0x08,
- + 0xF8,0x00,0x00,0x3F,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x54,0x48,0x01,0x00,0x00,
- + 0x00,0x10,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x48,0x08,0x84,0x00,0x00,0x00,
- + 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x41,0x08,0x48,0x92,0x00,0x00,0x07,0x44,0x00,
- + 0x00,0x00,0x00,0x00,0x00,0x41,0x08,0x48,0x12,0x7F,0xFF,0x38,0x7F,0x80,0x00,0x00,
- + 0x00,0x00,0x00,0x3F,0x28,0x87,0xF0,0x00,0x00,0x10,0x40,0x00,0x00,0x00,0x00,0x00,
- + 0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- + 0x00,0x00,0x00,0x3E,0x00,0x00,0x00,0x07,0x01,0x80,0x00,0x00,0x00,0x3C,0x7E,0x00,
- + 0x00,0x42,0x00,0x00,0x00,0x01,0x01,0x80,0x80,0x00,0x00,0x42,0x21,0x00,0x00,0x42,
- + 0x00,0x00,0x00,0x01,0x00,0x00,0x80,0x00,0x00,0x42,0x20,0x80,0x00,0x80,0x00,0x00,
- + 0x00,0x01,0x00,0x00,0x80,0x00,0x00,0x04,0x20,0x80,0x00,0x80,0xEE,0x1E,0x0F,0x01,
- + 0x03,0x83,0xE1,0xDC,0x00,0x18,0x20,0x80,0x00,0x80,0x32,0x21,0x10,0x81,0x00,0x80,
- + 0x80,0x88,0x00,0x04,0x20,0x80,0x00,0x80,0x20,0x3F,0x07,0x81,0x00,0x80,0x80,0x90,
- + 0x00,0x02,0x20,0x80,0x00,0x80,0x20,0x20,0x08,0x81,0x00,0x80,0x80,0x50,0x00,0x02,
- + 0x20,0x80,0x00,0x82,0x20,0x20,0x10,0x81,0x00,0x80,0x80,0x50,0x00,0x42,0x20,0x80,
- + 0x00,0x44,0x20,0x21,0x10,0x81,0x00,0x80,0x90,0x20,0x00,0x42,0x21,0x00,0x00,0x38,
- + 0xF8,0x1E,0x0F,0xC7,0xC3,0xE0,0xE0,0x20,0x00,0x3C,0x7E,0x00,0x00,0x00,0x00,0x00,
- + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- + 0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,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
- #define START_BMPBYTEWIDTH 7
- #define START_BMPBYTES 133 // START_BMPWIDTH * START_BMPHEIGHT / 8
- - const unsigned char start_bmp[START_BMPBYTES] PROGMEM = {
- + const unsigned char start_bmp[START_BMPBYTES] PROGMEM =
- + {
- 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x60, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF,
- 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
- @@ -105,7 +213,9 @@
- 0x8C, 0x30, 0xC7, 0x7C, 0x03, 0x8F, 0x19,
- 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
- 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06,
- - 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8 };
- + 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8
- +
- + };
- #endif
- #endif
- @@ -117,6 +227,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 +277,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-3
- + 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,
- + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2F,0x03,0xD0,
- + 0xF8,0x01,0x80,0x00,0x0C,0x1F,0xE0,0x00,0x00,0x08,0x20,0x80,0x00,0x20,0x30,0x10,
- + 0x48,0x00,0x80,0x00,0x12,0x3F,0xF0,0x00,0x00,0x04,0x10,0x40,0x00,0x20,0x78,0x10,
- + 0x43,0xC3,0x8C,0xD0,0x02,0x3F,0xF0,0x00,0x00,0x04,0x10,0x40,0x00,0x20,0x78,0x10,
- + 0x71,0x24,0x92,0x67,0xCC,0x3F,0xF0,0x00,0x00,0x08,0x20,0x80,0x00,0x20,0x30,0x10,
- + 0x41,0x24,0x9E,0x40,0x02,0x1F,0xE0,0x00,0x00,0x10,0x41,0x00,0x00,0x2F,0x03,0xD0,
- + 0x49,0x24,0x90,0x40,0x12,0x1F,0xE0,0x00,0x00,0x20,0x82,0x00,0x00,0x2F,0x87,0xD0,
- + 0xFB,0xB3,0xCE,0xE0,0x0C,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-3
- + 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,
- + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2C,0x00,0xD0,
- + 0xF8,0x01,0x80,0x00,0x0C,0x1F,0xE0,0x00,0x00,0x10,0x41,0x00,0x00,0x2E,0x31,0xD0,
- + 0x48,0x00,0x80,0x00,0x12,0x3F,0xF0,0x00,0x00,0x08,0x20,0x80,0x00,0x2F,0x7B,0xD0,
- + 0x43,0xC3,0x8C,0xD0,0x02,0x3F,0xF0,0x00,0x00,0x08,0x20,0x80,0x00,0x2F,0x7B,0xD0,
- + 0x71,0x24,0x92,0x67,0xCC,0x3F,0xF0,0x00,0x00,0x10,0x41,0x00,0x00,0x2E,0x31,0xD0,
- + 0x41,0x24,0x9E,0x40,0x02,0x1F,0xE0,0x00,0x00,0x20,0x82,0x00,0x00,0x2C,0x00,0xD0,
- + 0x49,0x24,0x90,0x40,0x12,0x1F,0xE0,0x00,0x00,0x41,0x04,0x00,0x00,0x20,0x30,0x10,
- + 0xFB,0xB3,0xCE,0xE0,0x0C,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/language.h b/language.h
- index 0ff6bad..e68ca79 100644
- --- a/language.h
- +++ b/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/language_cn.h b/language_cn.h
- index f6230a0..f06a477 100644
- --- a/language_cn.h
- +++ b/language_cn.h
- @@ -53,7 +53,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 +61,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 +80,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 +142,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 +163,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/language_en.h b/language_en.h
- index 811b132..17eadef 100644
- --- a/language_en.h
- +++ b/language_en.h
- @@ -564,10 +564,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 +621,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 +870,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/pins_MELZI_CREALITY.h b/pins_MELZI_CREALITY.h
- index 7981e4a..07f7d71 100644
- --- a/pins_MELZI_CREALITY.h
- +++ b/pins_MELZI_CREALITY.h
- @@ -59,6 +59,9 @@
- #define ST7920_DELAY_2 DELAY_2_NOP
- #define ST7920_DELAY_3 DELAY_2_NOP
- +// BLTouch mappings: (Creality 3D)
- +#define SERVO0_PIN 27
- +
- /**
- PIN: 0 Port: B0 E0_DIR_PIN protected
- PIN: 1 Port: B1 E0_STEP_PIN protected
- diff --git a/pins_SANGUINOLOLU_11.h b/pins_SANGUINOLOLU_11.h
- index 0506d78..a14cb78 100644
- --- a/pins_SANGUINOLOLU_11.h
- +++ b/pins_SANGUINOLOLU_11.h
- @@ -170,7 +170,7 @@
- // Pin 27 is taken by LED_PIN, but Melzi LED does nothing with
- // Marlin so this can be used for BEEPER_PIN. You can use this pin
- // with M42 instead of BEEPER_PIN.
- - #define BEEPER_PIN 27
- + #define BEEPER_PIN -1 // 27
- #else // Sanguinololu >=1.3
- #define LCD_PINS_RS 4
- #define LCD_PINS_ENABLE 17
- diff --git a/temperature.cpp b/temperature.cpp
- index e2ea537..9bd2d8c 100644
- --- a/temperature.cpp
- +++ b/temperature.cpp
- @@ -506,22 +506,36 @@ int Temperature::getHeaterPower(int heater) {
- //
- // Temperature Error Handlers
- //
- -void Temperature::_temp_error(const int8_t e, const char * const serial_msg, const char * const lcd_msg) {
- +void Temperature::_temp_error(const int8_t e, const char * const serial_msg, const char * const lcd_msg)
- +{
- static bool killed = false;
- - if (IsRunning()) {
- + if (IsRunning())
- + {
- SERIAL_ERROR_START();
- serialprintPGM(serial_msg);
- SERIAL_ERRORPGM(MSG_STOPPED_HEATER);
- - if (e >= 0) SERIAL_ERRORLN((int)e); else SERIAL_ERRORLNPGM(MSG_HEATER_BED);
- + if (e >= 0)
- + {
- + SERIAL_ERRORLN((int)e);
- + }
- + else
- + {
- + SERIAL_ERRORLNPGM(MSG_HEATER_BED);
- + }
- }
- #if DISABLED(BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE)
- - if (!killed) {
- - Running = false;
- - killed = true;
- - kill(lcd_msg);
- + if (!killed)
- + {
- + // Generate error temperature, close firmware.
- + // Running = false;
- + // killed = true;
- + // Diabale lcd message display
- + // kill(lcd_msg);
- }
- else
- - disable_all_heaters(); // paranoia
- + {
- + disable_all_heaters(); // paranoia prohibits all heating.
- + }
- #endif
- }
- diff --git a/ultralcd.cpp b/ultralcd.cpp
- index 83ce9d2..39000f2 100644
- --- a/ultralcd.cpp
- +++ b/ultralcd.cpp
- @@ -157,14 +157,19 @@ uint16_t max_display_update_time = 0;
- void lcd_control_temperature_preheat_material2_settings_menu();
- void lcd_control_motion_menu();
- void lcd_control_filament_menu();
- + // Add power off cotinue print function.
- + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE)
- + static void lcd_resume_ok_menu();
- + #endif
- #if ENABLED(LCD_INFO_MENU)
- #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)
- @@ -750,8 +755,22 @@ void kill_screen(const char* lcd_msg) {
- #if ENABLED(SDSUPPORT)
- - void lcd_sdcard_pause() {
- + int mytemphot = 0;
- + int mytempbed = 0;
- + float pause_z = 0;
- + void lcd_sdcard_pause()
- + {
- card.pauseSDPrint();
- + 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("G1 F1200 X0 Y0"));
- +
- print_job_timer.pause();
- #if ENABLED(PARK_HEAD_ON_PAUSE)
- enqueue_and_echo_commands_P(PSTR("M125"));
- @@ -759,7 +778,46 @@ void kill_screen(const char* lcd_msg) {
- lcd_setstatusPGM(PSTR(MSG_PRINT_PAUSED), -1);
- }
- - void lcd_sdcard_resume() {
- + 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(SDSUPPORT) && 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
- @@ -769,12 +827,25 @@ void kill_screen(const char* lcd_msg) {
- lcd_reset_status();
- }
- - void lcd_sdcard_stop() {
- + void lcd_sdcard_stop()
- + {
- card.stopSDPrint();
- clear_command_queue();
- 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,8 +854,39 @@ void kill_screen(const char* lcd_msg) {
- lcd_return_to_status();
- }
- + static void lcd_sdcard_resume_return()
- + {
- + lcd_sdcard_resume();
- + lcd_return_to_status();
- + }
- +
- + static void lcd_sdcard_stop_return()
- + {
- + lcd_sdcard_stop();
- + lcd_return_to_status();
- + }
- +
- + static void msg_resume_print_ok_title()
- + {
- + return;
- + }
- +
- #endif // SDSUPPORT
- + /**
- + * "Resume yes or no" menu
- + */
- + #if ENABLED(SDSUPPORT) && ENABLED(POWEROFF_SAVE_SD_FILE)
- + static void lcd_resume_ok_menu()
- + {
- + START_MENU();
- + MENU_ITEM(function, MSG_POWER_LOSS_RECOVERY, msg_resume_print_ok_title);
- + MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume_return);
- + MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop_return);
- + END_MENU();
- + }
- + #endif
- +
- #if ENABLED(MENU_ITEM_CASE_LIGHT)
- extern uint8_t case_light_brightness;
- @@ -929,7 +1031,8 @@ void kill_screen(const char* lcd_msg) {
- *
- */
- - void lcd_main_menu() {
- + void lcd_main_menu()
- + {
- START_MENU();
- MENU_BACK(MSG_WATCH);
- @@ -948,38 +1051,71 @@ void kill_screen(const char* lcd_msg) {
- // Set Case light on/off/brightness
- //
- #if ENABLED(MENU_ITEM_CASE_LIGHT)
- - if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) {
- + if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN))
- + {
- 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) {
- + if (planner.movesplanned() || IS_SD_PRINTING)
- + {
- MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu);
- }
- - else {
- + else
- + {
- MENU_ITEM(submenu, MSG_PREPARE, lcd_prepare_menu);
- }
- MENU_ITEM(submenu, MSG_CONTROL, lcd_control_menu);
- #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 (card.cardOK)
- + {
- + if (card.isFileOpen())
- + {
- + #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 {
- + else
- + {
- MENU_ITEM(submenu, MSG_CARD_MENU, lcd_sdcard_menu);
- #if !PIN_EXISTS(SD_DETECT)
- MENU_ITEM(gcode, MSG_CNG_SDCARD, PSTR("M21")); // SD-card changed by user
- #endif
- }
- }
- - else {
- + else
- + {
- MENU_ITEM(submenu, MSG_NO_CARD, lcd_sdcard_menu);
- #if !PIN_EXISTS(SD_DETECT)
- MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface
- @@ -988,7 +1124,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 +2637,15 @@ 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();
- +}
- +
- /**
- *
- * "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"));
- @@ -2602,11 +2748,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 +3280,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(submenu, MSG_INIT_EEPROM, lcd_init_eeprom);
- #endif
- END_MENU();
- @@ -3283,6 +3431,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 +3489,7 @@ void kill_screen(const char* lcd_msg) {
- #endif // !PID_PARAMS_PER_HOTEND || HOTENDS == 1
- #endif // PIDTEMP
- -
- +*/
- //
- // Preheat Material 1 conf
- //
- @@ -3850,11 +3999,15 @@ void kill_screen(const char* lcd_msg) {
- if (lcd_clicked) { return lcd_goto_previous_menu(); }
- START_SCREEN();
- STATIC_ITEM(MSG_MARLIN, 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-3
- + STATIC_ITEM(WEBSITE_URL, true); // www.cxsw3d.com
- + 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 +4019,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 +4645,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
- @@ -4498,34 +4659,51 @@ void lcd_update() {
- #endif
- // 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 (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
- }
- }
- - else wait_for_unclick = false;
- + else
- + {
- + wait_for_unclick = false;
- + }
- #endif
- #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
- const bool sd_status = IS_SD_INSERTED;
- - if (sd_status != lcd_sd_status && lcd_detected()) {
- -
- - if (sd_status) {
- + if (sd_status != lcd_sd_status && lcd_detected())
- + {
- + if (sd_status)
- + {
- card.initsd();
- - if (lcd_sd_status != 2) LCD_MESSAGEPGM(MSG_SD_INSERTED);
- + 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();
- - if (lcd_sd_status != 2) LCD_MESSAGEPGM(MSG_SD_REMOVED);
- + if (lcd_sd_status != 2)
- + {
- + LCD_MESSAGEPGM(MSG_SD_REMOVED);
- + }
- }
- lcd_sd_status = sd_status;
- lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW;
- - lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
- + // to maybe revive the LCD if static electricity killed it.
- + lcd_implementation_init(
- #if ENABLED(LCD_PROGRESS_BAR)
- currentScreen == lcd_status_screen
- #endif
- @@ -4556,7 +4734,9 @@ void lcd_update() {
- #if ENABLED(ADC_KEYPAD)
- if (handle_adc_keypad())
- + {
- return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
- + }
- #elif ENABLED(REPRAPWORLD_KEYPAD)
- @@ -4565,22 +4745,32 @@ void lcd_update() {
- #endif
- bool encoderPastThreshold = (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP);
- - if (encoderPastThreshold || lcd_clicked) {
- - if (encoderPastThreshold) {
- + if (encoderPastThreshold || lcd_clicked)
- + {
- + if (encoderPastThreshold)
- + {
- int32_t encoderMultiplier = 1;
- #if ENABLED(ENCODER_RATE_MULTIPLIER)
- - if (encoderRateMultiplierEnabled) {
- + if (encoderRateMultiplierEnabled)
- + {
- int32_t encoderMovementSteps = abs(encoderDiff) / ENCODER_PULSES_PER_STEP;
- - if (lastEncoderMovementMillis) {
- + if (lastEncoderMovementMillis)
- + {
- // Note that the rate is always calculated between two passes through the
- // loop and that the abs of the encoderDiff value is tracked.
- float encoderStepRate = float(encoderMovementSteps) / float(ms - lastEncoderMovementMillis) * 1000.0;
- - if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100;
- - else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10;
- + if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC)
- + {
- + encoderMultiplier = 100;
- + }
- + else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC)
- + {
- + encoderMultiplier = 10;
- + }
- #if ENABLED(ENCODER_RATE_MULTIPLIER_DEBUG)
- SERIAL_ECHO_START();
- @@ -4612,7 +4802,8 @@ void lcd_update() {
- currentScreen == lcd_status_screen &&
- #endif
- !lcd_status_update_delay--
- - ) {
- + )
- + {
- lcd_status_update_delay = 9
- #if ENABLED(DOGLCD)
- + 3
- @@ -4635,7 +4826,8 @@ void lcd_update() {
- if (!drawing_screen)
- #endif
- {
- - switch (lcdDrawUpdate) {
- + switch (lcdDrawUpdate)
- + {
- case LCDVIEW_CALL_NO_REDRAW:
- lcdDrawUpdate = LCDVIEW_NONE;
- break;
- @@ -4659,14 +4851,16 @@ void lcd_update() {
- #endif
- #if ENABLED(DOGLCD) // Changes due to different driver architecture of the DOGM display
- - if (!drawing_screen) {
- + if (!drawing_screen)
- + {
- u8g.firstPage();
- drawing_screen = 1;
- }
- lcd_setFont(FONT_MENU);
- u8g.setColorIndex(1);
- CURRENTSCREEN();
- - if (drawing_screen && (drawing_screen = u8g.nextPage())) {
- + if (drawing_screen && (drawing_screen = u8g.nextPage()))
- + {
- NOLESS(max_display_update_time, millis() - ms);
- return;
- }
- @@ -4680,9 +4874,13 @@ void lcd_update() {
- // Return to Status Screen after a timeout
- if (currentScreen == lcd_status_screen || defer_return_to_status)
- + {
- return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
- + }
- else if (ELAPSED(ms, return_to_status_ms))
- + {
- lcd_return_to_status();
- + }
- #endif // ULTIPANEL
- @@ -4690,7 +4888,8 @@ void lcd_update() {
- if (!drawing_screen)
- #endif
- {
- - switch (lcdDrawUpdate) {
- + switch (lcdDrawUpdate)
- + {
- case LCDVIEW_CLEAR_CALL_REDRAW:
- lcd_implementation_clear();
- case LCDVIEW_CALL_REDRAW_NEXT:
- diff --git a/ultralcd_impl_DOGM.h b/ultralcd_impl_DOGM.h
- index 6f75143..e0911fc 100644
- --- a/ultralcd_impl_DOGM.h
- +++ b/ultralcd_impl_DOGM.h
- @@ -291,11 +291,12 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
- #endif // SHOW_CUSTOM_BOOTSCREEN
- - void lcd_bootscreen() {
- -
- + void lcd_bootscreen()
- + {
- static bool show_bootscreen = true;
- - if (show_bootscreen) {
- + if (show_bootscreen)
- + {
- show_bootscreen = false;
- #if ENABLED(START_BMPHIGH)
- @@ -304,15 +305,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);
- @@ -325,8 +326,8 @@ void lcd_printPGM_utf(const char *str, uint8_t n=LCD_WIDTH) {
- #endif // SHOW_BOOTSCREEN
- // Initialize or re-initialize the LCD
- -static void lcd_implementation_init() {
- -
- +static void lcd_implementation_init()
- +{
- #if PIN_EXISTS(LCD_BACKLIGHT) // Enable LCD backlight
- OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH);
- #endif
- @@ -478,9 +479,10 @@ inline void lcd_implementation_status_message(const bool blink) {
- #endif
- }
- -//#define DOGM_SD_PERCENT
- +// #define DOGM_SD_PERCENT
- -static void lcd_implementation_status_screen() {
- +static void lcd_implementation_status_screen()
- +{
- const bool blink = lcd_blink();
- @@ -491,9 +493,10 @@ static void lcd_implementation_status_screen() {
- // Fan Animation
- //
- - if (PAGE_UNDER(STATUS_SCREENHEIGHT + 1)) {
- -
- - u8g.drawBitmapP(9, 1, STATUS_SCREENBYTEWIDTH, STATUS_SCREENHEIGHT,
- + if (PAGE_UNDER(STATUS_SCREENHEIGHT + 1))
- + {
- + // 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
- @@ -507,20 +510,24 @@ static void lcd_implementation_status_screen() {
- // Temperature Graphics and Info
- //
- - if (PAGE_UNDER(28)) {
- + 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
- - if (PAGE_CONTAINS(20, 27)) {
- + if (PAGE_CONTAINS(20, 27))
- + {
- // Fan
- const int16_t per = ((fanSpeeds[0] + 1) * 100) / 256;
- - if (per) {
- + if (per)
- + {
- u8g.setPrintPos(104, 27);
- lcd_print(itostr3(per));
- u8g.print('%');
- @@ -535,7 +542,8 @@ static void lcd_implementation_status_screen() {
- // SD Card Symbol
- //
- - if (PAGE_CONTAINS(42 - (TALL_FONT_CORRECTION), 51 - (TALL_FONT_CORRECTION))) {
- + if (PAGE_CONTAINS(42 - (TALL_FONT_CORRECTION), 51 - (TALL_FONT_CORRECTION)))
- + {
- // Upper box
- u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7); // 42-48 (or 41-47)
- // Right edge
- @@ -556,7 +564,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 +576,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)
- );
- //
- @@ -595,14 +603,31 @@ static void lcd_implementation_status_screen() {
- #define SD_DURATION_X (LCD_PIXEL_WIDTH - len * DOG_CHAR_WIDTH)
- #endif
- - if (PAGE_CONTAINS(41, 48)) {
- + if (PAGE_CONTAINS(41, 48))
- + {
- char buffer[10];
- 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
- @@ -641,7 +666,8 @@ static void lcd_implementation_status_screen() {
- #endif
- // At the first page, regenerate the XYZ strings
- - if (page.page == 0) {
- + if (page.page == 0)
- + {
- strcpy(xstring, ftostr4sign(current_position[X_AXIS]));
- strcpy(ystring, ftostr4sign(current_position[Y_AXIS]));
- strcpy(zstring, ftostr52sp(FIXFLOAT(current_position[Z_AXIS])));
- @@ -690,7 +716,8 @@ static void lcd_implementation_status_screen() {
- // Feedrate
- //
- - if (PAGE_CONTAINS(51 - INFO_FONT_HEIGHT, 49)) {
- + if (PAGE_CONTAINS(51 - INFO_FONT_HEIGHT, 49))
- + {
- lcd_setFont(FONT_MENU);
- u8g.setPrintPos(3, 50);
- lcd_print(LCD_STR_FEEDRATE[0]);
- @@ -723,14 +750,18 @@ static void lcd_implementation_status_screen() {
- #define STATUS_BASELINE (55 + INFO_FONT_HEIGHT)
- - if (PAGE_CONTAINS(STATUS_BASELINE - (INFO_FONT_HEIGHT - 1), STATUS_BASELINE)) {
- + if (PAGE_CONTAINS(STATUS_BASELINE - (INFO_FONT_HEIGHT - 1), STATUS_BASELINE))
- + {
- 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 {
- + else
- + {
- lcd_printPGM(PSTR(LCD_STR_FILAM_DIA));
- u8g.print(':');
- lcd_print(ftostr12ns(filament_width_meas));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement