diff --git a/.travis.yml b/.travis.yml index 9bbc420d53..25a0c51423 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,9 +29,8 @@ before_install: # # Publish the buildroot script folder - chmod +x ${TRAVIS_BUILD_DIR}/buildroot/bin/* - - export PATH=${TRAVIS_BUILD_DIR}/buildroot/bin/:${PATH} - chmod +x ${TRAVIS_BUILD_DIR}/buildroot/share/tests/* - - export PATH=${TRAVIS_BUILD_DIR}/buildroot/share/tests/:${PATH} + - export PATH=${TRAVIS_BUILD_DIR}/buildroot/bin/:${TRAVIS_BUILD_DIR}/buildroot/share/tests/:${PATH} install: #- pip install -U platformio diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ca7d36d66e..a6d6c1f8a6 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -26,8 +26,8 @@ //#define X_2208 //#define X_Spreadcycle -#define Y_2208 // Highly recommended as large prints with high mass can cause layer shifts with stealthchop at high speed -#define Y_Spreadcycle +//#define Y_2208 // Highly recommended as large prints with high mass can cause layer shifts with stealthchop at high speed +//#define Y_Spreadcycle //#define Z_2208 // NOT Recommended! Dual stepper current draw is above the recommended limit for this driver //#define Y_Spreadcycle //#define E_2208 // Not Recommended! Stealthchop mode faults with linear advance @@ -40,7 +40,7 @@ /* * Enables a filament sensor plugged into the laser pin. Disables the laser */ -#define FilamentSensor // Standard older TM3D runout sensor +//#define FilamentSensor // Standard older TM3D runout sensor //#define lerdgeFilSensor // Newer inverted logic TM3D Runout Sensor @@ -176,7 +176,11 @@ // Optional custom name for your RepStrap or other custom machine // Displayed in the LCD "Ready" message -#define CUSTOM_MACHINE_NAME "TM3D T-REX 2+" +#if ENABLED(TREX3) + #define CUSTOM_MACHINE_NAME "TM3D T-REX 3" +#else + #define CUSTOM_MACHINE_NAME "TM3D T-REX 2+" +#endif // 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) @@ -278,6 +282,11 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. + #if ENABLED(TREX3) + #define HOTEND_OFFSET_X {0.0, 438.5} // (mm) relative X-offset for each nozzle + #else + #define HOTEND_OFFSET_X {0.0, 442.0} // (mm) relative X-offset for each nozzle + #endif //#define HOTEND_OFFSET_X {0.0, 20.00} // (mm) relative X-offset for each nozzle //#define HOTEND_OFFSET_Y {0.0, 5.00} // (mm) relative Y-offset for each nozzle //#define HOTEND_OFFSET_Z {0.0, 0.00} // (mm) relative Z-offset for each nozzle @@ -702,19 +711,31 @@ */ - #if(ENABLED(Y_2208)) -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 1600, 93 } +#if(ENABLED(Y_2208)) + #define Y_STEPSMM 80 #else -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 160, 1600, 93 } + #define Y_STEPSMM 160 #endif +#if(ENABLED(Z_2208)) + #define Z_STEPSMM 800 +#else + #define Z_STEPSMM 1600 +#endif + +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, Y_STEPSMM, Z_STEPSMM, 93 } /** * Default Max Feed Rate (mm/s) * Override with M203 * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] */ -#define DEFAULT_MAX_FEEDRATE { 250, 150, 5, 25 } +#if ENABLED(Y_2208) && DISABLED(Y_Spreadcycle) + #define Y_MAXFEED 100 +#else + #define Y_MAXFEED 150 +#endif +#define DEFAULT_MAX_FEEDRATE { 250, Y_MAXFEED, 5, 25 } /** * Default Max Acceleration (change/s) change = mm/s @@ -861,12 +882,18 @@ * O-- FRONT --+ * (0,0) */ -#define X_PROBE_OFFSET_FROM_EXTRUDER -7 // X offset: -left +right [of the nozzle] -#define Y_PROBE_OFFSET_FROM_EXTRUDER 29 // Y offset: -front +behind [the nozzle] -#define Z_PROBE_OFFSET_FROM_EXTRUDER -1.5 // Z offset: -below +above [the nozzle] +#if ENABLED(TREX3) + #define X_PROBE_OFFSET_FROM_EXTRUDER -3 // X offset: -left +right [of the nozzle] + #define Y_PROBE_OFFSET_FROM_EXTRUDER 31 // Y offset: -front +behind [the nozzle] + #define Z_PROBE_OFFSET_FROM_EXTRUDER -1.25 // Z offset: -below +above [the nozzle] +#else + #define X_PROBE_OFFSET_FROM_EXTRUDER -7 // X offset: -left +right [of the nozzle] + #define Y_PROBE_OFFSET_FROM_EXTRUDER 29 // Y offset: -front +behind [the nozzle] + #define Z_PROBE_OFFSET_FROM_EXTRUDER -1.5 // Z offset: -below +above [the nozzle] +#endif // Certain types of probes need to stay away from edges -#define MIN_PROBE_EDGE 10 +#define MIN_PROBE_EDGE 3 // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 8000 @@ -899,7 +926,7 @@ #define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points #define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done +#define Z_AFTER_PROBING 5 // Z position after probing is done #define Z_PROBE_LOW_POINT -3 // Farthest distance below the trigger-point to go before stopping @@ -952,12 +979,12 @@ // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. -#if(ENABLED(X_2208)) +#if ENABLED(X_2208) #define INVERT_X_DIR true #else #define INVERT_X_DIR false #endif -#if(ENABLED(Y_2208)) +#if ENABLED(Y_2208) #define INVERT_Y_DIR true #else #define INVERT_Y_DIR false @@ -1052,7 +1079,7 @@ * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. * By default the firmware assumes HIGH=FILAMENT PRESENT. */ - #if(ENABLED(FilamentSensor)) + #if ENABLED(FilamentSensor) #define FILAMENT_RUNOUT_SENSOR #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) @@ -1061,14 +1088,16 @@ #else #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. #endif - #if ENABLED(lerdgeFilSensor) + #if ENABLED(lerdgeFilSensor) || ENABLED(TREX3) #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. #else #define FIL_RUNOUT_INVERTING true // set to true to invert the logic of the sensor. #endif #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. - #define FIL_RUNOUT_PIN 4 + #if DISABLED(TREX3) + #define FIL_RUNOUT_PIN 4 + #endif #define FILAMENT_RUNOUT_SCRIPT "M600" // After a runout is detected, continue printing this length of filament @@ -1150,8 +1179,8 @@ // For Cartesian machines, instead of dividing moves on mesh boundaries, // split up moves into short segments like a Delta. This follows the // contours of the bed more closely than edge-to-edge straight moves. - #define SEGMENT_LEVELED_MOVES - #define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one) + //#define SEGMENT_LEVELED_MOVES + //#define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one) /** * Enable the G26 Mesh Validation Pattern tool. @@ -1207,7 +1236,7 @@ #define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_INSET 30 // Set Mesh bounds as an inset region of the bed + #define MESH_INSET 5 // Set Mesh bounds as an inset region of the bed #define GRID_MAX_POINTS_X 15 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X @@ -1236,12 +1265,12 @@ * Override if the automatically selected points are inadequate. */ #if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) - #define PROBE_PT_1_X 30 + #define PROBE_PT_1_X 40 #define PROBE_PT_1_Y 365 - #define PROBE_PT_2_X 30 - #define PROBE_PT_2_Y 30 + #define PROBE_PT_2_X 40 + #define PROBE_PT_2_Y 40 #define PROBE_PT_3_X 365 - #define PROBE_PT_3_Y 30 + #define PROBE_PT_3_Y 40 #endif /** diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 3572397090..5a72a2f960 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -220,7 +220,7 @@ * Define one or both of these to override the default 0-255 range. */ #define FAN_MIN_PWM 64 -//#define FAN_MAX_PWM 128 +//#define FAN_MAX_PWM 255 // @section extruder @@ -236,8 +236,14 @@ * Multiple extruders can be assigned to the same pin in which case * the fan will turn on when any selected extruder is above the threshold. */ -#define E0_AUTO_FAN_PIN -1 -#define E1_AUTO_FAN_PIN -1 +#if ENABLED(TREX3) + #define E0_AUTO_FAN_PIN 6 + #define E1_AUTO_FAN_PIN 45 +#else + #define E0_AUTO_FAN_PIN -1 + #define E1_AUTO_FAN_PIN -1 +#endif + #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 #define E4_AUTO_FAN_PIN -1 @@ -245,7 +251,6 @@ #define CHAMBER_AUTO_FAN_PIN -1 #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 #define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed - /** * Part-Cooling Fan Multiplexer * @@ -262,7 +267,9 @@ */ #define CASE_LIGHT_ENABLE #if ENABLED(CASE_LIGHT_ENABLE) - #define CASE_LIGHT_PIN 8 + #if DISABLED(TREX3) + #define CASE_LIGHT_PIN 8 + #endif #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 255 // Set default power-up brightness (0-255, requires PWM pin) @@ -364,7 +371,12 @@ #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage #define X2_MIN_POS 0 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage - #define X2_MAX_POS 442 // set maximum to the distance between toolheads when both heads are homed + // set maximum to the distance between toolheads when both heads are homed + #if ENABLED(TREX3) + #define X2_MAX_POS 438.5 + #else + #define X2_MAX_POS 442 + #endif #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software @@ -485,7 +497,7 @@ // // Use Junction Deviation instead of traditional Jerk Limiting // -//#define JUNCTION_DEVIATION +#define JUNCTION_DEVIATION #if ENABLED(JUNCTION_DEVIATION) #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge #endif @@ -575,10 +587,10 @@ #define LCD_INFO_MENU // Scroll a longer status message into view -//#define STATUS_MESSAGE_SCROLLING +#define STATUS_MESSAGE_SCROLLING // On the Info Screen, display XY with one decimal place when possible -//#define LCD_DECIMAL_SMALL_XY +#define LCD_DECIMAL_SMALL_XY // The timeout (in ms) to return to the status screen from sub-menus #define LCD_TIMEOUT_TO_STATUS 15000 @@ -883,10 +895,29 @@ #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) // Override the mesh area if the automatic (max) area is too large - //#define MESH_MIN_X MESH_INSET - //#define MESH_MIN_Y MESH_INSET - //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) - //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) + #if( (X_PROBE_OFFSET_FROM_EXTRUDER + 10) > 0 ) + #define MESH_MIN_X (X_PROBE_OFFSET_FROM_EXTRUDER + 5) + #else + #define MESH_MIN_X 10 + #endif + + #if( (X_BED_SIZE + X_PROBE_OFFSET_FROM_EXTRUDER - 10) < X_BED_SIZE) + #define MESH_MAX_X (X_BED_SIZE + X_PROBE_OFFSET_FROM_EXTRUDER - 5) + #else + #define MESH_MAX_X (X_BED_SIZE - 10) + #endif + + #if ( (Y_PROBE_OFFSET_FROM_EXTRUDER + 10) > 5 ) + #define MESH_MIN_Y (Y_PROBE_OFFSET_FROM_EXTRUDER + 10) + #else + #define MESH_MIN_Y 25 + #endif + + #if( (Y_BED_SIZE + Y_PROBE_OFFSET_FROM_EXTRUDER - 10) < Y_BED_SIZE) + #define MESH_MAX_Y (Y_BED_SIZE + Y_PROBE_OFFSET_FROM_EXTRUDER - 10) + #else + #define MESH_MAX_Y (Y_BED_SIZE - 10) + #endif #endif /** @@ -918,7 +949,7 @@ // // G2/G3 Arc Support // -//#define ARC_SUPPORT // Disable this feature to save ~3226 bytes +#define ARC_SUPPORT // Disable this feature to save ~3226 bytes #if ENABLED(ARC_SUPPORT) #define MM_PER_ARC_SEGMENT 1 // Length of each arc segment #define N_ARC_CORRECTION 25 // Number of intertpolated segments between corrections @@ -927,7 +958,7 @@ #endif // Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. -//#define BEZIER_CURVE_SUPPORT +#define BEZIER_CURVE_SUPPORT // G38.2 and G38.3 Probe Target // Set MULTIPLE_PROBING if you want G38 to double touch @@ -1162,7 +1193,7 @@ // Filament Unload does a Retract, Delay, and Purge first: #define FILAMENT_UNLOAD_RETRACT_LENGTH 4 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. + #define FILAMENT_UNLOAD_DELAY 2000 // (ms) Delay for the filament to cool after retract. #define FILAMENT_UNLOAD_PURGE_LENGTH 0 // (mm) An unretract is done, then this length is purged. #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. #define FILAMENT_CHANGE_ALERT_BEEPS 1 // Number of alert beeps to play when a response is needed. @@ -1550,17 +1581,19 @@ * * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. */ -//#define SPINDLE_LASER_ENABLE +#if ENABLED(TREX3) + #define SPINDLE_LASER_ENABLE +#endif #if ENABLED(SPINDLE_LASER_ENABLE) - #define SPINDLE_LASER_ENABLE_INVERT false // set to "true" if the on/off function is reversed - #define SPINDLE_LASER_PWM true // set to true if your controller supports setting the speed/power + #define SPINDLE_LASER_ENABLE_INVERT true // set to "true" if the on/off function is reversed + #define SPINDLE_LASER_PWM false // set to true if your controller supports setting the speed/power #define SPINDLE_LASER_PWM_INVERT true // set to "true" if the speed/power goes up when you want it to go slower - #define SPINDLE_LASER_POWERUP_DELAY 5000 // delay in milliseconds to allow the spindle/laser to come up to speed/power - #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // delay in milliseconds to allow the spindle to stop - #define SPINDLE_DIR_CHANGE true // set to true if your spindle controller supports changing spindle direction + #define SPINDLE_LASER_POWERUP_DELAY 1 // delay in milliseconds to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 1 // delay in milliseconds to allow the spindle to stop + #define SPINDLE_DIR_CHANGE false // set to true if your spindle controller supports changing spindle direction #define SPINDLE_INVERT_DIR false - #define SPINDLE_STOP_ON_DIR_CHANGE true // set to true if Marlin should stop the spindle before changing rotation direction + #define SPINDLE_STOP_ON_DIR_CHANGE false // set to true if Marlin should stop the spindle before changing rotation direction /** * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power @@ -1582,7 +1615,7 @@ //#define SPEED_POWER_MAX 100 // 0-100% #endif -#if(DISABLED(FilamentSensor)) +#if DISABLED(FilamentSensor) && DISABLED(TREX3) #define FAN_AS_LASER #endif #if ENABLED(FAN_AS_LASER) @@ -1635,7 +1668,7 @@ /** * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins */ -//#define PINS_DEBUGGING +#define PINS_DEBUGGING /** * Auto-report temperatures with M155 S @@ -1723,10 +1756,10 @@ #define USER_SCRIPT_AUDIBLE_FEEDBACK #define USER_SCRIPT_RETURN // Return to status screen after a script - #define USER_DESC_1 "UBL Commission Step 1" + #define USER_DESC_1 "UBL Commission 1" #define USER_GCODE_1 "M502 \n M500 \n M501 \n T0 \n M190 S75 \n M106 S128 \n M104 S225 \n G28 \n G29 P1 \n G29 S1 \n M117 Run Step 2 \n" - #define USER_DESC_2 "UBL Commission Step 2" + #define USER_DESC_2 "UBL Commission 2" #define USER_GCODE_2 "G29 S1 \n G29 S0 \n G29 F 10.0 \n G29 A \n M500 \n G28 \n G29 L1 \n T0 \n M106 S128 \n M109 S225 \n G1 X150 Y 150 \n G1 Z0 \n M117 Set Z Offset \n" #define USER_DESC_3 "Prep for Z Adjust" diff --git a/Marlin/Makefile b/Marlin/Makefile index da3897e807..864ee949d1 100644 --- a/Marlin/Makefile +++ b/Marlin/Makefile @@ -89,8 +89,8 @@ WIRE ?= 0 # this defines if U8GLIB is needed (may require RELOC_WORKAROUND) U8GLIB ?= 1 -# this defines whether to include the Trinamic TMC2630Stepper -TMC2630 ?= 1 +# this defines whether to include the Trinamic TMCStepper library +TMC ?= 1 ############ # Try to automatically determine whether RELOC_WORKAROUND is needed based @@ -103,7 +103,7 @@ CC_PATCHLEVEL:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_PATCHLEVEL__ | c CC_VER:=$(shell echo $$(( $(CC_MAJ) * 10000 + $(CC_MIN) * 100 + $(CC_PATCHLEVEL) ))) ifeq ($(shell test $(CC_VER) -lt 40901 && echo 1),1) @echo This version of GCC is likely broken. Enabling relocation workaround. - RELOC_WORKAROUND = 1 + RELOC_WORKAROUND = 1 endif ############################################################################ @@ -195,7 +195,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),49) else ifeq ($(HARDWARE_MOTHERBOARD),7) # Ultimaker (Older electronics. Pre 1.5.4. This is rare) else ifeq ($(HARDWARE_MOTHERBOARD),71) -MCU ?= atmega1280 + MCU ?= atmega1280 # Azteeg X3 else ifeq ($(HARDWARE_MOTHERBOARD),67) # Azteeg X3 Pro @@ -204,6 +204,16 @@ else ifeq ($(HARDWARE_MOTHERBOARD),68) else ifeq ($(HARDWARE_MOTHERBOARD),72) # Rumba else ifeq ($(HARDWARE_MOTHERBOARD),80) +# Raise3D Rumba +else ifeq ($(HARDWARE_MOTHERBOARD),333) +# Formbot T-Rex 2 Plus +else ifeq ($(HARDWARE_MOTHERBOARD),95) +# Formbot T-Rex 3 +else ifeq ($(HARDWARE_MOTHERBOARD),96) +# Formbot Raptor +else ifeq ($(HARDWARE_MOTHERBOARD),97) +# Formbot Raptor 2 +else ifeq ($(HARDWARE_MOTHERBOARD),98) # bq ZUM Mega 3D else ifeq ($(HARDWARE_MOTHERBOARD),503) # MakeBoard Mini v2.1.2 is a control board sold by MicroMake @@ -214,6 +224,10 @@ else ifeq ($(HARDWARE_MOTHERBOARD),343) else ifeq ($(HARDWARE_MOTHERBOARD),443) # Creality: Ender-4, CR-8 else ifeq ($(HARDWARE_MOTHERBOARD),243) +# Creality: CR10S, CR20, CR-X +else ifeq ($(HARDWARE_MOTHERBOARD),244) +# Fysetc F6 +else ifeq ($(HARDWARE_MOTHERBOARD),541) # # Other ATmega1280, ATmega2560 @@ -265,9 +279,9 @@ else ifeq ($(HARDWARE_MOTHERBOARD),75) # else ifeq ($(HARDWARE_MOTHERBOARD),702) -MCU ?= atmega1281 + MCU ?= atmega1281 else ifeq ($(HARDWARE_MOTHERBOARD),25) -MCU ?= atmega1281 + MCU ?= atmega1281 # # Sanguinololu and Derivatives - ATmega644P, ATmega1284P @@ -275,44 +289,44 @@ MCU ?= atmega1281 # Sanguinololu < 1.2 else ifeq ($(HARDWARE_MOTHERBOARD),6) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega644p # Sanguinololu 1.2 and above else ifeq ($(HARDWARE_MOTHERBOARD),62) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega644p # Melzi else ifeq ($(HARDWARE_MOTHERBOARD),63) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega644p # Melzi with ATmega1284 (MaKr3d version) else ifeq ($(HARDWARE_MOTHERBOARD),66) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega1284p # Melzi Creality3D board (for CR-10 etc) else ifeq ($(HARDWARE_MOTHERBOARD),89) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega1284p # Melzi Malyan M150 board else ifeq ($(HARDWARE_MOTHERBOARD),92) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega1284p # Tronxy X5S else ifeq ($(HARDWARE_MOTHERBOARD),505) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega1284p # STB V1.1 else ifeq ($(HARDWARE_MOTHERBOARD),64) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega1284p # Azteeg X1 else ifeq ($(HARDWARE_MOTHERBOARD),65) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega1284p # Anet 1.0 (Melzi clone) else ifeq ($(HARDWARE_MOTHERBOARD),69) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega1284p + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega1284p # # Other ATmega644P, ATmega644, ATmega1284P @@ -320,52 +334,52 @@ MCU ?= atmega1284p # Gen3 Monolithic Electronics else ifeq ($(HARDWARE_MOTHERBOARD),22) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega644p # Gen3+ else ifeq ($(HARDWARE_MOTHERBOARD),9) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega644p # Gen6 else ifeq ($(HARDWARE_MOTHERBOARD),5) -HARDWARE_VARIANT ?= Gen6 -MCU ?= atmega644p + HARDWARE_VARIANT ?= Gen6 + MCU ?= atmega644p # Gen6 deluxe else ifeq ($(HARDWARE_MOTHERBOARD),51) -HARDWARE_VARIANT ?= Gen6 -MCU ?= atmega644p + HARDWARE_VARIANT ?= Gen6 + MCU ?= atmega644p # Gen7 custom (Alfons3 Version) else ifeq ($(HARDWARE_MOTHERBOARD),10) -HARDWARE_VARIANT ?= Gen7 -MCU ?= atmega644 -F_CPU ?= 20000000 + HARDWARE_VARIANT ?= Gen7 + MCU ?= atmega644 + F_CPU ?= 20000000 # Gen7 v1.1, v1.2 else ifeq ($(HARDWARE_MOTHERBOARD),11) -HARDWARE_VARIANT ?= Gen7 -MCU ?= atmega644p -F_CPU ?= 20000000 + HARDWARE_VARIANT ?= Gen7 + MCU ?= atmega644p + F_CPU ?= 20000000 # Gen7 v1.3 else ifeq ($(HARDWARE_MOTHERBOARD),12) -HARDWARE_VARIANT ?= Gen7 -MCU ?= atmega644p -F_CPU ?= 20000000 + HARDWARE_VARIANT ?= Gen7 + MCU ?= atmega644p + F_CPU ?= 20000000 # Gen7 v1.4 else ifeq ($(HARDWARE_MOTHERBOARD),13) -HARDWARE_VARIANT ?= Gen7 -MCU ?= atmega1284p -F_CPU ?= 20000000 + HARDWARE_VARIANT ?= Gen7 + MCU ?= atmega1284p + F_CPU ?= 20000000 # Alpha OMCA board else ifeq ($(HARDWARE_MOTHERBOARD),90) -HARDWARE_VARIANT ?= SanguinoA -MCU ?= atmega644 + HARDWARE_VARIANT ?= SanguinoA + MCU ?= atmega644 # Final OMCA board else ifeq ($(HARDWARE_MOTHERBOARD),91) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega644p # Sethi 3D_1 else ifeq ($(HARDWARE_MOTHERBOARD),20) -HARDWARE_VARIANT ?= Sanguino -MCU ?= atmega644p + HARDWARE_VARIANT ?= Sanguino + MCU ?= atmega644p # # Teensyduino - AT90USB1286, AT90USB1286P @@ -373,37 +387,49 @@ MCU ?= atmega644p # Teensylu else ifeq ($(HARDWARE_MOTHERBOARD),8) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 + HARDWARE_VARIANT ?= Teensy + MCU ?= at90usb1286 # Printrboard (AT90USB1286) else ifeq ($(HARDWARE_MOTHERBOARD),81) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 + HARDWARE_VARIANT ?= Teensy + MCU ?= at90usb1286 # Printrboard Revision F (AT90USB1286) else ifeq ($(HARDWARE_MOTHERBOARD),811) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 + HARDWARE_VARIANT ?= Teensy + MCU ?= at90usb1286 # Brainwave (AT90USB646) else ifeq ($(HARDWARE_MOTHERBOARD),82) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb646 + HARDWARE_VARIANT ?= Teensy + MCU ?= at90usb646 # Brainwave Pro (AT90USB1286) else ifeq ($(HARDWARE_MOTHERBOARD),83) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 + HARDWARE_VARIANT ?= Teensy + MCU ?= at90usb1286 # SAV Mk-I (AT90USB1286) else ifeq ($(HARDWARE_MOTHERBOARD),84) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 + HARDWARE_VARIANT ?= Teensy + MCU ?= at90usb1286 # Teensy++2.0 (AT90USB1286) else ifeq ($(HARDWARE_MOTHERBOARD),85) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 + HARDWARE_VARIANT ?= Teensy + MCU ?= at90usb1286 # 5DPrint D8 Driver Board else ifeq ($(HARDWARE_MOTHERBOARD),88) -HARDWARE_VARIANT ?= Teensy -MCU ?= at90usb1286 + HARDWARE_VARIANT ?= Teensy + MCU ?= at90usb1286 +# UltiMachine Archim1 (with DRV8825 drivers) +else ifeq ($(HARDWARE_MOTHERBOARD),1591) + HARDWARE_VARIANT ?= archim + MCPU = cortex-m3 + F_CPU = 84000000L + IS_MCU = 0 +# UltiMachine Archim2 (with TMC2130 drivers) +else ifeq ($(HARDWARE_MOTHERBOARD),1592) + HARDWARE_VARIANT ?= archim + MCPU = cortex-m3 + F_CPU = 84000000L + IS_MCU = 0 endif # Be sure to regenerate speed_lookuptable.h with create_speed_lookuptable.py @@ -411,9 +437,22 @@ endif # Set to 16Mhz if not yet set. F_CPU ?= 16000000 -# Set to arduino, ATmega2560 if not yet set. -HARDWARE_VARIANT ?= arduino -MCU ?= atmega2560 +# Set to microcontroller if IS_MCU not yet set +IS_MCU ?= 1 + +ifeq ($(IS_MCU),1) + # Set to arduino, ATmega2560 if not yet set. + HARDWARE_VARIANT ?= arduino + MCU ?= atmega2560 + + TOOL_PREFIX = avr + MCU_FLAGS = -mmcu=$(MCU) + SIZE_FLAGS = --mcu=$(MCU) -C +else + TOOL_PREFIX = arm-none-eabi + CPU_FLAGS = -mthumb -mcpu=$(MCPU) + SIZE_FLAGS = -A +endif # Arduino contained the main source code for the Arduino # Libraries, the "hardware variant" are for boards @@ -434,19 +473,19 @@ VPATH = . VPATH += $(BUILD_DIR) VPATH += $(HARDWARE_SRC) -# U8glib -VPATH += $(ARDUINO_USER_DIR)/libraries/U8glib -VPATH += $(ARDUINO_USER_DIR)/libraries/U8glib/clib - ifeq ($(HARDWARE_VARIANT), $(filter $(HARDWARE_VARIANT),arduino Teensy Sanguino)) VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/libraries/LiquidCrystal/src VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/libraries/SPI endif -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino +ifeq ($(IS_MCU),1) + VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino + + VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI + VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src + VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SoftwareSerial/src +endif -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidCrystal/src ifeq ($(LIQUID_TWI2), 1) VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire @@ -462,71 +501,90 @@ VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel endif ifeq ($(U8GLIB), 1) VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/clib +VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/csrc +VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/cppsrc +VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/fntsrc endif -ifeq ($(TMC2630), 1) -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMC2130Stepper/src -VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMC2130Stepper/src/source +ifeq ($(TMC), 1) +VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src +VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src/source endif ifeq ($(HARDWARE_VARIANT), arduino) -HARDWARE_SUB_VARIANT ?= mega -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/variants/$(HARDWARE_SUB_VARIANT) + HARDWARE_SUB_VARIANT ?= mega + VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/variants/$(HARDWARE_SUB_VARIANT) +else ifeq ($(HARDWARE_VARIANT), Sanguino) + VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/variants/sanguino +else ifeq ($(HARDWARE_VARIANT), archim) + VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/libsam + VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Include/ + VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/Device/ATMEL/ + VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino + VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino/avr + VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino/USB + VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/Wire/src + VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/SPI/src + VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/U8glib/src/clib + VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim + LDSCRIPT = $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/linker_scripts/gcc/flash.ld + LDLIBS = $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/libsam_sam3x8e_gcc_rel.a else -ifeq ($(HARDWARE_VARIANT), Sanguino) -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/variants/sanguino -else -HARDWARE_SUB_VARIANT ?= standard -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/$(HARDWARE_VARIANT)/variants/$(HARDWARE_SUB_VARIANT) -endif + HARDWARE_SUB_VARIANT ?= standard + VPATH += $(ARDUINO_INSTALL_DIR)/hardware/$(HARDWARE_VARIANT)/variants/$(HARDWARE_SUB_VARIANT) endif + LIB_SRC = wiring.c \ - wiring_analog.c wiring_digital.c \ - wiring_pulse.c \ - wiring_shift.c WInterrupts.c hooks.c + wiring_analog.c wiring_digital.c \ + wiring_shift.c WInterrupts.c hooks.c + +ifeq ($(HARDWARE_VARIANT), archim) + LIB_ASRC += wiring_pulse_asm.S +else + LIB_SRC += wiring_pulse.c +endif ifeq ($(HARDWARE_VARIANT), Teensy) -LIB_SRC = wiring.c -VPATH += $(ARDUINO_INSTALL_DIR)/hardware/teensy/cores/teensy + LIB_SRC = wiring.c + VPATH += $(ARDUINO_INSTALL_DIR)/hardware/teensy/cores/teensy endif -LIB_CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp Tone.cpp +LIB_CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp ifeq ($(NEOPIXEL), 1) -LIB_CXXSRC += Adafruit_NeoPixel.cpp + LIB_CXXSRC += Adafruit_NeoPixel.cpp endif ifeq ($(LIQUID_TWI2), 0) -LIB_CXXSRC += LiquidCrystal.cpp + LIB_CXXSRC += LiquidCrystal.cpp else -LIB_SRC += twi.c -LIB_CXXSRC += Wire.cpp LiquidTWI2.cpp + LIB_SRC += twi.c + LIB_CXXSRC += Wire.cpp LiquidTWI2.cpp endif ifeq ($(WIRE), 1) -LIB_SRC += twi.c -LIB_CXXSRC += Wire.cpp + LIB_SRC += twi.c + LIB_CXXSRC += Wire.cpp endif ifeq ($(U8GLIB), 1) -LIB_CXXSRC += U8glib.cpp -LIB_SRC += u8g_ll_api.c u8g_bitmap.c u8g_clip.c u8g_com_null.c u8g_delay.c u8g_page.c u8g_pb.c u8g_pb16h1.c u8g_rect.c u8g_state.c u8g_font.c u8g_font_data.c + LIB_CXXSRC += U8glib.cpp + LIB_SRC += u8g_ll_api.c u8g_bitmap.c u8g_clip.c u8g_com_null.c u8g_delay.c u8g_page.c u8g_pb.c u8g_pb16h1.c u8g_rect.c u8g_state.c u8g_font.c u8g_font_6x13.c u8g_font_04b_03.c u8g_font_5x8.c endif -ifeq ($(TMC2630), 1) -LIB_CXXSRC += TMC2130Stepper.cpp TMC2130Stepper_COOLCONF.cpp TMC2130Stepper_DRV_STATUS.cpp TMC2130Stepper_IHOLD_IRUN.cpp TMC2130Stepper_CHOPCONF.cpp TMC2130Stepper_GCONF.cpp TMC2130Stepper_PWMCONF.cpp SW_SPI.cpp +ifeq ($(TMC), 1) + LIB_CXXSRC += TMCStepper.cpp COOLCONF.cpp DRV_STATUS.cpp IHOLD_IRUN.cpp CHOPCONF.cpp GCONF.cpp PWMCONF.cpp DRV_CONF.cpp DRVCONF.cpp DRVCTRL.cpp DRVSTATUS.cpp ENCMODE.cpp RAMP_STAT.cpp SGCSCONF.cpp SHORT_CONF.cpp SMARTEN.cpp SW_MODE.cpp SW_SPI.cpp TMC2130Stepper.cpp TMC2208Stepper.cpp TMC2660Stepper.cpp TMC5130Stepper.cpp TMC5160Stepper.cpp endif ifeq ($(RELOC_WORKAROUND), 1) -LD_PREFIX=-nodefaultlibs -LD_SUFFIX=-lm -lgcc -lc -lgcc + LD_PREFIX=-nodefaultlibs + LD_SUFFIX=-lm -lgcc -lc -lgcc endif #Check for Arduino 1.0.0 or higher and use the correct source files for that version ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true) -LIB_CXXSRC += main.cpp + LIB_CXXSRC += main.cpp else -LIB_SRC += pins_arduino.c main.c + LIB_SRC += pins_arduino.c main.c endif FORMAT = ihex @@ -544,62 +602,81 @@ OPT = s DEFINES ?= # Program settings -CC = $(AVR_TOOLS_PATH)avr-gcc -CXX = $(AVR_TOOLS_PATH)avr-g++ -OBJCOPY = $(AVR_TOOLS_PATH)avr-objcopy -OBJDUMP = $(AVR_TOOLS_PATH)avr-objdump -AR = $(AVR_TOOLS_PATH)avr-ar -SIZE = $(AVR_TOOLS_PATH)avr-size -NM = $(AVR_TOOLS_PATH)avr-nm +CC = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-gcc +CXX = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-g++ +OBJCOPY = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-objcopy +OBJDUMP = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-objdump +AR = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-ar +SIZE = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-size +NM = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-nm AVRDUDE = avrdude REMOVE = rm -f MV = mv -f # Place -D or -U options here -CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)} +CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)} -DARDUINO=$(ARDUINO_VERSION) CXXDEFS = $(CDEFS) ifeq ($(HARDWARE_VARIANT), Teensy) -CDEFS += -DUSB_SERIAL -LIB_SRC += usb.c pins_teensy.c -LIB_CXXSRC += usb_api.cpp + CDEFS += -DUSB_SERIAL + LIB_SRC += usb.c pins_teensy.c + LIB_CXXSRC += usb_api.cpp + +else ifeq ($(HARDWARE_VARIANT), archim) + CDEFS += -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__ -DUSB_VID=0x27b1 -DUSB_PID=0x0001 -DUSBCON '-DUSB_MANUFACTURER="UltiMachine"' '-DUSB_PRODUCT="Archim"' + LIB_CXXSRC += variant.cpp IPAddress.cpp Reset.cpp RingBuffer.cpp Stream.cpp UARTClass.cpp USARTClass.cpp abi.cpp new.cpp watchdog.cpp CDC.cpp PluggableUSB.cpp USBCore.cpp + LIB_SRC += cortex_handlers.c iar_calls_sam3.c syscalls_sam3.c dtostrf.c itoa.c + + ifeq ($(U8GLIB), 1) + LIB_SRC += u8g_com_api.c u8g_pb32h1.c + endif endif # Add all the source directories as include directories too CINCS = ${addprefix -I ,${VPATH}} CXXINCS = ${addprefix -I ,${VPATH}} +# Silence warnings for library code (won't work for .h files, unfortunately) +LIBWARN = -w -Wno-packed-bitfield-compat + # Compiler flag to set the C/CPP Standard level. CSTANDARD = -std=gnu99 CXXSTANDARD = -std=gnu++11 CDEBUG = -g$(DEBUG) -CWARN = -Wall -Wstrict-prototypes -CTUNING = -w -fsigned-char -funsigned-bitfields -fpack-struct \ - -fshort-enums -ffunction-sections -fdata-sections -flto \ - -DARDUINO=$(ARDUINO_VERSION) +CWARN = -Wall -Wstrict-prototypes -Wno-packed-bitfield-compat -Wno-pragmas +CXXWARN = -Wall -Wno-packed-bitfield-compat -Wno-pragmas +CTUNING = -fsigned-char -funsigned-bitfields -fpack-struct -fno-exceptions \ + -fshort-enums -ffunction-sections -fdata-sections ifneq ($(HARDWARE_MOTHERBOARD),) -CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD} + CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD} endif #CEXTRA = -Wa,-adhlns=$(<:.c=.lst) -CEXTRA = -fno-use-cxa-atexit -fno-threadsafe-statics - -CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING) $(CSTANDARD) -CXXFLAGS := $(CDEFS) $(CINCS) -O$(OPT) -Wall $(CEXTRA) $(CTUNING) $(CXXSTANDARD) +CXXEXTRA = -fno-use-cxa-atexit -fno-threadsafe-statics -fno-rtti +CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CEXTRA) $(CTUNING) $(CSTANDARD) +CXXFLAGS := $(CDEFS) $(CINCS) -O$(OPT) $(CXXEXTRA) $(CTUNING) $(CXXSTANDARD) +ASFLAGS := $(CDEFS) #ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs -LDFLAGS = -lm - +ifeq ($(HARDWARE_VARIANT), archim) + LD_PREFIX = -Wl,--gc-sections,-Map,Marlin.ino.map,--cref,--check-sections,--entry=Reset_Handler,--unresolved-symbols=report-all,--warn-common,--warn-section-align + LD_SUFFIX = $(LDLIBS) + LDFLAGS = -lm -gcc -T$(LDSCRIPT) -u _sbrk -u link -u _close -u _fstat -u _isatty -u _lseek -u _read -u _write -u _exit -u kill -u _getpid +else + LD_PREFIX = -Wl,--gc-sections,--relax + LDFLAGS = -lm + CTUNING += -flto +endif # Programming support using avrdude. Settings and variables. AVRDUDE_PORT = $(UPLOAD_PORT) AVRDUDE_WRITE_FLASH = -Uflash:w:$(BUILD_DIR)/$(TARGET).hex:i ifeq ($(shell uname -s), Linux) -AVRDUDE_CONF = /etc/avrdude/avrdude.conf + AVRDUDE_CONF = /etc/avrdude/avrdude.conf else -AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf + AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf endif AVRDUDE_FLAGS = -D -C$(AVRDUDE_CONF) \ - -p$(MCU) -P$(AVRDUDE_PORT) -c$(AVRDUDE_PROGRAMMER) \ - -b$(UPLOAD_RATE) + -p$(MCU) -P$(AVRDUDE_PORT) -c$(AVRDUDE_PROGRAMMER) \ + -b$(UPLOAD_RATE) # Since Marlin 2.0, the source files may be distributed into several # different directories, so it is necessary to find them recursively @@ -619,17 +696,17 @@ LST = $(LIB_ASRC:.S=.lst) $(LIB_CXXSRC:.cpp=.lst) $(LIB_SRC:.c=.lst) # Combine all necessary flags and optional flags. # Add target processor to flags. -ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) -ALL_CXXFLAGS = -mmcu=$(MCU) $(CXXFLAGS) -ALL_ASFLAGS = -mmcu=$(MCU) -x assembler-with-cpp $(ASFLAGS) +ALL_CFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(CFLAGS) -I. +ALL_CXXFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(CXXFLAGS) +ALL_ASFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(ASFLAGS) -x assembler-with-cpp # set V=1 (eg, "make V=1") to print the full commands etc. ifneq ($V,1) - Pecho=@echo - P=@ + Pecho=@echo + P=@ else - Pecho=@: - P= + Pecho=@: + P= endif # Create required build hierarchy if it does not exist @@ -639,9 +716,10 @@ $(shell mkdir -p $(dir $(OBJ))) # Default target. all: sizeafter -build: elf hex +build: elf hex bin elf: $(BUILD_DIR)/$(TARGET).elf +bin: $(BUILD_DIR)/$(TARGET).bin hex: $(BUILD_DIR)/$(TARGET).hex eep: $(BUILD_DIR)/$(TARGET).eep lss: $(BUILD_DIR)/$(TARGET).lss @@ -658,9 +736,9 @@ ifeq (${AVRDUDE_PROGRAMMER}, arduino) stty -hup < $(UPLOAD_PORT); true endif - # Display size of file. + # Display size of file. HEXSIZE = $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex -ELFSIZE = $(SIZE) --mcu=$(MCU) -C $(BUILD_DIR)/$(TARGET).elf; \ +ELFSIZE = $(SIZE) $(SIZE_FLAGS) $(BUILD_DIR)/$(TARGET).elf; \ $(SIZE) $(BUILD_DIR)/$(TARGET).elf sizebefore: $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi @@ -671,10 +749,10 @@ sizeafter: build # Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. COFFCONVERT=$(OBJCOPY) --debugging \ - --change-section-address .data-0x800000 \ - --change-section-address .bss-0x800000 \ - --change-section-address .noinit-0x800000 \ - --change-section-address .eeprom-0x810000 + --change-section-address .data-0x800000 \ + --change-section-address .bss-0x800000 \ + --change-section-address .noinit-0x800000 \ + --change-section-address .eeprom-0x810000 coff: $(BUILD_DIR)/$(TARGET).elf @@ -685,16 +763,20 @@ extcoff: $(TARGET).elf $(COFFCONVERT) -O coff-ext-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof -.SUFFIXES: .elf .hex .eep .lss .sym +.SUFFIXES: .elf .hex .eep .lss .sym .bin .PRECIOUS: .o .elf.hex: $(Pecho) " COPY $@" $P $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ +.elf.bin: + $(Pecho) " COPY $@" + $P $(OBJCOPY) -O binary -R .eeprom $< $@ + .elf.eep: -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ - --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ + --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ # Create extended listing file from ELF output file. .elf.lss: @@ -704,32 +786,36 @@ extcoff: $(TARGET).elf .elf.sym: $(NM) -n $< > $@ - # Link: create ELF output file from library. + # Link: create ELF output file from library. $(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h $(Pecho) " CXX $@" - $P $(CC) $(LD_PREFIX) $(ALL_CXXFLAGS) -Wl,--gc-sections,--relax -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX) + $P $(CC) $(LD_PREFIX) $(ALL_CXXFLAGS) -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX) # Object files that were found in "src" will be stored in $(BUILD_DIR) # in directories that mirror the structure of "src" $(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE) $(Pecho) " CC $<" - $P $(CC) -MMD -c $(ALL_CFLAGS) $< -o $@ + $P $(CC) -MMD -c $(ALL_CFLAGS) $(CWARN) $< -o $@ $(BUILD_DIR)/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE) $(Pecho) " CXX $<" - $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@ + $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(CXXWARN) $< -o $@ # Object files for Arduino libs will be created in $(BUILD_DIR)/arduino $(BUILD_DIR)/arduino/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE) $(Pecho) " CC $<" - $P $(CC) -MMD -c $(ALL_CFLAGS) $< -o $@ + $P $(CC) -MMD -c $(ALL_CFLAGS) $(LIBWARN) $< -o $@ $(BUILD_DIR)/arduino/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE) $(Pecho) " CXX $<" - $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@ + $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(LIBWARN) $< -o $@ + +$(BUILD_DIR)/arduino/%.o: %.S $(MAKEFILE) + $(Pecho) " CXX $<" + $P $(CXX) -MMD -c $(ALL_ASFLAGS) $< -o $@ # Target: clean project. clean: @@ -737,7 +823,7 @@ clean: $P rm -rf $(BUILD_DIR) -.PHONY: all build elf hex eep lss sym program coff extcoff clean depend sizebefore sizeafter +.PHONY: all build elf hex eep lss sym program coff extcoff clean depend sizebefore sizeafter # Automaticaly include the dependency files created by gcc -include ${patsubst %.o, %.d, ${OBJ}} diff --git a/Marlin/_statusscreen.h b/Marlin/_statusscreen.h index 515aa97792..d0450837ab 100644 --- a/Marlin/_statusscreen.h +++ b/Marlin/_statusscreen.h @@ -29,444 +29,46 @@ * Use the Marlin Bitmap Converter to make your own: * http://marlinfw.org/tools/u8glib/converter.html */ -//#include "MarlinConfig.h" -//============================================ +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_Y 3 +#define STATUS_LOGO_WIDTH 24 -#define STATUS_SCREENWIDTH 128 - -#define STATUS_SCREEN_HOTEND_TEXT_X(E) (41 + (E) * 20) - -#define STATUS_SCREEN_BED_TEXT_X (HOTENDS > 1 ? 81 : 73) - -#define FAN_ANIM_FRAMES 3 -#define STATUS_SCREEN_FAN_TEXT_X (FAN_ANIM_FRAMES == 3 ? 103 : 105) -#define STATUS_SCREEN_FAN_TEXT_Y (FAN_ANIM_FRAMES > 2 ? 28 : 27) - -//============================================ +const unsigned char status_logo_bmp[] PROGMEM = { + B11111111,B11111111,B11111111, + B10000000,B00000000,B00000001, + B10001110,B00000000,B11100001, + B10011111,B00000001,B11110001, + B10010011,B10000001,B00111001, + B10011111,B10000001,B11111001, + B10011111,B10000001,B11111001, + B10011111,B10111001,B11111001, + B10001111,B00101000,B11110001, + B10000000,B00111000,B00000001, + B10000000,B00000000,B00000001, + B10011111,B11111111,B11111001, + B10010001,B01110100,B10011001, + B10011011,B00000110,B10101001, + B10011011,B01010100,B10101001, + B10011011,B01010110,B10101001, + B10011011,B01010100,B10011001, + B10011111,B11111111,B11111001, + B11111111,B11111111,B11111111 +}; +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM #if HOTENDS < 2 - - #if FAN_ANIM_FRAMES <= 2 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00111111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111110,B00011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101000,B01111100,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00111000,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B00111001,B11001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11111111,B11101000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11000111,B11101000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11111111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100111,B00111001,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B00111000,B01101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B01111100,B00101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B11111100,B00011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11111000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 -}; - const unsigned char status_screen1_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B10000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B10000000,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000001,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B11000011,B11011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11101000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B11000111,B11111000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100001,B11111111,B10001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01101100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01101100,B00001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01101100,B00001000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100011,B11111111,B00001000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00111111,B11000111,B10001000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B11000111,B11001000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110111,B10000111,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110111,B00000011,B11011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000011,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000010,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 -}; - - #elif FAN_ANIM_FRAMES == 3 - - -const unsigned char status_screen0_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00111111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111110,B00011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101000,B01111100,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00111000,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B00111001,B11001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11111111,B11101000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11000111,B11101000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11111111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100111,B00111001,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B00111000,B01101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B01111100,B00101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B11111100,B00011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11111000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 -}; - - - const unsigned char status_screen1_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00001111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110110,B00011111,B10011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011111,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10011110,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11111100,B00001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11011100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100111,B11101111,B11001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01110111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100000,B01111111,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B11110011,B11101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100001,B11110001,B11101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110011,B11110000,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110111,B11110000,B01011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11100000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 -}; - const unsigned char status_screen2_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B10000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B10000000,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000001,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B11000011,B11011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11101000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B11000111,B11111000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100001,B11111111,B10001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01101100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01101100,B00001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01101100,B00001000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100011,B11111111,B00001000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00111111,B11000111,B10001000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B11000111,B11001000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110111,B10000111,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110111,B00000011,B11011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000011,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000010,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 -}; - - #elif FAN_ANIM_FRAMES == 4 - -const unsigned char status_screen0_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00111111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111110,B00011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101000,B01111100,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00111000,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B00111001,B11001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11111111,B11101000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11000111,B11101000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11111111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100111,B00111001,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B00111000,B01101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B01111100,B00101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B11111100,B00011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11111000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 -}; - -const unsigned char status_screen1_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00001111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110110,B00011111,B10011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011111,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10011110,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11111100,B00001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11011100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100111,B11101111,B11001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01110111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100000,B01111111,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B11110011,B11101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100001,B11110001,B11101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110011,B11110000,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110111,B11110000,B01011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11100000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 -}; - -const unsigned char status_screen2_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B10000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B10000000,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000001,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B11000011,B11011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11101000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B11000111,B11111000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100001,B11111111,B10001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01101100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01101100,B00001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01101100,B00001000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100011,B11111111,B00001000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00111111,B11000111,B10001000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B11000111,B11001000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110111,B10000111,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110111,B00000011,B11011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000011,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000010,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 -}; - - -const unsigned char status_screen3_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11100000,B00011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11100000,B00011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11100001,B11101000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110011,B11101000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01111111,B11101000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01110111,B11101000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101000,B11101110,B00101000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11011100,B00001000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00101111,B11111100,B00001000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B10011110,B00001000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B00001111,B00001000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110000,B00001111,B00011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B00001111,B00011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 -}; - - - #endif - -#else // HOTENDS >= 2 - - #if FAN_ANIM_FRAMES <= 2 - -const unsigned char status_screen0_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00111111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111110,B00011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101000,B01111100,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00111000,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00101111,B00111001,B11001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00101111,B11111111,B11101000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00101111,B11000111,B11101000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00101111,B11111111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00100111,B00111001,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00100000,B00111000,B01101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110000,B01111100,B00011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110000,B11111100,B00011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111001,B11111000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 -}; - - -const unsigned char status_screen1_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00001111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110110,B00011111,B10011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011111,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10011110,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00101111,B11111100,B00001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00101111,B11011100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00100111,B11101111,B11001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00100000,B01110111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00100000,B11110011,B11101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00100001,B11110001,B11101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110011,B11110000,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110111,B11110000,B01011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111001,B11100000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 -}; - - - #elif FAN_ANIM_FRAMES == 3 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00111111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111110,B00011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101000,B01111100,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00111000,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00101111,B00111001,B11001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00101111,B11111111,B11101000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00101111,B11000111,B11101000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00101111,B11111111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00100111,B00111001,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00100000,B00111000,B01101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110000,B01111100,B00011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110000,B11111100,B00011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111001,B11111000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 -}; - - -const unsigned char status_screen1_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00001111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110110,B00011111,B10011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011111,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10011110,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00101111,B11111100,B00001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00101111,B11011100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00100111,B11101111,B11001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00100000,B01110111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00100000,B11110011,B11101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00100001,B11110001,B11101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110011,B11110000,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110111,B11110000,B01011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111001,B11100000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 -}; - -const unsigned char status_screen2_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B10000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B10000000,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000001,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B11000011,B11011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11101000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B11000111,B11111000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00100001,B11111111,B10001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00100000,B01101100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00100000,B01101100,B00001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00100000,B01101100,B00001000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00100011,B11111111,B00001000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00111111,B11000111,B10001000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00101111,B11000111,B11001000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110111,B10000111,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110111,B00000011,B11011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00000011,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000010,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 -}; - - - #elif FAN_ANIM_FRAMES == 4 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00111111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111110,B00011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101000,B01111100,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00111000,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00101111,B00111001,B11001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00101111,B11111111,B11101000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00101111,B11000111,B11101000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00101111,B11111111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00100111,B00111001,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00100000,B00111000,B01101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110000,B01111100,B00011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110000,B11111100,B00011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111001,B11111000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 -}; - - -const unsigned char status_screen1_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00001111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110110,B00011111,B10011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011111,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10011110,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00101111,B11111100,B00001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00101111,B11011100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00100111,B11101111,B11001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00100000,B01110111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00100000,B11110011,B11101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00100001,B11110001,B11101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110011,B11110000,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110111,B11110000,B01011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111001,B11100000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 -}; - -const unsigned char status_screen2_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B10000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B10000000,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000001,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B11000011,B11011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11101000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B11000111,B11111000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00100001,B11111111,B10001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00100000,B01101100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00100000,B01101100,B00001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00100000,B01101100,B00001000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00100011,B11111111,B00001000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00111111,B11000111,B10001000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00101111,B11000111,B11001000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110111,B10000111,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110111,B00000011,B11011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00000011,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000010,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 -}; - -const unsigned char status_screen3_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11100000,B00011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11100000,B00011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11100001,B11101000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110011,B11101000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00100000,B01111111,B11101000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00100000,B01110111,B11101000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00101000,B11101110,B00101000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00101111,B11011100,B00001000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00101111,B11111100,B00001000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00101111,B10011110,B00001000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00101111,B00001111,B00001000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110000,B00001111,B00011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110000,B00001111,B00011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 -}; - - - #endif - -#endif // HOTENDS >= 2 + #define STATUS_LOGO_X 8 + #define STATUS_HEATERS_X 40 + #define STATUS_BED_X 72 +#else + #define STATUS_LOGO_X 0 + #define STATUS_HEATERS_X 32 + #define STATUS_BED_X 80 +#endif diff --git a/Marlin/src/HAL/HAL_AVR/SanityCheck.h b/Marlin/src/HAL/HAL_AVR/SanityCheck.h index 5b15bca082..4485b8f39b 100644 --- a/Marlin/src/HAL/HAL_AVR/SanityCheck.h +++ b/Marlin/src/HAL/HAL_AVR/SanityCheck.h @@ -79,11 +79,11 @@ #elif PIN_EXISTS(E5_AUTO_FAN) && SPINDLE_LASER_PWM_PIN == E5_AUTO_FAN_PIN #error "SPINDLE_LASER_PWM_PIN is used by E5_AUTO_FAN_PIN." #elif PIN_EXISTS(FAN) && SPINDLE_LASER_PWM_PIN == FAN_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN_PIN." + #error "SPINDLE_LASER_PWM_PIN is used by FAN_PIN." #elif PIN_EXISTS(FAN1) && SPINDLE_LASER_PWM_PIN == FAN1_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN1_PIN." + #error "SPINDLE_LASER_PWM_PIN is used by FAN1_PIN." #elif PIN_EXISTS(FAN2) && SPINDLE_LASER_PWM_PIN == FAN2_PIN - #error "SPINDLE_LASER_PWM_PIN is used FAN2_PIN." + #error "SPINDLE_LASER_PWM_PIN is used by FAN2_PIN." #elif PIN_EXISTS(CONTROLLERFAN) && SPINDLE_LASER_PWM_PIN == CONTROLLERFAN_PIN #error "SPINDLE_LASER_PWM_PIN is used by CONTROLLERFAN_PIN." #elif PIN_EXISTS(MOTOR_CURRENT_PWM_XY) && SPINDLE_LASER_PWM_PIN == MOTOR_CURRENT_PWM_XY_PIN diff --git a/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp index c129226bb0..1fcd1ac70a 100644 --- a/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp @@ -23,7 +23,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(EEPROM_SETTINGS) +#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE) #include "../shared/persistent_store_api.h" @@ -39,8 +39,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); return true; } } @@ -64,5 +63,5 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t size_t PersistentStore::capacity() { return E2END + 1; } -#endif // EEPROM_SETTINGS +#endif // EEPROM_SETTINGS || SD_FIRMWARE_UPDATE #endif // __AVR__ diff --git a/Marlin/src/HAL/HAL_AVR/pinsDebug.h b/Marlin/src/HAL/HAL_AVR/pinsDebug.h index 9c0bebbdd4..91798cdffc 100644 --- a/Marlin/src/HAL/HAL_AVR/pinsDebug.h +++ b/Marlin/src/HAL/HAL_AVR/pinsDebug.h @@ -150,7 +150,7 @@ static bool pwm_status(uint8_t pin) { default: return false; } - SERIAL_PROTOCOL_SP(2); + SERIAL_ECHO_SP(2); } // pwm_status @@ -222,24 +222,24 @@ const volatile uint8_t* const PWM_OCR[][3] PROGMEM = { #define OCR_VAL(T, L) pgm_read_word(&PWM_OCR[T][L]) -static void err_is_counter() { SERIAL_PROTOCOLPGM(" non-standard PWM mode"); } -static void err_is_interrupt() { SERIAL_PROTOCOLPGM(" compare interrupt enabled"); } -static void err_prob_interrupt() { SERIAL_PROTOCOLPGM(" overflow interrupt enabled"); } -static void print_is_also_tied() { SERIAL_PROTOCOLPGM(" is also tied to this pin"); SERIAL_PROTOCOL_SP(14); } +static void err_is_counter() { SERIAL_ECHOPGM(" non-standard PWM mode"); } +static void err_is_interrupt() { SERIAL_ECHOPGM(" compare interrupt enabled"); } +static void err_prob_interrupt() { SERIAL_ECHOPGM(" overflow interrupt enabled"); } +static void print_is_also_tied() { SERIAL_ECHOPGM(" is also tied to this pin"); SERIAL_ECHO_SP(14); } void com_print(uint8_t N, uint8_t Z) { const uint8_t *TCCRA = (uint8_t*)TCCR_A(N); - SERIAL_PROTOCOLPGM(" COM"); - SERIAL_PROTOCOLCHAR(N + '0'); + SERIAL_ECHOPGM(" COM"); + SERIAL_CHAR(N + '0'); switch (Z) { case 'A': - SERIAL_PROTOCOLPAIR("A: ", ((*TCCRA & (_BV(7) | _BV(6))) >> 6)); + SERIAL_ECHOPAIR("A: ", ((*TCCRA & (_BV(7) | _BV(6))) >> 6)); break; case 'B': - SERIAL_PROTOCOLPAIR("B: ", ((*TCCRA & (_BV(5) | _BV(4))) >> 4)); + SERIAL_ECHOPAIR("B: ", ((*TCCRA & (_BV(5) | _BV(4))) >> 4)); break; case 'C': - SERIAL_PROTOCOLPAIR("C: ", ((*TCCRA & (_BV(3) | _BV(2))) >> 2)); + SERIAL_ECHOPAIR("C: ", ((*TCCRA & (_BV(3) | _BV(2))) >> 2)); break; } } @@ -251,10 +251,10 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N - uint8_t WGM = (((*TCCRB & _BV(WGM_2)) >> 1) | (*TCCRA & (_BV(WGM_0) | _BV(WGM_1)))); if (N == 4) WGM |= ((*TCCRB & _BV(WGM_3)) >> 1); - SERIAL_PROTOCOLPGM(" TIMER"); - SERIAL_PROTOCOLCHAR(T + '0'); - SERIAL_PROTOCOLCHAR(L); - SERIAL_PROTOCOL_SP(3); + SERIAL_ECHOPGM(" TIMER"); + SERIAL_CHAR(T + '0'); + SERIAL_CHAR(L); + SERIAL_ECHO_SP(3); if (N == 3) { const uint8_t *OCRVAL8 = (uint8_t*)OCR_VAL(T, L - 'A'); @@ -264,22 +264,22 @@ void timer_prefix(uint8_t T, char L, uint8_t N) { // T - timer L - pwm N - const uint16_t *OCRVAL16 = (uint16_t*)OCR_VAL(T, L - 'A'); PWM_PRINT(*OCRVAL16); } - SERIAL_PROTOCOLPAIR(" WGM: ", WGM); + SERIAL_ECHOPAIR(" WGM: ", WGM); com_print(T,L); - SERIAL_PROTOCOLPAIR(" CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) )); + SERIAL_ECHOPAIR(" CS: ", (*TCCRB & (_BV(CS_0) | _BV(CS_1) | _BV(CS_2)) )); - SERIAL_PROTOCOLPGM(" TCCR"); - SERIAL_PROTOCOLCHAR(T + '0'); - SERIAL_PROTOCOLPAIR("A: ", *TCCRA); + SERIAL_ECHOPGM(" TCCR"); + SERIAL_CHAR(T + '0'); + SERIAL_ECHOPAIR("A: ", *TCCRA); - SERIAL_PROTOCOLPGM(" TCCR"); - SERIAL_PROTOCOLCHAR(T + '0'); - SERIAL_PROTOCOLPAIR("B: ", *TCCRB); + SERIAL_ECHOPGM(" TCCR"); + SERIAL_CHAR(T + '0'); + SERIAL_ECHOPAIR("B: ", *TCCRB); const uint8_t *TMSK = (uint8_t*)TIMSK(T); - SERIAL_PROTOCOLPGM(" TIMSK"); - SERIAL_PROTOCOLCHAR(T + '0'); - SERIAL_PROTOCOLPAIR(": ", *TMSK); + SERIAL_ECHOPGM(" TIMSK"); + SERIAL_CHAR(T + '0'); + SERIAL_ECHOPAIR(": ", *TMSK); const uint8_t OCIE = L - 'A' + 1; if (N == 3) { if (WGM == 0 || WGM == 2 || WGM == 4 || WGM == 6) err_is_counter(); } @@ -336,22 +336,22 @@ static void pwm_details(uint8_t pin) { case NOT_ON_TIMER: break; } - SERIAL_PROTOCOLPGM(" "); + SERIAL_ECHOPGM(" "); // on pins that have two PWMs, print info on second PWM #if AVR_ATmega2560_FAMILY || AVR_AT90USB1286_FAMILY // looking for port B7 - PWMs 0A and 1C if (digitalPinToPort_DEBUG(pin) == 'B' - 64 && 0x80 == digitalPinToBitMask_DEBUG(pin)) { #if !AVR_AT90USB1286_FAMILY - SERIAL_PROTOCOLPGM("\n ."); - SERIAL_PROTOCOL_SP(18); - SERIAL_PROTOCOLPGM("TIMER1C"); + SERIAL_ECHOPGM("\n ."); + SERIAL_ECHO_SP(18); + SERIAL_ECHOPGM("TIMER1C"); print_is_also_tied(); timer_prefix(1, 'C', 4); #else - SERIAL_PROTOCOLPGM("\n ."); - SERIAL_PROTOCOL_SP(18); - SERIAL_PROTOCOLPGM("TIMER0A"); + SERIAL_ECHOPGM("\n ."); + SERIAL_ECHO_SP(18); + SERIAL_ECHOPGM("TIMER0A"); print_is_also_tied(); timer_prefix(0, 'A', 3); #endif @@ -372,7 +372,7 @@ static void pwm_details(uint8_t pin) { void print_port(int8_t pin) { // print port number #ifdef digitalPinToPort_DEBUG uint8_t x; - SERIAL_PROTOCOLPGM(" Port: "); + SERIAL_ECHOPGM(" Port: "); #if AVR_AT90USB1286_FAMILY x = (pin == 46 || pin == 47) ? 'E' : digitalPinToPort_DEBUG(pin) + 64; #else @@ -395,7 +395,7 @@ static void pwm_details(uint8_t pin) { #endif SERIAL_CHAR(x); #else - SERIAL_PROTOCOL_SP(10); + SERIAL_ECHO_SP(10); #endif } diff --git a/Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp b/Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp index 8845fa04ac..238981afa8 100644 --- a/Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp +++ b/Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp @@ -62,8 +62,7 @@ void watchdog_init() { #if ENABLED(WATCHDOG_RESET_MANUAL) ISR(WDT_vect) { sei(); // With the interrupt driven serial we need to allow interrupts. - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_WATCHDOG_FIRED); + SERIAL_ERROR_MSG(MSG_WATCHDOG_FIRED); minkill(); // interrupt-safe final kill and infinite loop } #endif // WATCHDOG_RESET_MANUAL diff --git a/Marlin/src/HAL/HAL_DUE/DebugMonitor_Due.cpp b/Marlin/src/HAL/HAL_DUE/DebugMonitor_Due.cpp index f12f0df7fb..40407f7f5d 100644 --- a/Marlin/src/HAL/HAL_DUE/DebugMonitor_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/DebugMonitor_Due.cpp @@ -145,8 +145,8 @@ static const UnwindCallbacks UnwCallbacks = { UnwReadW, UnwReadH, UnwReadB - #if defined(UNW_DEBUG) - ,UnwPrintf + #ifdef UNW_DEBUG + , UnwPrintf #endif }; diff --git a/Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp b/Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp index dfc7842ffd..54d08d69b1 100644 --- a/Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/EepromEmulation_Due.cpp @@ -121,7 +121,7 @@ static uint8_t buffer[256] = {0}, // The RAM buffer to accumulate writes char buffer[80]; sprintf(buffer, "Page: %d (0x%04x)\n", page, page); - SERIAL_PROTOCOL(buffer); + SERIAL_ECHO(buffer); char* p = &buffer[0]; for (int i = 0; i< PageSize; ++i) { @@ -131,7 +131,7 @@ static uint8_t buffer[256] = {0}, // The RAM buffer to accumulate writes if ((i & 0xF) == 0xF) { *p++ = '\n'; *p = 0; - SERIAL_PROTOCOL(buffer); + SERIAL_ECHO(buffer); p = &buffer[0]; } } diff --git a/Marlin/src/HAL/HAL_DUE/fastio_Due.h b/Marlin/src/HAL/HAL_DUE/fastio_Due.h index d7a8d33c25..cb713122e7 100644 --- a/Marlin/src/HAL/HAL_DUE/fastio_Due.h +++ b/Marlin/src/HAL/HAL_DUE/fastio_Due.h @@ -465,6 +465,9 @@ #define DIO107_PIN 10 #define DIO107_WPORT PIOB + + #define DIO108_PIN 9 + #define DIO108_WPORT PIOB #else #define DIO92_PIN 5 #define DIO92_WPORT PIOA diff --git a/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp index e7ff4f9c81..7c35818b47 100644 --- a/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp @@ -53,8 +53,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/HAL/HAL_DUE/pinsDebug.h b/Marlin/src/HAL/HAL_DUE/pinsDebug.h index 691830b873..f4e2238981 100644 --- a/Marlin/src/HAL/HAL_DUE/pinsDebug.h +++ b/Marlin/src/HAL/HAL_DUE/pinsDebug.h @@ -93,7 +93,7 @@ bool GET_ARRAY_IS_DIGITAL(int8_t pin) { void pwm_details(int32_t pin) { if (pwm_status(pin)) { uint32_t chan = g_APinDescription[pin].ulPWMChannel; - SERIAL_PROTOCOLPAIR("PWM = ", PWM_INTERFACE->PWM_CH_NUM[chan].PWM_CDTY); + SERIAL_ECHOPAIR("PWM = ", PWM_INTERFACE->PWM_CH_NUM[chan].PWM_CDTY); } } diff --git a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp b/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp index 26c2ae8848..c62f6a06ec 100644 --- a/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp +++ b/Marlin/src/HAL/HAL_DUE/u8g_com_HAL_DUE_shared_hw_spi.cpp @@ -94,10 +94,8 @@ void u8g_SetPILevel_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index, uint8_t level) { else port->PIO_CODR = mask; } -uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) -{ - switch(msg) - { +uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { + switch(msg) { case U8G_COM_MSG_STOP: break; diff --git a/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h b/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h index 11e9b73b53..6934494e57 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h +++ b/Marlin/src/HAL/HAL_DUE/usb/conf_usb.h @@ -49,6 +49,7 @@ #undef UNUSED /* To avoid a macro clash as macros.h already defines it */ #include "../../../core/macros.h" /* For ENABLED()/DISABLED() */ +#include "../../../core/boards.h" /* For MB() */ #include "../../../../Configuration.h" /* For CUSTOM_MACHINE_NAME definition - We just need the name, no C++ allowed! */ #include "compiler.h" @@ -88,7 +89,11 @@ //#define USB_DEVICE_LOW_SPEED //! To define a Full speed device -//#define USB_DEVICE_FULL_SPEED +//#define USB_DEVICE_FULL_SPEED + +#if MB(ARCHIM1) + #define USB_DEVICE_FULL_SPEED +#endif //! To authorize the High speed #ifndef USB_DEVICE_FULL_SPEED diff --git a/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp b/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp index 1054f5ab34..dc83c133e7 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp +++ b/Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp @@ -19,7 +19,7 @@ void sd_mmc_spi_mem_init(void) { } Ctrl_status sd_mmc_spi_test_unit_ready(void) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.cardOK) + if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.flag.cardOK) return CTRL_NO_PRESENT; return CTRL_GOOD; } @@ -27,7 +27,7 @@ Ctrl_status sd_mmc_spi_test_unit_ready(void) { // NOTE: This function is defined as returning the address of the last block // in the card, which is cardSize() - 1 Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.cardOK) + if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.flag.cardOK) return CTRL_NO_PRESENT; *nb_sector = card.getSd2Card().cardSize() - 1; return CTRL_GOOD; @@ -42,7 +42,7 @@ bool sd_mmc_spi_wr_protect(void) { } bool sd_mmc_spi_removal(void) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.cardOK) + if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.flag.cardOK) return true; return false; } @@ -61,13 +61,13 @@ uint8_t sector_buf[SD_MMC_BLOCK_SIZE]; // #define DEBUG_MMC Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.cardOK) + if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.flag.cardOK) return CTRL_NO_PRESENT; #ifdef DEBUG_MMC char buffer[80]; sprintf(buffer, "SDRD: %d @ 0x%08x\n", nb_sector, addr); - SERIAL_PROTOCOL_P(0, buffer); + SERIAL_ECHO_P(0, buffer); #endif // Start reading @@ -95,13 +95,13 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) { } Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) { - if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.cardOK) + if (!IS_SD_INSERTED() || IS_SD_PRINTING() || IS_SD_FILE_OPEN() || !card.flag.cardOK) return CTRL_NO_PRESENT; #ifdef DEBUG_MMC char buffer[80]; sprintf(buffer, "SDWR: %d @ 0x%08x\n", nb_sector, addr); - SERIAL_PROTOCOL_P(0, buffer); + SERIAL_ECHO_P(0, buffer); #endif if (!card.getSd2Card().writeStart(addr, nb_sector)) diff --git a/Marlin/src/HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp b/Marlin/src/HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp index 6798d60cc6..c992925bf0 100644 --- a/Marlin/src/HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp @@ -118,7 +118,7 @@ static const UnwindCallbacks UnwCallbacks = { UnwReadW, UnwReadH, UnwReadB - #if defined(UNW_DEBUG) + #ifdef UNW_DEBUG ,UnwPrintf #endif }; diff --git a/Marlin/src/HAL/HAL_LPC1768/main.cpp b/Marlin/src/HAL/HAL_LPC1768/main.cpp index 02207c6109..c4aea39660 100644 --- a/Marlin/src/HAL/HAL_LPC1768/main.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/main.cpp @@ -106,7 +106,7 @@ void HAL_idletask(void) { // the disk if Marlin has it mounted. Unfortuately there is currently no way // to unmount the disk from the LCD menu. // if (IS_SD_PRINTING() || IS_SD_FILE_OPEN()) - if (card.cardOK) + if (card.flag.cardOK) MSC_Aquire_Lock(); else MSC_Release_Lock(); diff --git a/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp b/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp index ce6ab7de65..e08da20904 100644 --- a/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp @@ -57,7 +57,7 @@ extern "C" { #define EEPROM_ERASE (0xff) #define SLOT_ADDRESS(sector, slot) (((uint8_t *)SECTOR_START(sector)) + slot * EEPROM_SIZE) -static uint8_t ram_eeprom[EEPROM_SIZE]; +static uint8_t ram_eeprom[EEPROM_SIZE] __attribute__((aligned(4))) = {0}; static bool eeprom_dirty = false; static int current_slot = 0; @@ -92,7 +92,6 @@ bool PersistentStore::access_finish() { if (--current_slot < 0) { // all slots have been used, erase everything and start again __disable_irq(); - PrepareSector(EEPROM_SECTOR, EEPROM_SECTOR); status = EraseSector(EEPROM_SECTOR, EEPROM_SECTOR); __enable_irq(); @@ -100,7 +99,6 @@ bool PersistentStore::access_finish() { } __disable_irq(); - PrepareSector(EEPROM_SECTOR, EEPROM_SECTOR); status = CopyRAM2Flash(SLOT_ADDRESS(EEPROM_SECTOR, current_slot), ram_eeprom, IAP_WRITE_4096); __enable_irq(); diff --git a/Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp b/Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp index 5731333ed2..7c8be7e185 100644 --- a/Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp @@ -80,23 +80,23 @@ bool PersistentStore::access_finish() { // to see errors that are happening in read_data / write_data static void debug_rw(const bool write, int &pos, const uint8_t *value, const size_t size, const FRESULT s, const size_t total=0) { PGM_P const rw_str = write ? PSTR("write") : PSTR("read"); - SERIAL_PROTOCOLCHAR(' '); + SERIAL_CHAR(' '); serialprintPGM(rw_str); - SERIAL_PROTOCOLPAIR("_data(", pos); - SERIAL_PROTOCOLPAIR(",", (int)value); - SERIAL_PROTOCOLPAIR(",", (int)size); - SERIAL_PROTOCOLLNPGM(", ...)"); + SERIAL_ECHOPAIR("_data(", pos); + SERIAL_ECHOPAIR(",", (int)value); + SERIAL_ECHOPAIR(",", (int)size); + SERIAL_ECHOLNPGM(", ...)"); if (total) { - SERIAL_PROTOCOLPGM(" f_"); + SERIAL_ECHOPGM(" f_"); serialprintPGM(rw_str); - SERIAL_PROTOCOLPAIR("()=", (int)s); - SERIAL_PROTOCOLPAIR("\n size=", size); - SERIAL_PROTOCOLPGM("\n bytes_"); + SERIAL_ECHOPAIR("()=", (int)s); + SERIAL_ECHOPAIR("\n size=", size); + SERIAL_ECHOPGM("\n bytes_"); serialprintPGM(write ? PSTR("written=") : PSTR("read=")); - SERIAL_PROTOCOLLN(total); + SERIAL_ECHOLN(total); } else - SERIAL_PROTOCOLLNPAIR(" f_lseek()=", (int)s); + SERIAL_ECHOLNPAIR(" f_lseek()=", (int)s); } // File function return codes for type FRESULT. This goes away soon, but diff --git a/Marlin/src/HAL/HAL_STM32/HAL.cpp b/Marlin/src/HAL/HAL_STM32/HAL.cpp index 6776530004..1bddf77f48 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL.cpp +++ b/Marlin/src/HAL/HAL_STM32/HAL.cpp @@ -78,14 +78,20 @@ uint16_t HAL_adc_result; // Public functions // -------------------------------------------------------------------------- + +// Needed for DELAY_NS() / DELAY_US() on CORTEX-M7 +#if (defined(__arm__) || defined(__thumb__)) && __CORTEX_M == 7 + // HAL pre-initialization task + // Force the preinit function to run between the premain() and main() function + // of the STM32 arduino core + __attribute__((constructor (102))) + void HAL_preinit() { + enableCycleCounter(); + } +#endif + // HAL initialization task void HAL_init(void) { - - // Needed for DELAY_NS() / DELAY_US() on CORTEX-M7 - #if (defined(__arm__) || defined(__thumb__)) && __CORTEX_M == 7 - enableCycleCounter(); - #endif - FastIO_init(); #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp index 31715ac664..5fc87cc241 100644 --- a/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp @@ -62,8 +62,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp b/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp index 349abba246..757d62fd59 100644 --- a/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp @@ -41,7 +41,7 @@ char HAL_STM32F1_eeprom_content[HAL_STM32F1_EEPROM_SIZE]; char eeprom_filename[] = "eeprom.dat"; bool PersistentStore::access_start() { - if (!card.cardOK) return false; + if (!card.flag.cardOK) return false; int16_t bytes_read = 0; constexpr char eeprom_zero = 0xFF; card.openFile(eeprom_filename, true); @@ -54,7 +54,7 @@ bool PersistentStore::access_start() { } bool PersistentStore::access_finish() { - if (!card.cardOK) return false; + if (!card.flag.cardOK) return false; card.openFile(eeprom_filename, true); int16_t bytes_written = card.write(HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE); card.closefile(); diff --git a/Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp index 648c297687..ef70389714 100644 --- a/Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp @@ -41,8 +41,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/HAL/HAL_STM32F7/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_STM32F7/persistent_store_eeprom.cpp index 50bf09a9a3..21b6a561b8 100644 --- a/Marlin/src/HAL/HAL_STM32F7/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_STM32F7/persistent_store_eeprom.cpp @@ -41,8 +41,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp index 71908bc1cd..d746dc9730 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp @@ -21,8 +21,7 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp index 7a1fa0e44c..3a1e3477a6 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp @@ -42,8 +42,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp index c0c9dc2684..29b4653b3e 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp @@ -21,8 +21,7 @@ bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { if (v != eeprom_read_byte(p)) { eeprom_write_byte(p, v); if (eeprom_read_byte(p) != v) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_EEPROM_WRITE); + SERIAL_ECHO_MSG(MSG_ERR_EEPROM_WRITE); return true; } } diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h b/Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h index f94f55c1d2..6ba5eebab5 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h +++ b/Marlin/src/HAL/HAL_TEENSY35_36/pinsDebug.h @@ -45,7 +45,7 @@ #define FTM3_CH5_PIN 36 #define FTM3_CH6_PIN 37 #define FTM3_CH7_PIN 38 -#if defined(__MK66FX1M0__) // Teensy3.6 +#ifdef __MK66FX1M0__ // Teensy3.6 #define TPM1_CH0_PIN 16 #define TPM1_CH1_PIN 17 #endif @@ -102,7 +102,7 @@ bool HAL_pwm_status(int8_t pin) { default: return false; } - SERIAL_PROTOCOLPGM(" "); + SERIAL_ECHOPGM(" "); } static void HAL_pwm_details(uint8_t pin) { /* TODO */ } diff --git a/Marlin/src/HAL/shared/I2cEeprom.cpp b/Marlin/src/HAL/shared/I2cEeprom.cpp index 921c7ff903..02a201c9ef 100644 --- a/Marlin/src/HAL/shared/I2cEeprom.cpp +++ b/Marlin/src/HAL/shared/I2cEeprom.cpp @@ -129,7 +129,6 @@ void eeprom_update_block(const void *pos, void* eeprom_address, size_t n) { uint8_t eeprom_read_byte(uint8_t *pos) { - byte data = 0xFF; unsigned eeprom_address = (unsigned)pos; eeprom_init(); diff --git a/Marlin/src/HAL/shared/backtrace/backtrace.cpp b/Marlin/src/HAL/shared/backtrace/backtrace.cpp index 95f1fc0b0f..65827b0c97 100644 --- a/Marlin/src/HAL/shared/backtrace/backtrace.cpp +++ b/Marlin/src/HAL/shared/backtrace/backtrace.cpp @@ -88,8 +88,7 @@ void backtrace(void) { btf.pc = pc | 1; // Force Thumb, as CORTEX only support it // Perform a backtrace - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Backtrace:"); + SERIAL_ERROR_MSG("Backtrace:"); int ctr = 0; UnwindStart(&btf, &UnwCallbacks, &ctr); } diff --git a/Marlin/src/HAL/shared/backtrace/unwarm.cpp b/Marlin/src/HAL/shared/backtrace/unwarm.cpp index 13079817ba..e1740fc248 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarm.cpp @@ -23,7 +23,7 @@ #include "unwarm.h" #include "unwarmmem.h" -#if defined(UNW_DEBUG) +#ifdef UNW_DEBUG /** * Printf wrapper. diff --git a/Marlin/src/HAL/shared/backtrace/unwarm.h b/Marlin/src/HAL/shared/backtrace/unwarm.h index 7414ecc06b..9594ed95d7 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm.h +++ b/Marlin/src/HAL/shared/backtrace/unwarm.h @@ -106,7 +106,7 @@ typedef struct { #define M_IsOriginValid(v) (((v) & 0x7F) ? true : false) #define M_Origin2Str(v) ((v) ? "VALID" : "INVALID") -#if defined(UNW_DEBUG) +#ifdef UNW_DEBUG #define UnwPrintd1(a) state->cb->printf(a) #define UnwPrintd2(a,b) state->cb->printf(a,b) #define UnwPrintd3(a,b,c) state->cb->printf(a,b,c) diff --git a/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp b/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp index 09528885f7..be43b22392 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarm_arm.cpp @@ -142,7 +142,7 @@ UnwResult UnwStartArm(UnwState * const state) { /* MRS */ else if ((instr & 0xFFBF0FFF) == 0xE10F0000) { -#if defined(UNW_DEBUG) +#ifdef UNW_DEBUG bool R = (instr & 0x00400000) ? true : false; #endif uint8_t rd = (instr & 0x0000F000) >> 12; @@ -154,7 +154,7 @@ UnwResult UnwStartArm(UnwState * const state) { } /* MSR */ else if ((instr & 0xFFB0F000) == 0xE120F000) { -#if defined(UNW_DEBUG) +#ifdef UNW_DEBUG bool R = (instr & 0x00400000) ? true : false; UnwPrintd2("MSR %s_?, ???", R ? "SPSR" : "CPSR"); @@ -172,7 +172,7 @@ UnwResult UnwStartArm(UnwState * const state) { else if (isDataProc(instr)) { bool I = (instr & 0x02000000) ? true : false; uint8_t opcode = (instr & 0x01E00000) >> 21; -#if defined(UNW_DEBUG) +#ifdef UNW_DEBUG bool S = (instr & 0x00100000) ? true : false; #endif uint8_t rn = (instr & 0x000F0000) >> 16; @@ -220,7 +220,7 @@ UnwResult UnwStartArm(UnwState * const state) { uint8_t regShift = (operand2 & 0x0010) ? true : false; uint8_t shiftType = (operand2 & 0x0060) >> 5; uint32_t shiftDist; -#if defined(UNW_DEBUG) +#ifdef UNW_DEBUG const char * const shiftMnu[4] = { "LSL", "LSR", "ASR", "ROR" }; #endif UnwPrintd2("r%d ", rm); @@ -453,7 +453,7 @@ UnwResult UnwStartArm(UnwState * const state) { bool addrValid = M_IsOriginValid(state->regData[baseReg].o); int8_t r; -#if defined(UNW_DEBUG) +#ifdef UNW_DEBUG /* Display the instruction */ if (L) { UnwPrintd6("LDM%c%c r%d%s, {reglist}%s\n", P ? 'E' : 'F', U ? 'D' : 'A', baseReg, W ? "!" : "", S ? "^" : ""); diff --git a/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp b/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp index a4afbeaf8d..29efb13096 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarm_thumb.cpp @@ -680,7 +680,7 @@ UnwResult UnwStartThumb(UnwState * const state) { uint8_t rs = (instr & 0x0038) >> 3; uint8_t rd = (instr & 0x0007); -#if defined(UNW_DEBUG) +#ifdef UNW_DEBUG static const char * const mnu[16] = { "AND", "EOR", "LSL", "LSR", "ASR", "ADC", "SBC", "ROR", diff --git a/Marlin/src/HAL/shared/backtrace/unwarmmem.cpp b/Marlin/src/HAL/shared/backtrace/unwarmmem.cpp index 7453fdb8db..b836841713 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarmmem.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarmmem.cpp @@ -90,7 +90,7 @@ bool UnwMemHashWrite(MemData * const memData, uint32_t addr, uint32_t val, bool M_SetIdxUsed(memData->tracked, i); } else { - #if defined(UNW_DEBUG) + #ifdef UNW_DEBUG memData->v[i] = 0xDEADBEEF; #endif M_ClrIdxUsed(memData->tracked, i); diff --git a/Marlin/src/HAL/shared/persistent_store_api.cpp b/Marlin/src/HAL/shared/persistent_store_api.cpp index 50adc12631..230a70e85b 100644 --- a/Marlin/src/HAL/shared/persistent_store_api.cpp +++ b/Marlin/src/HAL/shared/persistent_store_api.cpp @@ -22,7 +22,7 @@ */ #include "../../inc/MarlinConfigPre.h" -#if ENABLED(EEPROM_SETTINGS) +#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE) #include "persistent_store_api.h" PersistentStore persistentStore; diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 944c5ec96f..290cb06425 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -264,8 +264,7 @@ bool pin_is_protected(const pin_t pin) { } void protected_pin_err() { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_PROTECTED_PIN); + SERIAL_ERROR_MSG(MSG_ERR_PROTECTED_PIN); } void quickstop_stepper() { @@ -371,7 +370,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL) if (ubl.lcd_map_control) { ubl.lcd_map_control = false; - set_defer_return_to_status(false); + ui.defer_status_screen(false); } #endif } @@ -400,8 +399,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { // KILL the machine // ---------------------------------------------------------------- if (killCount >= KILL_DELAY) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_KILL_BUTTON); + SERIAL_ERROR_MSG(MSG_KILL_BUTTON); kill(); } #endif @@ -549,7 +547,7 @@ void idle( max7219.idle_tasks(); #endif - lcd_update(); + ui.update(); #if ENABLED(HOST_KEEPALIVE_FEATURE) gcode.host_keepalive(); @@ -606,11 +604,10 @@ void idle( void kill(PGM_P const lcd_msg/*=NULL*/) { thermalManager.disable_all_heaters(); - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_KILLED); + SERIAL_ERROR_MSG(MSG_ERR_KILLED); - #if ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI) - kill_screen(lcd_msg ? lcd_msg : PSTR(MSG_KILLED)); + #if HAS_SPI_LCD || ENABLED(EXTENSIBLE_UI) + ui.kill_screen(lcd_msg ? lcd_msg : PSTR(MSG_KILLED)); #else UNUSED(lcd_msg); #endif @@ -663,8 +660,7 @@ void stop() { if (IsRunning()) { Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_STOPPED); + SERIAL_ERROR_MSG(MSG_ERR_STOPPED); LCD_MESSAGEPGM(MSG_STOPPED); safe_delay(350); // allow enough time for messages to get out before stopping Running = false; @@ -745,7 +741,7 @@ void setup() { #endif #endif - SERIAL_PROTOCOLLNPGM("start"); + SERIAL_ECHOLNPGM("start"); SERIAL_ECHO_START(); #if TMC_HAS_SPI @@ -781,8 +777,7 @@ void setup() { SERIAL_ECHOPGM(MSG_CONFIGURATION_VER); SERIAL_ECHOPGM(STRING_DISTRIBUTION_DATE); SERIAL_ECHOLNPGM(MSG_AUTHOR STRING_CONFIG_H_AUTHOR); - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Compiled: " __DATE__); + SERIAL_ECHO_MSG("Compiled: " __DATE__); #endif SERIAL_ECHO_START(); @@ -899,11 +894,11 @@ void setup() { fanmux_init(); #endif - lcd_init(); - lcd_reset_status(); + ui.init(); + ui.reset_status(); #if ENABLED(SHOW_BOOTSCREEN) - lcd_bootscreen(); + ui.show_bootscreen(); #endif #if ENABLED(MIXING_EXTRUDER) @@ -924,11 +919,11 @@ void setup() { #endif #if DO_SWITCH_EXTRUDER - move_extruder_servo(0); // Initialize extruder servo + move_extruder_servo(0); // Initialize extruder servo #endif #if ENABLED(SWITCHING_NOZZLE) - move_nozzle_servo(0); // Initialize nozzle servo + move_nozzle_servo(0); // Initialize nozzle servo #endif #if ENABLED(PARKING_EXTRUDER) @@ -936,11 +931,11 @@ void setup() { #endif #if ENABLED(POWER_LOSS_RECOVERY) - check_print_job_recovery(); + recovery.check(); #endif - #if ENABLED(USE_WATCHDOG) // Reinit watchdog after HAL_get_reset_source call - watchdog_init(); + #if ENABLED(USE_WATCHDOG) + watchdog_init(); // Reinit watchdog after HAL_get_reset_source call #endif #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) @@ -967,7 +962,7 @@ void loop() { #if ENABLED(SDSUPPORT) card.checkautostart(); - if (card.abort_sd_printing) { + if (card.flag.abort_sd_printing) { card.stopSDPrint( #if SD_RESORT true diff --git a/Marlin/src/Marlin.h b/Marlin/src/Marlin.h index 1025d677c9..1ccac95e52 100644 --- a/Marlin/src/Marlin.h +++ b/Marlin/src/Marlin.h @@ -41,126 +41,6 @@ void idle( void manage_inactivity(const bool ignore_stepper_queue=false); -#if HAS_X2_ENABLE - #define enable_X() do{ X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); }while(0) - #define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0) -#elif HAS_X_ENABLE - #define enable_X() X_ENABLE_WRITE( X_ENABLE_ON) - #define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0) -#else - #define enable_X() NOOP - #define disable_X() NOOP -#endif - -#if HAS_Y2_ENABLE - #define enable_Y() do{ Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }while(0) - #define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); CBI(axis_known_position, Y_AXIS); }while(0) -#elif HAS_Y_ENABLE - #define enable_Y() Y_ENABLE_WRITE( Y_ENABLE_ON) - #define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); CBI(axis_known_position, Y_AXIS); }while(0) -#else - #define enable_Y() NOOP - #define disable_Y() NOOP -#endif - -#if HAS_Z3_ENABLE - #define enable_Z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); Z3_ENABLE_WRITE(Z_ENABLE_ON); }while(0) - #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); Z3_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0) -#elif HAS_Z2_ENABLE - #define enable_Z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }while(0) - #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0) -#elif HAS_Z_ENABLE - #define enable_Z() Z_ENABLE_WRITE( Z_ENABLE_ON) - #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0) -#else - #define enable_Z() NOOP - #define disable_Z() NOOP -#endif - -#if ENABLED(MIXING_EXTRUDER) - - /** - * Mixing steppers synchronize their enable (and direction) together - */ - #if MIXING_STEPPERS > 5 - #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); E4_ENABLE_WRITE( E_ENABLE_ON); E5_ENABLE_WRITE( E_ENABLE_ON); } - #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); E4_ENABLE_WRITE(!E_ENABLE_ON); E5_ENABLE_WRITE(!E_ENABLE_ON); } - #elif MIXING_STEPPERS > 4 - #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); E4_ENABLE_WRITE( E_ENABLE_ON); } - #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); E4_ENABLE_WRITE(!E_ENABLE_ON); } - #elif MIXING_STEPPERS > 3 - #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); } - #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); } - #elif MIXING_STEPPERS > 2 - #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); } - #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); } - #else - #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); } - #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); } - #endif - #define enable_E1() NOOP - #define disable_E1() NOOP - #define enable_E2() NOOP - #define disable_E2() NOOP - #define enable_E3() NOOP - #define disable_E3() NOOP - #define enable_E4() NOOP - #define disable_E4() NOOP - #define enable_E5() NOOP - #define disable_E5() NOOP - -#else // !MIXING_EXTRUDER - - #if HAS_E0_ENABLE - #define enable_E0() E0_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E0() E0_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E0() NOOP - #define disable_E0() NOOP - #endif - - #if E_STEPPERS > 1 && HAS_E1_ENABLE - #define enable_E1() E1_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E1() E1_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E1() NOOP - #define disable_E1() NOOP - #endif - - #if E_STEPPERS > 2 && HAS_E2_ENABLE - #define enable_E2() E2_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E2() E2_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E2() NOOP - #define disable_E2() NOOP - #endif - - #if E_STEPPERS > 3 && HAS_E3_ENABLE - #define enable_E3() E3_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E3() E3_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E3() NOOP - #define disable_E3() NOOP - #endif - - #if E_STEPPERS > 4 && HAS_E4_ENABLE - #define enable_E4() E4_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E4() E4_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E4() NOOP - #define disable_E4() NOOP - #endif - - #if E_STEPPERS > 5 && HAS_E5_ENABLE - #define enable_E5() E5_ENABLE_WRITE( E_ENABLE_ON) - #define disable_E5() E5_ENABLE_WRITE(!E_ENABLE_ON) - #else - #define enable_E5() NOOP - #define disable_E5() NOOP - #endif - -#endif // !MIXING_EXTRUDER - #if ENABLED(EXPERIMENTAL_I2CBUS) #include "feature/twibus.h" extern TWIBus i2c; @@ -210,11 +90,12 @@ extern millis_t max_inactive_time, stepper_inactive_time; extern bool fans_paused; extern uint8_t paused_fan_speed[FAN_COUNT]; #endif + #define FANS_LOOP(I) LOOP_L_N(I, FAN_COUNT) #endif inline void zero_fan_speeds() { #if FAN_COUNT > 0 - LOOP_L_N(i, FAN_COUNT) fan_speed[i] = 0; + FANS_LOOP(i) fan_speed[i] = 0; #endif } diff --git a/Marlin/src/config/default/Configuration_adv.h b/Marlin/src/config/default/Configuration_adv.h index e9c273780b..e9ee032b71 100644 --- a/Marlin/src/config/default/Configuration_adv.h +++ b/Marlin/src/config/default/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1049,6 +1063,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h index 970b201cdb..ee7ee61d6a 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Anet/A2/Configuration_adv.h b/Marlin/src/config/examples/Anet/A2/Configuration_adv.h index 2ff456d28a..b4e749dfc8 100644 --- a/Marlin/src/config/examples/Anet/A2/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A2/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h b/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h index 2ff456d28a..b4e749dfc8 100644 --- a/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h index c49c0f9aa8..c73d08f6a1 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h @@ -585,7 +585,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -804,7 +804,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1047,6 +1061,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h index 62a4127bf1..4cad717ac4 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/ArmEd/Configuration_adv.h b/Marlin/src/config/examples/ArmEd/Configuration_adv.h index c8c823e333..aeb1448f30 100644 --- a/Marlin/src/config/examples/ArmEd/Configuration_adv.h +++ b/Marlin/src/config/examples/ArmEd/Configuration_adv.h @@ -558,7 +558,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -777,7 +777,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1021,6 +1035,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h index b77d57bbbf..914d78f931 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -585,7 +585,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -804,7 +804,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1047,6 +1061,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h index 87426b386d..8f644d6a6c 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h index 6b02701fc5..cd10d663b9 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h index 0e46abc1be..b6725c00ac 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -594,7 +594,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -813,7 +813,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1056,6 +1070,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. #define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h index 6b02701fc5..cd10d663b9 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Cartesio/Configuration_adv.h b/Marlin/src/config/examples/Cartesio/Configuration_adv.h index 0c574a9b88..fb18a3b9f8 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration_adv.h +++ b/Marlin/src/config/examples/Cartesio/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h index 944ee1db99..88fda1efe0 100644 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Creality/CR-10/_Statusscreen.h b/Marlin/src/config/examples/Creality/CR-10/_Statusscreen.h index a03bc992fa..9df6de9c10 100644 --- a/Marlin/src/config/examples/Creality/CR-10/_Statusscreen.h +++ b/Marlin/src/config/examples/Creality/CR-10/_Statusscreen.h @@ -30,51 +30,36 @@ * http://marlinfw.org/tools/u8glib/converter.html */ -#define STATUS_SCREENWIDTH 128 -#define STATUS_SCREEN_HOTEND_TEXT_X(E) 38 -#define STATUS_SCREEN_BED_TEXT_X 73 +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_X 8 +#define STATUS_LOGO_Y 5 +#define STATUS_LOGO_WIDTH 22 -//============================================ +const unsigned char status_logo_bmp[] PROGMEM = { + B00111110,B00001111,B11110000, + B11000001,B10000110,B00011000, + B11000001,B10000110,B00001100, + B00000001,B10000110,B00000100, + B00000011,B00000110,B00000100, + B00011111,B00000110,B00000100, + B00000011,B00000110,B00000100, + B00000001,B10000110,B00000100, + B11000001,B10000110,B00001100, + B11000001,B10000110,B00011000, + B00111110,B00001111,B11110000 +}; -const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00111110,B00001111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B11000001,B10000110,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B11000001,B10000110,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00000000,B00000001,B10000110,B00000100,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101110,B00110001,B11010000, - B00000000,B00000011,B00000110,B00000100,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B01111011,B11010000, - B00000000,B00011111,B00000110,B00000100,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B01111011,B11010000, - B00000000,B00000011,B00000110,B00000100,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101110,B00110001,B11010000, - B00000000,B00000001,B10000110,B00000100,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00101100,B00000000,B11010000, - B00000000,B11000001,B10000110,B00001100,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B11000001,B10000110,B00011000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00111110,B00001111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000 -}; -const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B10000111,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00111110,B00001111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B11000001,B10000110,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B11000001,B10000110,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00000000,B00000001,B10000110,B00000100,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000011,B00000110,B00000100,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00011111,B00000110,B00000100,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000011,B00000110,B00000100,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000001,B10000110,B00000100,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00101111,B00000011,B11010000, - B00000000,B11000001,B10000110,B00001100,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B11000001,B10000110,B00011000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00111110,B00001111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110011,B10000111,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000 -}; +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM +#if HOTENDS < 2 + #define STATUS_HEATERS_X 40 + #define STATUS_BED_X 72 +#else + #define STATUS_HEATERS_X 32 + #define STATUS_BED_X 80 +#endif diff --git a/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h index 9a856c6488..ceb09db9c3 100644 --- a/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. #define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Creality/CR-10S/_Statusscreen.h b/Marlin/src/config/examples/Creality/CR-10S/_Statusscreen.h index 30264c6def..b8b13e000c 100644 --- a/Marlin/src/config/examples/Creality/CR-10S/_Statusscreen.h +++ b/Marlin/src/config/examples/Creality/CR-10S/_Statusscreen.h @@ -30,423 +30,44 @@ * http://marlinfw.org/tools/u8glib/converter.html */ -#define STATUS_SCREENWIDTH 128 +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_Y 1 +#define STATUS_LOGO_WIDTH 36 -#define STATUS_SCREEN_HOTEND_TEXT_X(E) (38 + (E) * 20) - -#define STATUS_SCREEN_BED_TEXT_X (HOTENDS > 1 ? 81 : 73) - -// Can also be overridden in Configuration.h -#ifndef FAN_ANIM_FRAMES - #define FAN_ANIM_FRAMES 3 -#endif -#define STATUS_SCREEN_FAN_TEXT_X (FAN_ANIM_FRAMES == 3 ? 103 : 105) -#define STATUS_SCREEN_FAN_TEXT_Y (FAN_ANIM_FRAMES > 2 ? 28 : 27) - -//============================================ +const unsigned char status_logo_bmp[] PROGMEM = { + B00111101,B11110000,B00000010,B00111000,B11110000, + B01000100,B10001000,B00000110,B01000101,B00010000, + B10000000,B10001000,B00000010,B01000101,B00000000, + B10000000,B11110000,B00000010,B01000100,B10000000, + B10000000,B10100011,B11110010,B01000100,B01100000, + B10000000,B10010000,B00000010,B01000100,B00010000, + B10000000,B10010000,B00000010,B01000100,B00010000, + B01000100,B10001000,B00000010,B01000101,B00010000, + B00111001,B11001100,B00000111,B00111001,B11100000, + B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00111000,B01110000,B11100000,B00000000, + B00000000,B01000100,B10001001,B00010000,B00000000, + B00000000,B00000100,B10001001,B00010000,B00000000, + B00000000,B00011000,B10001001,B00010000,B00000000, + B00000000,B00000100,B10001001,B00010000,B00000000, + B00000000,B00000100,B10001001,B00010000,B00000000, + B00000000,B00000100,B10001001,B00010000,B00000000, + B00000000,B01000100,B10001001,B00010000,B00000000, + B00000000,B00111000,B01110000,B11100000,B00000000 +}; +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM +#define STATUS_HEATERS_XSPACE 20 #if HOTENDS < 2 - - #if FAN_ANIM_FRAMES <= 2 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101110,B00110001,B11010000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B01111011,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B01111011,B11010000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101110,B00110001,B11010000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00101100,B00000000,B11010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B10000111,B00110000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B00110000,B00010000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00101111,B00000011,B11010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110011,B10000111,B00110000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000 - }; - - #elif FAN_ANIM_FRAMES == 3 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000000,B00011111, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00100000,B00100111, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B11110000,B01111011, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B11110000,B01111011, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11111000,B11111101, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B11111000,B11111001, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00000100,B00111111,B11100001, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00000100,B00001111,B10000001, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00000100,B00001111,B10000001, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00000100,B00001111,B10000001, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00000100,B00111111,B11100001, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00000100,B11111000,B11111001, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00000101,B11111000,B11111101, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00000110,B11110000,B01111011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00000110,B11110000,B01111011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00100000,B00100111, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000111,B11000000,B00011111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000111,B11111111,B11111111 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000110,B00011111, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00111110,B00000111, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00111110,B00000011, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00011110,B00000011, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00011110,B00001101, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00000110,B00111101, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00000100,B00000111,B00111101, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00000100,B00001111,B11111111, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00000111,B11111111,B11111111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00000111,B11111111,B10000001, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00000101,B11100111,B00000001, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00000101,B11000011,B00000001, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00000101,B10000011,B11000001, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00000110,B00000011,B11000011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00000110,B00000011,B11100011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00000011,B11100111, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000111,B11000011,B00011111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000111,B11111111,B11111111 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000011,B00011111, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00000011,B11100111, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00000011,B11110011, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B10000011,B11100011, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11000011,B11000001, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11100011,B10000001, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00000101,B11110111,B00000001, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00000111,B11111111,B10000001, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00000111,B11111111,B11111111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00000100,B00001111,B11111111, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00000100,B00000111,B01111101, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00000100,B00001110,B00111101, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00000100,B00011110,B00011101, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00000110,B00111110,B00001011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00000110,B01111110,B00000011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00111110,B00000111, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000111,B11000110,B00011111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000111,B11111111,B11111111 - }; - - #elif FAN_ANIM_FRAMES == 4 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00111111,B00111000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111110,B00011000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111100,B00011000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101000,B01111100,B00001000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00111000,B00001000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B00111001,B11001000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11111111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11111111,B11101000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100111,B00111001,B11101000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B00111000,B01101000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B01111100,B00101000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110000,B01111100,B00011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B11111100,B00011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11111000,B00111000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00001111,B00111000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B11011000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110110,B00011111,B10011000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011111,B00001000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10011110,B00001000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11111100,B00001000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11011100,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100111,B11101111,B11001000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01110111,B11101000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100000,B01111111,B11101000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B11110011,B11101000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100001,B11110001,B11101000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110011,B11110000,B11011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110111,B11110000,B01011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11100000,B00111000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B10000000,B11111000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B10000000,B00111000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000001,B11011000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B11000011,B11011000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11101000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B11000111,B11111000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100001,B11111111,B10001000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01101100,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01101100,B00001000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01101100,B00001000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100011,B11111111,B00001000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00111111,B11000111,B10001000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B11000111,B11001000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110111,B10000111,B11011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110111,B00000011,B11011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000011,B00111000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000010,B11111000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen3_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11100000,B00011000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11100000,B00011000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11100001,B11101000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110011,B11101000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01111111,B11101000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01110111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101000,B11101110,B00101000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11011100,B00001000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00101111,B11111100,B00001000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B10011110,B00001000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B00001111,B00001000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110000,B00001111,B00011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B00001111,B00011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 - }; - - #endif - -#else // HOTENDS >= 2 - - #if FAN_ANIM_FRAMES <= 2 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00101110,B00110001,B11010000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00101111,B01111011,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00101111,B01111011,B11010000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00101110,B00110001,B11010000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00101100,B00000000,B11010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110000,B11111100,B00110000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B10000111,B00110000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00100000,B00110000,B00010000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00100000,B01111000,B00010000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00100000,B00110000,B00010000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00101111,B00000011,B11010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00101111,B10000111,B11010000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110011,B10000111,B00110000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - - #elif FAN_ANIM_FRAMES == 3 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000000,B00011111, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00100000,B00100111, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B11110000,B01111011, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B11110000,B01111011, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11111000,B11111101, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B11111000,B11111001, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00000100,B00111111,B11100001, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00000100,B00001111,B10000001, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00000100,B00001111,B10000001, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00000100,B00001111,B10000001, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00000100,B00111111,B11100001, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00000100,B11111000,B11111001, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00000101,B11111000,B11111101, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00000110,B11110000,B01111011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00000110,B11110000,B01111011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000111,B00100000,B00100111, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00000111,B11000000,B00011111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00000111,B11111111,B11111111 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000110,B00011111, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00111110,B00000111, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00111110,B00000011, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00011110,B00000011, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00011110,B00001101, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00000110,B00111101, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00000100,B00000111,B00111101, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00000100,B00001111,B11111111, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00000111,B11111111,B11111111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00000111,B11111111,B10000001, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00000101,B11100111,B00000001, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00000101,B11000011,B00000001, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00000101,B10000011,B11000001, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00000110,B00000011,B11000011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00000110,B00000011,B11100011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000111,B00000011,B11100111, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00000111,B11000011,B00011111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00000111,B11111111,B11111111 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000011,B00011111, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00000011,B11100111, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00000011,B11110011, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B10000011,B11100011, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11000011,B11000001, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11100011,B10000001, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00000101,B11110111,B00000001, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00000111,B11111111,B10000001, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00000111,B11111111,B11111111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00000100,B00001111,B11111111, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00000100,B00000111,B01111101, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00000100,B00001110,B00111101, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00000100,B00011110,B00011101, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00000110,B00111110,B00001011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00000110,B01111110,B00000011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000111,B00111110,B00000111, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00000111,B11000110,B00011111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00000111,B11111111,B11111111 - }; - - #elif FAN_ANIM_FRAMES == 4 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00111111,B00111000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111110,B00011000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111100,B00011000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101000,B01111100,B00001000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00111000,B00001000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00101111,B00111001,B11001000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00101111,B11111111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00101111,B11000111,B11101000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00101111,B11111111,B11101000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00100111,B00111001,B11101000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00100000,B00111000,B01101000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00101000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110000,B01111100,B00011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110000,B11111100,B00011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111001,B11111000,B00111000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00001111,B00111000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B11011000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110110,B00011111,B10011000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011111,B00001000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10011110,B00001000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00101111,B11111100,B00001000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00101111,B11011100,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00100111,B11101111,B11001000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00100000,B01110111,B11101000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11101000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00100000,B11110011,B11101000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00100001,B11110001,B11101000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110011,B11110000,B11011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110111,B11110000,B01011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111001,B11100000,B00111000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B10000000,B11111000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B10000000,B00111000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000001,B11011000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B11000011,B11011000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11101000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B11000111,B11111000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00100001,B11111111,B10001000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00100000,B01101100,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00100000,B01101100,B00001000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00100000,B01101100,B00001000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00100011,B11111111,B00001000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00111111,B11000111,B10001000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00101111,B11000111,B11001000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110111,B10000111,B11011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110111,B00000011,B11011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00000011,B00111000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000010,B11111000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen3_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11100000,B00011000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11100000,B00011000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11100001,B11101000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110011,B11101000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00100000,B01111111,B11101000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00100000,B01110111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00101000,B11101110,B00101000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00101111,B11011100,B00001000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00101111,B11111100,B00001000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00101111,B10011110,B00001000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00101111,B00001111,B00001000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110000,B00001111,B00011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110000,B00001111,B00011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - - #endif - -#endif // HOTENDS >= 2 + #define STATUS_HEATERS_X 48 + #define STATUS_BED_X 72 +#else + #define STATUS_HEATERS_X 40 + #define STATUS_BED_X 80 +#endif diff --git a/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h index 689bb16811..4777910147 100644 --- a/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Creality/CR-10mini/_Statusscreen.h b/Marlin/src/config/examples/Creality/CR-10mini/_Statusscreen.h index f4fd17696a..29353ad7e5 100644 --- a/Marlin/src/config/examples/Creality/CR-10mini/_Statusscreen.h +++ b/Marlin/src/config/examples/Creality/CR-10mini/_Statusscreen.h @@ -30,51 +30,44 @@ * http://marlinfw.org/tools/u8glib/converter.html */ -#define STATUS_SCREENWIDTH 128 -#define STATUS_SCREEN_HOTEND_TEXT_X(E) 38 -#define STATUS_SCREEN_BED_TEXT_X 73 +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_Y 5 +#define STATUS_LOGO_WIDTH 36 -//============================================ +const unsigned char status_logo_bmp[] PROGMEM = { + B00000111,B11001111,B10000000,B00110001,B11100000, + B00001111,B11001111,B11000000,B01110011,B11110000, + B00001100,B00001100,B01000000,B01110011,B00110000, + B00001100,B00001100,B11000000,B00110011,B00110000, + B00001100,B00001111,B11001111,B00110011,B00110000, + B00001100,B00001101,B10001111,B00110011,B00110000, + B00001100,B00001100,B11000000,B00110011,B00110000, + B00001111,B11001100,B11000000,B00110011,B11110000, + B00000111,B11001100,B11000000,B00110001,B11100000, + B00000000,B00000000,B00000000,B00000000,B00000000, + B00000001,B10000011,B00110000,B00000011,B00000000, + B00000001,B10000011,B00110010,B00000011,B00000000, + B00000001,B11000111,B00000010,B11100000,B00000000, + B00000001,B11000111,B00110011,B11110011,B00000000, + B00000001,B11101111,B00110011,B00110011,B00000000, + B00000001,B10111011,B00110011,B00110011,B00000000, + B00000001,B10010011,B00110011,B00110011,B00000000, + B00000001,B10010011,B00110011,B00110011,B00000000, + B00000001,B10000011,B00110011,B00110011,B00000000 +}; -const unsigned char status_screen0_bmp[] PROGMEM = { - B00000111,B11001111,B10000000,B00110001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00001111,B11001111,B11000000,B01110011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001100,B00001100,B01000000,B01110011,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00001100,B00001100,B11000000,B00110011,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00001100,B00001111,B11001111,B00110011,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00001100,B00001101,B10001111,B00110011,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00001100,B00001100,B11000000,B00110011,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00001111,B11001100,B11000000,B00110011,B11110000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101110,B00110001,B11010000, - B00000111,B11001100,B11000000,B00110001,B11100000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B01111011,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B01111011,B11010000, - B00000001,B10000011,B00110000,B00000011,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101110,B00110001,B11010000, - B00000001,B10000011,B00110010,B00000011,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00101100,B00000000,B11010000, - B00000001,B11000111,B00000010,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000001,B11000111,B00110011,B11110011,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000001,B11101111,B00110011,B00110011,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000001,B10111011,B00110011,B00110011,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B11111100,B00110000, - B00000001,B10010011,B00110011,B00110011,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000001,B10010011,B00110011,B00110011,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11110000, - B00000001,B10000011,B00110011,B00110011,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000 -}; -const unsigned char status_screen1_bmp[] PROGMEM = { - B00000111,B11001111,B10000000,B00110001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00001111,B11001111,B11000000,B01110011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001100,B00001100,B01000000,B01110011,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B10000111,B00110000, - B00001100,B00001100,B11000000,B00110011,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00001100,B00001111,B11001111,B00110011,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00001100,B00001101,B10001111,B00110011,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00001100,B00001100,B11000000,B00110011,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00001111,B11001100,B11000000,B00110011,B11110000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B00110000,B00010000, - B00000111,B11001100,B11000000,B00110001,B11100000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01111000,B00010000, - B00000001,B10000011,B00110000,B00000011,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B00110000,B00010000, - B00000001,B10000011,B00110010,B00000011,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00101111,B00000011,B11010000, - B00000001,B11000111,B00000010,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000001,B11000111,B00110011,B11110011,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000001,B11101111,B00110011,B00110011,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000001,B10111011,B00110011,B00110011,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110011,B10000111,B00110000, - B00000001,B10010011,B00110011,B00110011,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000001,B10010011,B00110011,B00110011,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11110000, - B00000001,B10000011,B00110011,B00110011,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000 -}; +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM +#define STATUS_HEATERS_XSPACE 20 +#if HOTENDS < 2 + #define STATUS_HEATERS_X 48 + #define STATUS_BED_X 72 +#else + #define STATUS_HEATERS_X 40 + #define STATUS_BED_X 80 +#endif diff --git a/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h index da34a421b4..1e5b7396ae 100644 --- a/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h index d2ff9289b7..83723a207f 100644 --- a/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Creality/Ender-2/_Statusscreen.h b/Marlin/src/config/examples/Creality/Ender-2/_Statusscreen.h index fd269c4b91..b8f474ee80 100644 --- a/Marlin/src/config/examples/Creality/Ender-2/_Statusscreen.h +++ b/Marlin/src/config/examples/Creality/Ender-2/_Statusscreen.h @@ -30,101 +30,36 @@ * http://marlinfw.org/tools/u8glib/converter.html */ -#define STATUS_SCREENWIDTH 128 -#define STATUS_SCREEN_HOTEND_TEXT_X(E) (38 + (E) * 20) -#define STATUS_SCREEN_BED_TEXT_X (HOTENDS > 1 ? 81 : 73) -#define STATUS_SCREEN_FAN_TEXT_X 103 +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_Y 5 +#define STATUS_LOGO_WIDTH 39 -//============================================ +const unsigned char status_logo_bmp[] PROGMEM = { + B00000000,B00000000,B00000110,B00000000,B00000000, + B11111110,B00000000,B00000010,B00000000,B00000000, + B01000010,B00000000,B00000010,B00000000,B00000000, + B01001000,B00000000,B00000010,B00000000,B00000000, + B01001000,B11011100,B00111110,B00111100,B11101110, + B01111000,B01100010,B01000010,B01000010,B00110010, + B01001000,B01000010,B01000010,B01000010,B00100000, + B01001000,B01000010,B01000010,B01111110,B00100000, + B01000000,B01000010,B01000010,B01000000,B00100000, + B01000010,B01000010,B01000110,B01000010,B00100000, + B11111110,B11100111,B00111011,B00111100,B11111000 +}; +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM +#define STATUS_HEATERS_XSPACE 20 #if HOTENDS < 2 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B11111110,B00000000,B00000010,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101110,B00110001,B11010000, - B01000010,B00000000,B00000010,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B01111011,B11010000, - B01001000,B00000000,B00000010,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B01111011,B11010000, - B01001000,B11011100,B00111110,B00111100,B11101110,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101110,B00110001,B11010000, - B01111000,B01100010,B01000010,B01000010,B00110010,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00101100,B00000000,B11010000, - B01001000,B01000010,B01000010,B01000010,B00100000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B00110000,B00010000, - B01001000,B01000010,B01000010,B01111110,B00100000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B01111000,B00010000, - B01000000,B01000010,B01000010,B01000000,B00100000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100000,B11111100,B00010000, - B01000010,B01000010,B01000110,B01000010,B00100000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B11111100,B00110000, - B11111110,B11100111,B00111011,B00111100,B11111000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B10000111,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B11111110,B00000000,B00000010,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B00110000,B00010000, - B01000010,B00000000,B00000010,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01111000,B00010000, - B01001000,B00000000,B00000010,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01111000,B00010000, - B01001000,B11011100,B00111110,B00111100,B11101110,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B00110000,B00010000, - B01111000,B01100010,B01000010,B01000010,B00110010,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00101111,B00000011,B11010000, - B01001000,B01000010,B01000010,B01000010,B00100000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B10000111,B11010000, - B01001000,B01000010,B01000010,B01111110,B00100000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B10000111,B11010000, - B01000000,B01000010,B01000010,B01000000,B00100000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100111,B10000111,B10010000, - B01000010,B01000010,B01000110,B01000010,B00100000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110011,B10000111,B00110000, - B11111110,B11100111,B00111011,B00111100,B11111000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000 - }; - -#else // HOTENDS >= 2 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B11111110,B00000000,B00000010,B00000000,B00000000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00101110,B00110001,B11010000, - B01000010,B00000000,B00000010,B00000000,B00000000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00101111,B01111011,B11010000, - B01001000,B00000000,B00000010,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00101111,B01111011,B11010000, - B01001000,B11011100,B00111110,B00111100,B11101110,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00101110,B00110001,B11010000, - B01111000,B01100010,B01000010,B01000010,B00110010,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00101100,B00000000,B11010000, - B01001000,B01000010,B01000010,B01000010,B00100000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B01001000,B01000010,B01000010,B01111110,B00100000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00100000,B01111000,B00010000, - B01000000,B01000010,B01000010,B01000000,B00100000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00100000,B11111100,B00010000, - B01000010,B01000010,B01000110,B01000010,B00100000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110000,B11111100,B00110000, - B11111110,B11100111,B00111011,B00111100,B11111000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B10000111,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B11111110,B00000000,B00000010,B00000000,B00000000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00100000,B00110000,B00010000, - B01000010,B00000000,B00000010,B00000000,B00000000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00100000,B01111000,B00010000, - B01001000,B00000000,B00000010,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00100000,B01111000,B00010000, - B01001000,B11011100,B00111110,B00111100,B11101110,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00100000,B00110000,B00010000, - B01111000,B01100010,B01000010,B01000010,B00110010,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00101111,B00000011,B11010000, - B01001000,B01000010,B01000010,B01000010,B00100000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00101111,B10000111,B11010000, - B01001000,B01000010,B01000010,B01111110,B00100000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00101111,B10000111,B11010000, - B01000000,B01000010,B01000010,B01000000,B00100000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00100111,B10000111,B10010000, - B01000010,B01000010,B01000110,B01000010,B00100000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110011,B10000111,B00110000, - B11111110,B11100111,B00111011,B00111100,B11111000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - -#endif // HOTENDS >= 2 + #define STATUS_HEATERS_X 48 + #define STATUS_BED_X 72 +#else + #define STATUS_HEATERS_X 40 + #define STATUS_BED_X 80 +#endif diff --git a/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h index 6a556568a0..2127ff2eb5 100644 --- a/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Creality/Ender-3/_Statusscreen.h b/Marlin/src/config/examples/Creality/Ender-3/_Statusscreen.h index 95e8298c3e..285711236a 100644 --- a/Marlin/src/config/examples/Creality/Ender-3/_Statusscreen.h +++ b/Marlin/src/config/examples/Creality/Ender-3/_Statusscreen.h @@ -30,101 +30,32 @@ * http://marlinfw.org/tools/u8glib/converter.html */ -#define STATUS_SCREENWIDTH 128 -#define STATUS_SCREEN_HOTEND_TEXT_X(E) (38 + (E) * 20) -#define STATUS_SCREEN_BED_TEXT_X (HOTENDS > 1 ? 81 : 73) -#define STATUS_SCREEN_FAN_TEXT_X 103 +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_Y 8 +#define STATUS_LOGO_WIDTH 39 -//============================================ +const unsigned char status_logo_bmp[] PROGMEM = { + B11111000,B00000001,B10000000,B00000000,B00001100, + B01001000,B00000000,B10000000,B00000000,B00010010, + B01000011,B11000011,B10001100,B11010000,B00000010, + B01110001,B00100100,B10010010,B01100111,B11001100, + B01000001,B00100100,B10011110,B01000000,B00000010, + B01001001,B00100100,B10010000,B01000000,B00010010, + B11111011,B10110011,B11001110,B11100000,B00001100 +}; +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM +#define STATUS_HEATERS_XSPACE 20 #if HOTENDS < 2 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B11111000,B00000001,B10000000,B00000000,B00001100,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101110,B00110001,B11010000, - B01001000,B00000000,B10000000,B00000000,B00010010,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B01111011,B11010000, - B01000011,B11000011,B10001100,B11010000,B00000010,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B01111011,B11010000, - B01110001,B00100100,B10010010,B01100111,B11001100,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101110,B00110001,B11010000, - B01000001,B00100100,B10011110,B01000000,B00000010,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00101100,B00000000,B11010000, - B01001001,B00100100,B10010000,B01000000,B00010010,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B00110000,B00010000, - B11111011,B10110011,B11001110,B11100000,B00001100,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B10000111,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B11111000,B00000001,B10000000,B00000000,B00001100,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B00110000,B00010000, - B01001000,B00000000,B10000000,B00000000,B00010010,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01111000,B00010000, - B01000011,B11000011,B10001100,B11010000,B00000010,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01111000,B00010000, - B01110001,B00100100,B10010010,B01100111,B11001100,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B00110000,B00010000, - B01000001,B00100100,B10011110,B01000000,B00000010,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00101111,B00000011,B11010000, - B01001001,B00100100,B10010000,B01000000,B00010010,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B10000111,B11010000, - B11111011,B10110011,B11001110,B11100000,B00001100,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110011,B10000111,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000 - }; - -#else // HOTENDS >= 2 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B11111000,B00000001,B10000000,B00000000,B00001100,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00101110,B00110001,B11010000, - B01001000,B00000000,B10000000,B00000000,B00010010,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00101111,B01111011,B11010000, - B01000011,B11000011,B10001100,B11010000,B00000010,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00101111,B01111011,B11010000, - B01110001,B00100100,B10010010,B01100111,B11001100,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00101110,B00110001,B11010000, - B01000001,B00100100,B10011110,B01000000,B00000010,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00101100,B00000000,B11010000, - B01001001,B00100100,B10010000,B01000000,B00010010,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B11111011,B10110011,B11001110,B11100000,B00001100,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B10000111,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B11111000,B00000001,B10000000,B00000000,B00001100,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00100000,B00110000,B00010000, - B01001000,B00000000,B10000000,B00000000,B00010010,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00100000,B01111000,B00010000, - B01000011,B11000011,B10001100,B11010000,B00000010,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00100000,B01111000,B00010000, - B01110001,B00100100,B10010010,B01100111,B11001100,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00100000,B00110000,B00010000, - B01000001,B00100100,B10011110,B01000000,B00000010,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00101111,B00000011,B11010000, - B01001001,B00100100,B10010000,B01000000,B00010010,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00101111,B10000111,B11010000, - B11111011,B10110011,B11001110,B11100000,B00001100,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110011,B10000111,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - -#endif // HOTENDS >= 2 + #define STATUS_HEATERS_X 48 + #define STATUS_BED_X 72 +#else + #define STATUS_HEATERS_X 40 + #define STATUS_BED_X 80 +#endif diff --git a/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h index 2224cd3c9b..f8bcdbee0d 100644 --- a/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Einstart-S/Configuration_adv.h b/Marlin/src/config/examples/Einstart-S/Configuration_adv.h index 78aacb61c7..15c6665857 100644 --- a/Marlin/src/config/examples/Einstart-S/Configuration_adv.h +++ b/Marlin/src/config/examples/Einstart-S/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Felix/Configuration_adv.h b/Marlin/src/config/examples/Felix/Configuration_adv.h index c425e5e899..ec2fdd35c4 100644 --- a/Marlin/src/config/examples/Felix/Configuration_adv.h +++ b/Marlin/src/config/examples/Felix/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h index 1b0209a6bc..4297720717 100644 --- a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS #define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Formbot/Raptor/Configuration.h b/Marlin/src/config/examples/Formbot/Raptor/Configuration.h index e44136589b..8086bd3690 100644 --- a/Marlin/src/config/examples/Formbot/Raptor/Configuration.h +++ b/Marlin/src/config/examples/Formbot/Raptor/Configuration.h @@ -751,19 +751,19 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#if ENABLED(X_SpreadCycle) || !ENABLED(X_2208) - #define DEFAULT_XJERK 20.0 +#if ENABLED(X_SpreadCycle) || DISABLED(X_2208) + #define DEFAULT_XJERK 20.0 #else - #define DEFAULT_XJERK 10.0 + #define DEFAULT_XJERK 10.0 #endif -#if ENABLED(Y_SpreadCycle) || !ENABLED(Y_2208) - #define DEFAULT_YJERK 10.0 +#if ENABLED(Y_SpreadCycle) || DISABLED(Y_2208) + #define DEFAULT_YJERK 10.0 #else - #define DEFAULT_YJERK 5.0 + #define DEFAULT_YJERK 5.0 #endif -#define DEFAULT_ZJERK 0.4 -#define DEFAULT_EJERK 5.0 +#define DEFAULT_ZJERK 0.4 +#define DEFAULT_EJERK 5.0 /** * S-Curve Acceleration diff --git a/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h b/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h index 6be3a02d15..b86b563e33 100644 --- a/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h +++ b/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage #define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1050,6 +1064,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. #define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Formbot/Raptor/_Statusscreen.h b/Marlin/src/config/examples/Formbot/Raptor/_Statusscreen.h index 723c1f40fe..d0450837ab 100644 --- a/Marlin/src/config/examples/Formbot/Raptor/_Statusscreen.h +++ b/Marlin/src/config/examples/Formbot/Raptor/_Statusscreen.h @@ -30,422 +30,45 @@ * http://marlinfw.org/tools/u8glib/converter.html */ -//============================================ +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_Y 3 +#define STATUS_LOGO_WIDTH 24 -#define STATUS_SCREENWIDTH 128 - -#define STATUS_SCREEN_HOTEND_TEXT_X(E) (41 + (E) * 20) - -#define STATUS_SCREEN_BED_TEXT_X (HOTENDS > 1 ? 81 : 73) - -#define FAN_ANIM_FRAMES 3 -#define STATUS_SCREEN_FAN_TEXT_X (FAN_ANIM_FRAMES == 3 ? 103 : 105) -#define STATUS_SCREEN_FAN_TEXT_Y (FAN_ANIM_FRAMES > 2 ? 28 : 27) - -//============================================ +const unsigned char status_logo_bmp[] PROGMEM = { + B11111111,B11111111,B11111111, + B10000000,B00000000,B00000001, + B10001110,B00000000,B11100001, + B10011111,B00000001,B11110001, + B10010011,B10000001,B00111001, + B10011111,B10000001,B11111001, + B10011111,B10000001,B11111001, + B10011111,B10111001,B11111001, + B10001111,B00101000,B11110001, + B10000000,B00111000,B00000001, + B10000000,B00000000,B00000001, + B10011111,B11111111,B11111001, + B10010001,B01110100,B10011001, + B10011011,B00000110,B10101001, + B10011011,B01010100,B10101001, + B10011011,B01010110,B10101001, + B10011011,B01010100,B10011001, + B10011111,B11111111,B11111001, + B11111111,B11111111,B11111111 +}; +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM #if HOTENDS < 2 - - #if FAN_ANIM_FRAMES <= 2 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00111111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111110,B00011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101000,B01111100,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00111000,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B00111001,B11001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11111111,B11101000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11000111,B11101000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11111111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100111,B00111001,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B00111000,B01101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B01111100,B00101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B11111100,B00011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11111000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B10000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B10000000,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000001,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B11000011,B11011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11101000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B11000111,B11111000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100001,B11111111,B10001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01101100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01101100,B00001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01101100,B00001000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100011,B11111111,B00001000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00111111,B11000111,B10001000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B11000111,B11001000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110111,B10000111,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110111,B00000011,B11011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000011,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000010,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 - }; - - #elif FAN_ANIM_FRAMES == 3 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00111111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111110,B00011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101000,B01111100,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00111000,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B00111001,B11001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11111111,B11101000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11000111,B11101000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11111111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100111,B00111001,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B00111000,B01101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B01111100,B00101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B11111100,B00011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11111000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00001111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110110,B00011111,B10011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011111,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10011110,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11111100,B00001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11011100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100111,B11101111,B11001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01110111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100000,B01111111,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B11110011,B11101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100001,B11110001,B11101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110011,B11110000,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110111,B11110000,B01011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11100000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B10000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B10000000,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000001,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B11000011,B11011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11101000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B11000111,B11111000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100001,B11111111,B10001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01101100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01101100,B00001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01101100,B00001000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100011,B11111111,B00001000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00111111,B11000111,B10001000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B11000111,B11001000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110111,B10000111,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110111,B00000011,B11011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000011,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000010,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 - }; - - #elif FAN_ANIM_FRAMES == 4 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00111111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111110,B00011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101000,B01111100,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00111000,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B00111001,B11001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11111111,B11101000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11000111,B11101000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11111111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100111,B00111001,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B00111000,B01101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B01111100,B00101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110000,B01111100,B00011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B11111100,B00011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11111000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00001111,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110110,B00011111,B10011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011111,B00001000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10011110,B00001000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11111100,B00001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101111,B11011100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100111,B11101111,B11001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01110111,B11101000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100000,B01111111,B11101000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100000,B11110011,B11101000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00100001,B11110001,B11101000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110011,B11110000,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110111,B11110000,B01011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11100000,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B10000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B10000000,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000001,B11011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B11000011,B11011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11101000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B11000111,B11111000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100001,B11111111,B10001000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01101100,B00001000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01101100,B00001000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01101100,B00001000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00100011,B11111111,B00001000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00111111,B11000111,B10001000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B11000111,B11001000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110111,B10000111,B11011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110111,B00000011,B11011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000011,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000010,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen3_bmp[] PROGMEM = { - B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10001110,B00000000,B11100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B10011111,B00000000,B11110001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11100000,B00011000, - B10010011,B10000001,B00111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11100000,B00011000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11100001,B11101000, - B10011111,B10000001,B11111001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110011,B11101000, - B10011111,B10111001,B11110001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00100000,B01111111,B11101000, - B10001111,B00101000,B11110001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00100000,B01110111,B11101000, - B10000000,B00111000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000100,B00010000,B01000000,B00000000,B00101000,B11101110,B00101000, - B10000000,B00000000,B00000001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00101111,B11011100,B00001000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00101111,B11111100,B00001000, - B10010001,B01110100,B10011001,B00000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B10011110,B00001000, - B10011011,B00000110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00100000,B10000010,B00000000,B00000000,B00101111,B00001111,B00001000, - B10011011,B01010100,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00010000,B01000001,B00000000,B00000000,B00110000,B00001111,B00011000, - B10011011,B01010110,B10101001,B00000000,B00000000,B00111111,B11110000,B00000000,B00000000,B00001000,B00100000,B10000000,B00000000,B00110000,B00001111,B00011000, - B10011011,B01010100,B10011001,B00000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B10011111,B11111111,B11111001,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111110,B00000000,B11111000, - B11111111,B11111111,B11111111,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00111111,B11111111,B11111000 - }; - - #endif - -#else // HOTENDS >= 2 - - #if FAN_ANIM_FRAMES <= 2 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00101110,B00110001,B11010000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00101111,B01111011,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00101111,B01111011,B11010000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00101110,B00110001,B11010000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00101100,B00000000,B11010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110000,B11111100,B00110000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B10000111,B00110000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00100000,B00110000,B00010000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00100000,B01111000,B00010000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00100000,B00110000,B00010000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00101111,B00000011,B11010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00101111,B10000111,B11010000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110011,B10000111,B00110000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - - #elif FAN_ANIM_FRAMES == 3 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000000,B00011111, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00100000,B00100111, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B11110000,B01111011, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B11110000,B01111011, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11111000,B11111101, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B11111000,B11111001, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00000100,B00111111,B11100001, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00000100,B00001111,B10000001, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00000100,B00001111,B10000001, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00000100,B00001111,B10000001, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00000100,B00111111,B11100001, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00000100,B11111000,B11111001, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00000101,B11111000,B11111101, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00000110,B11110000,B01111011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00000110,B11110000,B01111011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000111,B00100000,B00100111, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00000111,B11000000,B00011111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00000111,B11111111,B11111111 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000110,B00011111, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00111110,B00000111, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00111110,B00000011, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00011110,B00000011, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00011110,B00001101, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00000110,B00111101, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00000100,B00000111,B00111101, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00000100,B00001111,B11111111, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00000111,B11111111,B11111111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00000111,B11111111,B10000001, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00000101,B11100111,B00000001, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00000101,B11000011,B00000001, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00000101,B10000011,B11000001, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00000110,B00000011,B11000011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00000110,B00000011,B11100011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000111,B00000011,B11100111, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00000111,B11000011,B00011111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00000111,B11111111,B11111111 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000011,B00011111, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00000011,B11100111, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00000011,B11110011, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B10000011,B11100011, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11000011,B11000001, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11100011,B10000001, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00000101,B11110111,B00000001, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00000111,B11111111,B10000001, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00000111,B11111111,B11111111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00000100,B00001111,B11111111, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00000100,B00000111,B01111101, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00000100,B00001110,B00111101, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00000100,B00011110,B00011101, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00000110,B00111110,B00001011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00000110,B01111110,B00000011, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000111,B00111110,B00000111, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00000111,B11000110,B00011111, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00000111,B11111111,B11111111 - }; - - #elif FAN_ANIM_FRAMES == 4 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00111111,B00111000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111110,B00011000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B01111100,B00011000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101000,B01111100,B00001000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00111000,B00001000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00101111,B00111001,B11001000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00101111,B11111111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00101111,B11000111,B11101000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00101111,B11111111,B11101000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00100111,B00111001,B11101000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00100000,B00111000,B01101000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00101000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110000,B01111100,B00011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110000,B11111100,B00011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111001,B11111000,B00111000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00001111,B00111000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B11011000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110110,B00011111,B10011000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011111,B00001000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10011110,B00001000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00101111,B11111100,B00001000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00101111,B11011100,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00100111,B11101111,B11001000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00100000,B01110111,B11101000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11101000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00100000,B11110011,B11101000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00100001,B11110001,B11101000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110011,B11110000,B11011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110111,B11110000,B01011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111001,B11100000,B00111000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B10000000,B11111000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B10000000,B00111000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000001,B11011000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B11000011,B11011000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11101000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B11000111,B11111000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00100001,B11111111,B10001000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00100000,B01101100,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00100000,B01101100,B00001000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00100000,B01101100,B00001000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00100011,B11111111,B00001000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00111111,B11000111,B10001000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00101111,B11000111,B11001000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110111,B10000111,B11011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110111,B00000011,B11011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00000011,B00111000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000010,B11111000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen3_bmp[] PROGMEM = { - B00111101,B11110000,B00000010,B00111000,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01000100,B10001000,B00000110,B01000101,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B10000000,B10001000,B00000010,B01000101,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B10000000,B11110000,B00000010,B01000100,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11100000,B00011000, - B10000000,B10100011,B11110010,B01000100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11100000,B00011000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11100001,B11101000, - B10000000,B10010000,B00000010,B01000100,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110011,B11101000, - B01000100,B10001000,B00000010,B01000101,B00010000,B00011111,B11100000,B00000001,B11111110,B00000000,B00001000,B00100000,B10000000,B00100000,B01111111,B11101000, - B00111001,B11001100,B00000111,B00111001,B11100000,B00111110,B11110000,B00000011,B11001111,B00000000,B00000100,B00010000,B01000000,B00100000,B01110111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00111100,B11110000,B00000011,B10110111,B00000000,B00000100,B00010000,B01000000,B00101000,B11101110,B00101000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00111010,B11110000,B00000011,B11110111,B00000000,B00001000,B00100000,B10000000,B00101111,B11011100,B00001000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11101110,B00000000,B00010000,B01000001,B00000000,B00101111,B11111100,B00001000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00011110,B11100000,B00000001,B11011110,B00000000,B00100000,B10000010,B00000000,B00101111,B10011110,B00001000, - B00000000,B00011000,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10111111,B00000000,B00100000,B10000010,B00000000,B00101111,B00001111,B00001000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111110,B11110000,B00000011,B10000111,B00000000,B00010000,B01000001,B00000000,B00110000,B00001111,B00011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00111111,B11110000,B00000011,B11111111,B00000000,B00001000,B00100000,B10000000,B00110000,B00001111,B00011000, - B00000000,B00000100,B10001001,B00010000,B00000000,B00001111,B11000000,B00000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B01000100,B10001001,B00010000,B00000000,B00000111,B10000000,B00000000,B01111000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000000,B00111000,B01110000,B11100000,B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - - #endif - -#endif // HOTENDS >= 2 + #define STATUS_LOGO_X 8 + #define STATUS_HEATERS_X 40 + #define STATUS_BED_X 72 +#else + #define STATUS_LOGO_X 0 + #define STATUS_HEATERS_X 32 + #define STATUS_BED_X 80 +#endif diff --git a/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration.h b/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration.h index fbf0d71fce..30422027ec 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration.h @@ -242,6 +242,9 @@ // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). // For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X {0.0, 20.00} // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z {0.0, 0.00} // (mm) relative Z-offset for each nozzle #ifdef ROXYs_TRex #define HOTEND_OFFSET_X {0.0, 0.00} // (mm) for each extruder, offset of the hotend on the X axis @@ -665,7 +668,6 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] */ -//#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 160, 1600, 93 } #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 800, 93 } /** @@ -673,7 +675,6 @@ * Override with M203 * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] */ -//#define DEFAULT_MAX_FEEDRATE { 250, 150, 5, 25 } #define DEFAULT_MAX_FEEDRATE { 250, 100, 5, 25 } /** @@ -692,11 +693,6 @@ * 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 1500 // X, Y, Z and E acceleration for printing moves #define DEFAULT_RETRACT_ACCELERATION 1500 // E acceleration for retracts #define DEFAULT_TRAVEL_ACCELERATION 1500 // X, Y, Z acceleration for travel (non printing) moves @@ -709,11 +705,6 @@ * 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 10.0 -//#define DEFAULT_ZJERK 0.4 -//#define DEFAULT_EJERK 5.0 - #define DEFAULT_XJERK 12.0 // More conservitive numbers. #define DEFAULT_YJERK 8.0 #define DEFAULT_ZJERK 0.4 @@ -801,6 +792,7 @@ //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed #endif + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE @@ -846,7 +838,7 @@ #define MIN_PROBE_EDGE 0 // X and Y axis travel speed (mm/m) between probes -#define XY_PROBE_SPEED 7000 +#define XY_PROBE_SPEED 5000 // Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z @@ -876,7 +868,7 @@ #define Z_CLEARANCE_DEPLOY_PROBE 7 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 7 // Z Clearance between probe points #define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -#define Z_AFTER_PROBING 7 // Z position after probing is done +#define Z_AFTER_PROBING 10 // Z position after probing is done #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping @@ -970,11 +962,7 @@ #define Z_MIN_POS 0 #define X_MAX_POS 450 #define Y_MAX_POS Y_BED_SIZE -#if ENABLED(tallVersion) - #define Z_MAX_POS 700 -#else - #define Z_MAX_POS 500 -#endif +#define Z_MAX_POS 700 /** * Software Endstops @@ -1110,7 +1098,7 @@ #if ENABLED(G26_MESH_VALIDATION) #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. - #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 208.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif @@ -1249,8 +1237,8 @@ #define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) - #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). - #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_X_POINT (((X_BED_SIZE) / 2) - 15) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT (((Y_BED_SIZE) / 2) - 15) // Y point for Z homing when homing all axes (G28). #endif // Homing speeds (mm/m) @@ -1484,7 +1472,7 @@ * * View the current statistics with M78. */ -#define PRINTCOUNTER +//#define PRINTCOUNTER //============================================================================= //============================= LCD and SD support ============================ diff --git a/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h b/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h index ad385fdcb5..36140c5660 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h @@ -219,7 +219,7 @@ * * Define one or both of these to override the default 0-255 range. */ -#define FAN_MIN_PWM 64 +#define FAN_MIN_PWM 45 //#define FAN_MAX_PWM 128 // @section extruder @@ -365,12 +365,12 @@ */ #define DUAL_X_CARRIAGE #if ENABLED(DUAL_X_CARRIAGE) - #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage - #define X2_MIN_POS 0 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage - #define X2_MAX_POS (442-4.0) // set maximum to the distance between toolheads when both heads are homed - #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position - #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS (X_BED_SIZE) // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X2_MIN_POS 0 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS (442-4.0) // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops // without modifying the firmware (through the "M218 T1 X???" command). @@ -809,7 +809,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -849,6 +863,7 @@ #if ENABLED(MOVE_Z_WHEN_IDLE) #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. #endif + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping #if ENABLED(BABYSTEP_ZPROBE_OFFSET) #define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets @@ -1052,6 +1067,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** @@ -1061,7 +1080,7 @@ * 'M106 P T2' : Use the set secondary speed * 'M106 P T1' : Restore the previous fan speed */ -#define EXTRA_FAN_SPEED +//#define EXTRA_FAN_SPEED /** * Firmware-based and LCD-controlled retract @@ -1162,19 +1181,19 @@ // until extrusion is consistent, and to purge old filament. // Filament Unload does a Retract, Delay, and Purge first: - #define FILAMENT_UNLOAD_RETRACT_LENGTH 4 // (mm) Unload initial retract length. - #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. + #define FILAMENT_UNLOAD_RETRACT_LENGTH 0 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_DELAY 500 // (ms) Delay for the filament to cool after retract. #define FILAMENT_UNLOAD_PURGE_LENGTH 0 // (mm) An unretract is done, then this length is purged. - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 1 // Number of alert beeps to play when a response is needed. + #define PAUSE_PARK_NOZZLE_TIMEOUT (3*60) // (seconds) Time limit before the nozzle is turned off for safety. + #define FILAMENT_CHANGE_ALERT_BEEPS 3 // Number of alert beeps to play when a response is needed. #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. #define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. #define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. - //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. + #define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) #endif // @section tmc @@ -1712,20 +1731,24 @@ //#define CUSTOM_USER_MENUS #if ENABLED(CUSTOM_USER_MENUS) //#define CUSTOM_USER_MENU_TITLE "Custom Commands" - //#define USER_SCRIPT_AUDIBLE_FEEDBACK - #define USER_SCRIPT_RETURN // Return to status screen after a script + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script - #define USER_DESC_1 "User cmd 1" - #define USER_GCODE_1 "G28 X \n" + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "User cmd 2" - #define USER_GCODE_2 "G28 \nG1 X100 \n" + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) - #define USER_DESC_3 "User cmd 3" - #define USER_GCODE_3 "M48 \n" + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) - #define USER_DESC_4 "User cmd 4" - #define USER_GCODE_4 "M114 \n" + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" #endif /** @@ -1851,7 +1874,7 @@ #define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) - #define MAX7219_NUMBER_UNITS 2 // Number of Max7219 units in chain. + #define MAX7219_NUMBER_UNITS 3 // Number of Max7219 units in chain. #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) // connector at: right=0 bottom=-90 top=90 left=180 #define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order diff --git a/Marlin/src/config/examples/Formbot/T_Rex_2+/_Statusscreen.h b/Marlin/src/config/examples/Formbot/T_Rex_2+/_Statusscreen.h index 487419892d..689b1c947f 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_2+/_Statusscreen.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_2+/_Statusscreen.h @@ -29,102 +29,45 @@ * Use the Marlin Bitmap Converter to make your own: * http://marlinfw.org/tools/u8glib/converter.html */ -//#include "MarlinConfig.h" -//============================================ +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_Y 4 +#define STATUS_LOGO_WIDTH 21 -#define STATUS_SCREENWIDTH 128 - -#define STATUS_SCREEN_HOTEND_TEXT_X(E) (27 + (E) * 25) - -#define STATUS_SCREEN_BED_TEXT_X 81 - -#define FAN_ANIM_FRAMES 3 -#define STATUS_SCREEN_FAN_TEXT_X 103 -#define STATUS_SCREEN_FAN_TEXT_Y 28 - -//============================================ +const unsigned char status_logo_bmp[] PROGMEM = { + B00000000,B00011110,B00000000, + B00000000,B11111111,B10000000, + B00000001,B11111111,B11100000, + B00000111,B00000000,B00000000, + B00001111,B00000000,B00000000, + B00011111,B00001111,B11111000, + B00011111,B00001111,B11111000, + B00011111,B00001111,B11111000, + B00011111,B00001111,B11111000, + B00011111,B00001111,B11111000, + B00011111,B00001111,B11111000, + B00011111,B00000000,B00000000, + B00011111,B00000000,B00000000, + B00001111,B00001111,B11111000, + B00000111,B00001111,B11110000, + B00000011,B00001111,B11000000, + B00000001,B00001111,B00000000, + B00000000,B00001100,B00000000 +}; +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM #if HOTENDS < 2 - - #error "Single hotend bitmap not available." - -#else // HOTENDS >= 2 - - #if FAN_ANIM_FRAMES <= 2 - - #error "Under 3 FAN_ANIM_FRAMES not available." - - #elif FAN_ANIM_FRAMES == 3 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00000000,B01111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000000,B00011111, - B00000000,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00100000,B00100111, - B00000011,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B11110000,B01111011, - B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B11110000,B01111011, - B00001111,B10000111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11111000,B11111101, - B00001111,B10000111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B11111000,B11111001, - B00001111,B10000111,B11111100,B00000000,B11111111,B00000000,B00000000,B01111111,B10000000,B00000000,B00001000,B00100000,B10000000,B00000100,B00111111,B11100001, - B00001111,B10000111,B11111100,B00000001,B11110111,B10000000,B00000000,B11110011,B11000000,B00000000,B00000100,B00010000,B01000000,B00000100,B00001111,B10000001, - B00001111,B10000111,B11111100,B00000001,B11100111,B10000000,B00000000,B11101101,B11000000,B00000000,B00000100,B00010000,B01000000,B00000100,B00001111,B10000001, - B00001111,B10000111,B11111100,B00000001,B11010111,B10000000,B00000000,B11111101,B11000000,B00000000,B00001000,B00100000,B10000000,B00000100,B00001111,B10000001, - B00001111,B10000000,B00000000,B00000000,B11110111,B00000000,B00000000,B01111011,B10000000,B00000000,B00010000,B01000001,B00000000,B00000100,B00111111,B11100001, - B00001111,B10000000,B00000000,B00000000,B11110111,B00000000,B00000000,B01110111,B10000000,B00000000,B00100000,B10000010,B00000000,B00000100,B11111000,B11111001, - B00000111,B10000111,B11111100,B00000001,B11110111,B10000000,B00000000,B11101111,B11000000,B00000000,B00100000,B10000010,B00000000,B00000101,B11111000,B11111101, - B00000011,B10000111,B11111000,B00000001,B11100011,B10000000,B00000000,B11100001,B11000000,B00000000,B00010000,B01000001,B00000000,B00000110,B11110000,B01111011, - B00000001,B10000111,B11100000,B00000001,B11111111,B10000000,B00000000,B11111111,B11000000,B00000000,B00001000,B00100000,B10000000,B00000110,B11110000,B01111011, - B00000000,B10000111,B10000000,B00000000,B01111110,B00000000,B00000000,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00100000,B00100111, - B00000000,B00000110,B00000000,B00000000,B00111100,B00000000,B00000000,B00011110,B00000000,B00000000,B11111111,B11111111,B11000000,B00000111,B11000000,B00011111, - B00000000,B00000000,B00000000,B00000000,B00011000,B00000000,B00000000,B00001100,B00000000,B00000000,B11111111,B11111111,B11000000,B00000111,B11111111,B11111111 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00000000,B01111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000110,B00011111, - B00000000,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00111110,B00000111, - B00000011,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00111110,B00000011, - B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00011110,B00000011, - B00001111,B10000111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00011110,B00001101, - B00001111,B10000111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00000110,B00111101, - B00001111,B10000111,B11111100,B00000000,B11111111,B00000000,B00000000,B01111111,B10000000,B00000000,B00001000,B00100000,B10000000,B00000100,B00000111,B00111101, - B00001111,B10000111,B11111100,B00000001,B11110111,B10000000,B00000000,B11110011,B11000000,B00000000,B00000100,B00010000,B01000000,B00000100,B00001111,B11111111, - B00001111,B10000111,B11111100,B00000001,B11100111,B10000000,B00000000,B11101101,B11000000,B00000000,B00000100,B00010000,B01000000,B00000111,B11111111,B11111111, - B00001111,B10000111,B11111100,B00000001,B11010111,B10000000,B00000000,B11111101,B11000000,B00000000,B00001000,B00100000,B10000000,B00000111,B11111111,B10000001, - B00001111,B10000000,B00000000,B00000000,B11110111,B00000000,B00000000,B01111011,B10000000,B00000000,B00010000,B01000001,B00000000,B00000101,B11100111,B00000001, - B00001111,B10000000,B00000000,B00000000,B11110111,B00000000,B00000000,B01110111,B10000000,B00000000,B00100000,B10000010,B00000000,B00000101,B11000011,B00000001, - B00000111,B10000111,B11111100,B00000001,B11110111,B10000000,B00000000,B11101111,B11000000,B00000000,B00100000,B10000010,B00000000,B00000101,B10000011,B11000001, - B00000011,B10000111,B11111000,B00000001,B11100011,B10000000,B00000000,B11100001,B11000000,B00000000,B00010000,B01000001,B00000000,B00000110,B00000011,B11000011, - B00000001,B10000111,B11100000,B00000001,B11111111,B10000000,B00000000,B11111111,B11000000,B00000000,B00001000,B00100000,B10000000,B00000110,B00000011,B11100011, - B00000000,B10000111,B10000000,B00000000,B01111110,B00000000,B00000000,B01111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00000011,B11100111, - B00000000,B00000110,B00000000,B00000000,B00111100,B00000000,B00000000,B00111110,B00000000,B00000000,B11111111,B11111111,B11000000,B00000111,B11000011,B00011111, - B00000000,B00000000,B00000000,B00000000,B00011000,B00000000,B00000000,B00001100,B00000000,B00000000,B11111111,B11111111,B11000000,B00000111,B11111111,B11111111 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00000000,B01111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000011,B00011111, - B00000000,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00000011,B11100111, - B00000011,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00000011,B11110011, - B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B10000011,B11100011, - B00001111,B10000111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11000011,B11000001, - B00001111,B10000111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11100011,B10000001, - B00001111,B10000111,B11111100,B00000000,B11111111,B00000000,B00000000,B01111111,B10000000,B00000000,B00001000,B00100000,B10000000,B00000101,B11110111,B00000001, - B00001111,B10000111,B11111100,B00000001,B11110111,B10000000,B00000000,B11110011,B11000000,B00000000,B00000100,B00010000,B01000000,B00000111,B11111111,B10000001, - B00001111,B10000111,B11111100,B00000001,B11100111,B10000000,B00000000,B11101101,B11000000,B00000000,B00000100,B00010000,B01000000,B00000111,B11111111,B11111111, - B00001111,B10000111,B11111100,B00000001,B11010111,B10000000,B00000000,B11111101,B11000000,B00000000,B00001000,B00100000,B10000000,B00000100,B00001111,B11111111, - B00001111,B10000000,B00000000,B00000000,B11110111,B00000000,B00000000,B01111011,B10000000,B00000000,B00010000,B01000001,B00000000,B00000100,B00000111,B01111101, - B00001111,B10000000,B00000000,B00000000,B11110111,B00000000,B00000000,B01110111,B10000000,B00000000,B00100000,B10000010,B00000000,B00000100,B00001110,B00111101, - B00000111,B10000111,B11111100,B00000001,B11110111,B10000000,B00000000,B11101111,B11000000,B00000000,B00100000,B10000010,B00000000,B00000100,B00011110,B00011101, - B00000011,B10000111,B11111000,B00000001,B11100011,B10000000,B00000000,B11100001,B11000000,B00000000,B00010000,B01000001,B00000000,B00000110,B00111110,B00001011, - B00000001,B10000111,B11100000,B00000001,B11111111,B10000000,B00000000,B11111111,B11000000,B00000000,B00001000,B00100000,B10000000,B00000110,B01111110,B00000011, - B00000000,B10000111,B10000000,B00000000,B01111110,B00000000,B00000000,B01111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00111110,B00000111, - B00000000,B00000110,B00000000,B00000000,B00111100,B00000000,B00000000,B00111110,B00000000,B00000000,B11111111,B11111111,B11000000,B00000111,B11000110,B00011111, - B00000000,B00000000,B00000000,B00000000,B00011000,B00000000,B00000000,B00001100,B00000000,B00000000,B11111111,B11111111,B11000000,B00000111,B11111111,B11111111 - }; - - #elif FAN_ANIM_FRAMES == 4 - - #error "4 FAN_ANIM_FRAMES not available." - - #endif - -#endif // HOTENDS >= 2 + #define STATUS_LOGO_X 8 + #define STATUS_HEATERS_X 40 + #define STATUS_BED_X 72 +#else + #define STATUS_LOGO_X 0 + #define STATUS_HEATERS_X 32 + #define STATUS_BED_X 80 +#endif diff --git a/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h b/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h index 270e6f7e1a..da3f9d7fd2 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h @@ -591,7 +591,7 @@ // Add an 'M73' G-code to set the current percentage #define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -810,7 +810,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1053,6 +1067,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Formbot/T_Rex_3/_Statusscreen.h b/Marlin/src/config/examples/Formbot/T_Rex_3/_Statusscreen.h index 63159c98a2..689b1c947f 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_3/_Statusscreen.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_3/_Statusscreen.h @@ -30,102 +30,44 @@ * http://marlinfw.org/tools/u8glib/converter.html */ -//#include "MarlinConfig.h" +// +// Status Screen Logo bitmap +// +#define STATUS_LOGO_Y 4 +#define STATUS_LOGO_WIDTH 21 -//============================================ - -#define STATUS_SCREENWIDTH 128 - -#define STATUS_SCREEN_HOTEND_TEXT_X(E) (27 + (E) * 25) - -#define STATUS_SCREEN_BED_TEXT_X 81 - -#define FAN_ANIM_FRAMES 3 -#define STATUS_SCREEN_FAN_TEXT_X 103 -#define STATUS_SCREEN_FAN_TEXT_Y 28 - -//============================================ +const unsigned char status_logo_bmp[] PROGMEM = { + B00000000,B00011110,B00000000, + B00000000,B11111111,B10000000, + B00000001,B11111111,B11100000, + B00000111,B00000000,B00000000, + B00001111,B00000000,B00000000, + B00011111,B00001111,B11111000, + B00011111,B00001111,B11111000, + B00011111,B00001111,B11111000, + B00011111,B00001111,B11111000, + B00011111,B00001111,B11111000, + B00011111,B00001111,B11111000, + B00011111,B00000000,B00000000, + B00011111,B00000000,B00000000, + B00001111,B00001111,B11111000, + B00000111,B00001111,B11110000, + B00000011,B00001111,B11000000, + B00000001,B00001111,B00000000, + B00000000,B00001100,B00000000 +}; +// +// Use default bitmaps +// +#define STATUS_HOTEND_ANIM +#define STATUS_BED_ANIM #if HOTENDS < 2 - #if FAN_ANIM_FRAMES <= 2 - #elif FAN_ANIM_FRAMES == 3 - #elif FAN_ANIM_FRAMES == 4 - #endif - -#else // HOTENDS >= 2 - - #if FAN_ANIM_FRAMES <= 2 - - #elif FAN_ANIM_FRAMES == 3 - - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00000000,B01111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000000,B00011111, - B00000000,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00100000,B00100111, - B00000011,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B11110000,B01111011, - B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B11110000,B01111011, - B00001111,B10000111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11111000,B11111101, - B00001111,B10000111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B11111000,B11111001, - B00001111,B10000111,B11111100,B00000000,B11111111,B00000000,B00000000,B01111111,B10000000,B00000000,B00001000,B00100000,B10000000,B00000100,B00111111,B11100001, - B00001111,B10000111,B11111100,B00000001,B11110111,B10000000,B00000000,B11110011,B11000000,B00000000,B00000100,B00010000,B01000000,B00000100,B00001111,B10000001, - B00001111,B10000111,B11111100,B00000001,B11100111,B10000000,B00000000,B11101101,B11000000,B00000000,B00000100,B00010000,B01000000,B00000100,B00001111,B10000001, - B00001111,B10000111,B11111100,B00000001,B11010111,B10000000,B00000000,B11111101,B11000000,B00000000,B00001000,B00100000,B10000000,B00000100,B00001111,B10000001, - B00001111,B10000000,B00000000,B00000000,B11110111,B00000000,B00000000,B01111011,B10000000,B00000000,B00010000,B01000001,B00000000,B00000100,B00111111,B11100001, - B00001111,B10000000,B00000000,B00000000,B11110111,B00000000,B00000000,B01110111,B10000000,B00000000,B00100000,B10000010,B00000000,B00000100,B11111000,B11111001, - B00000111,B10000111,B11111100,B00000001,B11110111,B10000000,B00000000,B11101111,B11000000,B00000000,B00100000,B10000010,B00000000,B00000101,B11111000,B11111101, - B00000011,B10000111,B11111000,B00000001,B11100011,B10000000,B00000000,B11100001,B11000000,B00000000,B00010000,B01000001,B00000000,B00000110,B11110000,B01111011, - B00000001,B10000111,B11100000,B00000001,B11111111,B10000000,B00000000,B11111111,B11000000,B00000000,B00001000,B00100000,B10000000,B00000110,B11110000,B01111011, - B00000000,B10000111,B10000000,B00000000,B01111110,B00000000,B00000000,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00100000,B00100111, - B00000000,B00000110,B00000000,B00000000,B00111100,B00000000,B00000000,B00011110,B00000000,B00000000,B11111111,B11111111,B11000000,B00000111,B11000000,B00011111, - B00000000,B00000000,B00000000,B00000000,B00011000,B00000000,B00000000,B00001100,B00000000,B00000000,B11111111,B11111111,B11000000,B00000111,B11111111,B11111111 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00000000,B01111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000110,B00011111, - B00000000,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00111110,B00000111, - B00000011,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00111110,B00000011, - B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00011110,B00000011, - B00001111,B10000111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00011110,B00001101, - B00001111,B10000111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000100,B00000110,B00111101, - B00001111,B10000111,B11111100,B00000000,B11111111,B00000000,B00000000,B01111111,B10000000,B00000000,B00001000,B00100000,B10000000,B00000100,B00000111,B00111101, - B00001111,B10000111,B11111100,B00000001,B11110111,B10000000,B00000000,B11110011,B11000000,B00000000,B00000100,B00010000,B01000000,B00000100,B00001111,B11111111, - B00001111,B10000111,B11111100,B00000001,B11100111,B10000000,B00000000,B11101101,B11000000,B00000000,B00000100,B00010000,B01000000,B00000111,B11111111,B11111111, - B00001111,B10000111,B11111100,B00000001,B11010111,B10000000,B00000000,B11111101,B11000000,B00000000,B00001000,B00100000,B10000000,B00000111,B11111111,B10000001, - B00001111,B10000000,B00000000,B00000000,B11110111,B00000000,B00000000,B01111011,B10000000,B00000000,B00010000,B01000001,B00000000,B00000101,B11100111,B00000001, - B00001111,B10000000,B00000000,B00000000,B11110111,B00000000,B00000000,B01110111,B10000000,B00000000,B00100000,B10000010,B00000000,B00000101,B11000011,B00000001, - B00000111,B10000111,B11111100,B00000001,B11110111,B10000000,B00000000,B11101111,B11000000,B00000000,B00100000,B10000010,B00000000,B00000101,B10000011,B11000001, - B00000011,B10000111,B11111000,B00000001,B11100011,B10000000,B00000000,B11100001,B11000000,B00000000,B00010000,B01000001,B00000000,B00000110,B00000011,B11000011, - B00000001,B10000111,B11100000,B00000001,B11111111,B10000000,B00000000,B11111111,B11000000,B00000000,B00001000,B00100000,B10000000,B00000110,B00000011,B11100011, - B00000000,B10000111,B10000000,B00000000,B01111110,B00000000,B00000000,B01111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00000011,B11100111, - B00000000,B00000110,B00000000,B00000000,B00111100,B00000000,B00000000,B00111110,B00000000,B00000000,B11111111,B11111111,B11000000,B00000111,B11000011,B00011111, - B00000000,B00000000,B00000000,B00000000,B00011000,B00000000,B00000000,B00001100,B00000000,B00000000,B11111111,B11111111,B11000000,B00000111,B11111111,B11111111 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00000000,B01111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11000011,B00011111, - B00000000,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00000011,B11100111, - B00000011,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00000011,B11110011, - B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B10000011,B11100011, - B00001111,B10000111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11000011,B11000001, - B00001111,B10000111,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000101,B11100011,B10000001, - B00001111,B10000111,B11111100,B00000000,B11111111,B00000000,B00000000,B01111111,B10000000,B00000000,B00001000,B00100000,B10000000,B00000101,B11110111,B00000001, - B00001111,B10000111,B11111100,B00000001,B11110111,B10000000,B00000000,B11110011,B11000000,B00000000,B00000100,B00010000,B01000000,B00000111,B11111111,B10000001, - B00001111,B10000111,B11111100,B00000001,B11100111,B10000000,B00000000,B11101101,B11000000,B00000000,B00000100,B00010000,B01000000,B00000111,B11111111,B11111111, - B00001111,B10000111,B11111100,B00000001,B11010111,B10000000,B00000000,B11111101,B11000000,B00000000,B00001000,B00100000,B10000000,B00000100,B00001111,B11111111, - B00001111,B10000000,B00000000,B00000000,B11110111,B00000000,B00000000,B01111011,B10000000,B00000000,B00010000,B01000001,B00000000,B00000100,B00000111,B01111101, - B00001111,B10000000,B00000000,B00000000,B11110111,B00000000,B00000000,B01110111,B10000000,B00000000,B00100000,B10000010,B00000000,B00000100,B00001110,B00111101, - B00000111,B10000111,B11111100,B00000001,B11110111,B10000000,B00000000,B11101111,B11000000,B00000000,B00100000,B10000010,B00000000,B00000100,B00011110,B00011101, - B00000011,B10000111,B11111000,B00000001,B11100011,B10000000,B00000000,B11100001,B11000000,B00000000,B00010000,B01000001,B00000000,B00000110,B00111110,B00001011, - B00000001,B10000111,B11100000,B00000001,B11111111,B10000000,B00000000,B11111111,B11000000,B00000000,B00001000,B00100000,B10000000,B00000110,B01111110,B00000011, - B00000000,B10000111,B10000000,B00000000,B01111110,B00000000,B00000000,B01111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B00111110,B00000111, - B00000000,B00000110,B00000000,B00000000,B00111100,B00000000,B00000000,B00111110,B00000000,B00000000,B11111111,B11111111,B11000000,B00000111,B11000110,B00011111, - B00000000,B00000000,B00000000,B00000000,B00011000,B00000000,B00000000,B00001100,B00000000,B00000000,B11111111,B11111111,B11000000,B00000111,B11111111,B11111111 - }; - - #elif FAN_ANIM_FRAMES == 4 - - #error "4 FAN_ANIM_FRAMES not available." - - #endif - -#endif // HOTENDS >= 2 + #define STATUS_LOGO_X 8 + #define STATUS_HEATERS_X 40 + #define STATUS_BED_X 72 +#else + #define STATUS_LOGO_X 0 + #define STATUS_HEATERS_X 32 + #define STATUS_BED_X 80 +#endif diff --git a/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h b/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h index f992c4b773..9afc16c4ab 100644 --- a/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h @@ -2035,8 +2035,8 @@ */ #if ENABLED(ULTIMAKERCONTROLLER) || ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) || ENABLED(G3D_PANEL) || ENABLED(MKS_MINI_12864) #define SDSUPPORT // Force SD Card support on for these displays -#else - #define LCD_WIDTH_OVERRIDE 20 // Default is 22. For this Geeetech use 20. +#elif DISABLED(LIGHTWEIGHT_UI) + #define LCD_WIDTH 20 // Default is 22. For this Geeetech use 20. #endif // Allow servo angle to be edited and saved to EEPROM diff --git a/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h b/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h index 0cb4ac4582..9fabbbab03 100644 --- a/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h +++ b/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1049,6 +1063,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h index fb631297b7..dc7c02246a 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h index fb631297b7..dc7c02246a 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h index a310eb1fdb..8c02f2f1ad 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h b/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h index f731003c22..c894b9ff22 100644 --- a/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h +++ b/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/MakerParts/Configuration_adv.h b/Marlin/src/config/examples/MakerParts/Configuration_adv.h index 672781e4da..e641f281a4 100644 --- a/Marlin/src/config/examples/MakerParts/Configuration_adv.h +++ b/Marlin/src/config/examples/MakerParts/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h index 30062018a5..80aa4504f3 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h index 8c1bf6a6e8..df051d3f08 100644 --- a/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h index bf26b8846c..82e0e1be65 100644 --- a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h index 6f1365bef4..2f346fc053 100644 --- a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h +++ b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h @@ -587,7 +587,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -813,7 +813,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1056,6 +1070,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/RigidBot/Configuration_adv.h b/Marlin/src/config/examples/RigidBot/Configuration_adv.h index b9751f915a..c7548e796d 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration_adv.h +++ b/Marlin/src/config/examples/RigidBot/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/SCARA/Configuration_adv.h b/Marlin/src/config/examples/SCARA/Configuration_adv.h index 81dd0a46d2..d03ae78bee 100644 --- a/Marlin/src/config/examples/SCARA/Configuration_adv.h +++ b/Marlin/src/config/examples/SCARA/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h index b2fd2efb06..93449d3dbe 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/TheBorg/Configuration_adv.h b/Marlin/src/config/examples/TheBorg/Configuration_adv.h index 4b3f85eb86..c3ac042b51 100644 --- a/Marlin/src/config/examples/TheBorg/Configuration_adv.h +++ b/Marlin/src/config/examples/TheBorg/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h index e7326dc44c..ddfa10b4f8 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h b/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h index 5e7c1501e1..cc2db6b9fc 100644 --- a/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h +++ b/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/UltiMachine/Archim1/Configuration.h b/Marlin/src/config/examples/UltiMachine/Archim1/Configuration.h new file mode 100644 index 0000000000..1b8d9555f5 --- /dev/null +++ b/Marlin/src/config/examples/UltiMachine/Archim1/Configuration.h @@ -0,0 +1,2019 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Configuration.h + * + * Basic settings such as: + * + * - Type of electronics + * - Type of temperature sensor + * - Printer geometry + * - Endstop configuration + * - LCD controller + * - Extra features + * + * Advanced settings can be found in Configuration_adv.h + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// 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 SHOW_BOOTSCREEN +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 + +/** + * *** VENDORS PLEASE READ *** + * + * Marlin allows you to add a custom boot image for Graphical LCDs. + * With this option Marlin will first show your custom screen followed + * by the standard Marlin logo with version number and web URL. + * + * We encourage you to take advantage of this new feature and we also + * respectfully request that you retain the unmodified Marlin boot screen. + */ + +// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +//#define CUSTOM_STATUS_SCREEN_IMAGE + +// @section machine + +/** + * Select the serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT -1 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// 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_ARCHIM1 +#endif + +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +//#define CUSTOM_MACHINE_NAME "3D Printer" + +// 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) +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#define EXTRUDERS 1 + +// Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc. +#define DEFAULT_NOMINAL_FILAMENT_DIA 3.0 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER +#if ENABLED(PARKING_EXTRUDER) + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // Delay (ms) for magnetic field. No delay if 0 or not defined. + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // mm to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD +#if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Firmware's 'M164 S' supporting virtual tools. + * - This implementation supports up to two mixing extruders. + * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X {0.0, 20.00} // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z {0.0, 0.00} // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Select your power supply here. Use 0 if you haven't connected the PS_ON_PIN + * + * 0 = No Power Switch + * 1 = ATX + * 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) + * + * :{ 0:'No power switch', 1:'ATX', 2:'X-Box 360' } + */ +#define POWER_SUPPLY 0 + +#if POWER_SUPPLY > 0 + // Enable this option to leave the PSU off at startup. + // Power to steppers and heaters will need to be turned on with M80. + //#define PS_DEFAULT_OFF + + //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin + #if ENABLED(AUTO_POWER_CONTROL) + #define AUTO_POWER_FANS // Turn on PSU if fans need power + #define AUTO_POWER_E_FANS + #define AUTO_POWER_CONTROLLERFAN + #define POWER_TIMEOUT 30 + #endif + +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -4 : thermocouple with AD8495 + * -3 : thermocouple with MAX31855 (only for sensor 0) + * -2 : thermocouple with MAX6675 (only for sensor 0) + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) + * 3 : Mendel-parts thermistor (4.7k pullup) + * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! + * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) + * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) + * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 11 : 100k beta 3950 1% thermistor (4.7k pullup) + * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) + * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" + * 15 : 100k thermistor calibration for JGAurora A5 hotend + * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. + * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. + * + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + */ +#define TEMP_SENSOR_0 1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 0 +#define TEMP_SENSOR_BED 0 +#define TEMP_SENSOR_CHAMBER 0 + +// Dummy thermistor constant temperature readings, for use with 998 and 999 +#define DUMMY_THERMISTOR_998_VALUE 25 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +// Extruder temperature must be close to target for this long before M109 returns success +#define TEMP_RESIDENCY_TIME 10 // (seconds) +#define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. + +// Bed temperature must be close to target for this long before M190 returns success +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) +#define TEMP_BED_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_BED_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. + +// The minimal temperature defines the temperature below which the heater will not be enabled It is used +// to check that the wiring to the thermistor is not broken. +// Otherwise this would lead to the heater being powered on all the time. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// When temperature exceeds max temp, your heater will be switched off. +// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! +// You should use MINTEMP for thermistor short/failure protection. +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // 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 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//============================= PID > Bed Temperature Control =============== +//=========================================================================== + +/** + * PID Bed Heating + * + * If this option is enabled set PID constants below. + * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. + * + * The PID frequency will be the same as the extruder PWM. + * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, + * which is fine for driving a square wave into a resistive load and does not significantly + * impact FET heating. This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W + * heater. If your configuration is significantly different than this and you don't understand + * the issues involved, don't use bed PID until someone else verifies that your hardware works. + */ +//#define PIDTEMPBED + +//#define BED_LIMIT_SWITCHING + +/** + * Max Bed Power + * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). + * When set to any value below 255, enables a form of PWM to the bed that acts like a divider + * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) + */ +#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current + +#if ENABLED(PIDTEMPBED) + + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //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) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. + * Add M302 to set the minimum extrusion temperature and/or turn + * cold extrusion prevention on and off. + * + * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** + */ +#define PREVENT_COLD_EXTRUSION +#define EXTRUDE_MINTEMP 170 + +/** + * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. + * Note: For Bowden Extruders make this large enough to allow load/unload. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +#define USE_XMIN_PLUG +#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG +//#define USE_XMAX_PLUG +//#define USE_YMAX_PLUG +//#define USE_ZMAX_PLUG + +// Enable pullup for all endstops to prevent a floating state +#define ENDSTOPPULLUPS +#if DISABLED(ENDSTOPPULLUPS) + // Disable ENDSTOPPULLUPS to set pullups individually + //#define ENDSTOPPULLUP_XMAX + //#define ENDSTOPPULLUP_YMAX + //#define ENDSTOPPULLUP_ZMAX + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the probe. + +/** + * Stepper Drivers + * + * These settings allow Marlin to tune stepper driver timing and enable advanced options for + * stepper drivers that support them. You may also override timing options in Configuration_adv.h. + * + * A4988 is assumed for unspecified drivers. + * + * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +#define X_DRIVER_TYPE DRV8825 +#define Y_DRIVER_TYPE DRV8825 +#define Z_DRIVER_TYPE DRV8825 +#define X2_DRIVER_TYPE DRV8825 +#define Y2_DRIVER_TYPE DRV8825 +#define Z2_DRIVER_TYPE DRV8825 +//#define Z3_DRIVER_TYPE DRV8825 +#define E0_DRIVER_TYPE DRV8825 +#define E1_DRIVER_TYPE DRV8825 +#define E2_DRIVER_TYPE DRV8825 +#define E3_DRIVER_TYPE DRV8825 +//#define E4_DRIVER_TYPE DRV8825 +//#define E5_DRIVER_TYPE DRV8825 + +// Enable this feature if all enabled endstop pins are interrupt-capable. +// This will remove the need to poll the interrupt pins, saving many CPU cycles. +//#define ENDSTOP_INTERRUPTS_FEATURE + +/** + * Endstop Noise Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + */ +#define DEFAULT_AXIS_STEPS_PER_UNIT { 200, 200, 800, 500 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + */ +#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + */ +#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * 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 + +/** + * Default Jerk (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +#define DEFAULT_XJERK 10.0 +#define DEFAULT_YJERK 10.0 +#define DEFAULT_ZJERK 0.3 +#define DEFAULT_EJERK 5.0 + +/** + * S-Curve Acceleration + * + * This option eliminates vibration during printing by fitting a Bézier + * curve to move acceleration, producing much smoother direction changes. + * + * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained + */ +//#define S_CURVE_ACCELERATION + +//=========================================================================== +//============================= Z Probe Options ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_ENDSTOP + * + * Enable this option for a probe connected to any pin except Z-Min. + * (By default Marlin assumes the Z-Max endstop pin.) + * To use a custom Z Probe pin, set Z_MIN_PROBE_PIN below. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * WARNING: Setting the wrong pin may have unexpected and potentially + * disastrous consequences. Use with caution and do your homework. + * + */ +//#define Z_MIN_PROBE_ENDSTOP + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ +//#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 + +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + */ +//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH +#if ENABLED(BLTOUCH) + //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +// +// For Z_PROBE_ALLEN_KEY see the Delta example configurations. +// + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * 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] + +// Certain types of probes need to stay away from edges +#define MIN_PROBE_EDGE 10 + +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 8000 + +// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +// The number of probes to perform at each point. +// Set to 2 for a fast/slow probe, using the second probe result. +// Set to 3 or more for slow probes, averaging the results. +//#define MULTIPLE_PROBING 2 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. + * But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle. + */ +#define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow +#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes +//#define Z_AFTER_PROBING 5 // Z position after probing is done + +#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping + +// For M851 give a range for adjusting the Z probe offset +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * readings with inductive probes and piezo sensors. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +#if ENABLED(PROBING_HEATERS_OFF) + //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) +#endif +//#define PROBING_FANS_OFF // Turn fans off when probing +//#define PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @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_Y_DIR true +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed + +//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. + +//#define Z_HOMING_HEIGHT 4 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ... + // Be sure you have this distance over your Z_MAX_POS in case. + +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] +#define X_HOME_DIR -1 +#define Y_HOME_DIR -1 +#define Z_HOME_DIR -1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE 200 +#define Y_BED_SIZE 200 + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS 0 +#define Y_MIN_POS 0 +#define Z_MIN_POS 0 +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 200 + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) + //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD +#endif + +/** + * Filament Runout Sensors + * Mechanical or opto endstops are used to check for the presence of filament. + * + * RAMPS-based boards use SERVO3_PIN for the first runout sensor. + * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. + * By default the firmware assumes HIGH=FILAMENT PRESENT. + */ +//#define FILAMENT_RUNOUT_SENSOR +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#define AUTO_BED_LEVELING_UBL +//#define MESH_BED_LEVELING + +/** + * Normally G28 leaves leveling disabled on completion. Enable + * this option to have G28 restore the prior leveling state. + */ +//#define RESTORE_LEVELING_AFTER_G28 + +/** + * Enable detailed logging of G28, G29, M48, etc. + * Turn on with the command 'M111 S32'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + #define ENABLE_LEVELING_FADE_HEIGHT + + // For Cartesian machines, instead of dividing moves on mesh boundaries, + // split up moves into short segments like a Delta. This follows the + // contours of the bed more closely than edge-to-edge straight moves. + #define SEGMENT_LEVELED_MOVES + #define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one) + + /** + * Enable the G26 Mesh Validation Pattern tool. + */ + //#define G26_MESH_VALIDATION + #if ENABLED(G26_MESH_VALIDATION) + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #endif + +#endif + +#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // Set the boundaries for probing (where the probe can reach). + //#define LEFT_PROBE_BED_POSITION MIN_PROBE_EDGE + //#define RIGHT_PROBE_BED_POSITION (X_BED_SIZE - (MIN_PROBE_EDGE)) + //#define FRONT_PROBE_BED_POSITION MIN_PROBE_EDGE + //#define BACK_PROBE_BED_POSITION (Y_BED_SIZE - (MIN_PROBE_EDGE)) + + // Probe along the Y axis, advancing X after each column + //#define PROBE_Y_FIRST + + #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + + // Beyond the probed grid, continue the implied tilt? + // Default is to maintain the height of the nearest edge. + //#define EXTRAPOLATE_BEYOND_GRID + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh + + #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle + #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 + + //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used + // as the Z-Height correction value. + +#elif ENABLED(MESH_BED_LEVELING) + + //=========================================================================== + //=================================== Mesh ================================== + //=========================================================================== + + #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// Add a menu item to move between bed corners for manual bed adjustment +//#define LEVEL_BED_CORNERS + +#if ENABLED(LEVEL_BED_CORNERS) + #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling + //#define LEVEL_CENTER_TOO // Move to the center after the last corner +#endif + +/** + * Commands to execute at the end of G29 probing. + * Useful to retract or move the Z probe out of the way. + */ +//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +//#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +//#define MANUAL_Z_HOME_POS 0 + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Homing speeds (mm/m) +#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_Z (4*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @section calibrate + +/** + * Bed Skew Compensation + * + * This feature corrects for misalignment in the XYZ axes. + * + * Take the following steps to get the bed skew in the XY plane: + * 1. Print a test square (e.g., https://www.thingiverse.com/thing:2563185) + * 2. For XY_DIAG_AC measure the diagonal A to C + * 3. For XY_DIAG_BD measure the diagonal B to D + * 4. For XY_SIDE_AD measure the edge A to D + * + * Marlin automatically computes skew factors from these measurements. + * Skew factors may also be computed and set manually: + * + * - Compute AB : SQRT(2*AC*AC+2*BD*BD-4*AD*AD)/2 + * - XY_SKEW_FACTOR : TAN(PI/2-ACOS((AC*AC-AB*AB-AD*AD)/(2*AB*AD))) + * + * If desired, follow the same procedure for XZ and YZ. + * Use these diagrams for reference: + * + * Y Z Z + * ^ B-------C ^ B-------C ^ B-------C + * | / / | / / | / / + * | / / | / / | / / + * | A-------D | A-------D | A-------D + * +-------------->X +-------------->X +-------------->Y + * XY_SKEW_FACTOR XZ_SKEW_FACTOR YZ_SKEW_FACTOR + */ +//#define SKEW_CORRECTION + +#if ENABLED(SKEW_CORRECTION) + // Input all length measurements here: + #define XY_DIAG_AC 282.8427124746 + #define XY_DIAG_BD 282.8427124746 + #define XY_SIDE_AD 200 + + // Or, set the default skew factors directly here + // to override the above measurements: + #define XY_SKEW_FACTOR 0.0 + + //#define SKEW_CORRECTION_FOR_Z + #if ENABLED(SKEW_CORRECTION_FOR_Z) + #define XZ_DIAG_AC 282.8427124746 + #define XZ_DIAG_BD 282.8427124746 + #define YZ_DIAG_AC 282.8427124746 + #define YZ_DIAG_BD 282.8427124746 + #define YZ_SIDE_AD 200 + #define XZ_SKEW_FACTOR 0.0 + #define YZ_SKEW_FACTOR 0.0 + #endif + + // Enable this option for M852 to set skew at runtime + //#define SKEW_CORRECTION_GCODE +#endif + +//============================================================================= +//============================= Additional Features =========================== +//============================================================================= + +// @section extras + +// +// EEPROM +// +// The microcontroller can store settings in the EEPROM, e.g. max velocity... +// M500 - stores parameters in EEPROM +// 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 DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#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_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * P1 Raise the nozzle always to Z-park height. + * P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS. + */ +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #define NOZZLE_CLEAN_TRIANGLES 3 + + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +//#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * LCD Menu Items + * + * Disable all menus and only display the Status Screen, or + * just remove some extraneous menu items to recover space. + */ +//#define NO_LCD_MENUS +//#define SLIM_LCD_MENUS + +// +// ENCODER SETTINGS +// +// This option overrides the default number of encoder pulses needed to +// produce one step. Should be increased for high-resolution encoders. +// +//#define ENCODER_PULSES_PER_STEP 4 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#define RIGIDBOT_PANEL + +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. + // This LCD is known to be susceptible to electrical interference + // which scrambles the display. Pressing any button clears it up. + // This is a LCD2004 display with 5 analog buttons. + +// +// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. +// +//#define ULTRA_LCD + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// CONTROLLER TYPE: Shift register panels +// + +// +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD + +//============================================================================= +//======================= LCD / Controller Selection ======================= +//========================= (Graphical LCDs) ======================== +//============================================================================= + +// +// CONTROLLER TYPE: Graphical 128x64 (DOGM) +// +// IMPORTANT: The U8glib library is required for Graphical Display! +// https://github.com/olikraus/U8glib_Arduino +// + +// +// RepRapDiscount FULL GRAPHIC Smart Controller +// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller +// +//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + +// +// Activate one of these if you have a Panucatt Devices +// Viki 2.0 or mini Viki with Graphic LCD +// http://panucatt.com +// +//#define VIKI2 +//#define miniVIKI + +// +// MakerLab Mini Panel with graphic +// controller and SD support - http://reprap.org/wiki/Mini_panel +// +//#define MINIPANEL + +// +// MaKr3d Makr-Panel with graphic controller and SD support. +// http://reprap.org/wiki/MaKr3d_MaKrPanel +// +//#define MAKRPANEL + +// +// Adafruit ST7565 Full Graphic Controller. +// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ +// +//#define ELB_FULL_GRAPHIC_CONTROLLER + +// +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. +// +//#define BQ_LCD_SMART_CONTROLLER + +// +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + //#define U8GLIB_SSD1306 + #define U8GLIB_SH1106 +#endif + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS MINI12864 with graphic controller and SD support +// http://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// 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 + +// +// ANET and Tronxy Graphical Controller +// +// Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 +// A clone of the RepRapDiscount full graphics display but with +// different pins/wiring (see pins_ANET_10.h). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +// +// Extensible UI +// +// Enable third-party or vendor customized user interfaces that aren't +// packaged with Marlin. Source code for the user interface will need to +// be placed in "src/lcd/extensible_ui/lib" +// +//#define EXTENSIBLE_UI + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// CONTROLLER TYPE: Standalone / Serial +// + +// +// LCD for Malyan M200 printers. +// +//#define MALYAN_LCD + +// +// CONTROLLER TYPE: Keypad / Add-on +// + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key +// is pressed, a value of 10.0 means 10mm per click. +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// M240 Triggers a camera by emulating a Canon RC-1 Remote +// Data from: http://www.doc-diy.net/photo/rc-1_hacked/ +//#define PHOTOGRAPH_PIN 23 + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * NOTE: A separate 5V power supply is required! The Neopixel LED needs + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define RGB_LED_R_PIN 34 + #define RGB_LED_G_PIN 43 + #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba) + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/Marlin/src/config/examples/UltiMachine/Archim1/Configuration_adv.h b/Marlin/src/config/examples/UltiMachine/Archim1/Configuration_adv.h new file mode 100644 index 0000000000..d24ee84baa --- /dev/null +++ b/Marlin/src/config/examples/UltiMachine/Archim1/Configuration_adv.h @@ -0,0 +1,1904 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Hephestos 2 24V heated bed upgrade kit. +// https://store.bq.com/en/heated-bed-kit-hephestos2 +// +//#define HEPHESTOS2_HEATED_BED_KIT +#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) + #undef TEMP_SENSOR_BED + #define TEMP_SENSOR_BED 70 + #define HEATER_BED_INVERTING true +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 40 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 60 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // this adds an experimental additional term to the heating power, proportional to the extrusion speed. + // if Kc is chosen well, the additional required power due to increased melting should be compensated. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information in M114 +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #define EXTRUDER_RUNOUT_SPEED 1500 // (mm/m) + #define EXTRUDER_RUNOUT_EXTRUDE 5 // (mm) +#endif + +// @section temperature + +// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. +// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. +#define TEMP_SENSOR_AD595_OFFSET 0.0 +#define TEMP_SENSOR_AD595_GAIN 1.0 +#define TEMP_SENSOR_AD8495_OFFSET 0.0 +#define TEMP_SENSOR_AD8495_GAIN 1.0 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled + #define CONTROLLERFAN_SPEED 255 // 255 == full speed +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed + +/** + * Part-Cooling Fan Multiplexer + * + * This feature allows you to digitally multiplex the fan output. + * The multiplexer is automatically switched at tool-change. + * Set FANMUX[012]_PINs below for up to 2, 4, or 8 multiplexed fans. + */ +#define FANMUX0_PIN -1 +#define FANMUX1_PIN -1 +#define FANMUX2_PIN -1 + +/** + * M355 Case Light on-off / brightness + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on + #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) + //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu + //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. + #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) + #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } + #endif +#endif + +//=========================================================================== +//============================ Mechanical Settings ========================== +//=========================================================================== + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #endif +#endif + +/** + * Dual X Carriage + * + * This setup has two X carriages that can move independently, each with its own hotend. + * The carriages can be used to print an object with two colors or materials, or in + * "duplication mode" it can print two identical or X-mirrored objects simultaneously. + * The inactive carriage is parked automatically to prevent oozing. + * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. + * By default the X2 stepper is assigned to the first unused E plug on the board. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0 (DXC_FULL_CONTROL_MODE): Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1 (DXC_AUTO_PARK_MODE) : Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2 (DXC_DUPLICATION_MODE) : Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// Homing hits each endstop, retracts by these distances, then does a slower bump. +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 2 +#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially + +// When G28 is called, this option will make Y home before X +//#define HOME_Y_BEFORE_X + +// Enable this if X or Y can't home without homing the other axis first. +//#define CODEPENDENT_XY_HOMING + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + // Use the amplification factor to de-/increase correction step. + // In case the stepper (spindle) position is further out than the test point + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section machine + +#define AXIS_RELATIVE_MODES {false, false, false, false} + +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// @section lcd + +#if ENABLED(ULTIPANEL) + #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel + #define MANUAL_E_MOVES_RELATIVE // Show LCD extruder moves as relative rather than absolute positions + #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder +#endif + +// @section extras + +// minimum time in microseconds that a movement needs to take if the buffer is emptied. +#define DEFAULT_MINSEGMENTTIME 20000 + +// If defined the movements slow down when the look ahead buffer is only half full +#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Use Junction Deviation instead of traditional Jerk Limiting +// +//#define JUNCTION_DEVIATION +#if ENABLED(JUNCTION_DEVIATION) + #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge +#endif + +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +#define MICROSTEP1 LOW,LOW,LOW +#define MICROSTEP2 HIGH,LOW,LOW +#define MICROSTEP4 LOW,HIGH,LOW +#define MICROSTEP8 HIGH,HIGH,LOW +#define MICROSTEP16 LOW,LOW,HIGH +#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 32, 32, 32, 32, 32, 32 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +#define PWM_MOTOR_CURRENT { 1200, 1200, 1200 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis + +// Use an I2C based DIGIPOT (e.g., Azteeg X3 Pro) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. +// These correspond to the physical drivers, so be mindful if the order is changed. +#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// The timeout (in ms) to return to the status screen from sub-menus +//#define LCD_TIMEOUT_TO_STATUS 15000 + +// Add an 'M73' G-code to set the current percentage +//#define LCD_SET_PROGRESS_MANUALLY + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing + #if ENABLED(LCD_PROGRESS_BAR) + #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar + #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message + #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) + //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it + //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar + #endif +#endif // HAS_PRINT_PROGRESS + +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU +#if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the Z enabled so your bed stays in place. + + // Reverse SD sort to show "more recent" files first, according to the card's FAT. + // Since the FAT gets out of order with usage, SDCARD_SORT_ALPHA is recommended. + #define SDCARD_RATHERRECENTFIRST + + // Add an option in the menu to run all auto#.g files + //#define MENU_ADDAUTOSTART + + /** + * Continue after Power-Loss (Creality3D) + * + * Store the current state to the SD Card at the start of each layer + * during SD printing. If the recovery file is found at boot time, present + * an option on the LCD screen to continue the print from the last-known + * point in the file. + */ + //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E must be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN + * SS --> SDSS + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define FAST_FILE_TRANSFER + +#endif // SDSUPPORT + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // Show SD percentage next to the progress bar + //#define DOGM_SD_PERCENT + + // Enable to save many cycles by drawing a hollow frame on the Info Screen + #define XYZ_HOLLOW_FRAME + + // Enable to save many cycles by drawing a hollow frame on Menu Screens + #define MENU_HOLLOW_FRAME + + // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM. + // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. + //#define USE_BIG_EDIT_FONT + + // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM. + // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. + //#define USE_SMALL_INFOFONT + + // Enable this option and reduce the value to optimize screen updates. + // The normal delay is 10µs. Use the lowest value that still gives a reliable display. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + #if ENABLED(U8GLIB_ST7920) + /** + * ST7920-based LCDs can emulate a 16 x 4 character display using + * the ST7920 character-generator for very fast screen updates. + * Enable LIGHTWEIGHT_UI to use this special display mode. + * + * Since LIGHTWEIGHT_UI has limited space, the position and status + * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the + * length of time to display the status message before clearing. + * + * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. + * This will prevent position updates from being displayed. + */ + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD + +// @section safety + +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. +#define USE_WATCHDOG + +#if ENABLED(USE_WATCHDOG) + // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. + // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. + // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#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 1 // Babysteps are very small. Increase for faster motion. + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) + #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: Extra time may be added to mitigate controller latency. + #endif + + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * K=0 means advance disabled. + * + * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! + * + * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. + * Larger K values will be needed for flexible filament and greater distances. + * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) + * print acceleration will be reduced during the affected moves to keep within the limit. + * + * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. + * Mention @Sebastianv650 on GitHub to alert the author of any issues. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed + //#define LA_DEBUG // If enabled, this will generate debug information output over USB. +#endif + +// @section leveling + +#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + /** + * Specify an action command to send to the host on a recovery attempt or failure. + * Will be sent in the form '//action:ACTION_ON_G29_FAILURE', e.g. '//action:probe_failed'. + * The host must be configured to handle the action command. + */ + #define G29_ACTION_ON_RECOVER "probe_rewipe" + #define G29_ACTION_ON_FAILURE "probe_failed" +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#define ARC_SUPPORT // Disable this feature to save ~3226 bytes +#if ENABLED(ARC_SUPPORT) + #define MM_PER_ARC_SEGMENT 1 // Length of each arc segment + #define N_ARC_CORRECTION 25 // Number of intertpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +// G38.2 and G38.3 Probe Target +// Set MULTIPLE_PROBING if you want G38 to double touch +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + #define G38_MINIMUM_MOVE 0.0275 // minimum distance in mm that will produce a move (determined using the print statement in check_move) +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 400 : Minimum for A5984 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988, A5984, and LV8729 stepper drivers + * 2 : Minimum for DRV8825 stepper drivers + * 3 : Minimum for TB6600 stepper drivers + * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_PULSE 2 + +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MAXIMUM_STEPPER_RATE 250000 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering. +#if ENABLED(SDSUPPORT) + #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// Host Receive Buffer Size +// Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough. +// To use flow control, set this buffer size to at least 1024 bytes. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048] +//#define RX_BUFFER_SIZE 1024 + +#if RX_BUFFER_SIZE >= 1024 + // Enable to have the controller send XON/XOFF control characters to + // the host to signal the RX buffer is becoming full. + //#define SERIAL_XON_XOFF +#endif + +#if ENABLED(SDSUPPORT) + // Enable this option to collect and display the maximum + // RX queue usage after transferring a file to SD. + //#define SERIAL_STATS_MAX_RX_QUEUED + + // Enable this option to collect and display the number + // of dropped bytes after a file transfer to SD. + //#define SERIAL_STATS_DROPPED_RX +#endif + +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over + #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #endif + #define RETRACT_LENGTH 3 // Default retract length (positive mm) + #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change + #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) + #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) + #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) + #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#define ADVANCED_PAUSE_FEATURE +#if ENABLED(ADVANCED_PAUSE_FEATURE) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. + #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. + // This short retract is done immediately, before parking the nozzle. + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. + // For Bowden, the full length of the tube and nozzle. + // For direct drive, the full length of the nozzle. + // Set to 0 for manual unloading. + #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. + #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. + // 0 to disable start loading and skip to fast load only + #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. + #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. + // For Bowden, the full length of the tube and nozzle. + // For direct drive, the full length of the nozzle. + //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. + #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. + #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. + // Set to 0 for manual extrusion. + // Filament can be extruded repeatedly from the Filament Change menu + // until extrusion is consistent, and to purge old filament. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. + #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. + + #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. + #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. + + //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change + + //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. + //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #define X_MAX_CURRENT 1000 // in mA + #define X_SENSE_RESISTOR 91 // in mOhms + #define X_MICROSTEPS 16 // number of microsteps + + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + * You may also use software SPI if you wish to use general purpose IO pins. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use the reading capabilities, also connect #_SERIAL_RX_PIN + * to PDN_UART without a resistor. + * The drivers can also be used with hardware serial. + * + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper + */ +#if HAS_TRINAMIC + + #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current. + #define X_MICROSTEPS 16 // 0..256 + + #define Y_CURRENT 800 + #define Y_MICROSTEPS 16 + + #define Z_CURRENT 800 + #define Z_MICROSTEPS 16 + + #define X2_CURRENT 800 + #define X2_MICROSTEPS 16 + + #define Y2_CURRENT 800 + #define Y2_MICROSTEPS 16 + + #define Z2_CURRENT 800 + #define Z2_MICROSTEPS 16 + + #define Z3_CURRENT 800 + #define Z3_MICROSTEPS 16 + + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + + /** + * Use software SPI for TMC2130. + * The default SW SPI pins are defined the respective pins files, + * but you can override or define them here. + */ + //#define TMC_USE_SW_SPI + //#define TMC_SW_MOSI -1 + //#define TMC_SW_MISO -1 + //#define TMC_SW_SCK -1 + + /** + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP + + /** + * Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions, + * like overtemperature and short to ground. TMC2208 requires hardware serial. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 S0/1 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP needs to be enabled. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to sense an obstacle and trigger an endstop. + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is used for tuning the trigger sensitivity. + * Higher values make the system LESS sensitive. + * Lower value make the system MORE sensitive. + * Too low values can lead to false positives, while too high values will collide the axis without triggering. + * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. + * M914 X/Y/Z to live tune the setting + */ + //#define SENSORLESS_HOMING // TMC2130 only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // TMC2130 only + + #if ENABLED(SENSORLESS_HOMING) || ENABLED(SENSORLESS_PROBING) + #define X_STALL_SENSITIVITY 8 + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + #endif + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * M915 Z Axis Calibration + * + * - Adjust Z stepper current, + * - Drive the Z axis to its physical maximum, and + * - Home Z to account for the lost steps. + * + * Use M915 Snn to specify the current. + * Use M925 Znn to add extra Z height to Z_MAX_POS. + */ + //#define TMC_Z_CALIBRATION + #if ENABLED(TMC_Z_CALIBRATION) + #define CALIBRATION_CURRENT 250 + #define CALIBRATION_EXTRA_HEIGHT 10 + #endif + + /** + * You can set your own advanced settings by filling in predefined functions. + * A list of available functions can be found on the library github page + * https://github.com/teemuatlut/TMC2130Stepper + * https://github.com/teemuatlut/TMC2208Stepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_temp_prewarn(1); \ + * stepperY.interpolate(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + */ +#if HAS_DRIVER(L6470) + + #define X_MICROSTEPS 16 // number of microsteps + #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 // current in mA where the driver will detect a stall + + #define X2_MICROSTEPS 16 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + + #define Y_MICROSTEPS 16 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + + #define Y2_MICROSTEPS 16 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + + #define Z_MICROSTEPS 16 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + + #define Z2_MICROSTEPS 16 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + + #define Z3_MICROSTEPS 16 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + + #define E0_MICROSTEPS 16 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + + #define E1_MICROSTEPS 16 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + + #define E2_MICROSTEPS 16 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + + #define E3_MICROSTEPS 16 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + + #define E4_MICROSTEPS 16 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + + #define E5_MICROSTEPS 16 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Canon Hack Development Kit + * http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + */ +//#define CHDK_PIN 4 // Set and enable a pin for triggering CHDK to take a picture +#if PIN_EXISTS(CHDK) + #define CHDK_DELAY 50 // (ms) How long the pin should remain HIGH +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_LASER_ENABLE +#if ENABLED(SPINDLE_LASER_ENABLE) + + #define SPINDLE_LASER_ENABLE_INVERT false // set to "true" if the on/off function is reversed + #define SPINDLE_LASER_PWM true // set to true if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // delay in milliseconds to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // delay in milliseconds to allow the spindle to stop + #define SPINDLE_DIR_CHANGE true // set to true if your spindle controller supports changing spindle direction + #define SPINDLE_INVERT_DIR false + #define SPINDLE_STOP_ON_DIR_CHANGE true // set to true if Marlin should stop the spindle before changing rotation direction + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + + //#define SPEED_POWER_SLOPE 0.3922 + //#define SPEED_POWER_INTERCEPT 0 + //#define SPEED_POWER_MIN 10 + //#define SPEED_POWER_MAX 100 // 0-100% +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + +/** + * Specify an action command to send to the host on pause and resume. + * Will be sent in the form '//action:ACTION_ON_PAUSE', e.g. '//action:pause'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_PAUSE "pause" +//#define ACTION_ON_RESUME "resume" + +//=========================================================================== +//====================== I2C Position Encoder Settings ====================== +//=========================================================================== + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reilabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper + // steps per full revolution (motor steps/rev * microstepping) + //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the + // printer will attempt to correct the error; errors + // smaller than this are ignored to minimize effects of + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_ENC_2_TICKS_UNIT 2048 + //#define I2CPE_ENC_2_TICKS_REV (16 * 200) + //#define I2CPE_ENC_2_INVERT + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behaviour. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * this setting determines the minimum update time between checks. A value of 100 works well with + * error rolling average when attempting to correct only for skips and not for vibration. + */ + #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * MAX7219 Debug Matrix + * + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. + * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + + /** + * Sample debug features + * If you add more debug displays, be careful to avoid conflicts! + */ + #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning + #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + + #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + // If you experience stuttering, reboots, etc. this option can reveal how + // tweaks made to the configuration are affecting the printer in real-time. +#endif + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behaviour is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" +#endif + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h index b974fc03f0..825a9216ef 100644 --- a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h index 605bce04a2..3bd6011ebe 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h @@ -599,7 +599,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS #define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -818,7 +818,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1061,6 +1075,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h index 2649829f5c..c2834f5785 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h index f30b97a1b6..828241938c 100644 --- a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -588,7 +588,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -807,7 +807,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1050,6 +1064,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h b/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h index 376f359d8e..e3d2db162e 100644 --- a/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h @@ -588,7 +588,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -807,7 +807,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1050,6 +1064,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index 07a7f63035..10b67acfcc 100644 --- a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -588,7 +588,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -807,7 +807,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1050,6 +1064,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h index 07a7f63035..10b67acfcc 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -588,7 +588,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -807,7 +807,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1050,6 +1064,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index a5bd5af9b7..b92a6c85f6 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -588,7 +588,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -807,7 +807,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1050,6 +1064,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h b/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h index 6835432c59..a97abf4091 100644 --- a/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h @@ -588,7 +588,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -807,7 +807,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1050,6 +1064,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/delta/MKS/SBASE/Configuration.h b/Marlin/src/config/examples/delta/MKS/SBASE/Configuration.h new file mode 100644 index 0000000000..c66e9f744c --- /dev/null +++ b/Marlin/src/config/examples/delta/MKS/SBASE/Configuration.h @@ -0,0 +1,2134 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Configuration.h + * + * Basic settings such as: + * + * - Type of electronics + * - Type of temperature sensor + * - Printer geometry + * - Endstop configuration + * - LCD controller + * - Extra features + * + * Advanced settings can be found in Configuration_adv.h + * + */ +#define CONFIGURATION_H_VERSION 020000 + +//=========================================================================== +//============================= Getting Started ============================= +//=========================================================================== + +/** + * Here are some standard links for getting your machine calibrated: + * + * http://reprap.org/wiki/Calibration + * http://youtu.be/wAL9d7FgInk + * http://calculator.josefprusa.cz + * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide + * http://www.thingiverse.com/thing:5573 + * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap + * http://www.thingiverse.com/thing:298812 + */ + +//=========================================================================== +//============================= DELTA Printer =============================== +//=========================================================================== +// For a Delta printer start with one of the configuration files in the +// config/examples/delta directory and customize for your machine. +// + +//=========================================================================== +//============================= SCARA Printer =============================== +//=========================================================================== +// For a SCARA printer start with the configuration files in +// config/examples/SCARA and customize for your machine. +// + +// @section info + +// 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 SHOW_BOOTSCREEN +#define STRING_SPLASH_LINE1 SHORT_BUILD_VERSION // will be shown during bootup in line 1 +#define STRING_SPLASH_LINE2 WEBSITE_URL // will be shown during bootup in line 2 + +/** + * *** VENDORS PLEASE READ *** + * + * Marlin allows you to add a custom boot image for Graphical LCDs. + * With this option Marlin will first show your custom screen followed + * by the standard Marlin logo with version number and web URL. + * + * We encourage you to take advantage of this new feature and we also + * respectfully request that you retain the unmodified Marlin boot screen. + */ + +// Enable to show the bitmap in Marlin/_Bootscreen.h on startup. +//#define SHOW_CUSTOM_BOOTSCREEN + +// Enable to show the bitmap in Marlin/_Statusscreen.h on the status screen. +//#define CUSTOM_STATUS_SCREEN_IMAGE + +// @section machine + +/** + * Select the serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +#define SERIAL_PORT 0 + +/** + * Select a secondary serial port on the board to use for communication with the host. + * This allows the connection of wireless adapters (for instance) to non-default port pins. + * Serial port -1 is the USB emulated serial port, if available. + * + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define SERIAL_PORT_2 -1 + +/** + * This setting determines the communication speed of the printer. + * + * 250000 works in most cases, but you might try a lower speed if + * you commonly experience drop-outs during host printing. + * You may try up to 1000000 to speed up SD file transfer. + * + * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] + */ +#define BAUDRATE 250000 + +// Enable the Bluetooth serial interface on AT90USB devices +//#define BLUETOOTH + +// 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_MKS_SBASE +#endif + +// Optional custom name for your RepStrap or other custom machine +// Displayed in the LCD "Ready" message +#define CUSTOM_MACHINE_NAME "Deltabot" + +// 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) +//#define MACHINE_UUID "00000000-0000-0000-0000-000000000000" + +// @section extruder + +// This defines the number of extruders +// :[1, 2, 3, 4, 5, 6] +#define EXTRUDERS 1 + +// Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc. +#define DEFAULT_NOMINAL_FILAMENT_DIA 3.0 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE + +/** + * Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. + * + * This device allows one stepper driver on a control board to drive + * two to eight stepper motors, one at a time, in a manner suitable + * for extruders. + * + * This option only allows the multiplexer to switch on tool-change. + * Additional options to configure custom E moves are pending. + */ +//#define MK2_MULTIPLEXER +#if ENABLED(MK2_MULTIPLEXER) + // Override the default DIO selector pins here, if needed. + // Some pins files may provide defaults for these pins. + //#define E_MUX0_PIN 40 // Always Required + //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs + //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs +#endif + +// A dual extruder that uses a single stepper motor +//#define SWITCHING_EXTRUDER +#if ENABLED(SWITCHING_EXTRUDER) + #define SWITCHING_EXTRUDER_SERVO_NR 0 + #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } // Angles for E0, E1[, E2, E3] + #if EXTRUDERS > 3 + #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 + #endif +#endif + +// A dual-nozzle that uses a servomotor to raise/lower one of the nozzles +//#define SWITCHING_NOZZLE +#if ENABLED(SWITCHING_NOZZLE) + #define SWITCHING_NOZZLE_SERVO_NR 0 + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 +#endif + +/** + * Two separate X-carriages with extruders that connect to a moving part + * via a magnetic docking mechanism. Requires SOL1_PIN and SOL2_PIN. + */ +//#define PARKING_EXTRUDER +#if ENABLED(PARKING_EXTRUDER) + #define PARKING_EXTRUDER_SOLENOIDS_INVERT // If enabled, the solenoid is NOT magnetized with applied voltage + #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW // LOW or HIGH pin signal energizes the coil + #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 // Delay (ms) for magnetic field. No delay if 0 or not defined. + #define PARKING_EXTRUDER_PARKING_X { -78, 184 } // X positions for parking the extruders + #define PARKING_EXTRUDER_GRAB_DISTANCE 1 // mm to move beyond the parking point to grab the extruder + //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 +#endif + +/** + * Switching Toolhead + * + * Support for swappable and dockable toolheads, such as + * the E3D Tool Changer. Toolheads are locked with a servo. + */ +//#define SWITCHING_TOOLHEAD +#if ENABLED(SWITCHING_TOOLHEAD) + #define SWITCHING_TOOLHEAD_SERVO_NR 2 // Index of the servo connector + #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } // (degrees) Angles for Lock, Unlock + #define SWITCHING_TOOLHEAD_Y_POS 235 // (mm) Y position of the toolhead dock + #define SWITCHING_TOOLHEAD_Y_SECURITY 10 // (mm) Security distance Y axis + #define SWITCHING_TOOLHEAD_Y_CLEAR 60 // (mm) Minimum distance from dock for unobstructed X axis + #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } // (mm) X positions for parking the extruders +#endif + +/** + * "Mixing Extruder" + * - Adds G-codes M163 and M164 to set and "commit" the current mix factors. + * - Extends the stepping routines to move multiple steppers in proportion to the mix. + * - Optional support for Repetier Firmware's 'M164 S' supporting virtual tools. + * - This implementation supports up to two mixing extruders. + * - Enable DIRECT_MIXING_IN_G1 for M165 and mixing in G1 (from Pia Taubert's reference implementation). + */ +//#define MIXING_EXTRUDER +#if ENABLED(MIXING_EXTRUDER) + #define MIXING_STEPPERS 2 // Number of steppers in your mixing extruder + #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164 + //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands +#endif + +// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing). +// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder). +// For the other hotends it is their distance from the extruder 0 hotend. +//#define HOTEND_OFFSET_X {0.0, 20.00} // (mm) relative X-offset for each nozzle +//#define HOTEND_OFFSET_Y {0.0, 5.00} // (mm) relative Y-offset for each nozzle +//#define HOTEND_OFFSET_Z {0.0, 0.00} // (mm) relative Z-offset for each nozzle + +// @section machine + +/** + * Select your power supply here. Use 0 if you haven't connected the PS_ON_PIN + * + * 0 = No Power Switch + * 1 = ATX + * 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) + * + * :{ 0:'No power switch', 1:'ATX', 2:'X-Box 360' } + */ +#define POWER_SUPPLY 1 + +#if POWER_SUPPLY > 0 + // Enable this option to leave the PSU off at startup. + // Power to steppers and heaters will need to be turned on with M80. + #define PS_DEFAULT_OFF + + //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin + #if ENABLED(AUTO_POWER_CONTROL) + #define AUTO_POWER_FANS // Turn on PSU if fans need power + #define AUTO_POWER_E_FANS + #define AUTO_POWER_CONTROLLERFAN + #define POWER_TIMEOUT 30 + #endif + +#endif + +// @section temperature + +//=========================================================================== +//============================= Thermal Settings ============================ +//=========================================================================== + +/** + * --NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table + * + * Temperature sensors available: + * + * -4 : thermocouple with AD8495 + * -3 : thermocouple with MAX31855 (only for sensor 0) + * -2 : thermocouple with MAX6675 (only for sensor 0) + * -1 : thermocouple with AD595 + * 0 : not used + * 1 : 100k thermistor - best choice for EPCOS 100k (4.7k pullup) + * 2 : 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup) + * 3 : Mendel-parts thermistor (4.7k pullup) + * 4 : 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !! + * 5 : 100K thermistor - ATC Semitec 104GT-2/104NT-4-R025H42G (Used in ParCan & J-Head) (4.7k pullup) + * 501 : 100K Zonestar (Tronxy X3A) Thermistor + * 6 : 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup) + * 7 : 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup) + * 71 : 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup) + * 8 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) + * 9 : 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup) + * 10 : 100k RS thermistor 198-961 (4.7k pullup) + * 11 : 100k beta 3950 1% thermistor (4.7k pullup) + * 12 : 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed) + * 13 : 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" + * 15 : 100k thermistor calibration for JGAurora A5 hotend + * 20 : the PT100 circuit found in the Ultimainboard V2.x + * 60 : 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 + * 66 : 4.7M High Temperature thermistor from Dyze Design + * 70 : the 100K thermistor found in the bq Hephestos 2 + * 75 : 100k Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor + * + * 1k ohm pullup tables - This is atypical, and requires changing out the 4.7k pullup for 1k. + * (but gives greater accuracy and more stable PID) + * 51 : 100k thermistor - EPCOS (1k pullup) + * 52 : 200k thermistor - ATC Semitec 204GT-2 (1k pullup) + * 55 : 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup) + * + * 1047 : Pt1000 with 4k7 pullup + * 1010 : Pt1000 with 1k pullup (non standard) + * 147 : Pt100 with 4k7 pullup + * 110 : Pt100 with 1k pullup (non standard) + * + * Use these for Testing or Development purposes. NEVER for production machine. + * 998 : Dummy Table that ALWAYS reads 25°C or the temperature defined below. + * 999 : Dummy Table that ALWAYS reads 100°C or the temperature defined below. + * + * :{ '0': "Not used", '1':"100k / 4.7k - EPCOS", '2':"200k / 4.7k - ATC Semitec 204GT-2", '3':"Mendel-parts / 4.7k", '4':"10k !! do not use for a hotend. Bad resolution at high temp. !!", '5':"100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '501':"100K Zonestar (Tronxy X3A)", '6':"100k / 4.7k EPCOS - Not as accurate as Table 1", '7':"100k / 4.7k Honeywell 135-104LAG-J01", '8':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9':"100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10':"100k / 4.7k RS 198-961", '11':"100k / 4.7k beta 3950 1%", '12':"100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13':"100k Hisens 3950 1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '20':"PT100 (Ultimainboard V2.x)", '51':"100k / 1k - EPCOS", '52':"200k / 1k - ATC Semitec 204GT-2", '55':"100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '60':"100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '66':"Dyze Design 4.7M High Temperature thermistor", '70':"the 100K thermistor found in the bq Hephestos 2", '71':"100k / 4.7k Honeywell 135-104LAF-J01", '147':"Pt100 / 4.7k", '1047':"Pt1000 / 4.7k", '110':"Pt100 / 1k (non-standard)", '1010':"Pt1000 / 1k (non standard)", '-4':"Thermocouple + AD8495", '-3':"Thermocouple + MAX31855 (only for sensor 0)", '-2':"Thermocouple + MAX6675 (only for sensor 0)", '-1':"Thermocouple + AD595",'998':"Dummy 1", '999':"Dummy 2" } + */ +#define TEMP_SENSOR_0 -1 +#define TEMP_SENSOR_1 0 +#define TEMP_SENSOR_2 0 +#define TEMP_SENSOR_3 0 +#define TEMP_SENSOR_4 0 +#define TEMP_SENSOR_5 0 +#define TEMP_SENSOR_BED 5 +#define TEMP_SENSOR_CHAMBER 0 + +// Dummy thermistor constant temperature readings, for use with 998 and 999 +#define DUMMY_THERMISTOR_998_VALUE 25 +#define DUMMY_THERMISTOR_999_VALUE 100 + +// Use temp sensor 1 as a redundant sensor with sensor 0. If the readings +// from the two sensors differ too much the print will be aborted. +//#define TEMP_SENSOR_1_AS_REDUNDANT +#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10 + +// Extruder temperature must be close to target for this long before M109 returns success +#define TEMP_RESIDENCY_TIME 10 // (seconds) +#define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. + +// Bed temperature must be close to target for this long before M190 returns success +#define TEMP_BED_RESIDENCY_TIME 10 // (seconds) +#define TEMP_BED_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one +#define TEMP_BED_WINDOW 1 // (degC) Window around target to start the residency timer x degC early. + +// The minimal temperature defines the temperature below which the heater will not be enabled It is used +// to check that the wiring to the thermistor is not broken. +// Otherwise this would lead to the heater being powered on all the time. +#define HEATER_0_MINTEMP 5 +#define HEATER_1_MINTEMP 5 +#define HEATER_2_MINTEMP 5 +#define HEATER_3_MINTEMP 5 +#define HEATER_4_MINTEMP 5 +#define HEATER_5_MINTEMP 5 +#define BED_MINTEMP 5 + +// When temperature exceeds max temp, your heater will be switched off. +// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure! +// You should use MINTEMP for thermistor short/failure protection. +#define HEATER_0_MAXTEMP 275 +#define HEATER_1_MAXTEMP 275 +#define HEATER_2_MAXTEMP 275 +#define HEATER_3_MAXTEMP 275 +#define HEATER_4_MAXTEMP 275 +#define HEATER_5_MAXTEMP 275 +#define BED_MAXTEMP 150 + +//=========================================================================== +//============================= PID Settings ================================ +//=========================================================================== +// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning + +// Comment the following line to disable PID and enable bang-bang. +#define PIDTEMP +#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current +#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current +#define PID_K1 0.95 // Smoothing factor within any PID loop +#if ENABLED(PIDTEMP) + //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result. + //#define PID_DEBUG // Sends debug data to the serial port. + //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX + //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay + //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) + // Set/get with gcode: M301 E[extruder number, 0-2] + #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature + // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. + + // 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 + + // MakerGear + //#define DEFAULT_Kp 7.0 + //#define DEFAULT_Ki 0.1 + //#define DEFAULT_Kd 12 + + // Mendel Parts V9 on 12V + //#define DEFAULT_Kp 63.0 + //#define DEFAULT_Ki 2.25 + //#define DEFAULT_Kd 440 + +#endif // PIDTEMP + +//=========================================================================== +//============================= PID > Bed Temperature Control =============== +//=========================================================================== + +/** + * PID Bed Heating + * + * If this option is enabled set PID constants below. + * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. + * + * The PID frequency will be the same as the extruder PWM. + * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz, + * which is fine for driving a square wave into a resistive load and does not significantly + * impact FET heating. This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W + * heater. If your configuration is significantly different than this and you don't understand + * the issues involved, don't use bed PID until someone else verifies that your hardware works. + */ +//#define PIDTEMPBED + +//#define BED_LIMIT_SWITCHING + +/** + * Max Bed Power + * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). + * When set to any value below 255, enables a form of PWM to the bed that acts like a divider + * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) + */ +#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current + +#if ENABLED(PIDTEMPBED) + + //#define PID_BED_DEBUG // Sends debug data to the serial port. + + //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) + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 + + //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) + //from pidautotune + //#define DEFAULT_bedKp 97.1 + //#define DEFAULT_bedKi 1.41 + //#define DEFAULT_bedKd 1675.16 + + // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. +#endif // PIDTEMPBED + +// @section extruder + +/** + * Prevent extrusion if the temperature is below EXTRUDE_MINTEMP. + * Add M302 to set the minimum extrusion temperature and/or turn + * cold extrusion prevention on and off. + * + * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** + */ +#define PREVENT_COLD_EXTRUSION +#define EXTRUDE_MINTEMP 170 + +/** + * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. + * Note: For Bowden Extruders make this large enough to allow load/unload. + */ +#define PREVENT_LENGTHY_EXTRUDE +#define EXTRUDE_MAXLENGTH 200 + +//=========================================================================== +//======================== Thermal Runaway Protection ======================= +//=========================================================================== + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * If you get "Thermal Runaway" or "Heating failed" errors the + * details can be tuned in Configuration_adv.h + */ + +#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders +#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed + +//=========================================================================== +//============================= Mechanical Settings ========================= +//=========================================================================== + +// @section machine + +// Uncomment one of these options to enable CoreXY, CoreXZ, or CoreYZ kinematics +// either in the usual order or reversed +//#define COREXY +//#define COREXZ +//#define COREYZ +//#define COREYX +//#define COREZX +//#define COREZY + +//=========================================================================== +//============================== Delta Settings ============================= +//=========================================================================== +// Enable DELTA kinematics and most of the default configuration for Deltas +#define DELTA + +#if ENABLED(DELTA) + + // Make delta curves from many straight lines (linear interpolation). + // This is a trade-off between visible corners (not enough segments) + // and processor overload (too many expensive sqrt calls). + #define DELTA_SEGMENTS_PER_SECOND 200 + + // After homing move down to a height where XY movement is unconstrained + //#define DELTA_HOME_TO_SAFE_ZONE + + // Delta calibration menu + // uncomment to add three points calibration menu option. + // See http://minow.blogspot.com/index.html#4918805519571907051 + //#define DELTA_CALIBRATION_MENU + + // uncomment to add G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results) + //#define DELTA_AUTO_CALIBRATION + + // NOTE NB all values for DELTA_* values MUST be floating point, so always have a decimal point in them + + #if ENABLED(DELTA_AUTO_CALIBRATION) + // set the default number of probe points : n*n (1 -> 7) + #define DELTA_CALIBRATION_DEFAULT_POINTS 4 + #endif + + #if ENABLED(DELTA_AUTO_CALIBRATION) || ENABLED(DELTA_CALIBRATION_MENU) + // Set the radius for the calibration probe points - max DELTA_PRINTABLE_RADIUS for non-eccentric probes + #define DELTA_CALIBRATION_RADIUS 121.5 // (mm) + // Set the steprate for papertest probing + #define PROBE_MANUALLY_STEP 0.05 // (mm) + #endif + + // Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers). + #define DELTA_PRINTABLE_RADIUS 140.0 // (mm) + + // Center-to-center distance of the holes in the diagonal push rods. + #define DELTA_DIAGONAL_ROD 250.0 // (mm) + + // height from z=0 to home position + #define DELTA_HEIGHT 250.00 // get this value from auto calibrate + + #define DELTA_ENDSTOP_ADJ { 0.0, 0.0, 0.0 } // get these from auto calibrate + + // Horizontal distance bridged by diagonal push rods when effector is centered. + #define DELTA_RADIUS 124.0 //mm Get this value from auto calibrate + + // Trim adjustments for individual towers + // tower angle corrections for X and Y tower / rotate XYZ so Z tower angle = 0 + // measured in degrees anticlockwise looking from above the printer + #define DELTA_TOWER_ANGLE_TRIM { 0.0, 0.0, 0.0 } // get these values from auto calibrate + + // delta radius and diaginal rod adjustments measured in mm + //#define DELTA_RADIUS_TRIM_TOWER { 0.0, 0.0, 0.0 } + //#define DELTA_DIAGONAL_ROD_TRIM_TOWER { 0.0, 0.0, 0.0 } + +#endif + +//=========================================================================== +//============================== Endstop Settings =========================== +//=========================================================================== + +// @section homing + +// Specify here all the endstop connectors that are connected to any endstop or probe. +// Almost all printers will be using one per axis. Probes will use one or more of the +// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. +//#define USE_XMIN_PLUG +//#define USE_YMIN_PLUG +#define USE_ZMIN_PLUG // a Z probe +#define USE_XMAX_PLUG +#define USE_YMAX_PLUG +#define USE_ZMAX_PLUG + +// Enable pullup for all endstops to prevent a floating state +#define ENDSTOPPULLUPS +#if DISABLED(ENDSTOPPULLUPS) + // Disable ENDSTOPPULLUPS to set pullups individually + //#define ENDSTOPPULLUP_XMAX + //#define ENDSTOPPULLUP_YMAX + //#define ENDSTOPPULLUP_ZMAX + //#define ENDSTOPPULLUP_XMIN + //#define ENDSTOPPULLUP_YMIN + //#define ENDSTOPPULLUP_ZMIN + //#define ENDSTOPPULLUP_ZMIN_PROBE +#endif + +// Enable pulldown for all endstops to prevent a floating state +//#define ENDSTOPPULLDOWNS +#if DISABLED(ENDSTOPPULLDOWNS) + // Disable ENDSTOPPULLDOWNS to set pulldowns individually + //#define ENDSTOPPULLDOWN_XMAX + //#define ENDSTOPPULLDOWN_YMAX + //#define ENDSTOPPULLDOWN_ZMAX + //#define ENDSTOPPULLDOWN_XMIN + //#define ENDSTOPPULLDOWN_YMIN + //#define ENDSTOPPULLDOWN_ZMIN + //#define ENDSTOPPULLDOWN_ZMIN_PROBE +#endif + +// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). +#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop. +#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the probe. + +/** + * Stepper Drivers + * + * These settings allow Marlin to tune stepper driver timing and enable advanced options for + * stepper drivers that support them. You may also override timing options in Configuration_adv.h. + * + * A4988 is assumed for unspecified drivers. + * + * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100, + * TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE, + * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, + * TMC5130, TMC5130_STANDALONE + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE'] + */ +//#define X_DRIVER_TYPE A4988 +//#define Y_DRIVER_TYPE A4988 +//#define Z_DRIVER_TYPE A4988 +//#define X2_DRIVER_TYPE A4988 +//#define Y2_DRIVER_TYPE A4988 +//#define Z2_DRIVER_TYPE A4988 +//#define Z3_DRIVER_TYPE A4988 +//#define E0_DRIVER_TYPE A4988 +//#define E1_DRIVER_TYPE A4988 +//#define E2_DRIVER_TYPE A4988 +//#define E3_DRIVER_TYPE A4988 +//#define E4_DRIVER_TYPE A4988 +//#define E5_DRIVER_TYPE A4988 + +// Enable this feature if all enabled endstop pins are interrupt-capable. +// This will remove the need to poll the interrupt pins, saving many CPU cycles. +//#define ENDSTOP_INTERRUPTS_FEATURE + +/** + * Endstop Noise Threshold + * + * Enable if your probe or endstops falsely trigger due to noise. + * + * - Higher values may affect repeatability or accuracy of some bed probes. + * - To fix noise install a 100nF ceramic capacitor inline with the switch. + * - This feature is not required for common micro-switches mounted on PCBs + * based on the Makerbot design, which already have the 100nF capacitor. + * + * :[2,3,4,5,6,7] + */ +//#define ENDSTOP_NOISE_THRESHOLD 2 + +//============================================================================= +//============================== Movement Settings ============================ +//============================================================================= +// @section motion + +// delta speeds must be the same on xyz +/** + * Default Settings + * + * These settings can be reset by M502 + * + * Note that if EEPROM is enabled, saved values will override these. + */ + +/** + * With this option each E stepper can have its own factors for the + * following movement settings. If fewer factors are given than the + * total number of extruders, the last value applies to the rest. + */ +//#define DISTINCT_E_FACTORS + +/** + * Default Axis Steps Per Unit (steps/mm) + * Override with M92 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + */ +// variables to calculate steps +#define XYZ_FULL_STEPS_PER_ROTATION 426.67 +#define XYZ_MICROSTEPS 32 +#define XYZ_BELT_PITCH 2 +#define XYZ_PULLEY_TEETH 20 + +// delta speeds must be the same on xyz +#define DEFAULT_XYZ_STEPS_PER_UNIT ((XYZ_FULL_STEPS_PER_ROTATION) * (XYZ_MICROSTEPS) / double(XYZ_BELT_PITCH) / double(XYZ_PULLEY_TEETH)) +#define DEFAULT_AXIS_STEPS_PER_UNIT { DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, 760*1.1 } // default steps per unit for Kossel (GT2, 20 tooth) + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + */ +#define DEFAULT_MAX_FEEDRATE { 500, 500, 500, 25 } + +/** + * Default Max Acceleration (change/s) change = mm/s + * (Maximum start speed for accelerated moves) + * Override with M201 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + */ +#define DEFAULT_MAX_ACCELERATION { 9000, 9000, 9000, 10000 } + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * 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 + +/** + * Default Jerk (mm/s) + * Override with M205 X Y Z E + * + * "Jerk" specifies the minimum speed change that requires acceleration. + * When changing speed and direction, if the difference is less than the + * value set here, it may happen instantaneously. + */ +#define DEFAULT_XJERK 10.0 +#define DEFAULT_YJERK DEFAULT_XJERK +#define DEFAULT_ZJERK DEFAULT_XJERK // Must be same as XY for delta +#define DEFAULT_EJERK 5.0 + +/** + * S-Curve Acceleration + * + * This option eliminates vibration during printing by fitting a Bézier + * curve to move acceleration, producing much smoother direction changes. + * + * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained + */ +//#define S_CURVE_ACCELERATION + +//=========================================================================== +//============================= Z Probe Options ============================= +//=========================================================================== +// @section probes + +// +// See http://marlinfw.org/docs/configuration/probes.html +// + +/** + * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + * + * Enable this option for a probe connected to the Z Min endstop pin. + */ +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + +/** + * Z_MIN_PROBE_ENDSTOP + * + * Enable this option for a probe connected to any pin except Z-Min. + * (By default Marlin assumes the Z-Max endstop pin.) + * To use a custom Z Probe pin, set Z_MIN_PROBE_PIN below. + * + * - The simplest option is to use a free endstop connector. + * - Use 5V for powered (usually inductive) sensors. + * + * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: + * - For simple switches connect... + * - normally-closed switches to GND and D32. + * - normally-open switches to 5V and D32. + * + * WARNING: Setting the wrong pin may have unexpected and potentially + * disastrous consequences. Use with caution and do your homework. + * + */ +//#define Z_MIN_PROBE_ENDSTOP + +/** + * Probe Type + * + * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. + * Activate one of these to use Auto Bed Leveling below. + */ + +/** + * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. + * Use G29 repeatedly, adjusting the Z height at each point with movement commands + * or (with LCD_BED_LEVELING) the LCD controller. + */ +//#define PROBE_MANUALLY +//#define MANUAL_PROBE_START_Z 0.2 + +/** + * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. + * (e.g., an inductive probe or a nozzle-based probe-switch.) + */ +//#define FIX_MOUNTED_PROBE + +/** + * Z Servo Probe, such as an endstop switch on a rotating arm. + */ +//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector. +//#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles + +/** + * The BLTouch probe uses a Hall effect sensor and emulates a servo. + */ +//#define BLTOUCH +#if ENABLED(BLTOUCH) + //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed +#endif + +// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) +//#define SOLENOID_PROBE + +// A sled-mounted probe like those designed by Charles Bell. +//#define Z_PROBE_SLED +//#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. + +// A probe deployed by moving the x-axis, such as the Wilson II's rack-and-pinion probe designed by Marty Rice. +//#define RACK_AND_PINION_PROBE +#if ENABLED(RACK_AND_PINION_PROBE) + #define Z_PROBE_DEPLOY_X X_MIN_POS + #define Z_PROBE_RETRACT_X X_MAX_POS +#endif + +/** + * Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe + * Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN. + */ +//#define Z_PROBE_ALLEN_KEY + +#if ENABLED(Z_PROBE_ALLEN_KEY) + // 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29, + // if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe. + + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_X 30.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Y DELTA_PRINTABLE_RADIUS + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_X 0.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Y DELTA_PRINTABLE_RADIUS + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_Z 100.0 + #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_SPEED)/10 + + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_X Z_PROBE_ALLEN_KEY_DEPLOY_2_X * 0.75 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Y Z_PROBE_ALLEN_KEY_DEPLOY_2_Y * 0.75 + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_Z Z_PROBE_ALLEN_KEY_DEPLOY_2_Z + #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_1_X -64.0 // Move the probe into position + #define Z_PROBE_ALLEN_KEY_STOW_1_Y 56.0 + #define Z_PROBE_ALLEN_KEY_STOW_1_Z 23.0 + #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_2_X -64.0 // Push it down + #define Z_PROBE_ALLEN_KEY_STOW_2_Y 56.0 + #define Z_PROBE_ALLEN_KEY_STOW_2_Z 3.0 + #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_SPEED)/10 + + #define Z_PROBE_ALLEN_KEY_STOW_3_X -64.0 // Move it up to clear + #define Z_PROBE_ALLEN_KEY_STOW_3_Y 56.0 + #define Z_PROBE_ALLEN_KEY_STOW_3_Z 50.0 + #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_SPEED + + #define Z_PROBE_ALLEN_KEY_STOW_4_X 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_4_Y 0.0 + #define Z_PROBE_ALLEN_KEY_STOW_4_Z Z_PROBE_ALLEN_KEY_STOW_3_Z + #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_SPEED + +#endif // Z_PROBE_ALLEN_KEY + +/** + * Z Probe to nozzle (X,Y) offset, relative to (0, 0). + * X and Y offsets must be integers. + * + * In the following example the X and Y offsets are both positive: + * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 + * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 + * + * +-- BACK ---+ + * | | + * L | (+) P | R <-- probe (20,20) + * E | | I + * F | (-) N (+) | G <-- nozzle (10,10) + * T | | H + * | (-) | T + * | | + * O-- FRONT --+ + * (0,0) + */ +#define X_PROBE_OFFSET_FROM_EXTRUDER 0 // 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 -3.5 // Z offset: -below +above [the nozzle] + +// Certain types of probes need to stay away from edges +#define MIN_PROBE_EDGE 10 + +// X and Y axis travel speed (mm/m) between probes +#define XY_PROBE_SPEED 4000 + +// Feedrate (mm/m) for the first approach when double-probing (MULTIPLE_PROBING == 2) +#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z + +// Feedrate (mm/m) for the "accurate" probe of each point +#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2) + +// The number of probes to perform at each point. +// Set to 2 for a fast/slow probe, using the second probe result. +// Set to 3 or more for slow probes, averaging the results. +//#define MULTIPLE_PROBING 2 + +/** + * Z probes require clearance when deploying, stowing, and moving between + * probe points to avoid hitting the bed and other hardware. + * Servo-mounted probes require extra space for the arm to rotate. + * Inductive probes need space to keep from triggering early. + * + * Use these settings to specify the distance (mm) to raise the probe (or + * lower the bed). The values set here apply over and above any (negative) + * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. + * Only integer values >= 1 are valid here. + * + * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. + * But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle. + */ +#define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow +#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes +//#define Z_AFTER_PROBING 5 // Z position after probing is done + +#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping + +// For M851 give a range for adjusting the Z probe offset +#define Z_PROBE_OFFSET_RANGE_MIN -20 +#define Z_PROBE_OFFSET_RANGE_MAX 20 + +// Enable the M48 repeatability test to test probe accuracy +//#define Z_MIN_PROBE_REPEATABILITY_TEST + +// Before deploy/stow pause for user confirmation +//#define PAUSE_BEFORE_DEPLOY_STOW + +/** + * Enable one or more of the following if probing seems unreliable. + * Heaters and/or fans can be disabled during probing to minimize electrical + * noise. A delay can also be added to allow noise and vibration to settle. + * These options are most useful for the BLTouch probe, but may also improve + * readings with inductive probes and piezo sensors. + */ +//#define PROBING_HEATERS_OFF // Turn heaters off when probing +#if ENABLED(PROBING_HEATERS_OFF) + //#define WAIT_FOR_BED_HEATER // Wait for bed to heat back up between probes (to improve accuracy) +#endif +//#define PROBING_FANS_OFF // Turn fans off when probing +//#define PROBING_STEPPERS_OFF // Turn steppers off (unless needed to hold position) when probing +//#define DELAY_BEFORE_PROBING 200 // (ms) To prevent vibrations from triggering piezo sensors + +// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 +// :{ 0:'Low', 1:'High' } +#define X_ENABLE_ON 0 +#define Y_ENABLE_ON 0 +#define Z_ENABLE_ON 0 +#define E_ENABLE_ON 0 // For all extruders + +// Disables axis stepper immediately when it's not being used. +// WARNING: When motors turn off there is a chance of losing position accuracy! +#define DISABLE_X false +#define DISABLE_Y false +#define DISABLE_Z false + +// Warn on display about possibly reduced accuracy +//#define DISABLE_REDUCED_ACCURACY_WARNING + +// @section extruder + +#define DISABLE_E false // For all extruders +#define DISABLE_INACTIVE_EXTRUDER // Keep only the active extruder enabled + +// @section machine + +// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. +#define INVERT_X_DIR false // DELTA does not invert +#define INVERT_Y_DIR false +#define INVERT_Z_DIR false + +// @section extruder + +// For direct drive extruder v9 set to true, for geared extruder set to false. +#define INVERT_E0_DIR false +#define INVERT_E1_DIR false +#define INVERT_E2_DIR false +#define INVERT_E3_DIR false +#define INVERT_E4_DIR false +#define INVERT_E5_DIR false + +// @section homing + +//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed + +//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off. + +//#define Z_HOMING_HEIGHT 4 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ... + // Be sure you have this distance over your Z_MAX_POS in case. + +// Direction of endstops when homing; 1=MAX, -1=MIN +// :[-1,1] +#define X_HOME_DIR 1 // deltas always home to max +#define Y_HOME_DIR 1 +#define Z_HOME_DIR 1 + +// @section machine + +// The size of the print bed +#define X_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) +#define Y_BED_SIZE ((DELTA_PRINTABLE_RADIUS) * 2) + +// Travel limits (mm) after homing, corresponding to endstop positions. +#define X_MIN_POS -(DELTA_PRINTABLE_RADIUS) +#define Y_MIN_POS -(DELTA_PRINTABLE_RADIUS) +#define Z_MIN_POS 0 +#define X_MAX_POS DELTA_PRINTABLE_RADIUS +#define Y_MAX_POS DELTA_PRINTABLE_RADIUS +#define Z_MAX_POS MANUAL_Z_HOME_POS + +/** + * Software Endstops + * + * - Prevent moves outside the set machine bounds. + * - Individual axes can be disabled, if desired. + * - X and Y only apply to Cartesian robots. + * - Use 'M211' to set software endstops on/off or report current state + */ + +// Min software endstops constrain movement within minimum coordinate bounds +//#define MIN_SOFTWARE_ENDSTOPS +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) + #define MIN_SOFTWARE_ENDSTOP_X + #define MIN_SOFTWARE_ENDSTOP_Y + #define MIN_SOFTWARE_ENDSTOP_Z +#endif + +// Max software endstops constrain movement within maximum coordinate bounds +//#define MAX_SOFTWARE_ENDSTOPS +#if ENABLED(MAX_SOFTWARE_ENDSTOPS) + #define MAX_SOFTWARE_ENDSTOP_X + #define MAX_SOFTWARE_ENDSTOP_Y + #define MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) + //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD +#endif + +/** + * Filament Runout Sensors + * Mechanical or opto endstops are used to check for the presence of filament. + * + * RAMPS-based boards use SERVO3_PIN for the first runout sensor. + * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. + * By default the firmware assumes HIGH=FILAMENT PRESENT. + */ +//#define FILAMENT_RUNOUT_SENSOR +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. + #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor. + #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. + //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. + #define FILAMENT_RUNOUT_SCRIPT "M600" + + // After a runout is detected, continue printing this length of filament + // before executing the runout script. Useful for a sensor at the end of + // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + + #ifdef FILAMENT_RUNOUT_DISTANCE_MM + // Enable this option to use an encoder disc that toggles the runout pin + // as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM + // large enough to avoid false positives.) + //#define FILAMENT_MOTION_SENSOR + #endif +#endif + +//=========================================================================== +//=============================== Bed Leveling ============================== +//=========================================================================== +// @section calibrate + +/** + * Choose one of the options below to enable G29 Bed Leveling. The parameters + * and behavior of G29 will change depending on your selection. + * + * If using a Probe for Z Homing, enable Z_SAFE_HOMING also! + * + * - AUTO_BED_LEVELING_3POINT + * Probe 3 arbitrary points on the bed (that aren't collinear) + * You specify the XY coordinates of all 3 points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_LINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a single tilted plane. Best for a flat bed. + * + * - AUTO_BED_LEVELING_BILINEAR + * Probe several points in a grid. + * You specify the rectangle and the density of sample points. + * The result is a mesh, best for large or uneven beds. + * + * - AUTO_BED_LEVELING_UBL (Unified Bed Leveling) + * A comprehensive bed leveling system combining the features and benefits + * of other systems. UBL also includes integrated Mesh Generation, Mesh + * Validation and Mesh Editing systems. + * + * - MESH_BED_LEVELING + * Probe a grid manually + * The result is a mesh, suitable for large or uneven beds. (See BILINEAR.) + * For machines without a probe, Mesh Bed Leveling provides a method to perform + * leveling in steps so you can manually adjust the Z height at each grid-point. + * With an LCD controller the process is guided step-by-step. + */ +//#define AUTO_BED_LEVELING_3POINT +//#define AUTO_BED_LEVELING_LINEAR +//#define AUTO_BED_LEVELING_BILINEAR +//#define AUTO_BED_LEVELING_UBL +//#define MESH_BED_LEVELING + +/** + * Normally G28 leaves leveling disabled on completion. Enable + * this option to have G28 restore the prior leveling state. + */ +//#define RESTORE_LEVELING_AFTER_G28 + +/** + * Enable detailed logging of G28, G29, M48, etc. + * Turn on with the command 'M111 S32'. + * NOTE: Requires a lot of PROGMEM! + */ +//#define DEBUG_LEVELING_FEATURE + +#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) + // Gradually reduce leveling correction until a set height is reached, + // at which point movement will be level to the machine's XY plane. + // The height can be set with M420 Z + //#define ENABLE_LEVELING_FADE_HEIGHT + + // For Cartesian machines, instead of dividing moves on mesh boundaries, + // split up moves into short segments like a Delta. This follows the + // contours of the bed more closely than edge-to-edge straight moves. + #define SEGMENT_LEVELED_MOVES + #define LEVELED_SEGMENT_LENGTH 5.0 // (mm) Length of all segments (except the last one) + + /** + * Enable the G26 Mesh Validation Pattern tool. + */ + //#define G26_MESH_VALIDATION + #if ENABLED(G26_MESH_VALIDATION) + #define MESH_TEST_NOZZLE_SIZE 0.4 // (mm) Diameter of primary nozzle. + #define MESH_TEST_LAYER_HEIGHT 0.2 // (mm) Default layer height for the G26 Mesh Validation Tool. + #define MESH_TEST_HOTEND_TEMP 205.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. + #define MESH_TEST_BED_TEMP 60.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. + #endif + +#endif + +#if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) + + // Set the number of grid points per dimension. + // Works best with 5 or more points in each dimension. + #define GRID_MAX_POINTS_X 9 + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + // Set the boundaries for probing (where the probe can reach). + //#define LEFT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE)) + //#define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE) + //#define FRONT_PROBE_BED_POSITION -(DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE)) + //#define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS -(MIN_PROBE_EDGE) + + // Probe along the Y axis, advancing X after each column + //#define PROBE_Y_FIRST + + #if ENABLED(AUTO_BED_LEVELING_BILINEAR) + + // Beyond the probed grid, continue the implied tilt? + // Default is to maintain the height of the nearest edge. + //#define EXTRAPOLATE_BEYOND_GRID + + // + // Experimental Subdivision of the grid by Catmull-Rom method. + // Synthesizes intermediate points to produce a more detailed mesh. + // + //#define ABL_BILINEAR_SUBDIVISION + #if ENABLED(ABL_BILINEAR_SUBDIVISION) + // Number of subdivisions between probe points + #define BILINEAR_SUBDIVISIONS 3 + #endif + + #endif + +#elif ENABLED(AUTO_BED_LEVELING_UBL) + + //=========================================================================== + //========================= Unified Bed Leveling ============================ + //=========================================================================== + + //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh + + #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + #define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle + #define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500 + + //#define UBL_Z_RAISE_WHEN_OFF_MESH 2.5 // When the nozzle is off the mesh, this value is used + // as the Z-Height correction value. + +#elif ENABLED(MESH_BED_LEVELING) + + //=========================================================================== + //=================================== Mesh ================================== + //=========================================================================== + + #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + + //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS + +#endif // BED_LEVELING + +/** + * Points to probe for all 3-point Leveling procedures. + * Override if the automatically selected points are inadequate. + */ +#if ENABLED(AUTO_BED_LEVELING_3POINT) || ENABLED(AUTO_BED_LEVELING_UBL) + //#define PROBE_PT_1_X 15 + //#define PROBE_PT_1_Y 180 + //#define PROBE_PT_2_X 15 + //#define PROBE_PT_2_Y 20 + //#define PROBE_PT_3_X 170 + //#define PROBE_PT_3_Y 20 +#endif + +/** + * Add a bed leveling sub-menu for ABL or MBL. + * Include a guided procedure if manual probing is enabled. + */ +//#define LCD_BED_LEVELING + +#if ENABLED(LCD_BED_LEVELING) + #define MESH_EDIT_Z_STEP 0.025 // (mm) Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // (mm) Z Range centered on Z_MIN_POS for LCD Z adjustment + //#define MESH_EDIT_MENU // Add a menu to edit mesh points +#endif + +// Add a menu item to move between bed corners for manual bed adjustment +//#define LEVEL_BED_CORNERS + +#if ENABLED(LEVEL_BED_CORNERS) + #define LEVEL_CORNERS_INSET 30 // (mm) An inset for corner leveling + //#define LEVEL_CENTER_TOO // Move to the center after the last corner +#endif + +/** + * Commands to execute at the end of G29 probing. + * Useful to retract or move the Z probe out of the way. + */ +//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + + +// @section homing + +// The center of the bed is at (X=0, Y=0) +#define BED_CENTER_AT_0_0 + +// Manually set the home position. Leave these undefined for automatic settings. +// For DELTA this is the top-center of the Cartesian print volume. +//#define MANUAL_X_HOME_POS 0 +//#define MANUAL_Y_HOME_POS 0 +#define MANUAL_Z_HOME_POS DELTA_HEIGHT // Distance between the nozzle to printbed after homing + +// Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area. +// +// With this feature enabled: +// +// - Allow Z homing only after X and Y homing AND stepper drivers still enabled. +// - If stepper drivers time out, it will need X and Y homing again before Z homing. +// - Move the Z probe (or nozzle) to a defined XY point before Z Homing when homing all axes (G28). +// - Prevent Z homing when the Z probe is outside bed area. +// +//#define Z_SAFE_HOMING + +#if ENABLED(Z_SAFE_HOMING) + #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 2) // X point for Z homing when homing all axes (G28). + #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 2) // Y point for Z homing when homing all axes (G28). +#endif + +// Delta only homes to Z +#define HOMING_FEEDRATE_Z (200*60) + +// Validate that endstops are triggered on homing moves +#define VALIDATE_HOMING_ENDSTOPS + +// @section calibrate + +/** + * Bed Skew Compensation + * + * This feature corrects for misalignment in the XYZ axes. + * + * Take the following steps to get the bed skew in the XY plane: + * 1. Print a test square (e.g., https://www.thingiverse.com/thing:2563185) + * 2. For XY_DIAG_AC measure the diagonal A to C + * 3. For XY_DIAG_BD measure the diagonal B to D + * 4. For XY_SIDE_AD measure the edge A to D + * + * Marlin automatically computes skew factors from these measurements. + * Skew factors may also be computed and set manually: + * + * - Compute AB : SQRT(2*AC*AC+2*BD*BD-4*AD*AD)/2 + * - XY_SKEW_FACTOR : TAN(PI/2-ACOS((AC*AC-AB*AB-AD*AD)/(2*AB*AD))) + * + * If desired, follow the same procedure for XZ and YZ. + * Use these diagrams for reference: + * + * Y Z Z + * ^ B-------C ^ B-------C ^ B-------C + * | / / | / / | / / + * | / / | / / | / / + * | A-------D | A-------D | A-------D + * +-------------->X +-------------->X +-------------->Y + * XY_SKEW_FACTOR XZ_SKEW_FACTOR YZ_SKEW_FACTOR + */ +//#define SKEW_CORRECTION + +#if ENABLED(SKEW_CORRECTION) + // Input all length measurements here: + #define XY_DIAG_AC 282.8427124746 + #define XY_DIAG_BD 282.8427124746 + #define XY_SIDE_AD 200 + + // Or, set the default skew factors directly here + // to override the above measurements: + #define XY_SKEW_FACTOR 0.0 + + //#define SKEW_CORRECTION_FOR_Z + #if ENABLED(SKEW_CORRECTION_FOR_Z) + #define XZ_DIAG_AC 282.8427124746 + #define XZ_DIAG_BD 282.8427124746 + #define YZ_DIAG_AC 282.8427124746 + #define YZ_DIAG_BD 282.8427124746 + #define YZ_SIDE_AD 200 + #define XZ_SKEW_FACTOR 0.0 + #define YZ_SKEW_FACTOR 0.0 + #endif + + // Enable this option for M852 to set skew at runtime + //#define SKEW_CORRECTION_GCODE +#endif + +//============================================================================= +//============================= Additional Features =========================== +//============================================================================= + +// @section extras + +// +// EEPROM +// +// The microcontroller can store settings in the EEPROM, e.g. max velocity... +// M500 - stores parameters in EEPROM +// 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 DISABLE_M503 // Saves ~2700 bytes of PROGMEM. Disable for release! +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. + +// +// Host Keepalive +// +// When enabled Marlin will send a busy status message to the host +// every couple of seconds when it can't accept commands. +// +#define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating + +// +// M100 Free Memory Watcher +// +//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage + +// +// G20/G21 Inch mode support +// +//#define INCH_MODE_SUPPORT + +// +// M149 Set temperature units support +// +//#define TEMPERATURE_UNITS_SUPPORT + +// @section temperature + +// Preheat Constants +#define PREHEAT_1_LABEL "PLA" +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 + +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 + +/** + * Nozzle Park + * + * Park the nozzle at the given XYZ position on idle or G27. + * + * The "P" parameter controls the action applied to the Z axis: + * + * P0 (Default) If Z is below park Z raise the nozzle. + * P1 Raise the nozzle always to Z-park height. + * P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS. + */ +//#define NOZZLE_PARK_FEATURE + +#if ENABLED(NOZZLE_PARK_FEATURE) + // Specify a park position as { X, Y, Z } + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_XY_FEEDRATE 100 // X and Y axes feedrate in mm/s (also used for delta printers Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // Z axis feedrate in mm/s (not used for delta printers) +#endif + +/** + * Clean Nozzle Feature -- EXPERIMENTAL + * + * Adds the G12 command to perform a nozzle cleaning process. + * + * Parameters: + * P Pattern + * S Strokes / Repetitions + * T Triangles (P1 only) + * + * Patterns: + * P0 Straight line (default). This process requires a sponge type material + * at a fixed bed location. "S" specifies strokes (i.e. back-forth motions) + * between the start / end points. + * + * P1 Zig-zag pattern between (X0, Y0) and (X1, Y1), "T" specifies the + * number of zig-zag triangles to do. "S" defines the number of strokes. + * Zig-zags are done in whichever is the narrower dimension. + * For example, "G12 P1 S1 T3" will execute: + * + * -- + * | (X0, Y1) | /\ /\ /\ | (X1, Y1) + * | | / \ / \ / \ | + * A | | / \ / \ / \ | + * | | / \ / \ / \ | + * | (X0, Y0) | / \/ \/ \ | (X1, Y0) + * -- +--------------------------------+ + * |________|_________|_________| + * T1 T2 T3 + * + * P2 Circular pattern with middle at NOZZLE_CLEAN_CIRCLE_MIDDLE. + * "R" specifies the radius. "S" specifies the stroke count. + * Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT. + * + * Caveats: The ending Z should be the same as starting Z. + * Attention: EXPERIMENTAL. G-code arguments may change. + * + */ +//#define NOZZLE_CLEAN_FEATURE + +#if ENABLED(NOZZLE_CLEAN_FEATURE) + // Default number of pattern repetitions + #define NOZZLE_CLEAN_STROKES 12 + + // Default number of triangles + #define NOZZLE_CLEAN_TRIANGLES 3 + + // Specify positions as { X, Y, Z } + #define NOZZLE_CLEAN_START_POINT { 30, 30, (Z_MIN_POS + 1)} + #define NOZZLE_CLEAN_END_POINT {100, 60, (Z_MIN_POS + 1)} + + // Circular pattern radius + #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 + // Circular pattern circle fragments number + #define NOZZLE_CLEAN_CIRCLE_FN 10 + // Middle point of circle + #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT + + // Moves the nozzle to the initial position + #define NOZZLE_CLEAN_GOBACK +#endif + +/** + * Print Job Timer + * + * Automatically start and stop the print job timer on M104/M109/M190. + * + * M104 (hotend, no wait) - high temp = none, low temp = stop timer + * M109 (hotend, wait) - high temp = start timer, low temp = stop timer + * M190 (bed, wait) - high temp = start timer, low temp = none + * + * The timer can also be controlled with the following commands: + * + * M75 - Start the print job timer + * M76 - Pause the print job timer + * M77 - Stop the print job timer + */ +#define PRINTJOB_TIMER_AUTOSTART + +/** + * Print Counter + * + * Track statistical data such as: + * + * - Total print jobs + * - Total successful print jobs + * - Total failed print jobs + * - Total time printing + * + * View the current statistics with M78. + */ +//#define PRINTCOUNTER + +//============================================================================= +//============================= LCD and SD support ============================ +//============================================================================= + +// @section lcd + +/** + * LCD LANGUAGE + * + * Select the language to display on the LCD. These languages are available: + * + * en, an, bg, ca, cz, da, de, el, el-gr, es, eu, fi, fr, gl, hr, it, + * jp-kana, ko_KR, nl, pl, pt, pt-br, ru, sk, tr, uk, zh_CN, zh_TW, test + * + * :{ 'en':'English', 'an':'Aragonese', 'bg':'Bulgarian', 'ca':'Catalan', 'cz':'Czech', 'da':'Danish', 'de':'German', 'el':'Greek', 'el-gr':'Greek (Greece)', 'es':'Spanish', 'eu':'Basque-Euskera', 'fi':'Finnish', 'fr':'French', 'gl':'Galician', 'hr':'Croatian', 'it':'Italian', 'jp-kana':'Japanese', 'ko_KR':'Korean (South Korea)', 'nl':'Dutch', 'pl':'Polish', 'pt':'Portuguese', 'pt-br':'Portuguese (Brazilian)', 'ru':'Russian', 'sk':'Slovak', 'tr':'Turkish', 'uk':'Ukrainian', 'zh_CN':'Chinese (Simplified)', 'zh_TW':'Chinese (Traditional)', 'test':'TEST' } + */ +#define LCD_LANGUAGE en + +/** + * LCD Character Set + * + * Note: This option is NOT applicable to Graphical Displays. + * + * All character-based LCDs provide ASCII plus one of these + * language extensions: + * + * - JAPANESE ... the most common + * - WESTERN ... with more accented characters + * - CYRILLIC ... for the Russian language + * + * To determine the language extension installed on your controller: + * + * - Compile and upload with LCD_LANGUAGE set to 'test' + * - Click the controller to view the LCD menu + * - The LCD will display Japanese, Western, or Cyrillic text + * + * See http://marlinfw.org/docs/development/lcd_language.html + * + * :['JAPANESE', 'WESTERN', 'CYRILLIC'] + */ +#define DISPLAY_CHARSET_HD44780 JAPANESE + +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + +/** + * SD CARD + * + * SD Card support is disabled by default. If your controller has an SD slot, + * you must uncomment the following option or it won't work. + * + */ +#define SDSUPPORT + +/** + * SD CARD: SPI SPEED + * + * Enable one of the following items for a slower SPI transfer speed. + * This may be required to resolve "volume init" errors. + */ +//#define SPI_SPEED SPI_HALF_SPEED +//#define SPI_SPEED SPI_QUARTER_SPEED +//#define SPI_SPEED SPI_EIGHTH_SPEED + +/** + * SD CARD: ENABLE CRC + * + * Use CRC checks and retries on the SD communication. + */ +//#define SD_CHECK_AND_RETRY + +/** + * LCD Menu Items + * + * Disable all menus and only display the Status Screen, or + * just remove some extraneous menu items to recover space. + */ +//#define NO_LCD_MENUS +//#define SLIM_LCD_MENUS + +// +// ENCODER SETTINGS +// +// This option overrides the default number of encoder pulses needed to +// produce one step. Should be increased for high-resolution encoders. +// +//#define ENCODER_PULSES_PER_STEP 4 + +// +// Use this option to override the number of step signals required to +// move between next/prev menu items. +// +//#define ENCODER_STEPS_PER_MENU_ITEM 1 + +/** + * Encoder Direction Options + * + * Test your encoder's behavior first with both options disabled. + * + * Reversed Value Edit and Menu Nav? Enable REVERSE_ENCODER_DIRECTION. + * Reversed Menu Navigation only? Enable REVERSE_MENU_DIRECTION. + * Reversed Value Editing only? Enable BOTH options. + */ + +// +// This option reverses the encoder direction everywhere. +// +// Set this option if CLOCKWISE causes values to DECREASE +// +//#define REVERSE_ENCODER_DIRECTION + +// +// This option reverses the encoder direction for navigating LCD menus. +// +// If CLOCKWISE normally moves DOWN this makes it go UP. +// If CLOCKWISE normally moves UP this makes it go DOWN. +// +//#define REVERSE_MENU_DIRECTION + +// +// Individual Axis Homing +// +// Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. +// +//#define INDIVIDUAL_AXIS_HOMING_MENU + +// +// SPEAKER/BUZZER +// +// If you have a speaker that can produce tones, enable it here. +// By default Marlin assumes you have a buzzer with a fixed frequency. +// +//#define SPEAKER + +// +// The duration and frequency for the UI feedback sound. +// Set these to 0 to disable audio feedback in the LCD menus. +// +// Note: Test audio output with the G-Code: +// M300 S P +// +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//======================== (Character-based LCDs) ========================= +//============================================================================= + +// +// RepRapDiscount Smart Controller. +// http://reprap.org/wiki/RepRapDiscount_Smart_Controller +// +// Note: Usually sold with a white PCB. +// +//#define REPRAP_DISCOUNT_SMART_CONTROLLER + +// +// Original RADDS LCD Display+Encoder+SDCardReader +// http://doku.radds.org/dokumentation/lcd-display/ +// +//#define RADDS_DISPLAY + +// +// ULTIMAKER Controller. +// +//#define ULTIMAKERCONTROLLER + +// +// ULTIPANEL as seen on Thingiverse. +// +//#define ULTIPANEL + +// +// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3) +// http://reprap.org/wiki/PanelOne +// +//#define PANEL_ONE + +// +// GADGETS3D G3D LCD/SD Controller +// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel +// +// Note: Usually sold with a blue PCB. +// +//#define G3D_PANEL + +// +// RigidBot Panel V1.0 +// http://www.inventapart.com/ +// +//#define RIGIDBOT_PANEL + +// +// Makeboard 3D Printer Parts 3D Printer Mini Display 1602 Mini Controller +// https://www.aliexpress.com/item/Micromake-Makeboard-3D-Printer-Parts-3D-Printer-Mini-Display-1602-Mini-Controller-Compatible-with-Ramps-1/32765887917.html +// +//#define MAKEBOARD_MINI_2_LINE_DISPLAY_1602 + +// +// ANET and Tronxy 20x4 Controller +// +//#define ZONESTAR_LCD // Requires ADC_KEYPAD_PIN to be assigned to an analog pin. + // This LCD is known to be susceptible to electrical interference + // which scrambles the display. Pressing any button clears it up. + // This is a LCD2004 display with 5 analog buttons. + +// +// Generic 16x2, 16x4, 20x2, or 20x4 character-based LCD. +// +//#define ULTRA_LCD + +//============================================================================= +//======================== LCD / Controller Selection ========================= +//===================== (I2C and Shift-Register LCDs) ===================== +//============================================================================= + +// +// CONTROLLER TYPE: I2C +// +// Note: These controllers require the installation of Arduino's LiquidCrystal_I2C +// library. For more info: https://github.com/kiyoshigawa/LiquidCrystal_I2C +// + +// +// Elefu RA Board Control Panel +// http://www.elefu.com/index.php?route=product/product&product_id=53 +// +//#define RA_CONTROL_PANEL + +// +// Sainsmart (YwRobot) LCD Displays +// +// These require F.Malpartida's LiquidCrystal_I2C library +// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home +// +//#define LCD_SAINSMART_I2C_1602 +//#define LCD_SAINSMART_I2C_2004 + +// +// Generic LCM1602 LCD adapter +// +//#define LCM1602 + +// +// PANELOLU2 LCD with status LEDs, +// separate encoder and click inputs. +// +// Note: This controller requires Arduino's LiquidTWI2 library v1.2.3 or later. +// For more info: https://github.com/lincomatic/LiquidTWI2 +// +// Note: The PANELOLU2 encoder click input can either be directly connected to +// a pin (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1). +// +//#define LCD_I2C_PANELOLU2 + +// +// Panucatt VIKI LCD with status LEDs, +// integrated click & L/R/U/D buttons, separate encoder inputs. +// +//#define LCD_I2C_VIKI + +// +// CONTROLLER TYPE: Shift register panels +// + +// +// 2 wire Non-latching LCD SR from https://goo.gl/aJJ4sH +// LCD configuration: http://reprap.org/wiki/SAV_3D_LCD +// +//#define SAV_3DLCD + +//============================================================================= +//======================= LCD / Controller Selection ======================= +//========================= (Graphical LCDs) ======================== +//============================================================================= + +// +// CONTROLLER TYPE: Graphical 128x64 (DOGM) +// +// IMPORTANT: The U8glib library is required for Graphical Display! +// https://github.com/olikraus/U8glib_Arduino +// + +// +// RepRapDiscount FULL GRAPHIC Smart Controller +// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller +// +//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER + +// +// ReprapWorld Graphical LCD +// https://reprapworld.com/?products_details&products_id/1218 +// +//#define REPRAPWORLD_GRAPHICAL_LCD + +// +// Activate one of these if you have a Panucatt Devices +// Viki 2.0 or mini Viki with Graphic LCD +// http://panucatt.com +// +//#define VIKI2 +//#define miniVIKI + +// +// MakerLab Mini Panel with graphic +// controller and SD support - http://reprap.org/wiki/Mini_panel +// +//#define MINIPANEL + +// +// MaKr3d Makr-Panel with graphic controller and SD support. +// http://reprap.org/wiki/MaKr3d_MaKrPanel +// +//#define MAKRPANEL + +// +// Adafruit ST7565 Full Graphic Controller. +// https://github.com/eboston/Adafruit-ST7565-Full-Graphic-Controller/ +// +//#define ELB_FULL_GRAPHIC_CONTROLLER + +// +// BQ LCD Smart Controller shipped by +// default with the BQ Hephestos 2 and Witbox 2. +// +//#define BQ_LCD_SMART_CONTROLLER + +// +// Cartesio UI +// http://mauk.cc/webshop/cartesio-shop/electronics/user-interface +// +//#define CARTESIO_UI + +// +// LCD for Melzi Card with Graphical LCD +// +//#define LCD_FOR_MELZI + +// +// SSD1306 OLED full graphics generic display +// +//#define U8GLIB_SSD1306 + +// +// SAV OLEd LCD module support using either SSD1306 or SH1106 based LCD modules +// +//#define SAV_3DGLCD +#if ENABLED(SAV_3DGLCD) + //#define U8GLIB_SSD1306 + #define U8GLIB_SH1106 +#endif + +// +// Original Ulticontroller from Ultimaker 2 printer with SSD1309 I2C display and encoder +// https://github.com/Ultimaker/Ultimaker2/tree/master/1249_Ulticontroller_Board_(x1) +// +//#define ULTI_CONTROLLER + +// +// TinyBoy2 128x64 OLED / Encoder Panel +// +//#define OLED_PANEL_TINYBOY2 + +// +// MKS MINI12864 with graphic controller and SD support +// http://reprap.org/wiki/MKS_MINI_12864 +// +//#define MKS_MINI_12864 + +// +// Factory display for Creality CR-10 +// https://www.aliexpress.com/item/Universal-LCD-12864-3D-Printer-Display-Screen-With-Encoder-For-CR-10-CR-7-Model/32833148327.html +// +// 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 + +// +// ANET and Tronxy Graphical Controller +// +// Anet 128x64 full graphics lcd with rotary encoder as used on Anet A6 +// A clone of the RepRapDiscount full graphics display but with +// different pins/wiring (see pins_ANET_10.h). +// +//#define ANET_FULL_GRAPHICS_LCD + +// +// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER +// http://reprap.org/wiki/MKS_12864OLED +// +// Tiny, but very sharp OLED display +// +//#define MKS_12864OLED // Uses the SH1106 controller (default) +//#define MKS_12864OLED_SSD1306 // Uses the SSD1306 controller + +// +// AZSMZ 12864 LCD with SD +// https://www.aliexpress.com/store/product/3D-printer-smart-controller-SMART-RAMPS-OR-RAMPS-1-4-LCD-12864-LCD-control-panel-green/2179173_32213636460.html +// +//#define AZSMZ_12864 + +// +// Silvergate GLCD controller +// http://github.com/android444/Silvergate +// +//#define SILVER_GATE_GLCD_CONTROLLER + +// +// Extensible UI +// +// Enable third-party or vendor customized user interfaces that aren't +// packaged with Marlin. Source code for the user interface will need to +// be placed in "src/lcd/extensible_ui/lib" +// +//#define EXTENSIBLE_UI + +//============================================================================= +//============================ Other Controllers ============================ +//============================================================================= + +// +// CONTROLLER TYPE: Standalone / Serial +// + +// +// LCD for Malyan M200 printers. +// +//#define MALYAN_LCD + +// +// CONTROLLER TYPE: Keypad / Add-on +// + +// +// RepRapWorld REPRAPWORLD_KEYPAD v1.1 +// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626 +// +// REPRAPWORLD_KEYPAD_MOVE_STEP sets how much should the robot move when a key +// is pressed, a value of 10.0 means 10mm per click. +// +//#define REPRAPWORLD_KEYPAD +//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 + +//============================================================================= +//=============================== Extra Features ============================== +//============================================================================= + +// @section extras + +// Increase the FAN PWM frequency. Removes the PWM noise but increases heating in the FET/Arduino +//#define FAST_PWM_FAN + +// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency +// which is not as annoying as with the hardware PWM. On the other hand, if this frequency +// is too low, you should also increment SOFT_PWM_SCALE. +//#define FAN_SOFT_PWM + +// Incrementing this by 1 will double the software PWM frequency, +// affecting heaters, and the fan if FAN_SOFT_PWM is enabled. +// However, control resolution will be halved for each increment; +// at zero value, there are 128 effective control positions. +#define SOFT_PWM_SCALE 0 + +// If SOFT_PWM_SCALE is set to a value higher than 0, dithering can +// be used to mitigate the associated resolution loss. If enabled, +// some of the PWM cycles are stretched so on average the desired +// duty cycle is attained. +//#define SOFT_PWM_DITHER + +// Temperature status LEDs that display the hotend and bed temperature. +// If all hotends, bed temperature, and target temperature are under 54C +// then the BLUE led is on. Otherwise the RED led is on. (1C hysteresis) +//#define TEMP_STAT_LEDS + +// M240 Triggers a camera by emulating a Canon RC-1 Remote +// Data from: http://www.doc-diy.net/photo/rc-1_hacked/ +//#define PHOTOGRAPH_PIN 23 + +// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure +//#define SF_ARC_FIX + +// Support for the BariCUDA Paste Extruder +//#define BARICUDA + +// Support for BlinkM/CyzRgb +//#define BLINKM + +// Support for PCA9632 PWM LED driver +//#define PCA9632 + +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * For Neopixel LED an overall brightness parameter is also available. + * + * *** CAUTION *** + * LED Strips require a MOSFET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * NOTE: A separate 5V power supply is required! The Neopixel LED needs + * more current than the Arduino 5V linear regulator can produce. + * *** CAUTION *** + * + * LED Type. Enable only one of the following two options. + * + */ +//#define RGB_LED +//#define RGBW_LED + +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define RGB_LED_R_PIN 34 + #define RGB_LED_G_PIN 43 + #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +// Support for Adafruit Neopixel LED driver +//#define NEOPIXEL_LED +#if ENABLED(NEOPIXEL_LED) + #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h) + #define NEOPIXEL_PIN 4 // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba) + #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip + #define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once. + #define NEOPIXEL_BRIGHTNESS 127 // Initial brightness (0-255) + //#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED) + #define PRINTER_EVENT_LEDS +#endif + +/** + * R/C SERVO support + * Sponsored by TrinityLabs, Reworked by codexmas + */ + +/** + * Number of servos + * + * For some servo-related options NUM_SERVOS will be set automatically. + * Set this manually if there are extra servos needing manual control. + * Leave undefined or set to 0 to entirely disable the servo subsystem. + */ +//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command + +// Delay (in milliseconds) before the next move will start, to give the servo time to reach its target angle. +// 300ms is a good value but you can try less delay. +// If the servo can't reach the requested position, increase it. +#define SERVO_DELAY { 300 } + +// Only power servos during movement, otherwise leave off to prevent jitter +//#define DEACTIVATE_SERVOS_AFTER_MOVE + +// Allow servo angle to be edited and saved to EEPROM +//#define EDITABLE_SERVO_ANGLES diff --git a/Marlin/src/config/examples/delta/MKS/SBASE/Configuration_adv.h b/Marlin/src/config/examples/delta/MKS/SBASE/Configuration_adv.h new file mode 100644 index 0000000000..2279bb433c --- /dev/null +++ b/Marlin/src/config/examples/delta/MKS/SBASE/Configuration_adv.h @@ -0,0 +1,1905 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Configuration_adv.h + * + * Advanced settings. + * Only change these if you know exactly what you're doing. + * Some of these settings can damage your printer if improperly set! + * + * Basic settings can be found in Configuration.h + * + */ +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +// +// Hephestos 2 24V heated bed upgrade kit. +// https://store.bq.com/en/heated-bed-kit-hephestos2 +// +//#define HEPHESTOS2_HEATED_BED_KIT +#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) + #undef TEMP_SENSOR_BED + #define TEMP_SENSOR_BED 70 + #define HEATER_BED_INVERTING true +#endif + +#if DISABLED(PIDTEMPBED) + #define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control + #if ENABLED(BED_LIMIT_SWITCHING) + #define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS + #endif +#endif + +/** + * Thermal Protection provides additional protection to your printer from damage + * and fire. Marlin always includes safe min and max temperature ranges which + * protect against a broken or disconnected thermistor wire. + * + * The issue: If a thermistor falls out, it will report the much lower + * temperature of the air in the room, and the the firmware will keep + * the heater on. + * + * The solution: Once the temperature reaches the target, start observing. + * If the temperature stays too far below the target (hysteresis) for too + * long (period), the firmware will halt the machine as a safety precaution. + * + * If you get false positives for "Thermal Runaway", increase + * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD + */ +#if ENABLED(THERMAL_PROTECTION_HOTENDS) + #define THERMAL_PROTECTION_PERIOD 50 // Seconds + #define THERMAL_PROTECTION_HYSTERESIS 6 // Degrees Celsius + + /** + * Whenever an M104, M109, or M303 increases the target temperature, the + * firmware will wait for the WATCH_TEMP_PERIOD to expire. If the temperature + * hasn't increased by WATCH_TEMP_INCREASE degrees, the machine is halted and + * requires a hard reset. This test restarts with any M104/M109/M303, but only + * if the current temperature is far enough below the target for a reliable + * test. + * + * If you get false positives for "Heating failed", increase WATCH_TEMP_PERIOD + * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set + * below 2. + */ + #define WATCH_TEMP_PERIOD 40 // Seconds + #define WATCH_TEMP_INCREASE 2 // Degrees Celsius +#endif + +/** + * Thermal Protection parameters for the bed are just as above for hotends. + */ +#if ENABLED(THERMAL_PROTECTION_BED) + #define THERMAL_PROTECTION_BED_PERIOD 110 // Seconds + #define THERMAL_PROTECTION_BED_HYSTERESIS 4 // Degrees Celsius + + /** + * As described above, except for the bed (M140/M190/M303). + */ + #define WATCH_BED_TEMP_PERIOD 100 // Seconds + #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius +#endif + +#if ENABLED(PIDTEMP) + // this adds an experimental additional term to the heating power, proportional to the extrusion speed. + // if Kc is chosen well, the additional required power due to increased melting should be compensated. + //#define PID_EXTRUSION_SCALING + #if ENABLED(PID_EXTRUSION_SCALING) + #define DEFAULT_Kc (100) //heating power=Kc*(e_speed) + #define LPQ_MAX_LEN 50 + #endif +#endif + +/** + * Automatic Temperature: + * The hotend target temperature is calculated by all the buffered lines of gcode. + * The maximum buffered steps/sec of the extruder motor is called "se". + * Start autotemp mode with M109 S B F + * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by + * mintemp and maxtemp. Turn this off by executing M109 without F* + * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp. + * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode + */ +#define AUTOTEMP +#if ENABLED(AUTOTEMP) + #define AUTOTEMP_OLDWEIGHT 0.98 +#endif + +// Show extra position information in M114 +//#define M114_DETAIL + +// Show Temperature ADC value +// Enable for M105 to include ADC values read from temperature sensors. +//#define SHOW_TEMP_ADC_VALUES + +/** + * High Temperature Thermistor Support + * + * Thermistors able to support high temperature tend to have a hard time getting + * good readings at room and lower temperatures. This means HEATER_X_RAW_LO_TEMP + * will probably be caught when the heating element first turns on during the + * preheating process, which will trigger a min_temp_error as a safety measure + * and force stop everything. + * To circumvent this limitation, we allow for a preheat time (during which, + * min_temp_error won't be triggered) and add a min_temp buffer to handle + * aberrant readings. + * + * If you want to enable this feature for your hotend thermistor(s) + * uncomment and set values > 0 in the constants below + */ + +// The number of consecutive low temperature errors that can occur +// before a min_temp_error is triggered. (Shouldn't be more than 10.) +//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0 + +// The number of milliseconds a hotend will preheat before starting to check +// the temperature. This value should NOT be set to the time it takes the +// hot end to reach the target temperature, but the time it takes to reach +// the minimum temperature your thermistor can read. The lower the better/safer. +// This shouldn't need to be more than 30 seconds (30000) +//#define MILLISECONDS_PREHEAT_TIME 0 + +// @section extruder + +// Extruder runout prevention. +// If the machine is idle and the temperature over MINTEMP +// then extrude some filament every couple of SECONDS. +//#define EXTRUDER_RUNOUT_PREVENT +#if ENABLED(EXTRUDER_RUNOUT_PREVENT) + #define EXTRUDER_RUNOUT_MINTEMP 190 + #define EXTRUDER_RUNOUT_SECONDS 30 + #define EXTRUDER_RUNOUT_SPEED 1500 // (mm/m) + #define EXTRUDER_RUNOUT_EXTRUDE 5 // (mm) +#endif + +// @section temperature + +// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. +// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET. +#define TEMP_SENSOR_AD595_OFFSET 0.0 +#define TEMP_SENSOR_AD595_GAIN 1.0 +#define TEMP_SENSOR_AD8495_OFFSET 0.0 +#define TEMP_SENSOR_AD8495_GAIN 1.0 + +/** + * Controller Fan + * To cool down the stepper drivers and MOSFETs. + * + * The fan will turn on automatically whenever any stepper is enabled + * and turn off after a set period after all steppers are turned off. + */ +//#define USE_CONTROLLER_FAN +#if ENABLED(USE_CONTROLLER_FAN) + //#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan + #define CONTROLLERFAN_SECS 60 // Duration in seconds for the fan to run after all motors are disabled + #define CONTROLLERFAN_SPEED 255 // 255 == full speed +#endif + +// When first starting the main fan, run it at full speed for the +// given number of milliseconds. This gets the fan spinning reliably +// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu) +//#define FAN_KICKSTART_TIME 100 + +/** + * PWM Fan Scaling + * + * Define the min/max speeds for PWM fans (as set with M106). + * + * With these options the M106 0-255 value range is scaled to a subset + * to ensure that the fan has enough power to spin, or to run lower + * current fans with higher current. (e.g., 5V/12V fans with 12V/24V) + * Value 0 always turns off the fan. + * + * Define one or both of these to override the default 0-255 range. + */ +//#define FAN_MIN_PWM 50 +//#define FAN_MAX_PWM 128 + +// @section extruder + +/** + * Extruder cooling fans + * + * Extruder auto fans automatically turn on when their extruders' + * temperatures go above EXTRUDER_AUTO_FAN_TEMPERATURE. + * + * Your board's pins file specifies the recommended pins. Override those here + * or set to -1 to disable completely. + * + * Multiple extruders can be assigned to the same pin in which case + * the fan will turn on when any selected extruder is above the threshold. + */ +#define E0_AUTO_FAN_PIN -1 +#define E1_AUTO_FAN_PIN -1 +#define E2_AUTO_FAN_PIN -1 +#define E3_AUTO_FAN_PIN -1 +#define E4_AUTO_FAN_PIN -1 +#define E5_AUTO_FAN_PIN -1 +#define CHAMBER_AUTO_FAN_PIN -1 +#define EXTRUDER_AUTO_FAN_TEMPERATURE 50 +#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed + +/** + * Part-Cooling Fan Multiplexer + * + * This feature allows you to digitally multiplex the fan output. + * The multiplexer is automatically switched at tool-change. + * Set FANMUX[012]_PINs below for up to 2, 4, or 8 multiplexed fans. + */ +#define FANMUX0_PIN -1 +#define FANMUX1_PIN -1 +#define FANMUX2_PIN -1 + +/** + * M355 Case Light on-off / brightness + */ +//#define CASE_LIGHT_ENABLE +#if ENABLED(CASE_LIGHT_ENABLE) + //#define CASE_LIGHT_PIN 4 // Override the default pin if needed + #define INVERT_CASE_LIGHT false // Set true if Case Light is ON when pin is LOW + #define CASE_LIGHT_DEFAULT_ON true // Set default power-up state on + #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) + //#define MENU_ITEM_CASE_LIGHT // Add a Case Light option to the LCD main menu + //#define CASE_LIGHT_USE_NEOPIXEL // Use Neopixel LED as case light, requires NEOPIXEL_LED. + #if ENABLED(CASE_LIGHT_USE_NEOPIXEL) + #define CASE_LIGHT_NEOPIXEL_COLOR { 255, 255, 255, 255 } // { Red, Green, Blue, White } + #endif +#endif + +//=========================================================================== +//============================ Mechanical Settings ========================== +//=========================================================================== + +// @section homing + +// If you want endstops to stay on (by default) even when not homing +// enable this option. Override at any time with M120, M121. +//#define ENDSTOPS_ALWAYS_ON_DEFAULT + +// @section extras + +//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats. + +// Employ an external closed loop controller. Override pins here if needed. +//#define EXTERNAL_CLOSED_LOOP_CONTROLLER +#if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) + //#define CLOSED_LOOP_ENABLE_PIN -1 + //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 +#endif + +/** + * Dual Steppers / Dual Endstops + * + * This section will allow you to use extra E drivers to drive a second motor for X, Y, or Z axes. + * + * For example, set X_DUAL_STEPPER_DRIVERS setting to use a second motor. If the motors need to + * spin in opposite directions set INVERT_X2_VS_X_DIR. If the second motor needs its own endstop + * set X_DUAL_ENDSTOPS. This can adjust for "racking." Use X2_USE_ENDSTOP to set the endstop plug + * that should be used for the second endstop. Extra endstops will appear in the output of 'M119'. + * + * Use X_DUAL_ENDSTOP_ADJUSTMENT to adjust for mechanical imperfection. After homing both motors + * this offset is applied to the X2 motor. To find the offset home the X axis, and measure the error + * in X2. Dual endstop offsets can be set at runtime with 'M666 X Y Z'. + */ + +//#define X_DUAL_STEPPER_DRIVERS +#if ENABLED(X_DUAL_STEPPER_DRIVERS) + #define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions + //#define X_DUAL_ENDSTOPS + #if ENABLED(X_DUAL_ENDSTOPS) + #define X2_USE_ENDSTOP _XMAX_ + #define X_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Y_DUAL_STEPPER_DRIVERS +#if ENABLED(Y_DUAL_STEPPER_DRIVERS) + #define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions + //#define Y_DUAL_ENDSTOPS + #if ENABLED(Y_DUAL_ENDSTOPS) + #define Y2_USE_ENDSTOP _YMAX_ + #define Y_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_DUAL_STEPPER_DRIVERS +#if ENABLED(Z_DUAL_STEPPER_DRIVERS) + //#define Z_DUAL_ENDSTOPS + #if ENABLED(Z_DUAL_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z_DUAL_ENDSTOPS_ADJUSTMENT 0 + #endif +#endif + +//#define Z_TRIPLE_STEPPER_DRIVERS +#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) + //#define Z_TRIPLE_ENDSTOPS + #if ENABLED(Z_TRIPLE_ENDSTOPS) + #define Z2_USE_ENDSTOP _XMAX_ + #define Z3_USE_ENDSTOP _YMAX_ + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT2 0 + #define Z_TRIPLE_ENDSTOPS_ADJUSTMENT3 0 + #endif +#endif + +/** + * Dual X Carriage + * + * This setup has two X carriages that can move independently, each with its own hotend. + * The carriages can be used to print an object with two colors or materials, or in + * "duplication mode" it can print two identical or X-mirrored objects simultaneously. + * The inactive carriage is parked automatically to prevent oozing. + * X1 is the left carriage, X2 the right. They park and home at opposite ends of the X axis. + * By default the X2 stepper is assigned to the first unused E plug on the board. + */ +//#define DUAL_X_CARRIAGE +#if ENABLED(DUAL_X_CARRIAGE) + #define X1_MIN_POS X_MIN_POS // set minimum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X1_MAX_POS X_BED_SIZE // set maximum to ensure first x-carriage doesn't hit the parked second X-carriage + #define X2_MIN_POS 80 // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage + #define X2_MAX_POS 353 // set maximum to the distance between toolheads when both heads are homed + #define X2_HOME_DIR 1 // the second X-carriage always homes to the maximum endstop position + #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position + // However: In this mode the HOTEND_OFFSET_X value for the second extruder provides a software + // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops + // without modifying the firmware (through the "M218 T1 X???" command). + // Remember: you should set the second extruder x-offset to 0 in your slicer. + + // There are a few selectable movement modes for dual x-carriages using M605 S + // Mode 0 (DXC_FULL_CONTROL_MODE): Full control. The slicer has full control over both x-carriages and can achieve optimal travel results + // as long as it supports dual x-carriages. (M605 S0) + // Mode 1 (DXC_AUTO_PARK_MODE) : Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so + // that additional slicer support is not required. (M605 S1) + // Mode 2 (DXC_DUPLICATION_MODE) : Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all + // actions of the first x-carriage. This allows the printer to print 2 arbitrary items at + // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) + + // This is the default power-up mode which can be later using M605. + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE + + // Default x offset in duplication mode (typically set to half print bed width) + #define DEFAULT_DUPLICATION_X_OFFSET 100 + +#endif // DUAL_X_CARRIAGE + +// Activate a solenoid on the active extruder with M380. Disable all with M381. +// Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. +//#define EXT_SOLENOID + +// @section homing + +// Homing hits each endstop, retracts by these distances, then does a slower bump. +#define X_HOME_BUMP_MM 5 +#define Y_HOME_BUMP_MM 5 +#define Z_HOME_BUMP_MM 5 // deltas need the same for all three axes +#define HOMING_BUMP_DIVISOR { 10, 10, 10 } // Re-Bump Speed Divisor (Divides the Homing Feedrate) +//#define QUICK_HOME // If homing includes X and Y, do a diagonal move initially + +// When G28 is called, this option will make Y home before X +//#define HOME_Y_BEFORE_X + +// Enable this if X or Y can't home without homing the other axis first. +//#define CODEPENDENT_XY_HOMING + +/** + * Z Steppers Auto-Alignment + * Add the G34 command to align multiple Z steppers using a bed probe. + */ +//#define Z_STEPPER_AUTO_ALIGN +#if ENABLED(Z_STEPPER_AUTO_ALIGN) + // Define probe X and Y positions for Z1, Z2 [, Z3] + #define Z_STEPPER_ALIGN_X { 10, 150, 290 } + #define Z_STEPPER_ALIGN_Y { 290, 10, 290 } + // Set number of iterations to align + #define Z_STEPPER_ALIGN_ITERATIONS 3 + // Enable to restore leveling setup after operation + #define RESTORE_LEVELING_AFTER_G34 + // Use the amplification factor to de-/increase correction step. + // In case the stepper (spindle) position is further out than the test point + // Use a value > 1. NOTE: This may cause instability + #define Z_STEPPER_ALIGN_AMP 1.0 + // Stop criterion. If the accuracy is better than this stop iterating early + #define Z_STEPPER_ALIGN_ACC 0.02 +#endif + +// @section machine + +#define AXIS_RELATIVE_MODES {false, false, false, false} + +// Allow duplication mode with a basic dual-nozzle extruder +//#define DUAL_NOZZLE_DUPLICATION_MODE + +// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. +#define INVERT_X_STEP_PIN false +#define INVERT_Y_STEP_PIN false +#define INVERT_Z_STEP_PIN false +#define INVERT_E_STEP_PIN false + +// Default stepper release if idle. Set to 0 to deactivate. +// Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLE_INACTIVE_? is true. +// Time can be set by M18 and M84. +#define DEFAULT_STEPPER_DEACTIVE_TIME 120 +#define DISABLE_INACTIVE_X true +#define DISABLE_INACTIVE_Y true +#define DISABLE_INACTIVE_Z true // set to false if the nozzle will fall down on your printed part when print has finished. +#define DISABLE_INACTIVE_E true + +#define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate +#define DEFAULT_MINTRAVELFEEDRATE 0.0 + +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated + +// @section lcd + +#if ENABLED(ULTIPANEL) + #define MANUAL_FEEDRATE_XYZ 50*60 + #define MANUAL_FEEDRATE { MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, MANUAL_FEEDRATE_XYZ, 60 } // Feedrates for manual moves along X, Y, Z, E from panel + #define MANUAL_E_MOVES_RELATIVE // Show LCD extruder moves as relative rather than absolute positions + #define ULTIPANEL_FEEDMULTIPLY // Comment to disable setting feedrate multiplier via encoder +#endif + +// @section extras + +// minimum time in microseconds that a movement needs to take if the buffer is emptied. +#define DEFAULT_MINSEGMENTTIME 20000 + +// If defined the movements slow down when the look ahead buffer is only half full +// (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second) +//#define SLOWDOWN + +// Frequency limit +// See nophead's blog for more info +// Not working O +//#define XY_FREQUENCY_LIMIT 15 + +// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end +// of the buffer and all stops. This should not be much greater than zero and should only be changed +// if unwanted behavior is observed on a user's machine when running at very slow speeds. +#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) + +// +// Use Junction Deviation instead of traditional Jerk Limiting +// +//#define JUNCTION_DEVIATION +#if ENABLED(JUNCTION_DEVIATION) + #define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge +#endif + +/** + * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies + * below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible + * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the + * lowest stepping frequencies. + */ +//#define ADAPTIVE_STEP_SMOOTHING + +/** + * Custom Microstepping + * Override as-needed for your setup. Up to 3 MS pins are supported. + */ +//#define MICROSTEP1 LOW,LOW,LOW +//#define MICROSTEP2 HIGH,LOW,LOW +//#define MICROSTEP4 LOW,HIGH,LOW +//#define MICROSTEP8 HIGH,HIGH,LOW +//#define MICROSTEP16 LOW,LOW,HIGH +//#define MICROSTEP32 HIGH,LOW,HIGH + +// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU. +#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16] + +/** + * @section stepper motor current + * + * Some boards have a means of setting the stepper motor current via firmware. + * + * The power on motor currents are set by: + * PWM_MOTOR_CURRENT - used by MINIRAMBO & ULTIMAIN_2 + * known compatible chips: A4982 + * DIGIPOT_MOTOR_CURRENT - used by BQ_ZUM_MEGA_3D, RAMBO & SCOOVO_X9H + * known compatible chips: AD5206 + * DAC_MOTOR_CURRENT_DEFAULT - used by PRINTRBOARD_REVF & RIGIDBOARD_V2 + * known compatible chips: MCP4728 + * DIGIPOT_I2C_MOTOR_CURRENTS - used by 5DPRINT, AZTEEG_X3_PRO, AZTEEG_X5_MINI_WIFI, MIGHTYBOARD_REVE + * known compatible chips: MCP4451, MCP4018 + * + * Motor currents can also be set by M907 - M910 and by the LCD. + * M907 - applies to all. + * M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H + * M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2 + */ +//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps +//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A) +//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis + +// Use an I2C based DIGIPOT (e.g., Azteeg X3 Pro) +//#define DIGIPOT_I2C +#if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A) + /** + * Common slave addresses: + * + * A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * AZTEEG_X5_MINI_WIFI 0x58 0x5C MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif + +//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster +#define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5 +// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. +// These correspond to the physical drivers, so be mindful if the order is changed. +#define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO + +//=========================================================================== +//=============================Additional Features=========================== +//=========================================================================== + +// @section lcd + +// Change values more rapidly when the encoder is rotated faster +#define ENCODER_RATE_MULTIPLIER +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed +#endif + +// Include a page of printer information in the LCD Main Menu +//#define LCD_INFO_MENU + +// Scroll a longer status message into view +//#define STATUS_MESSAGE_SCROLLING + +// On the Info Screen, display XY with one decimal place when possible +//#define LCD_DECIMAL_SMALL_XY + +// The timeout (in ms) to return to the status screen from sub-menus +//#define LCD_TIMEOUT_TO_STATUS 15000 + +// Add an 'M73' G-code to set the current percentage +//#define LCD_SET_PROGRESS_MANUALLY + +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS + //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing + #if ENABLED(LCD_PROGRESS_BAR) + #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar + #define PROGRESS_BAR_MSG_TIME 3000 // (ms) Amount of time to show the status message + #define PROGRESS_MSG_EXPIRE 0 // (ms) Amount of time to retain the status message (0=forever) + //#define PROGRESS_MSG_ONCE // Show the message for MSG_TIME then clear it + //#define LCD_PROGRESS_BAR_TEST // Add a menu item to test the progress bar + #endif +#endif // HAS_PRINT_PROGRESS + +/** + * LED Control Menu + * Enable this feature to add LED Control to the LCD menu + */ +//#define LED_CONTROL_MENU +#if ENABLED(LED_CONTROL_MENU) + #define LED_COLOR_PRESETS // Enable the Preset Color menu option + #if ENABLED(LED_COLOR_PRESETS) + #define LED_USER_PRESET_RED 255 // User defined RED value + #define LED_USER_PRESET_GREEN 128 // User defined GREEN value + #define LED_USER_PRESET_BLUE 0 // User defined BLUE value + #define LED_USER_PRESET_WHITE 255 // User defined WHITE value + #define LED_USER_PRESET_BRIGHTNESS 255 // User defined intensity + //#define LED_USER_PRESET_STARTUP // Have the printer display the user preset color on startup + #endif +#endif // LED_CONTROL_MENU + +#if ENABLED(SDSUPPORT) + + // Some RAMPS and other boards don't detect when an SD card is inserted. You can work + // around this by connecting a push button or single throw switch to the pin defined + // as SD_DETECT_PIN in your board's pins definitions. + // This setting should be disabled unless you are using a push button, pulling the pin to ground. + // Note: This is always disabled for ULTIPANEL (except ELB_FULL_GRAPHIC_CONTROLLER). + #define SD_DETECT_INVERTED + + #define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished + #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the Z enabled so your bed stays in place. + + // Reverse SD sort to show "more recent" files first, according to the card's FAT. + // Since the FAT gets out of order with usage, SDCARD_SORT_ALPHA is recommended. + #define SDCARD_RATHERRECENTFIRST + + // Add an option in the menu to run all auto#.g files + //#define MENU_ADDAUTOSTART + + /** + * Continue after Power-Loss (Creality3D) + * + * Store the current state to the SD Card at the start of each layer + * during SD printing. If the recovery file is found at boot time, present + * an option on the LCD screen to continue the print from the last-known + * point in the file. + */ + //#define POWER_LOSS_RECOVERY + #if ENABLED(POWER_LOSS_RECOVERY) + //#define POWER_LOSS_PIN 44 // Pin to detect power loss + //#define POWER_LOSS_STATE HIGH // State of pin indicating power loss + #endif + + /** + * Sort SD file listings in alphabetical order. + * + * With this option enabled, items on SD cards will be sorted + * by name for easier navigation. + * + * By default... + * + * - Use the slowest -but safest- method for sorting. + * - Folders are sorted to the top. + * - The sort key is statically allocated. + * - No added G-code (M34) support. + * - 40 item sorting limit. (Items after the first 40 are unsorted.) + * + * SD sorting uses static allocation (as set by SDSORT_LIMIT), allowing the + * compiler to calculate the worst-case usage and throw an error if the SRAM + * limit is exceeded. + * + * - SDSORT_USES_RAM provides faster sorting via a static directory buffer. + * - SDSORT_USES_STACK does the same, but uses a local stack-based buffer. + * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) + * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) + */ + //#define SDCARD_SORT_ALPHA + + // SD Card Sorting options + #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define FOLDER_SORTING -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. + // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. + #endif + + // This allows hosts to request long names for files and folders with M33 + //#define LONG_FILENAME_HOST_SUPPORT + + // Enable this option to scroll long filenames in the SD card menu + //#define SCROLL_LONG_FILENAMES + + /** + * This option allows you to abort SD printing when any endstop is triggered. + * This feature must be enabled with "M540 S1" or from the LCD menu. + * To have any effect, endstops must be enabled during SD printing. + */ + //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED + + /** + * This option makes it easier to print the same SD Card file again. + * On print completion the LCD Menu will open with the file selected. + * You can just click to start the print, or navigate elsewhere. + */ + //#define SD_REPRINT_LAST_SELECTED_FILE + + /** + * Auto-report SdCard status with M27 S + */ + //#define AUTO_REPORT_SD_STATUS + + /** + * Support for USB thumb drives using an Arduino USB Host Shield or + * equivalent MAX3421E breakout board. The USB thumb drive will appear + * to Marlin as an SD card. + * + * The MAX3421E must be assigned the same pins as the SD card reader, with + * the following pin mapping: + * + * SCLK, MOSI, MISO --> SCLK, MOSI, MISO + * INT --> SD_DETECT_PIN + * SS --> SDSS + */ + //#define USB_FLASH_DRIVE_SUPPORT + #if ENABLED(USB_FLASH_DRIVE_SUPPORT) + #define USB_CS_PIN SDSS + #define USB_INTR_PIN SD_DETECT_PIN + #endif + + /** + * When using a bootloader that supports SD-Firmware-Flashing, + * add a menu item to activate SD-FW-Update on the next reboot. + * + * Requires ATMEGA2560 (Arduino Mega) + * + * Tested with this bootloader: + * https://github.com/FleetProbe/MicroBridge-Arduino-ATMega2560 + */ + //#define SD_FIRMWARE_UPDATE + #if ENABLED(SD_FIRMWARE_UPDATE) + #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF + #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 + #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF + #endif + + // Add an optimized binary file transfer mode, initiated with 'M28 B1' + //#define FAST_FILE_TRANSFER + +#endif // SDSUPPORT + +/** + * Additional options for Graphical Displays + * + * Use the optimizations here to improve printing performance, + * which can be adversely affected by graphical display drawing, + * especially when doing several short moves, and when printing + * on DELTA and SCARA machines. + * + * Some of these options may result in the display lagging behind + * controller events, as there is a trade-off between reliable + * printing performance versus fast display updates. + */ +#if HAS_GRAPHICAL_LCD + // Show SD percentage next to the progress bar + //#define DOGM_SD_PERCENT + + // Enable to save many cycles by drawing a hollow frame on the Info Screen + #define XYZ_HOLLOW_FRAME + + // Enable to save many cycles by drawing a hollow frame on Menu Screens + #define MENU_HOLLOW_FRAME + + // A bigger font is available for edit items. Costs 3120 bytes of PROGMEM. + // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. + //#define USE_BIG_EDIT_FONT + + // A smaller font may be used on the Info Screen. Costs 2300 bytes of PROGMEM. + // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. + //#define USE_SMALL_INFOFONT + + // Enable this option and reduce the value to optimize screen updates. + // The normal delay is 10µs. Use the lowest value that still gives a reliable display. + //#define DOGM_SPI_DELAY_US 5 + + // Swap the CW/CCW indicators in the graphics overlay + //#define OVERLAY_GFX_REVERSE + + #if ENABLED(U8GLIB_ST7920) + /** + * ST7920-based LCDs can emulate a 16 x 4 character display using + * the ST7920 character-generator for very fast screen updates. + * Enable LIGHTWEIGHT_UI to use this special display mode. + * + * Since LIGHTWEIGHT_UI has limited space, the position and status + * message occupy the same line. Set STATUS_EXPIRE_SECONDS to the + * length of time to display the status message before clearing. + * + * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. + * This will prevent position updates from being displayed. + */ + //#define LIGHTWEIGHT_UI + #if ENABLED(LIGHTWEIGHT_UI) + #define STATUS_EXPIRE_SECONDS 20 + #endif + #endif + + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD + +// @section safety + +// The hardware watchdog should reset the microcontroller disabling all outputs, +// in case the firmware gets stuck and doesn't do temperature regulation. +#define USE_WATCHDOG + +#if ENABLED(USE_WATCHDOG) + // If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on. + // The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset. + // However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled. + //#define WATCHDOG_RESET_MANUAL +#endif + +// @section lcd + +/** + * Babystepping enables movement of the axes by tiny increments without changing + * the current position values. This feature is used primarily to adjust the Z + * axis in the first layer of a print in real-time. + * + * Warning: Does not respect endstops! + */ +//#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 1 // Babysteps are very small. Increase for faster motion. + + //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. + #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) + #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds. + // Note: Extra time may be added to mitigate controller latency. + #endif + + //#define MOVE_Z_WHEN_IDLE // Jump to the move Z menu on doubleclick when printer is idle. + #if ENABLED(MOVE_Z_WHEN_IDLE) + #define MOVE_Z_IDLE_MULTIPLICATOR 1 // Multiply 1mm by this factor for the move step size. + #endif + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + //#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif +#endif + +// @section extruder + +/** + * Linear Pressure Control v1.5 + * + * Assumption: advance [steps] = k * (delta velocity [steps/s]) + * K=0 means advance disabled. + * + * NOTE: K values for LIN_ADVANCE 1.5 differ from earlier versions! + * + * Set K around 0.22 for 3mm PLA Direct Drive with ~6.5cm between the drive gear and heatbreak. + * Larger K values will be needed for flexible filament and greater distances. + * If this algorithm produces a higher speed offset than the extruder can handle (compared to E jerk) + * print acceleration will be reduced during the affected moves to keep within the limit. + * + * See http://marlinfw.org/docs/features/lin_advance.html for full instructions. + * Mention @Sebastianv650 on GitHub to alert the author of any issues. + */ +//#define LIN_ADVANCE +#if ENABLED(LIN_ADVANCE) + #define LIN_ADVANCE_K 0.22 // Unit: mm compression per 1mm/s extruder speed + //#define LA_DEBUG // If enabled, this will generate debug information output over USB. +#endif + +// @section leveling + +#if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_UBL) + // Override the mesh area if the automatic (max) area is too large + //#define MESH_MIN_X MESH_INSET + //#define MESH_MIN_Y MESH_INSET + //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) + //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET) +#endif + +/** + * Repeatedly attempt G29 leveling until it succeeds. + * Stop after G29_MAX_RETRIES attempts. + */ +//#define G29_RETRY_AND_RECOVER +#if ENABLED(G29_RETRY_AND_RECOVER) + #define G29_MAX_RETRIES 3 + #define G29_HALT_ON_FAILURE + /** + * Specify the GCODE commands that will be executed when leveling succeeds, + * between attempts, and after the maximum number of retries have been tried. + */ + #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." + #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" + #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" + /** + * Specify an action command to send to the host on a recovery attempt or failure. + * Will be sent in the form '//action:ACTION_ON_G29_FAILURE', e.g. '//action:probe_failed'. + * The host must be configured to handle the action command. + */ + #define G29_ACTION_ON_RECOVER "probe_rewipe" + #define G29_ACTION_ON_FAILURE "probe_failed" +#endif + +// @section extras + +// +// G2/G3 Arc Support +// +#define ARC_SUPPORT // Disable this feature to save ~3226 bytes +#if ENABLED(ARC_SUPPORT) + #define MM_PER_ARC_SEGMENT 1 // Length of each arc segment + #define N_ARC_CORRECTION 25 // Number of intertpolated segments between corrections + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + //#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes +#endif + +// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes. +//#define BEZIER_CURVE_SUPPORT + +// G38.2 and G38.3 Probe Target +// Set MULTIPLE_PROBING if you want G38 to double touch +//#define G38_PROBE_TARGET +#if ENABLED(G38_PROBE_TARGET) + #define G38_MINIMUM_MOVE 0.0275 // minimum distance in mm that will produce a move (determined using the print statement in check_move) +#endif + +// Moves (or segments) with fewer steps than this will be joined with the next move +#define MIN_STEPS_PER_SEGMENT 6 + +/** + * Minimum delay after setting the stepper DIR (in ns) + * 0 : No delay (Expect at least 10µS since one Stepper ISR must transpire) + * 20 : Minimum for TMC2xxx drivers + * 200 : Minimum for A4988 drivers + * 400 : Minimum for A5984 drivers + * 500 : Minimum for LV8729 drivers (guess, no info in datasheet) + * 650 : Minimum for DRV8825 drivers + * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet) + * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet) + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_DIR_DELAY 650 + +/** + * Minimum stepper driver pulse width (in µs) + * 0 : Smallest possible width the MCU can produce, compatible with TMC2xxx drivers + * 1 : Minimum for A4988, A5984, and LV8729 stepper drivers + * 2 : Minimum for DRV8825 stepper drivers + * 3 : Minimum for TB6600 stepper drivers + * 30 : Minimum for TB6560 stepper drivers + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MINIMUM_STEPPER_PULSE 2 + +/** + * Maximum stepping rate (in Hz) the stepper driver allows + * If undefined, defaults to 1MHz / (2 * MINIMUM_STEPPER_PULSE) + * 500000 : Maximum for A4988 stepper driver + * 400000 : Maximum for TMC2xxx stepper drivers + * 250000 : Maximum for DRV8825 stepper driver + * 150000 : Maximum for TB6600 stepper driver + * 130000 : Maximum for LV8729 stepper driver + * 15000 : Maximum for TB6560 stepper driver + * + * Override the default value based on the driver type set in Configuration.h. + */ +//#define MAXIMUM_STEPPER_RATE 250000 + +// @section temperature + +// Control heater 0 and heater 1 in parallel. +//#define HEATERS_PARALLEL + +//=========================================================================== +//================================= Buffers ================================= +//=========================================================================== + +// @section hidden + +// The number of linear motions that can be in the plan at any give time. +// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering. +#if ENABLED(SDSUPPORT) + #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller +#else + #define BLOCK_BUFFER_SIZE 16 // maximize block buffer +#endif + +// @section serial + +// The ASCII buffer for serial input +#define MAX_CMD_SIZE 96 +#define BUFSIZE 4 + +// Transmission to Host Buffer Size +// To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. +// To buffer a simple "ok" you need 4 bytes. +// For ADVANCED_OK (M105) you need 32 bytes. +// For debug-echo: 128 bytes for the optimal speed. +// Other output doesn't need to be that speedy. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256] +#define TX_BUFFER_SIZE 0 + +// Host Receive Buffer Size +// Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough. +// To use flow control, set this buffer size to at least 1024 bytes. +// :[0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048] +//#define RX_BUFFER_SIZE 1024 + +#if RX_BUFFER_SIZE >= 1024 + // Enable to have the controller send XON/XOFF control characters to + // the host to signal the RX buffer is becoming full. + //#define SERIAL_XON_XOFF +#endif + +#if ENABLED(SDSUPPORT) + // Enable this option to collect and display the maximum + // RX queue usage after transferring a file to SD. + //#define SERIAL_STATS_MAX_RX_QUEUED + + // Enable this option to collect and display the number + // of dropped bytes after a file transfer to SD. + //#define SERIAL_STATS_DROPPED_RX +#endif + +// Enable an emergency-command parser to intercept certain commands as they +// enter the serial receive buffer, so they cannot be blocked. +// Currently handles M108, M112, M410 +// Does not work on boards using AT90USB (USBCON) processors! +//#define EMERGENCY_PARSER + +// Bad Serial-connections can miss a received command by sending an 'ok' +// Therefore some clients abort after 30 seconds in a timeout. +// Some other clients start sending commands while receiving a 'wait'. +// This "wait" is only sent when the buffer is empty. 1 second is a good value here. +//#define NO_TIMEOUTS 1000 // Milliseconds + +// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. +//#define ADVANCED_OK + +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + +// @section extras + +/** + * Extra Fan Speed + * Adds a secondary fan speed for each print-cooling fan. + * 'M106 P T3-255' : Set a secondary speed for + * 'M106 P T2' : Use the set secondary speed + * 'M106 P T1' : Restore the previous fan speed + */ +//#define EXTRA_FAN_SPEED + +/** + * Firmware-based and LCD-controlled retract + * + * Add G10 / G11 commands for automatic firmware-based retract / recover. + * Use M207 and M208 to define parameters for retract / recover. + * + * Use M209 to enable or disable auto-retract. + * With auto-retract enabled, all G1 E moves within the set range + * will be converted to firmware-based retract/recover moves. + * + * Be sure to turn off auto-retract during filament change. + * + * Note that M207 / M208 / M209 settings are saved to EEPROM. + * + */ +//#define FWRETRACT +#if ENABLED(FWRETRACT) + #define FWRETRACT_AUTORETRACT // costs ~500 bytes of PROGMEM + #if ENABLED(FWRETRACT_AUTORETRACT) + #define MIN_AUTORETRACT 0.1 // When auto-retract is on, convert E moves of this length and over + #define MAX_AUTORETRACT 10.0 // Upper limit for auto-retract conversion + #endif + #define RETRACT_LENGTH 3 // Default retract length (positive mm) + #define RETRACT_LENGTH_SWAP 13 // Default swap retract length (positive mm), for extruder change + #define RETRACT_FEEDRATE 45 // Default feedrate for retracting (mm/s) + #define RETRACT_ZRAISE 0 // Default retract Z-raise (mm) + #define RETRACT_RECOVER_LENGTH 0 // Default additional recover length (mm, added to retract length when recovering) + #define RETRACT_RECOVER_LENGTH_SWAP 0 // Default additional swap recover length (mm, added to retract length when recovering from extruder change) + #define RETRACT_RECOVER_FEEDRATE 8 // Default feedrate for recovering from retraction (mm/s) + #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // Default feedrate for recovering from swap retraction (mm/s) + #if ENABLED(MIXING_EXTRUDER) + //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously + #endif +#endif + +/** + * Universal tool change settings. + * Applies to all types of extruders except where explicitly noted. + */ +#if EXTRUDERS > 1 + // Z raise distance for tool-change, as needed for some extruders + #define TOOLCHANGE_ZRAISE 2 // (mm) + + // Retract and prime filament on tool-change + //#define TOOLCHANGE_FILAMENT_SWAP + #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) + #define TOOLCHANGE_FIL_SWAP_LENGTH 12 // (mm) + #define TOOLCHANGE_FIL_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define TOOLCHANGE_FIL_SWAP_PRIME_SPEED 3600 // (mm/m) + #endif + + /** + * Position to park head during tool change. + * Doesn't apply to SWITCHING_TOOLHEAD, DUAL_X_CARRIAGE, or PARKING_EXTRUDER + */ + //#define TOOLCHANGE_PARK + #if ENABLED(TOOLCHANGE_PARK) + #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * Advanced Pause + * Experimental feature for filament change support and for parking the nozzle when paused. + * Adds the GCode M600 for initiating filament change. + * If PARK_HEAD_ON_PAUSE enabled, adds the GCode M125 to pause printing and park the nozzle. + * + * Requires an LCD display. + * Requires NOZZLE_PARK_FEATURE. + * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. + */ +//#define ADVANCED_PAUSE_FEATURE +#if ENABLED(ADVANCED_PAUSE_FEATURE) + #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. + #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. + // This short retract is done immediately, before parking the nozzle. + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. + #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (mm) The length of filament for a complete unload. + // For Bowden, the full length of the tube and nozzle. + // For direct drive, the full length of the nozzle. + // Set to 0 for manual unloading. + #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load. + #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material. + // 0 to disable start loading and skip to fast load only + #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (mm/s) Load filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. + #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. + // For Bowden, the full length of the tube and nozzle. + // For direct drive, the full length of the nozzle. + //#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted. + #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate. + #define ADVANCED_PAUSE_PURGE_LENGTH 50 // (mm) Length to extrude after loading. + // Set to 0 for manual extrusion. + // Filament can be extruded repeatedly from the Filament Change menu + // until extrusion is consistent, and to purge old filament. + + // Filament Unload does a Retract, Delay, and Purge first: + #define FILAMENT_UNLOAD_RETRACT_LENGTH 13 // (mm) Unload initial retract length. + #define FILAMENT_UNLOAD_DELAY 5000 // (ms) Delay for the filament to cool after retract. + #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. + + #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. + #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. + #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. + + //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. + //#define HOME_BEFORE_FILAMENT_CHANGE // Ensure homing has been completed prior to parking for filament change + + //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. + //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) +#endif + +// @section tmc + +/** + * TMC26X Stepper Driver options + * + * The TMC26XStepper library is required for this stepper driver. + * https://github.com/trinamic/TMC26XStepper + */ +#if HAS_DRIVER(TMC26X) + + #define X_MAX_CURRENT 1000 // in mA + #define X_SENSE_RESISTOR 91 // in mOhms + #define X_MICROSTEPS 16 // number of microsteps + + #define X2_MAX_CURRENT 1000 + #define X2_SENSE_RESISTOR 91 + #define X2_MICROSTEPS 16 + + #define Y_MAX_CURRENT 1000 + #define Y_SENSE_RESISTOR 91 + #define Y_MICROSTEPS 16 + + #define Y2_MAX_CURRENT 1000 + #define Y2_SENSE_RESISTOR 91 + #define Y2_MICROSTEPS 16 + + #define Z_MAX_CURRENT 1000 + #define Z_SENSE_RESISTOR 91 + #define Z_MICROSTEPS 16 + + #define Z2_MAX_CURRENT 1000 + #define Z2_SENSE_RESISTOR 91 + #define Z2_MICROSTEPS 16 + + #define Z3_MAX_CURRENT 1000 + #define Z3_SENSE_RESISTOR 91 + #define Z3_MICROSTEPS 16 + + #define E0_MAX_CURRENT 1000 + #define E0_SENSE_RESISTOR 91 + #define E0_MICROSTEPS 16 + + #define E1_MAX_CURRENT 1000 + #define E1_SENSE_RESISTOR 91 + #define E1_MICROSTEPS 16 + + #define E2_MAX_CURRENT 1000 + #define E2_SENSE_RESISTOR 91 + #define E2_MICROSTEPS 16 + + #define E3_MAX_CURRENT 1000 + #define E3_SENSE_RESISTOR 91 + #define E3_MICROSTEPS 16 + + #define E4_MAX_CURRENT 1000 + #define E4_SENSE_RESISTOR 91 + #define E4_MICROSTEPS 16 + + #define E5_MAX_CURRENT 1000 + #define E5_SENSE_RESISTOR 91 + #define E5_MICROSTEPS 16 + +#endif // TMC26X + +// @section tmc_smart + +/** + * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to + * the hardware SPI interface on your board and define the required CS pins + * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.). + * You may also use software SPI if you wish to use general purpose IO pins. + * + * The TMC2130Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2130Stepper + * + * To use TMC2208 stepper UART-configurable stepper drivers + * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor. + * To use the reading capabilities, also connect #_SERIAL_RX_PIN + * to PDN_UART without a resistor. + * The drivers can also be used with hardware serial. + * + * The TMC2208Stepper library is required for this stepper driver. + * https://github.com/teemuatlut/TMC2208Stepper + */ +#if HAS_TRINAMIC + + #define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130 + #define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current + #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 + + #define X_CURRENT 800 // rms current in mA. Multiply by 1.41 for peak current. + #define X_MICROSTEPS 16 // 0..256 + + #define Y_CURRENT 800 + #define Y_MICROSTEPS 16 + + #define Z_CURRENT 800 + #define Z_MICROSTEPS 16 + + #define X2_CURRENT 800 + #define X2_MICROSTEPS 16 + + #define Y2_CURRENT 800 + #define Y2_MICROSTEPS 16 + + #define Z2_CURRENT 800 + #define Z2_MICROSTEPS 16 + + #define Z3_CURRENT 800 + #define Z3_MICROSTEPS 16 + + #define E0_CURRENT 800 + #define E0_MICROSTEPS 16 + + #define E1_CURRENT 800 + #define E1_MICROSTEPS 16 + + #define E2_CURRENT 800 + #define E2_MICROSTEPS 16 + + #define E3_CURRENT 800 + #define E3_MICROSTEPS 16 + + #define E4_CURRENT 800 + #define E4_MICROSTEPS 16 + + #define E5_CURRENT 800 + #define E5_MICROSTEPS 16 + + /** + * Use software SPI for TMC2130. + * The default SW SPI pins are defined the respective pins files, + * but you can override or define them here. + */ + //#define TMC_USE_SW_SPI + //#define TMC_SW_MOSI -1 + //#define TMC_SW_MISO -1 + //#define TMC_SW_SCK -1 + + /** + * Use Trinamic's ultra quiet stepping mode. + * When disabled, Marlin will use spreadCycle stepping mode. + */ + #define STEALTHCHOP + + /** + * Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions, + * like overtemperature and short to ground. TMC2208 requires hardware serial. + * In the case of overtemperature Marlin can decrease the driver current until error condition clears. + * Other detected conditions can be used to stop the current print. + * Relevant g-codes: + * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. + * M911 - Report stepper driver overtemperature pre-warn condition. + * M912 - Clear stepper driver overtemperature pre-warn condition flag. + * M122 S0/1 - Report driver parameters (Requires TMC_DEBUG) + */ + //#define MONITOR_DRIVER_STATUS + + #if ENABLED(MONITOR_DRIVER_STATUS) + #define CURRENT_STEP_DOWN 50 // [mA] + #define REPORT_CURRENT_CHANGE + #define STOP_ON_ERROR + #endif + + /** + * The driver will switch to spreadCycle when stepper speed is over HYBRID_THRESHOLD. + * This mode allows for faster movements at the expense of higher noise levels. + * STEALTHCHOP needs to be enabled. + * M913 X/Y/Z/E to live tune the setting + */ + //#define HYBRID_THRESHOLD + + #define X_HYBRID_THRESHOLD 100 // [mm/s] + #define X2_HYBRID_THRESHOLD 100 + #define Y_HYBRID_THRESHOLD 100 + #define Y2_HYBRID_THRESHOLD 100 + #define Z_HYBRID_THRESHOLD 3 + #define Z2_HYBRID_THRESHOLD 3 + #define Z3_HYBRID_THRESHOLD 3 + #define E0_HYBRID_THRESHOLD 30 + #define E1_HYBRID_THRESHOLD 30 + #define E2_HYBRID_THRESHOLD 30 + #define E3_HYBRID_THRESHOLD 30 + #define E4_HYBRID_THRESHOLD 30 + #define E5_HYBRID_THRESHOLD 30 + + /** + * Use StallGuard2 to sense an obstacle and trigger an endstop. + * Connect the stepper driver's DIAG1 pin to the X/Y endstop pin. + * X, Y, and Z homing will always be done in spreadCycle mode. + * + * X/Y/Z_STALL_SENSITIVITY is used for tuning the trigger sensitivity. + * Higher values make the system LESS sensitive. + * Lower value make the system MORE sensitive. + * Too low values can lead to false positives, while too high values will collide the axis without triggering. + * It is advised to set X/Y/Z_HOME_BUMP_MM to 0. + * M914 X/Y/Z to live tune the setting + */ + //#define SENSORLESS_HOMING // TMC2130 only + + /** + * Use StallGuard2 to probe the bed with the nozzle. + * + * CAUTION: This could cause damage to machines that use a lead screw or threaded rod + * to move the Z axis. Take extreme care when attempting to enable this feature. + */ + //#define SENSORLESS_PROBING // TMC2130 only + + #if ENABLED(SENSORLESS_HOMING) || ENABLED(SENSORLESS_PROBING) + #define X_STALL_SENSITIVITY 8 + #define Y_STALL_SENSITIVITY 8 + //#define Z_STALL_SENSITIVITY 8 + #endif + + /** + * Enable M122 debugging command for TMC stepper drivers. + * M122 S0/1 will enable continous reporting. + */ + //#define TMC_DEBUG + + /** + * M915 Z Axis Calibration + * + * - Adjust Z stepper current, + * - Drive the Z axis to its physical maximum, and + * - Home Z to account for the lost steps. + * + * Use M915 Snn to specify the current. + * Use M925 Znn to add extra Z height to Z_MAX_POS. + */ + //#define TMC_Z_CALIBRATION + #if ENABLED(TMC_Z_CALIBRATION) + #define CALIBRATION_CURRENT 250 + #define CALIBRATION_EXTRA_HEIGHT 10 + #endif + + /** + * You can set your own advanced settings by filling in predefined functions. + * A list of available functions can be found on the library github page + * https://github.com/teemuatlut/TMC2130Stepper + * https://github.com/teemuatlut/TMC2208Stepper + * + * Example: + * #define TMC_ADV() { \ + * stepperX.diag0_temp_prewarn(1); \ + * stepperY.interpolate(0); \ + * } + */ + #define TMC_ADV() { } + +#endif // HAS_TRINAMIC + +// @section L6470 + +/** + * L6470 Stepper Driver options + * + * The Arduino-L6470 library is required for this stepper driver. + * https://github.com/ameyer/Arduino-L6470 + */ +#if HAS_DRIVER(L6470) + + #define X_MICROSTEPS 16 // number of microsteps + #define X_OVERCURRENT 2000 // maxc current in mA. If the current goes over this value, the driver will switch off + #define X_STALLCURRENT 1500 // current in mA where the driver will detect a stall + + #define X2_MICROSTEPS 16 + #define X2_OVERCURRENT 2000 + #define X2_STALLCURRENT 1500 + + #define Y_MICROSTEPS 16 + #define Y_OVERCURRENT 2000 + #define Y_STALLCURRENT 1500 + + #define Y2_MICROSTEPS 16 + #define Y2_OVERCURRENT 2000 + #define Y2_STALLCURRENT 1500 + + #define Z_MICROSTEPS 16 + #define Z_OVERCURRENT 2000 + #define Z_STALLCURRENT 1500 + + #define Z2_MICROSTEPS 16 + #define Z2_OVERCURRENT 2000 + #define Z2_STALLCURRENT 1500 + + #define Z3_MICROSTEPS 16 + #define Z3_OVERCURRENT 2000 + #define Z3_STALLCURRENT 1500 + + #define E0_MICROSTEPS 16 + #define E0_OVERCURRENT 2000 + #define E0_STALLCURRENT 1500 + + #define E1_MICROSTEPS 16 + #define E1_OVERCURRENT 2000 + #define E1_STALLCURRENT 1500 + + #define E2_MICROSTEPS 16 + #define E2_OVERCURRENT 2000 + #define E2_STALLCURRENT 1500 + + #define E3_MICROSTEPS 16 + #define E3_OVERCURRENT 2000 + #define E3_STALLCURRENT 1500 + + #define E4_MICROSTEPS 16 + #define E4_OVERCURRENT 2000 + #define E4_STALLCURRENT 1500 + + #define E5_MICROSTEPS 16 + #define E5_OVERCURRENT 2000 + #define E5_STALLCURRENT 1500 + +#endif // L6470 + +/** + * TWI/I2C BUS + * + * This feature is an EXPERIMENTAL feature so it shall not be used on production + * machines. Enabling this will allow you to send and receive I2C data from slave + * devices on the bus. + * + * ; Example #1 + * ; This macro send the string "Marlin" to the slave device with address 0x63 (99) + * ; It uses multiple M260 commands with one B arg + * M260 A99 ; Target slave address + * M260 B77 ; M + * M260 B97 ; a + * M260 B114 ; r + * M260 B108 ; l + * M260 B105 ; i + * M260 B110 ; n + * M260 S1 ; Send the current buffer + * + * ; Example #2 + * ; Request 6 bytes from slave device with address 0x63 (99) + * M261 A99 B5 + * + * ; Example #3 + * ; Example serial output of a M261 request + * echo:i2c-reply: from:99 bytes:5 data:hello + */ + +// @section i2cbus + +//#define EXPERIMENTAL_I2CBUS +#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave + +// @section extras + +/** + * Canon Hack Development Kit + * http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ + */ +//#define CHDK_PIN 4 // Set and enable a pin for triggering CHDK to take a picture +#if PIN_EXISTS(CHDK) + #define CHDK_DELAY 50 // (ms) How long the pin should remain HIGH +#endif + +/** + * Spindle & Laser control + * + * Add the M3, M4, and M5 commands to turn the spindle/laser on and off, and + * to set spindle speed, spindle direction, and laser power. + * + * SuperPid is a router/spindle speed controller used in the CNC milling community. + * Marlin can be used to turn the spindle on and off. It can also be used to set + * the spindle speed from 5,000 to 30,000 RPM. + * + * You'll need to select a pin for the ON/OFF function and optionally choose a 0-5V + * hardware PWM pin for the speed control and a pin for the rotation direction. + * + * See http://marlinfw.org/docs/configuration/laser_spindle.html for more config details. + */ +//#define SPINDLE_LASER_ENABLE +#if ENABLED(SPINDLE_LASER_ENABLE) + + #define SPINDLE_LASER_ENABLE_INVERT false // set to "true" if the on/off function is reversed + #define SPINDLE_LASER_PWM true // set to true if your controller supports setting the speed/power + #define SPINDLE_LASER_PWM_INVERT true // set to "true" if the speed/power goes up when you want it to go slower + #define SPINDLE_LASER_POWERUP_DELAY 5000 // delay in milliseconds to allow the spindle/laser to come up to speed/power + #define SPINDLE_LASER_POWERDOWN_DELAY 5000 // delay in milliseconds to allow the spindle to stop + #define SPINDLE_DIR_CHANGE true // set to true if your spindle controller supports changing spindle direction + #define SPINDLE_INVERT_DIR false + #define SPINDLE_STOP_ON_DIR_CHANGE true // set to true if Marlin should stop the spindle before changing rotation direction + + /** + * The M3 & M4 commands use the following equation to convert PWM duty cycle to speed/power + * + * SPEED/POWER = PWM duty cycle * SPEED_POWER_SLOPE + SPEED_POWER_INTERCEPT + * where PWM duty cycle varies from 0 to 255 + * + * set the following for your controller (ALL MUST BE SET) + */ + + #define SPEED_POWER_SLOPE 118.4 + #define SPEED_POWER_INTERCEPT 0 + #define SPEED_POWER_MIN 5000 + #define SPEED_POWER_MAX 30000 // SuperPID router controller 0 - 30,000 RPM + + //#define SPEED_POWER_SLOPE 0.3922 + //#define SPEED_POWER_INTERCEPT 0 + //#define SPEED_POWER_MIN 10 + //#define SPEED_POWER_MAX 100 // 0-100% +#endif + +/** + * Filament Width Sensor + * + * Measures the filament width in real-time and adjusts + * flow rate to compensate for any irregularities. + * + * Also allows the measured filament diameter to set the + * extrusion rate, so the slicer only has to specify the + * volume. + * + * Only a single extruder is supported at this time. + * + * 34 RAMPS_14 : Analog input 5 on the AUX2 connector + * 81 PRINTRBOARD : Analog input 2 on the Exp1 connector (version B,C,D,E) + * 301 RAMBO : Analog input 3 + * + * Note: May require analog pins to be defined for other boards. + */ +//#define FILAMENT_WIDTH_SENSOR + +#if ENABLED(FILAMENT_WIDTH_SENSOR) + #define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4] + #define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber + + #define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it + #define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM. + + #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially + + // Display filament width on the LCD status line. Status messages will expire after 5 seconds. + //#define FILAMENT_LCD_DISPLAY +#endif + +/** + * CNC Coordinate Systems + * + * Enables G53 and G54-G59.3 commands to select coordinate systems + * and G92.1 to reset the workspace to native machine space. + */ +//#define CNC_COORDINATE_SYSTEMS + +/** + * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins + */ +//#define PINS_DEBUGGING + +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES + +/** + * Include capabilities in M115 output + */ +#define EXTENDED_CAPABILITIES_REPORT + +/** + * Disable all Volumetric extrusion options + */ +//#define NO_VOLUMETRICS + +#if DISABLED(NO_VOLUMETRICS) + /** + * Volumetric extrusion default state + * Activate to make volumetric extrusion the default method, + * with DEFAULT_NOMINAL_FILAMENT_DIA as the default diameter. + * + * M200 D0 to disable, M200 Dn to set a new diameter. + */ + //#define VOLUMETRIC_DEFAULT_ON +#endif + +/** + * Enable this option for a leaner build of Marlin that removes all + * workspace offsets, simplifying coordinate transformations, leveling, etc. + * + * - M206 and M428 are disabled. + * - G92 will revert to its behavior from Marlin 1.0. + */ +//#define NO_WORKSPACE_OFFSETS + +/** + * Set the number of proportional font spaces required to fill up a typical character space. + * This can help to better align the output of commands like `G29 O` Mesh Output. + * + * For clients that use a fixed-width font (like OctoPrint), leave this set to 1.0. + * Otherwise, adjust according to your client and font. + */ +#define PROPORTIONAL_FONT_RATIO 1.0 + +/** + * Spend 28 bytes of SRAM to optimize the GCode parser + */ +#define FASTER_GCODE_PARSER + +/** + * CNC G-code options + * Support CNC-style G-code dialects used by laser cutters, drawing machine cams, etc. + * Note that G0 feedrates should be used with care for 3D printing (if used at all). + * High feedrates may cause ringing and harm print quality. + */ +//#define PAREN_COMMENTS // Support for parentheses-delimited comments +//#define GCODE_MOTION_MODES // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc. + +// Enable and set a (default) feedrate for all G0 moves +//#define G0_FEEDRATE 3000 // (mm/m) +#ifdef G0_FEEDRATE + //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode +#endif + +/** + * G-code Macros + * + * Add G-codes M810-M819 to define and run G-code macros. + * Macros are not saved to EEPROM. + */ +//#define GCODE_MACROS +#if ENABLED(GCODE_MACROS) + #define GCODE_MACROS_SLOTS 5 // Up to 10 may be used + #define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro +#endif + +/** + * User-defined menu items that execute custom GCode + */ +//#define CUSTOM_USER_MENUS +#if ENABLED(CUSTOM_USER_MENUS) + //#define CUSTOM_USER_MENU_TITLE "Custom Commands" + #define USER_SCRIPT_DONE "M117 User Script Done" + #define USER_SCRIPT_AUDIBLE_FEEDBACK + //#define USER_SCRIPT_RETURN // Return to status screen after a script + + #define USER_DESC_1 "Home & UBL Info" + #define USER_GCODE_1 "G28\nG29 W" + + #define USER_DESC_2 "Preheat for " PREHEAT_1_LABEL + #define USER_GCODE_2 "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) + + #define USER_DESC_3 "Preheat for " PREHEAT_2_LABEL + #define USER_GCODE_3 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) + + #define USER_DESC_4 "Heat Bed/Home/Level" + #define USER_GCODE_4 "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nG28\nG29" + + #define USER_DESC_5 "Home & Info" + #define USER_GCODE_5 "G28\nM503" +#endif + +/** + * Specify an action command to send to the host when the printer is killed. + * Will be sent in the form '//action:ACTION_ON_KILL', e.g. '//action:poweroff'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_KILL "poweroff" + +/** + * Specify an action command to send to the host on pause and resume. + * Will be sent in the form '//action:ACTION_ON_PAUSE', e.g. '//action:pause'. + * The host must be configured to handle the action command. + */ +//#define ACTION_ON_PAUSE "pause" +//#define ACTION_ON_RESUME "resume" + +//=========================================================================== +//====================== I2C Position Encoder Settings ====================== +//=========================================================================== + +/** + * I2C position encoders for closed loop control. + * Developed by Chris Barr at Aus3D. + * + * Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder + * Github: https://github.com/Aus3D/MagneticEncoder + * + * Supplier: http://aus3d.com.au/magnetic-encoder-module + * Alternative Supplier: http://reliabuild3d.com/ + * + * Reilabuild encoders have been modified to improve reliability. + */ + +//#define I2C_POSITION_ENCODERS +#if ENABLED(I2C_POSITION_ENCODERS) + + #define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5 + // encoders supported currently. + + #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200. + #define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. _AXIS. + #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or- + // I2CPE_ENC_TYPE_ROTARY. + #define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for + // 1mm poles. For linear encoders this is ticks / mm, + // for rotary encoders this is ticks / revolution. + //#define I2CPE_ENC_1_TICKS_REV (16 * 200) // Only needed for rotary encoders; number of stepper + // steps per full revolution (motor steps/rev * microstepping) + //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel. + #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction. + #define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the + // printer will attempt to correct the error; errors + // smaller than this are ignored to minimize effects of + // measurement noise / latency (filter). + + #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2. + #define I2CPE_ENC_2_AXIS Y_AXIS + #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_ENC_2_TICKS_UNIT 2048 + //#define I2CPE_ENC_2_TICKS_REV (16 * 200) + //#define I2CPE_ENC_2_INVERT + #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP + #define I2CPE_ENC_2_EC_THRESH 0.10 + + #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options + #define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below. + + #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4. + #define I2CPE_ENC_4_AXIS E_AXIS + + #define I2CPE_ENC_5_ADDR 34 // Encoder 5. + #define I2CPE_ENC_5_AXIS E_AXIS + + // Default settings for encoders which are enabled, but without settings configured above. + #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR + #define I2CPE_DEF_ENC_TICKS_UNIT 2048 + #define I2CPE_DEF_TICKS_REV (16 * 200) + #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE + #define I2CPE_DEF_EC_THRESH 0.1 + + //#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given + // axis after which the printer will abort. Comment out to + // disable abort behaviour. + + #define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault + // for this amount of time (in ms) before the encoder + // is trusted again. + + /** + * Position is checked every time a new command is executed from the buffer but during long moves, + * this setting determines the minimum update time between checks. A value of 100 works well with + * error rolling average when attempting to correct only for skips and not for vibration. + */ + #define I2CPE_MIN_UPD_TIME_MS 4 // (ms) Minimum time between encoder checks. + + // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise. + #define I2CPE_ERR_ROLLING_AVERAGE + +#endif // I2C_POSITION_ENCODERS + +/** + * MAX7219 Debug Matrix + * + * Add support for a low-cost 8x8 LED Matrix based on the Max7219 chip as a realtime status display. + * Requires 3 signal wires. Some useful debug options are included to demonstrate its usage. + */ +//#define MAX7219_DEBUG +#if ENABLED(MAX7219_DEBUG) + #define MAX7219_CLK_PIN 64 + #define MAX7219_DIN_PIN 57 + #define MAX7219_LOAD_PIN 44 + + //#define MAX7219_GCODE // Add the M7219 G-code to control the LED matrix + #define MAX7219_INIT_TEST 2 // Do a test pattern at initialization (Set to 2 for spiral) + #define MAX7219_NUMBER_UNITS 1 // Number of Max7219 units in chain. + #define MAX7219_ROTATE 0 // Rotate the display clockwise (in multiples of +/- 90°) + // connector at: right=0 bottom=-90 top=90 left=180 + //#define MAX7219_REVERSE_ORDER // The individual LED matrix units may be in reversed order + + /** + * Sample debug features + * If you add more debug displays, be careful to avoid conflicts! + */ + #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning + #define MAX7219_DEBUG_PLANNER_HEAD 3 // Show the planner queue head position on this and the next LED matrix row + #define MAX7219_DEBUG_PLANNER_TAIL 5 // Show the planner queue tail position on this and the next LED matrix row + + #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row + // If you experience stuttering, reboots, etc. this option can reveal how + // tweaks made to the configuration are affecting the printer in real-time. +#endif + +/** + * NanoDLP Sync support + * + * Add support for Synchronized Z moves when using with NanoDLP. G0/G1 axis moves will output "Z_move_comp" + * string to enable synchronization with DLP projector exposure. This change will allow to use + * [[WaitForDoneMessage]] instead of populating your gcode with M400 commands + */ +//#define NANODLP_Z_SYNC +#if ENABLED(NANODLP_Z_SYNC) + //#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move. + // Default behaviour is limited to Z axis only. +#endif + +/** + * WiFi Support (Espressif ESP32 WiFi) + */ +//#define WIFISUPPORT +#if ENABLED(WIFISUPPORT) + #define WIFI_SSID "Wifi SSID" + #define WIFI_PWD "Wifi Password" +#endif + +// Enable Marlin dev mode which adds some special commands +//#define MARLIN_DEV_MODE diff --git a/Marlin/src/config/examples/delta/MKS/SBASE/RRD Full Graphic Smart Controller.md b/Marlin/src/config/examples/delta/MKS/SBASE/RRD Full Graphic Smart Controller.md new file mode 100644 index 0000000000..265cb541f9 --- /dev/null +++ b/Marlin/src/config/examples/delta/MKS/SBASE/RRD Full Graphic Smart Controller.md @@ -0,0 +1,34 @@ +### RepRap Discount Full Graphics Smart Controller + +Many MKS products have the EXP1 & EXP2 LCD connectors rotated 180 degrees from the ones on the RepRap LCD controllers. So there are three options for connecting the RepRap Discount Full Graphic Smart Controller: + 1. Slice, file, or grind the key off one end of the cables and plug the cables in backwards. + 2. Carefully pry the plastic housings off the board or controller, rotate them 180 degrees, and press them back onto the board. + 3. Make custom cables with one end's connector rotated 180 degrees. + +--- + +#### 3 DEC 2017 + +The current Marlin 2.0.x firmware can't access some of the pins on the EXP2 connector. A custom cable that gets three of the signals from a different connector is required to use the RepRap Discount Full Graphic Smart Controller. Use that cable to move the following connections: + +From|To +--|-- +`P0.8`|`J8-3` +`P0.7`|`J8-2` +`P0.5`|`J8-4` + +If using pins other than the J8 pins listed above the `spi_pins.h` file will need to be modified. + +An octopus cable like the [Adafruit 1199](https://www.adafruit.com/product/1199) 10-pin IDC Socket Rainbow Breakout Cable can simplify the construction of the custom cable. Just plug the Adafruit 1199 into one of the cables that came with the LCD and the individual pins into J8 and EXP2 as needed. + +--- + +#### 27 APR 2018 + +For a functional `SD_DETECT_PIN`, also move the following pin: + +From|To +--|-- +`P0.27`|`J8-5` + +If a different pin is used, modify the `pins_MKS_SBASE.h` file. diff --git a/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration.h b/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration.h index 974f7953d1..c65ededaa5 100644 --- a/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration.h +++ b/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration.h @@ -416,7 +416,7 @@ //E3D with 30MM fan #define DEFAULT_Kp 41.09 #define DEFAULT_Ki 7.60 - #define DEFAULT_Kd 55.54 + #define DEFAULT_Kd 55.54 #endif // PIDTEMP //=========================================================================== @@ -715,7 +715,7 @@ // delta speeds must be the same on xyz #define DEFAULT_XYZ_STEPS_PER_UNIT ((XYZ_FULL_STEPS_PER_ROTATION) * (XYZ_MICROSTEPS) / double(XYZ_BELT_PITCH) / double(XYZ_PULLEY_TEETH)) -#define DEFAULT_AXIS_STEPS_PER_UNIT { DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, 376.04 } +#define DEFAULT_AXIS_STEPS_PER_UNIT { DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, DEFAULT_XYZ_STEPS_PER_UNIT, 376.04 } /** * Default Max Feed Rate (mm/s) diff --git a/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration_adv.h b/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration_adv.h index 6cc3d35679..dfe94b19cb 100644 --- a/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration_adv.h @@ -588,7 +588,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -807,7 +807,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1050,6 +1064,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/delta/generic/Configuration_adv.h b/Marlin/src/config/examples/delta/generic/Configuration_adv.h index a5bd5af9b7..b92a6c85f6 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/generic/Configuration_adv.h @@ -588,7 +588,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -807,7 +807,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1050,6 +1064,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h index a5bd5af9b7..b92a6c85f6 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h @@ -588,7 +588,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -807,7 +807,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1050,6 +1064,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h index 4c319979b1..4f5367b72f 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h @@ -588,7 +588,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -807,7 +807,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1050,6 +1064,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h index 1012a6a563..7d67bb14b1 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/makibox/Configuration_adv.h b/Marlin/src/config/examples/makibox/Configuration_adv.h index c28b1ede83..4ad3635fc2 100644 --- a/Marlin/src/config/examples/makibox/Configuration_adv.h +++ b/Marlin/src/config/examples/makibox/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h index 0ed22b85f2..338be6d880 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h @@ -586,7 +586,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -805,7 +805,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1048,6 +1062,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/config/examples/wt150/Configuration_adv.h b/Marlin/src/config/examples/wt150/Configuration_adv.h index fa46e8f2b7..eb241a95a8 100644 --- a/Marlin/src/config/examples/wt150/Configuration_adv.h +++ b/Marlin/src/config/examples/wt150/Configuration_adv.h @@ -587,7 +587,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if HAS_PRINT_PROGRESS +#if HAS_CHARACTER_LCD && HAS_PRINT_PROGRESS //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing #if ENABLED(LCD_PROGRESS_BAR) #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar @@ -806,7 +806,21 @@ #endif #endif -#endif // DOGLCD + /** + * Status (Info) Screen customizations + * These options may affect code size and screen render time. + * Custom status screens can forcibly override these settings. + */ + //#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones + //#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends) + #define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM) + #define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating + #define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating + //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap + //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + +#endif // HAS_GRAPHICAL_LCD // @section safety @@ -1049,6 +1063,10 @@ // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK +// Printrun may have trouble receiving long strings all at once. +// This option inserts short delays between lines of serial output. +#define SERIAL_OVERRUN_PROTECTION + // @section extras /** diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 5a5dc76cd1..575bf26539 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -73,9 +73,11 @@ #define BOARD_AZTEEG_X3_PRO 68 // Azteeg X3 Pro #define BOARD_ULTIMAIN_2 72 // Ultimainboard 2.x (Uses TEMP_SENSOR 20) #define BOARD_RUMBA 80 // Rumba -#define BOARD_FORMBOT_TREX2PLUS 95 // Formbot version 1 -#define BOARD_FORMBOT_TREX3 96 // Formbot T-Rex 3 revision -#define BOARD_FORMBOT_RAPTOR 97 // Formbot version 1 +#define BOARD_RUMBA_RAISE3D 333 // Raise3D N series Rumba derivative +#define BOARD_FORMBOT_TREX2PLUS 95 // Formbot T-Rex 2 Plus +#define BOARD_FORMBOT_TREX3 96 // Formbot T-Rex 3 +#define BOARD_FORMBOT_RAPTOR 97 // Formbot Raptor +#define BOARD_FORMBOT_RAPTOR2 98 // Formbot Raptor 2 #define BOARD_BQ_ZUM_MEGA_3D 503 // bq ZUM Mega 3D #define BOARD_MAKEBOARD_MINI 431 // MakeBoard Mini v2.1.2 is a control board sold by MicroMake #define BOARD_TRIGORILLA_13 343 // TriGorilla Anycubic version 1.3 based on RAMPS EFB @@ -209,7 +211,8 @@ #define BOARD_RURAMPS4D_11 1550 // RuRAMPS4Duo v1.1 (Power outputs: Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) #define BOARD_RURAMPS4D_13 1551 // RuRAMPS4Duo v1.3 (Power outputs: Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed) #define BOARD_ULTRATRONICS_PRO 1560 // ReprapWorld Ultratronics Pro V1.0 -#define BOARD_ARCHIM2 1590 // UltiMachine Archim2 (with TMC2130 drivers) +#define BOARD_ARCHIM1 1591 // UltiMachine Archim1 (with DRV8825 drivers) +#define BOARD_ARCHIM2 1592 // UltiMachine Archim2 (with TMC2130 drivers) #define BOARD_ALLIGATOR 1602 // Alligator Board R2 // diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 6c86cf1390..fbd19bc0cc 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -94,6 +94,44 @@ #define WEBSITE_URL DEFAULT_WEBSITE_URL #endif +#if HAS_GRAPHICAL_LCD + // + // Custom characters from Marlin_symbols.fon which was merged into ISO10646-0-3.bdf + // \x00 intentionally skipped to avoid problems in strings + // + #define LCD_STR_REFRESH "\x01" + #define LCD_STR_FOLDER "\x02" + #define LCD_STR_ARROW_RIGHT "\x03" + #define LCD_STR_UPLEVEL "\x04" + #define LCD_STR_CLOCK "\x05" + #define LCD_STR_FEEDRATE "\x06" + #define LCD_STR_BEDTEMP "\x07" + #define LCD_STR_THERMOMETER "\x08" + #define LCD_STR_DEGREE "\x09" + + #define LCD_STR_SPECIAL_MAX '\x09' + // Maximum here is 0x1F because 0x20 is ' ' (space) and the normal charsets begin. + // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. + + // Symbol characters + #define LCD_STR_FILAM_DIA "\xF8" + #define LCD_STR_FILAM_MUL "\xA4" + +#elif HAS_CHARACTER_LCD + + // Custom characters defined in the first 8 characters of the LCD + #define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string! + #define LCD_STR_DEGREE "\x01" + #define LCD_STR_THERMOMETER "\x02" // Still used with string concatenation + #define LCD_STR_UPLEVEL "\x03" + #define LCD_STR_REFRESH "\x04" + #define LCD_STR_FOLDER "\x05" + #define LCD_STR_FEEDRATE "\x06" + #define LCD_STR_CLOCK "\x07" + #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ + +#endif + // Common LCD messages /* nothing here yet */ @@ -169,6 +207,8 @@ #define MSG_ERR_M428_TOO_FAR "Too far from reference point" #define MSG_ERR_M303_DISABLED "PIDTEMP disabled" #define MSG_M119_REPORT "Reporting endstop status" +#define MSG_ON "ON" +#define MSG_OFF "OFF" #define MSG_ENDSTOP_HIT "TRIGGERED" #define MSG_ENDSTOP_OPEN "open" #define MSG_HOTEND_OFFSET "Hotend offsets:" diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 945e983e97..1c57d88c86 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -196,7 +196,7 @@ #define MMM_TO_MMS(MM_M) ((MM_M)/60.0f) #define MMS_TO_MMM(MM_S) ((MM_S)*60.0f) -#define NOOP do{} while(0) +#define NOOP (void(0)) #define CEILING(x,y) (((x) + (y) - 1) / (y)) diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index 9b89644f02..27ccdbf94f 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -21,25 +21,26 @@ */ #include "serial.h" +#include "language.h" uint8_t marlin_debug_flags = MARLIN_DEBUG_NONE; -const char errormagic[] PROGMEM = "Error:"; -const char echomagic[] PROGMEM = "echo:"; +static const char errormagic[] PROGMEM = "Error:"; +static const char echomagic[] PROGMEM = "echo:"; #if NUM_SERIAL > 1 void serialprintPGM_P(const int8_t p, const char * str) { while (char ch = pgm_read_byte(str++)) SERIAL_CHAR_P(p, ch); } - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, const char *v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); } - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, char v) { serialprintPGM_P(p, s_P); SERIAL_CHAR_P(p, v); } - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, int v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); } - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, long v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); } - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, float v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); } - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, double v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); } - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, unsigned int v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); } - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, unsigned long v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); } + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, const char *v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); } + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, char v) { serialprintPGM_P(p, s_P); SERIAL_CHAR_P(p, v); } + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, int v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); } + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, long v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); } + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, float v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); } + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, double v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); } + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, unsigned int v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); } + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, unsigned long v) { serialprintPGM_P(p, s_P); SERIAL_ECHO_P(p, v); } void serial_spaces_P(const int8_t p, uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (count--) SERIAL_CHAR_P(p, ' '); } @@ -52,25 +53,28 @@ void serialprintPGM(PGM_P str) { while (char ch = pgm_read_byte(str++)) SERIAL_CHAR(ch); } -void serial_echopair_PGM(PGM_P s_P, const char *v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(PGM_P s_P, char v) { serialprintPGM(s_P); SERIAL_CHAR(v); } -void serial_echopair_PGM(PGM_P s_P, int v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(PGM_P s_P, long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(PGM_P s_P, float v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(PGM_P s_P, double v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(PGM_P s_P, unsigned int v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void serial_echopair_PGM(PGM_P s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } +void serial_echo_start() { serialprintPGM(echomagic); } +void serial_error_start() { serialprintPGM(errormagic); } + +void serial_echopair_PGM(PGM_P const s_P, const char *v) { serialprintPGM(s_P); SERIAL_ECHO(v); } +void serial_echopair_PGM(PGM_P const s_P, char v) { serialprintPGM(s_P); SERIAL_CHAR(v); } +void serial_echopair_PGM(PGM_P const s_P, int v) { serialprintPGM(s_P); SERIAL_ECHO(v); } +void serial_echopair_PGM(PGM_P const s_P, long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } +void serial_echopair_PGM(PGM_P const s_P, float v) { serialprintPGM(s_P); SERIAL_ECHO(v); } +void serial_echopair_PGM(PGM_P const s_P, double v) { serialprintPGM(s_P); SERIAL_ECHO(v); } +void serial_echopair_PGM(PGM_P const s_P, unsigned int v) { serialprintPGM(s_P); SERIAL_ECHO(v); } +void serial_echopair_PGM(PGM_P const s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } void serial_spaces(uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (count--) SERIAL_CHAR(' '); } -void serial_echo_start() { serialprintPGM(echomagic); } -void serial_error_start() { serialprintPGM(errormagic); } +void serialprint_onoff(const bool onoff) { serialprintPGM(onoff ? PSTR(MSG_ON) : PSTR(MSG_OFF)); } +void serialprintln_onoff(const bool onoff) { serialprint_onoff(onoff); SERIAL_EOL(); } #if ENABLED(DEBUG_LEVELING_FEATURE) #include "enum.h" - void print_xyz(PGM_P prefix, PGM_P suffix, const float x, const float y, const float z) { + void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z) { serialprintPGM(prefix); SERIAL_CHAR('('); SERIAL_ECHO(x); @@ -80,7 +84,7 @@ void serial_error_start() { serialprintPGM(errormagic); } if (suffix) serialprintPGM(suffix); else SERIAL_EOL(); } - void print_xyz(PGM_P prefix, PGM_P suffix, const float xyz[]) { + void print_xyz(PGM_P const prefix, PGM_P const suffix, const float xyz[]) { print_xyz(prefix, suffix, xyz[X_AXIS], xyz[Y_AXIS], xyz[Z_AXIS]); } diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index 5f67ecd53a..b8c8734510 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -48,199 +48,167 @@ extern uint8_t marlin_debug_flags; #endif #if NUM_SERIAL > 1 - #define SERIAL_CHAR_P(p,x) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.write(x) : MYSERIAL1.write(x)) : SERIAL_CHAR(x)) - #define SERIAL_PROTOCOL_P(p,x) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.print(x) : MYSERIAL1.print(x)) : SERIAL_PROTOCOL(x)) - #define SERIAL_PROTOCOL_F_P(p,x,y) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.print(x,y) : MYSERIAL1.print(x,y)) : SERIAL_PROTOCOL_F(x,y)) - #define SERIAL_PROTOCOLLN_P(p,x) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.println(x) : MYSERIAL1.println(x)) : SERIAL_PROTOCOLLN(x)) - #define SERIAL_PRINT_P(p,x,b) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.print(x,b) : MYSERIAL1.print(x,b)) : SERIAL_PRINT(x,b)) - #define SERIAL_PRINTLN_P(p,x,b) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.println(x,b) : MYSERIAL1.println(x,b)) : SERIAL_PRINTLN(x,b)) - #define SERIAL_PRINTF_P(p,args...) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.printf(args) : MYSERIAL1.printf(args)) : SERIAL_PRINTF(args)) - #define SERIAL_CHAR(x) (MYSERIAL0.write(x), MYSERIAL1.write(x)) - #define SERIAL_PROTOCOL(x) (MYSERIAL0.print(x), MYSERIAL1.print(x)) - #define SERIAL_PROTOCOL_F(x,y) (MYSERIAL0.print(x,y), MYSERIAL1.print(x,y)) - #define SERIAL_PROTOCOLLN(x) (MYSERIAL0.println(x), MYSERIAL1.println(x)) - #define SERIAL_PRINT(x,b) (MYSERIAL0.print(x,b), MYSERIAL1.print(x,b)) - #define SERIAL_PRINTLN(x,b) (MYSERIAL0.println(x,b), MYSERIAL1.println(x,b)) - #define SERIAL_PRINTF(args...) (MYSERIAL0.printf(args), MYSERIAL1.printf(args)) - - #define SERIAL_FLUSH_P(p) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.flush() : MYSERIAL1.flush()) : SERIAL_FLUSH()) - #define SERIAL_FLUSH() (MYSERIAL0.flush(), MYSERIAL1.flush()) + // + // Serial out to all ports + // + #define SERIAL_CHAR(x) (MYSERIAL0.write(x), MYSERIAL1.write(x)) + #define SERIAL_ECHO(x) (MYSERIAL0.print(x), MYSERIAL1.print(x)) + #define SERIAL_ECHO_F(x,y) (MYSERIAL0.print(x,y), MYSERIAL1.print(x,y)) + #define SERIAL_ECHOLN(x) (MYSERIAL0.println(x), MYSERIAL1.println(x)) + #define SERIAL_PRINT(x,b) (MYSERIAL0.print(x,b), MYSERIAL1.print(x,b)) + #define SERIAL_PRINTLN(x,b) (MYSERIAL0.println(x,b), MYSERIAL1.println(x,b)) + #define SERIAL_PRINTF(args...) (MYSERIAL0.printf(args), MYSERIAL1.printf(args)) + #define SERIAL_FLUSH() (MYSERIAL0.flush(), MYSERIAL1.flush()) #if TX_BUFFER_SIZE > 0 - #define SERIAL_FLUSHTX_P(p) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.flushTX() : MYSERIAL1.flushTX()) : SERIAL_FLUSHTX()) - #define SERIAL_FLUSHTX() (MYSERIAL0.flushTX(), MYSERIAL1.flushTX()) + #define SERIAL_FLUSHTX() (MYSERIAL0.flushTX(), MYSERIAL1.flushTX()) #endif - #define SERIAL_EOL_P(p) SERIAL_CHAR_P(p,'\n') + // + // Serial out with port redirect + // + #define SERIAL_CHAR_P(p,x) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.write(x) : MYSERIAL1.write(x)) : SERIAL_CHAR(x)) + #define SERIAL_ECHO_P(p,x) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.print(x) : MYSERIAL1.print(x)) : SERIAL_ECHO(x)) + #define SERIAL_ECHO_F_P(p,x,y) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.print(x,y) : MYSERIAL1.print(x,y)) : SERIAL_ECHO_F(x,y)) + #define SERIAL_ECHOLN_P(p,x) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.println(x) : MYSERIAL1.println(x)) : SERIAL_ECHOLN(x)) + #define SERIAL_PRINT_P(p,x,b) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.print(x,b) : MYSERIAL1.print(x,b)) : SERIAL_PRINT(x,b)) + #define SERIAL_PRINTLN_P(p,x,b) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.println(x,b) : MYSERIAL1.println(x,b)) : SERIAL_PRINTLN(x,b)) + #define SERIAL_PRINTF_P(p,args...) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.printf(args) : MYSERIAL1.printf(args)) : SERIAL_PRINTF(args)) + #define SERIAL_FLUSH_P(p) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.flush() : MYSERIAL1.flush()) : SERIAL_FLUSH()) + #if TX_BUFFER_SIZE > 0 + #define SERIAL_FLUSHTX_P(p) (WITHIN(p, 0, NUM_SERIAL-1) ? (p == 0 ? MYSERIAL0.flushTX() : MYSERIAL1.flushTX()) : SERIAL_FLUSHTX()) + #endif - #define SERIAL_PROTOCOLCHAR_P(p,x) SERIAL_CHAR_P(p,x) - #define SERIAL_PROTOCOLPGM_P(p,x) (serialprintPGM_P(p,PSTR(x))) - #define SERIAL_PROTOCOLLNPGM_P(p,x) (serialprintPGM_P(p,PSTR(x "\n"))) - #define SERIAL_PROTOCOLPAIR_P(p, pre, value) (serial_echopair_PGM_P(p,PSTR(pre),(value))) - #define SERIAL_PROTOCOLLNPAIR_P(p, pre, value) do{ SERIAL_PROTOCOLPAIR_P(p, pre, value); SERIAL_EOL_P(p); }while(0) + #define SERIAL_ECHOPGM_P(p,x) (serialprintPGM_P(p,PSTR(x))) + #define SERIAL_ECHOLNPGM_P(p,x) (serialprintPGM_P(p,PSTR(x "\n"))) + #define SERIAL_ECHOPAIR_P(p, pre, value) (serial_echopair_PGM_P(p,PSTR(pre),(value))) - #define SERIAL_ECHO_START_P(p) serial_echo_start_P(p) - #define SERIAL_ECHO_P(p,x) SERIAL_PROTOCOL_P(p,x) - #define SERIAL_ECHOPGM_P(p,x) SERIAL_PROTOCOLPGM_P(p,x) - #define SERIAL_ECHOLN_P(p,x) SERIAL_PROTOCOLLN_P(p,x) - #define SERIAL_ECHOLNPGM_P(p,x) SERIAL_PROTOCOLLNPGM_P(p,x) - #define SERIAL_ECHOPAIR_P(p,pre,value) SERIAL_PROTOCOLPAIR_P(p, pre, value) - #define SERIAL_ECHOLNPAIR_P(p,pre, value) SERIAL_PROTOCOLLNPAIR_P(p, pre, value) - #define SERIAL_ECHO_F_P(p,x,y) SERIAL_PROTOCOL_F_P(p,x,y) + #define SERIAL_ECHO_START_P(p) serial_echo_start_P(p) + #define SERIAL_ERROR_START_P(p) serial_error_start_P(p) + #define SERIAL_EOL_P(p) SERIAL_CHAR_P(p,'\n') - #define SERIAL_ERROR_START_P(p) serial_error_start_P(p) - #define SERIAL_ERROR_P(p,x) SERIAL_PROTOCOL_P(p,x) - #define SERIAL_ERRORPGM_P(p,x) SERIAL_PROTOCOLPGM_P(p,x) - #define SERIAL_ERRORLN_P(p,x) SERIAL_PROTOCOLLN_P(p,x) - #define SERIAL_ERRORLNPGM_P(p,x) SERIAL_PROTOCOLLNPGM_P(p,x) + #define SERIAL_ECHOPAIR_F_P(p, pre, value, y) do{ SERIAL_ECHO_P(p, pre); SERIAL_ECHO_F_P(p, value, y); }while(0) + #define SERIAL_ECHOLNPAIR_F_P(p, pre, value, y) do{ SERIAL_ECHOPAIR_F_P(p, pre, value, y); SERIAL_EOL_P(p); }while(0) - // These macros compensate for float imprecision - #define SERIAL_PROTOCOLPAIR_F_P(p, pre, value) SERIAL_PROTOCOLPAIR_P(p, pre, FIXFLOAT(value)) - #define SERIAL_PROTOCOLLNPAIR_F_P(p, pre, value) SERIAL_PROTOCOLLNPAIR_P(p, pre, FIXFLOAT(value)) - #define SERIAL_ECHOPAIR_F_P(p,pre,value) SERIAL_ECHOPAIR_P(p, pre, FIXFLOAT(value)) - #define SERIAL_ECHOLNPAIR_F_P(p,pre, value) SERIAL_ECHOLNPAIR_P(p, pre, FIXFLOAT(value)) - - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, const char *v); - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, char v); - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, int v); - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, long v); - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, float v); - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, double v); - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, unsigned int v); - void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, unsigned long v); - FORCE_INLINE void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, uint8_t v) { serial_echopair_PGM_P(p, s_P, (int)v); } - FORCE_INLINE void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, bool v) { serial_echopair_PGM_P(p, s_P, (int)v); } - FORCE_INLINE void serial_echopair_PGM_P(const int8_t p, PGM_P s_P, void *v) { serial_echopair_PGM_P(p, s_P, (unsigned long)v); } + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, const char *v); + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, char v); + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, int v); + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, long v); + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, float v); + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, double v); + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, unsigned int v); + void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, unsigned long v); + inline void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, uint8_t v) { serial_echopair_PGM_P(p, s_P, (int)v); } + inline void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, bool v) { serial_echopair_PGM_P(p, s_P, (int)v); } + inline void serial_echopair_PGM_P(const int8_t p, PGM_P const s_P, void *v) { serial_echopair_PGM_P(p, s_P, (unsigned long)v); } void serial_spaces_P(const int8_t p, uint8_t count); - #define SERIAL_ECHO_SP_P(p,C) serial_spaces_P(p,C) - #define SERIAL_ERROR_SP_P(p,C) serial_spaces_P(p,C) - #define SERIAL_PROTOCOL_SP_P(p,C) serial_spaces_P(p,C) + #define SERIAL_ECHO_SP_P(p,C) serial_spaces_P(p,C) void serialprintPGM_P(const int8_t p, PGM_P str); void serial_echo_start_P(const int8_t p); void serial_error_start_P(const int8_t p); -#else // NUM_SERIAL < 2 +#else // NUM_SERIAL <= 1 - #define SERIAL_CHAR_P(p,x) SERIAL_CHAR(x) - #define SERIAL_PROTOCOL_P(p,x) SERIAL_PROTOCOL(x) - #define SERIAL_PROTOCOL_F_P(p,x,y) SERIAL_PROTOCOL_F(x,y) - #define SERIAL_PROTOCOLLN_P(p,x) SERIAL_PROTOCOLLN(x) - #define SERIAL_PRINT_P(p,x,b) SERIAL_PRINT(x,b) - #define SERIAL_PRINTLN_P(p,x,b) SERIAL_PRINTLN(x,b) - #define SERIAL_PRINTF_P(p,args...) SERIAL_PRINTF(args) - - #define SERIAL_CHAR(x) MYSERIAL0.write(x) - #define SERIAL_PROTOCOL(x) MYSERIAL0.print(x) - #define SERIAL_PROTOCOL_F(x,y) MYSERIAL0.print(x,y) - #define SERIAL_PROTOCOLLN(x) MYSERIAL0.println(x) - #define SERIAL_PRINT(x,b) MYSERIAL0.print(x,b) - #define SERIAL_PRINTLN(x,b) MYSERIAL0.println(x,b) - #define SERIAL_PRINTF(args...) MYSERIAL0.printf(args) - - #define SERIAL_FLUSH_P(p) SERIAL_FLUSH() - #define SERIAL_FLUSH() MYSERIAL0.flush() + // + // Serial out to all ports + // + #define SERIAL_CHAR(x) MYSERIAL0.write(x) + #define SERIAL_ECHO(x) MYSERIAL0.print(x) + #define SERIAL_ECHO_F(x,y) MYSERIAL0.print(x,y) + #define SERIAL_ECHOLN(x) MYSERIAL0.println(x) + #define SERIAL_PRINT(x,b) MYSERIAL0.print(x,b) + #define SERIAL_PRINTLN(x,b) MYSERIAL0.println(x,b) + #define SERIAL_PRINTF(args...) MYSERIAL0.printf(args) + #define SERIAL_FLUSH() MYSERIAL0.flush() #if TX_BUFFER_SIZE > 0 - #define SERIAL_FLUSHTX_P(p) SERIAL_FLUSHTX() - #define SERIAL_FLUSHTX() MYSERIAL0.flushTX() + #define SERIAL_FLUSHTX() MYSERIAL0.flushTX() #endif - #define SERIAL_EOL_P(p) SERIAL_EOL() + // + // Serial out with port redirect + // + #define SERIAL_CHAR_P(p,x) SERIAL_CHAR(x) + #define SERIAL_ECHO_P(p,x) SERIAL_ECHO(x) + #define SERIAL_ECHO_F_P(p,x,y) SERIAL_ECHO_F(x,y) + #define SERIAL_ECHOLN_P(p,x) SERIAL_ECHOLN(x) + #define SERIAL_PRINT_P(p,x,b) SERIAL_PRINT(x,b) + #define SERIAL_PRINTLN_P(p,x,b) SERIAL_PRINTLN(x,b) + #define SERIAL_PRINTF_P(p,args...) SERIAL_PRINTF(args) + #define SERIAL_FLUSH_P(p) SERIAL_FLUSH() + #if TX_BUFFER_SIZE > 0 + #define SERIAL_FLUSHTX_P(p) SERIAL_FLUSHTX() + #endif - #define SERIAL_PROTOCOLCHAR_P(p,x) SERIAL_PROTOCOLCHAR(x) - #define SERIAL_PROTOCOLPGM_P(p,x) SERIAL_PROTOCOLPGM(x) - #define SERIAL_PROTOCOLLNPGM_P(p,x) SERIAL_PROTOCOLLNPGM(x) - #define SERIAL_PROTOCOLPAIR_P(p, pre, value) SERIAL_PROTOCOLPAIR(pre, value) - #define SERIAL_PROTOCOLLNPAIR_P(p, pre, value) SERIAL_PROTOCOLLNPAIR(pre, value) + #define SERIAL_ECHOPGM_P(p,x) SERIAL_ECHOPGM(x) + #define SERIAL_ECHOLNPGM_P(p,x) SERIAL_ECHOLNPGM(x) + #define SERIAL_ECHOPAIR_P(p, pre, value) SERIAL_ECHOPAIR(pre, value) - #define SERIAL_ECHO_START_P(p) SERIAL_ECHO_START() - #define SERIAL_ECHO_P(p,x) SERIAL_ECHO(x) - #define SERIAL_ECHOPGM_P(p,x) SERIAL_ECHOPGM(x) - #define SERIAL_ECHOLN_P(p,x) SERIAL_ECHOLN(x) - #define SERIAL_ECHOLNPGM_P(p,x) SERIAL_ECHOLNPGM(x) - #define SERIAL_ECHOPAIR_P(p,pre,value) SERIAL_ECHOPAIR(pre, value) - #define SERIAL_ECHOLNPAIR_P(p,pre, value) SERIAL_ECHOLNPAIR(pre, value) - #define SERIAL_ECHO_F_P(p,x,y) SERIAL_ECHO_F(x,y) + #define SERIAL_ECHO_P(p,x) SERIAL_ECHO(x) + #define SERIAL_ECHOLN_P(p,x) SERIAL_ECHOLN(x) - #define SERIAL_ERROR_START_P(p) SERIAL_ERROR_START() - #define SERIAL_ERROR_P(p,x) SERIAL_ERROR(x) - #define SERIAL_ERRORPGM_P(p,x) SERIAL_ERRORPGM(x) - #define SERIAL_ERRORLN_P(p,x) SERIAL_ERRORLN(x) - #define SERIAL_ERRORLNPGM_P(p,x) SERIAL_ERRORLNPGM(x) + #define SERIAL_ECHO_START_P(p) SERIAL_ECHO_START() + #define SERIAL_ERROR_START_P(p) SERIAL_ERROR_START() + #define SERIAL_EOL_P(p) SERIAL_EOL() - // These macros compensate for float imprecision - #define SERIAL_PROTOCOLPAIR_F_P(p, pre, value) SERIAL_PROTOCOLPAIR_F(pre, value) - #define SERIAL_PROTOCOLLNPAIR_F_P(p, pre, value) SERIAL_PROTOCOLLNPAIR_F(pre, value) - #define SERIAL_ECHOPAIR_F_P(p,pre,value) SERIAL_ECHOPAIR_F(pre, value) - #define SERIAL_ECHOLNPAIR_F_P(p,pre, value) SERIAL_ECHOLNPAIR_F(pre, value) + #define SERIAL_ECHOPAIR_F_P(p, pre, value, y) SERIAL_ECHOPAIR_F(pre, value, y) + #define SERIAL_ECHOLNPAIR_F_P(p, pre, value, y) SERIAL_ECHOLNPAIR_F(pre, value, y) - #define serial_echopair_PGM_P(p,s_P,v) serial_echopair_PGM(s_P, v) + #define serial_echopair_PGM_P(p,s_P,v) serial_echopair_PGM(s_P, v) - #define serial_spaces_P(p,c) serial_spaces(c) - #define SERIAL_ECHO_SP_P(p,C) SERIAL_ECHO_SP(C) - #define SERIAL_ERROR_SP_P(p,C) SERIAL_ERROR_SP(C) - #define SERIAL_PROTOCOL_SP_P(p,C) SERIAL_PROTOCOL_SP(C) + #define serial_spaces_P(p,c) serial_spaces(c) + #define SERIAL_ECHO_SP_P(p,C) SERIAL_ECHO_SP(C) - #define serialprintPGM_P(p,s) serialprintPGM(s) + #define serialprintPGM_P(p,s) serialprintPGM(s) #endif // NUM_SERIAL < 2 -#define SERIAL_EOL() SERIAL_CHAR('\n') +#define SERIAL_ECHOPGM(x) (serialprintPGM(PSTR(x))) +#define SERIAL_ECHOLNPGM(x) (serialprintPGM(PSTR(x "\n"))) +#define SERIAL_ECHOPAIR(pre, value) (serial_echopair_PGM(PSTR(pre), value)) +#define SERIAL_ECHOLNPAIR(pre, value) do { SERIAL_ECHOPAIR(pre, value); SERIAL_EOL(); } while(0) -#define SERIAL_PROTOCOLCHAR(x) SERIAL_CHAR(x) -#define SERIAL_PROTOCOLPGM(x) (serialprintPGM(PSTR(x))) -#define SERIAL_PROTOCOLLNPGM(x) (serialprintPGM(PSTR(x "\n"))) -#define SERIAL_PROTOCOLPAIR(pre, value) (serial_echopair_PGM(PSTR(pre), value)) -#define SERIAL_PROTOCOLLNPAIR(pre, value) do { SERIAL_PROTOCOLPAIR(pre, value); SERIAL_EOL(); } while(0) +#define SERIAL_ECHOPAIR_F(pre, value, y) do{ SERIAL_ECHO(pre); SERIAL_ECHO_F(value, y); }while(0) +#define SERIAL_ECHOLNPAIR_F(pre, value, y) do{ SERIAL_ECHOPAIR_F(pre, value, y); SERIAL_EOL(); }while(0) -#define SERIAL_ECHO_START() serial_echo_start() -#define SERIAL_ECHO(x) SERIAL_PROTOCOL(x) -#define SERIAL_ECHOPGM(x) SERIAL_PROTOCOLPGM(x) -#define SERIAL_ECHOLN(x) SERIAL_PROTOCOLLN(x) -#define SERIAL_ECHOLNPGM(x) SERIAL_PROTOCOLLNPGM(x) -#define SERIAL_ECHOPAIR(pre,value) SERIAL_PROTOCOLPAIR(pre, value) -#define SERIAL_ECHOLNPAIR(pre, value) SERIAL_PROTOCOLLNPAIR(pre, value) -#define SERIAL_ECHO_F(x,y) SERIAL_PROTOCOL_F(x, y) +#define SERIAL_ECHO_START() serial_echo_start() +#define SERIAL_ERROR_START() serial_error_start() +#define SERIAL_EOL() SERIAL_CHAR('\n') -#define SERIAL_ERROR_START() serial_error_start() -#define SERIAL_ERROR(x) SERIAL_PROTOCOL(x) -#define SERIAL_ERRORPGM(x) SERIAL_PROTOCOLPGM(x) -#define SERIAL_ERRORLN(x) SERIAL_PROTOCOLLN(x) -#define SERIAL_ERRORLNPGM(x) SERIAL_PROTOCOLLNPGM(x) +#define SERIAL_ECHO_MSG(STR) do{ SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(STR); }while(0) +#define SERIAL_ECHO_MSG_P(p, STR) do{ SERIAL_ECHO_START_P(p); SERIAL_ECHOLNPGM_P(p, STR); }while(0) +#define SERIAL_ERROR_MSG(STR) do{ SERIAL_ERROR_START(); SERIAL_ECHOLNPGM(STR); }while(0) +#define SERIAL_ERROR_MSG_P(p, STR) do{ SERIAL_ERROR_START_P(p); SERIAL_ECHOLNPGM_P(p, STR); }while(0) -// These macros compensate for float imprecision -#define SERIAL_PROTOCOLPAIR_F(pre, value) SERIAL_PROTOCOLPAIR(pre, FIXFLOAT(value)) -#define SERIAL_PROTOCOLLNPAIR_F(pre, value) SERIAL_PROTOCOLLNPAIR(pre, FIXFLOAT(value)) -#define SERIAL_ECHOPAIR_F(pre,value) SERIAL_ECHOPAIR(pre, FIXFLOAT(value)) -#define SERIAL_ECHOLNPAIR_F(pre, value) SERIAL_ECHOLNPAIR(pre, FIXFLOAT(value)) - -void serial_echopair_PGM(PGM_P s_P, const char *v); -void serial_echopair_PGM(PGM_P s_P, char v); -void serial_echopair_PGM(PGM_P s_P, int v); -void serial_echopair_PGM(PGM_P s_P, long v); -void serial_echopair_PGM(PGM_P s_P, float v); -void serial_echopair_PGM(PGM_P s_P, double v); -void serial_echopair_PGM(PGM_P s_P, unsigned int v); -void serial_echopair_PGM(PGM_P s_P, unsigned long v); -FORCE_INLINE void serial_echopair_PGM(PGM_P s_P, uint8_t v) { serial_echopair_PGM(s_P, (int)v); } -FORCE_INLINE void serial_echopair_PGM(PGM_P s_P, bool v) { serial_echopair_PGM(s_P, (int)v); } -FORCE_INLINE void serial_echopair_PGM(PGM_P s_P, void *v) { serial_echopair_PGM(s_P, (unsigned long)v); } +#define SERIAL_ECHOLNPAIR_P(p, pre, value) do{ SERIAL_ECHOPAIR_P(p, pre, value); SERIAL_EOL_P(p); }while(0) void serial_spaces(uint8_t count); -#define SERIAL_ECHO_SP(C) serial_spaces(C) -#define SERIAL_ERROR_SP(C) serial_spaces(C) -#define SERIAL_PROTOCOL_SP(C) serial_spaces(C) +#define SERIAL_ECHO_SP(C) serial_spaces(C) // // Functions for serial printing from PROGMEM. (Saves loads of SRAM.) // +void serial_echopair_PGM(PGM_P const s_P, const char *v); +void serial_echopair_PGM(PGM_P const s_P, char v); +void serial_echopair_PGM(PGM_P const s_P, int v); +void serial_echopair_PGM(PGM_P const s_P, long v); +void serial_echopair_PGM(PGM_P const s_P, float v); +void serial_echopair_PGM(PGM_P const s_P, double v); +void serial_echopair_PGM(PGM_P const s_P, unsigned int v); +void serial_echopair_PGM(PGM_P const s_P, unsigned long v); +inline void serial_echopair_PGM(PGM_P const s_P, uint8_t v) { serial_echopair_PGM(s_P, (int)v); } +inline void serial_echopair_PGM(PGM_P const s_P, bool v) { serial_echopair_PGM(s_P, (int)v); } +inline void serial_echopair_PGM(PGM_P const s_P, void *v) { serial_echopair_PGM(s_P, (unsigned long)v); } + void serialprintPGM(PGM_P str); void serial_echo_start(); void serial_error_start(); +void serialprint_onoff(const bool onoff); +void serialprintln_onoff(const bool onoff); #if ENABLED(DEBUG_LEVELING_FEATURE) - void print_xyz(PGM_P prefix, PGM_P suffix, const float x, const float y, const float z); - void print_xyz(PGM_P prefix, PGM_P suffix, const float xyz[]); + void print_xyz(PGM_P const prefix, PGM_P const suffix, const float x, const float y, const float z); + void print_xyz(PGM_P const prefix, PGM_P const suffix, const float xyz[]); #define DEBUG_POS(SUFFIX,VAR) do { print_xyz(PSTR(" " STRINGIFY(VAR) "="), PSTR(" : " SUFFIX "\n"), VAR); } while(0) #endif diff --git a/Marlin/src/core/utility.cpp b/Marlin/src/core/utility.cpp index e10d8f6a58..041c61b1ea 100644 --- a/Marlin/src/core/utility.cpp +++ b/Marlin/src/core/utility.cpp @@ -35,7 +35,7 @@ void safe_delay(millis_t ms) { thermalManager.manage_heater(); // This keeps us safe if too many small safe_delay() calls are made } -#if ENABLED(EEPROM_SETTINGS) +#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE) void crc16(uint16_t *crc, const void * const data, uint16_t cnt) { uint8_t *ptr = (uint8_t *)data; @@ -46,7 +46,7 @@ void safe_delay(millis_t ms) { } } -#endif // EEPROM_SETTINGS +#endif // EEPROM_SETTINGS || SD_FIRMWARE_UPDATE #if ENABLED(ULTRA_LCD) || ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(EXTENSIBLE_UI) @@ -296,30 +296,32 @@ void safe_delay(millis_t ms) { #if HAS_BED_PROBE SERIAL_ECHOPGM("Probe Offset X:" STRINGIFY(X_PROBE_OFFSET_FROM_EXTRUDER) " Y:" STRINGIFY(Y_PROBE_OFFSET_FROM_EXTRUDER)); SERIAL_ECHOPAIR(" Z:", zprobe_zoffset); - #if X_PROBE_OFFSET_FROM_EXTRUDER > 0 + if ((X_PROBE_OFFSET_FROM_EXTRUDER) > 0) SERIAL_ECHOPGM(" (Right"); - #elif X_PROBE_OFFSET_FROM_EXTRUDER < 0 + else if ((X_PROBE_OFFSET_FROM_EXTRUDER) < 0) SERIAL_ECHOPGM(" (Left"); - #elif Y_PROBE_OFFSET_FROM_EXTRUDER != 0 + else if ((Y_PROBE_OFFSET_FROM_EXTRUDER) != 0) SERIAL_ECHOPGM(" (Middle"); - #else + else SERIAL_ECHOPGM(" (Aligned With"); - #endif - #if Y_PROBE_OFFSET_FROM_EXTRUDER > 0 + + if ((Y_PROBE_OFFSET_FROM_EXTRUDER) > 0) { #if IS_SCARA SERIAL_ECHOPGM("-Distal"); #else SERIAL_ECHOPGM("-Back"); #endif - #elif Y_PROBE_OFFSET_FROM_EXTRUDER < 0 + } + else if ((Y_PROBE_OFFSET_FROM_EXTRUDER) < 0) { #if IS_SCARA SERIAL_ECHOPGM("-Proximal"); #else SERIAL_ECHOPGM("-Front"); #endif - #elif X_PROBE_OFFSET_FROM_EXTRUDER != 0 + } + else if ((X_PROBE_OFFSET_FROM_EXTRUDER) != 0) SERIAL_ECHOPGM("-Center"); - #endif + if (zprobe_zoffset < 0) SERIAL_ECHOPGM(" & Below"); else if (zprobe_zoffset > 0) diff --git a/Marlin/src/core/utility.h b/Marlin/src/core/utility.h index 8122c3b5ad..da3a065eaf 100644 --- a/Marlin/src/core/utility.h +++ b/Marlin/src/core/utility.h @@ -25,9 +25,19 @@ constexpr char axis_codes[XYZE] = { 'X', 'Y', 'Z', 'E' }; +// Delay that ensures heaters and watchdog are kept alive void safe_delay(millis_t ms); -#if ENABLED(EEPROM_SETTINGS) +// A delay to provide brittle hosts time to receive bytes +inline void serial_delay(const millis_t ms) { + #if ENABLED(SERIAL_OVERRUN_PROTECTION) + safe_delay(ms); + #else + UNUSED(ms); + #endif +} + +#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE) void crc16(uint16_t *crc, const void * const data, uint16_t cnt); #endif diff --git a/Marlin/src/feature/I2CPositionEncoder.cpp b/Marlin/src/feature/I2CPositionEncoder.cpp index b5ab7234eb..96e8284b1c 100644 --- a/Marlin/src/feature/I2CPositionEncoder.cpp +++ b/Marlin/src/feature/I2CPositionEncoder.cpp @@ -66,8 +66,7 @@ void I2CPositionEncoder::update() { /* if (trusted) { //commented out as part of the note below trusted = false; - SERIAL_ECHOPGM("Fault detected on "); - SERIAL_ECHO(axis_codes[encoderAxis]); + SERIAL_ECHOPAIR("Fault detected on ", axis_codes[encoderAxis]); SERIAL_ECHOLNPGM(" axis encoder. Disengaging error correction until module is trusted again."); } */ @@ -93,8 +92,7 @@ void I2CPositionEncoder::update() { if (millis() - lastErrorTime > I2CPE_TIME_TRUSTED) { trusted = true; - SERIAL_ECHOPGM("Untrusted encoder module on "); - SERIAL_ECHO(axis_codes[encoderAxis]); + SERIAL_ECHOPAIR("Untrusted encoder module on ", axis_codes[encoderAxis]); SERIAL_ECHOLNPGM(" axis has been fault-free for set duration, reinstating error correction."); //the encoder likely lost its place when the error occured, so we'll reset and use the printer's @@ -106,17 +104,10 @@ void I2CPositionEncoder::update() { zeroOffset -= (positionInTicks - get_position()); #ifdef I2CPE_DEBUG - SERIAL_ECHOPGM("Current position is "); - SERIAL_ECHOLN(pos); - - SERIAL_ECHOPGM("Position in encoder ticks is "); - SERIAL_ECHOLN(positionInTicks); - - SERIAL_ECHOPGM("New zero-offset of "); - SERIAL_ECHOLN(zeroOffset); - - SERIAL_ECHOPGM("New position reads as "); - SERIAL_ECHO(get_position()); + SERIAL_ECHOLNPAIR("Current position is ", pos); + SERIAL_ECHOLNPAIR("Position in encoder ticks is ", positionInTicks); + SERIAL_ECHOLNPAIR("New zero-offset of ", zeroOffset); + SERIAL_ECHOPAIR("New position reads as ", get_position()); SERIAL_CHAR('('); SERIAL_ECHO(mm_from_count(get_position())); SERIAL_ECHOLNPGM(")"); @@ -159,14 +150,12 @@ void I2CPositionEncoder::update() { const int32_t error = get_axis_error_steps(false); #endif - //SERIAL_ECHOPGM("Axis error steps: "); - //SERIAL_ECHOLN(error); + //SERIAL_ECHOLNPAIR("Axis error steps: ", error); #ifdef I2CPE_ERR_THRESH_ABORT if (ABS(error) > I2CPE_ERR_THRESH_ABORT * planner.settings.axis_steps_per_mm[encoderAxis]) { //kill(PSTR("Significant Error")); - SERIAL_ECHOPGM("Axis error greater than set threshold, aborting!"); - SERIAL_ECHOLN(error); + SERIAL_ECHOLNPAIR("Axis error greater than set threshold, aborting!", error); safe_delay(5000); } #endif @@ -800,33 +789,33 @@ int8_t I2CPositionEncodersMgr::parse() { if (parser.seen('A')) { if (!parser.has_value()) { - SERIAL_PROTOCOLLNPGM("?A seen, but no address specified! [30-200]"); + SERIAL_ECHOLNPGM("?A seen, but no address specified! [30-200]"); return I2CPE_PARSE_ERR; }; I2CPE_addr = parser.value_byte(); if (!WITHIN(I2CPE_addr, 30, 200)) { // reserve the first 30 and last 55 - SERIAL_PROTOCOLLNPGM("?Address out of range. [30-200]"); + SERIAL_ECHOLNPGM("?Address out of range. [30-200]"); return I2CPE_PARSE_ERR; } I2CPE_idx = idx_from_addr(I2CPE_addr); if (I2CPE_idx >= I2CPE_ENCODER_CNT) { - SERIAL_PROTOCOLLNPGM("?No device with this address!"); + SERIAL_ECHOLNPGM("?No device with this address!"); return I2CPE_PARSE_ERR; } } else if (parser.seenval('I')) { if (!parser.has_value()) { - SERIAL_PROTOCOLLNPAIR("?I seen, but no index specified! [0-", I2CPE_ENCODER_CNT - 1); - SERIAL_PROTOCOLLNPGM("]"); + SERIAL_ECHOLNPAIR("?I seen, but no index specified! [0-", I2CPE_ENCODER_CNT - 1); + SERIAL_ECHOLNPGM("]"); return I2CPE_PARSE_ERR; }; I2CPE_idx = parser.value_byte(); if (I2CPE_idx >= I2CPE_ENCODER_CNT) { - SERIAL_PROTOCOLLNPAIR("?Index out of range. [0-", I2CPE_ENCODER_CNT - 1); + SERIAL_ECHOLNPAIR("?Index out of range. [0-", I2CPE_ENCODER_CNT - 1); SERIAL_ECHOLNPGM("]"); return I2CPE_PARSE_ERR; } @@ -984,18 +973,18 @@ void I2CPositionEncodersMgr::M864() { if (parser.seen('S')) { if (!parser.has_value()) { - SERIAL_PROTOCOLLNPGM("?S seen, but no address specified! [30-200]"); + SERIAL_ECHOLNPGM("?S seen, but no address specified! [30-200]"); return; }; newAddress = parser.value_byte(); if (!WITHIN(newAddress, 30, 200)) { - SERIAL_PROTOCOLLNPGM("?New address out of range. [30-200]"); + SERIAL_ECHOLNPGM("?New address out of range. [30-200]"); return; } } else if (!I2CPE_anyaxis) { - SERIAL_PROTOCOLLNPGM("?You must specify S or [XYZE]."); + SERIAL_ECHOLNPGM("?You must specify S or [XYZE]."); return; } else { diff --git a/Marlin/src/feature/I2CPositionEncoder.h b/Marlin/src/feature/I2CPositionEncoder.h index 32895e62ce..a3c3225d4f 100644 --- a/Marlin/src/feature/I2CPositionEncoder.h +++ b/Marlin/src/feature/I2CPositionEncoder.h @@ -288,7 +288,7 @@ class I2CPositionEncodersMgr { CHECK_IDX(); encoders[idx].set_ec_threshold(newThreshold); SERIAL_ECHOPAIR("Error correct threshold for ", axis_codes[axis]); - SERIAL_ECHOPAIR_F(" axis set to ", newThreshold); + SERIAL_ECHOPAIR(" axis set to ", FIXFLOAT(newThreshold)); SERIAL_ECHOLNPGM("mm."); } @@ -296,7 +296,7 @@ class I2CPositionEncodersMgr { CHECK_IDX(); const float threshold = encoders[idx].get_ec_threshold(); SERIAL_ECHOPAIR("Error correct threshold for ", axis_codes[axis]); - SERIAL_ECHOPAIR_F(" axis is ", threshold); + SERIAL_ECHOPAIR(" axis is ", FIXFLOAT(threshold)); SERIAL_ECHOLNPGM("mm."); } diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index 737a971fb0..f91f134ad0 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -160,50 +160,50 @@ void reset_bed_level() { #ifndef SCAD_MESH_OUTPUT for (uint8_t x = 0; x < sx; x++) { serial_spaces(precision + (x < 10 ? 3 : 2)); - SERIAL_PROTOCOL(int(x)); + SERIAL_ECHO(int(x)); } SERIAL_EOL(); #endif #ifdef SCAD_MESH_OUTPUT - SERIAL_PROTOCOLLNPGM("measured_z = ["); // open 2D array + SERIAL_ECHOLNPGM("measured_z = ["); // open 2D array #endif for (uint8_t y = 0; y < sy; y++) { #ifdef SCAD_MESH_OUTPUT - SERIAL_PROTOCOLPGM(" ["); // open sub-array + SERIAL_ECHOPGM(" ["); // open sub-array #else - if (y < 10) SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOL(int(y)); + if (y < 10) SERIAL_CHAR(' '); + SERIAL_ECHO(int(y)); #endif for (uint8_t x = 0; x < sx; x++) { - SERIAL_PROTOCOLCHAR(' '); + SERIAL_CHAR(' '); const float offset = fn(x, y); if (!isnan(offset)) { - if (offset >= 0) SERIAL_PROTOCOLCHAR('+'); - SERIAL_PROTOCOL_F(offset, int(precision)); + if (offset >= 0) SERIAL_CHAR('+'); + SERIAL_ECHO_F(offset, int(precision)); } else { #ifdef SCAD_MESH_OUTPUT for (uint8_t i = 3; i < precision + 3; i++) - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOLPGM("NAN"); + SERIAL_CHAR(' '); + SERIAL_ECHOPGM("NAN"); #else for (uint8_t i = 0; i < precision + 3; i++) - SERIAL_PROTOCOLCHAR(i ? '=' : ' '); + SERIAL_CHAR(i ? '=' : ' '); #endif } #ifdef SCAD_MESH_OUTPUT - if (x < sx - 1) SERIAL_PROTOCOLCHAR(','); + if (x < sx - 1) SERIAL_CHAR(','); #endif } #ifdef SCAD_MESH_OUTPUT - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOLCHAR(']'); // close sub-array - if (y < sy - 1) SERIAL_PROTOCOLCHAR(','); + SERIAL_CHAR(' '); + SERIAL_CHAR(']'); // close sub-array + if (y < sy - 1) SERIAL_CHAR(','); #endif SERIAL_EOL(); } #ifdef SCAD_MESH_OUTPUT - SERIAL_PROTOCOLPGM("];"); // close 2D array + SERIAL_ECHOPGM("];"); // close 2D array #endif SERIAL_EOL(); } @@ -233,7 +233,7 @@ void reset_bed_level() { current_position[Y_AXIS] = ry; #if ENABLED(LCD_BED_LEVELING) - lcd_wait_for_move = false; + ui.wait_for_bl_move = false; #endif } diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp index 36812b6355..2591c9e285 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp @@ -119,9 +119,8 @@ #endif // IS_CARTESIAN && !SEGMENT_LEVELED_MOVES void mesh_bed_leveling::report_mesh() { - SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(GRID_MAX_POINTS_X) "," STRINGIFY(GRID_MAX_POINTS_Y)); - SERIAL_PROTOCOLPGM("Z offset: "); SERIAL_PROTOCOL_F(z_offset, 5); - SERIAL_PROTOCOLLNPGM("\nMeasured points:"); + SERIAL_ECHOPAIR_F(STRINGIFY(GRID_MAX_POINTS_X) "x" STRINGIFY(GRID_MAX_POINTS_Y) " mesh. Z offset: ", z_offset, 5); + SERIAL_ECHOLNPGM("\nMeasured points:"); print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 5, [](const uint8_t ix, const uint8_t iy) { return z_values[ix][iy]; } ); diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.cpp b/Marlin/src/feature/bedlevel/ubl/ubl.cpp index bc5088f209..e2e281aa50 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl.cpp @@ -34,14 +34,12 @@ #include "math.h" - uint8_t ubl_cnt = 0; - void unified_bed_leveling::echo_name( #if NUM_SERIAL > 1 const int8_t port/*= -1*/ #endif ) { - SERIAL_PROTOCOLPGM_P(port, "Unified Bed Leveling"); + SERIAL_ECHOPGM_P(port, "Unified Bed Leveling"); } void unified_bed_leveling::report_current_mesh( @@ -50,18 +48,16 @@ #endif ) { if (!leveling_is_valid()) return; - SERIAL_ECHO_START_P(port); - SERIAL_ECHOLNPGM_P(port, " G29 I99"); + SERIAL_ECHO_MSG_P(port, " G29 I99"); for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) if (!isnan(z_values[x][y])) { SERIAL_ECHO_START_P(port); SERIAL_ECHOPAIR_P(port, " M421 I", x); SERIAL_ECHOPAIR_P(port, " J", y); - SERIAL_ECHOPGM_P(port, " Z"); - SERIAL_ECHO_F_P(port, z_values[x][y], 2); + SERIAL_ECHOPAIR_F_P(port, " Z", z_values[x][y], 2); SERIAL_EOL_P(port); - safe_delay(75); // Prevent Printrun from exploding + serial_delay(75); // Prevent Printrun from exploding } } @@ -75,10 +71,10 @@ port #endif ); - SERIAL_PROTOCOLPGM_P(port, " System v" UBL_VERSION " "); - if (!planner.leveling_active) SERIAL_PROTOCOLPGM_P(port, "in"); - SERIAL_PROTOCOLLNPGM_P(port, "active."); - safe_delay(50); + SERIAL_ECHOPGM_P(port, " System v" UBL_VERSION " "); + if (!planner.leveling_active) SERIAL_ECHOPGM_P(port, "in"); + SERIAL_ECHOLNPGM_P(port, "active."); + serial_delay(50); } #if ENABLED(UBL_DEVEL_DEBUGGING) @@ -106,30 +102,19 @@ if (xy_dist == 0.0) return; - SERIAL_ECHOPGM(" fpmm="); const float fpmm = de / xy_dist; - SERIAL_ECHO_F(fpmm, 6); - - SERIAL_ECHOPGM(" current=( "); - SERIAL_ECHO_F(current_position[X_AXIS], 6); - SERIAL_ECHOPGM(", "); - SERIAL_ECHO_F(current_position[Y_AXIS], 6); - SERIAL_ECHOPGM(", "); - SERIAL_ECHO_F(current_position[Z_AXIS], 6); - SERIAL_ECHOPGM(", "); - SERIAL_ECHO_F(current_position[E_AXIS], 6); - SERIAL_ECHOPGM(" ) destination=( "); - debug_echo_axis(X_AXIS); - SERIAL_ECHOPGM(", "); - debug_echo_axis(Y_AXIS); - SERIAL_ECHOPGM(", "); - debug_echo_axis(Z_AXIS); - SERIAL_ECHOPGM(", "); - debug_echo_axis(E_AXIS); + SERIAL_ECHOPAIR_F(" fpmm=", fpmm, 6); + SERIAL_ECHOPAIR_F(" current=( ", current_position[X_AXIS], 6); + SERIAL_ECHOPAIR_F(", ", current_position[Y_AXIS], 6); + SERIAL_ECHOPAIR_F(", ", current_position[Z_AXIS], 6); + SERIAL_ECHOPAIR_F(", ", current_position[E_AXIS], 6); + SERIAL_ECHOPGM(" ) destination=( "); debug_echo_axis(X_AXIS); + SERIAL_ECHOPGM(", "); debug_echo_axis(Y_AXIS); + SERIAL_ECHOPGM(", "); debug_echo_axis(Z_AXIS); + SERIAL_ECHOPGM(", "); debug_echo_axis(E_AXIS); SERIAL_ECHOPGM(" ) "); serialprintPGM(title); SERIAL_EOL(); - } #endif // UBL_DEVEL_DEBUGGING @@ -150,7 +135,6 @@ volatile int unified_bed_leveling::encoder_diff; unified_bed_leveling::unified_bed_leveling() { - ubl_cnt++; // Debug counter to ensure we only have one UBL object present in memory. We can eliminate this (and all references to ubl_cnt) very soon. reset(); } @@ -187,7 +171,7 @@ if (y < 100) { SERIAL_CHAR(' '); if (y < 10) SERIAL_CHAR(' '); } SERIAL_ECHO(y); SERIAL_CHAR(')'); - safe_delay(5); + serial_delay(5); } static void serial_echo_column_labels(const uint8_t sp) { @@ -197,7 +181,7 @@ SERIAL_ECHO(i); SERIAL_ECHO_SP(sp); } - safe_delay(10); + serial_delay(10); } /** @@ -293,7 +277,7 @@ uint8_t error_flag = 0; if (settings.calc_num_meshes() < 1) { - SERIAL_PROTOCOLLNPGM("?Mesh too big for EEPROM."); + SERIAL_ECHOLNPGM("?Mesh too big for EEPROM."); error_flag++; } diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index 805469b8d4..e3b8fab280 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -26,6 +26,7 @@ #include "../bedlevel.h" #include "../../../module/planner.h" #include "../../../module/motion.h" +#include "../../../lcd/ultralcd.h" #include "../../../Marlin.h" #define UBL_VERSION "1.01" @@ -49,14 +50,6 @@ enum MeshPointType : char { INVALID, REAL, SET_IN_BITMAP }; // External references -extern uint8_t ubl_cnt; - -/////////////////////////////////////////////////////////////////////////////////////////////////////// - -#if ENABLED(ULTRA_LCD) - void lcd_quick_feedback(const bool clear_buttons); -#endif - #define MESH_X_DIST (float(MESH_MAX_X - (MESH_MIN_X)) / float(GRID_MAX_POINTS_X - 1)) #define MESH_Y_DIST (float(MESH_MAX_Y - (MESH_MIN_Y)) / float(GRID_MAX_POINTS_Y - 1)) @@ -90,12 +83,15 @@ class unified_bed_leveling { static void probe_entire_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) _O0; static void tilt_mesh_based_on_3pts(const float &z1, const float &z2, const float &z3); static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map); - static void g29_what_command(); - static void g29_eeprom_dump(); - static void g29_compare_current_mesh_to_stored_mesh(); static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir); static void smart_fill_mesh(); + #if ENABLED(UBL_DEVEL_DEBUGGING) + static void g29_what_command(); + static void g29_eeprom_dump(); + static void g29_compare_current_mesh_to_stored_mesh(); + #endif + public: static void echo_name( @@ -312,19 +308,13 @@ class unified_bed_leveling { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(MESH_ADJUST)) { SERIAL_ECHOPAIR(" raw get_z_correction(", rx0); - SERIAL_CHAR(','); - SERIAL_ECHO(ry0); - SERIAL_ECHOPGM(") = "); - SERIAL_ECHO_F(z0, 6); + SERIAL_CHAR(','); SERIAL_ECHO(ry0); + SERIAL_ECHOPAIR_F(") = ", z0, 6); } #endif #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(MESH_ADJUST)) { - SERIAL_ECHOPGM(" >>>---> "); - SERIAL_ECHO_F(z0, 6); - SERIAL_EOL(); - } + if (DEBUGGING(MESH_ADJUST)) SERIAL_ECHOLNPAIR_F(" >>>---> ", z0, 6); #endif if (isnan(z0)) { // if part of the Mesh is undefined, it will show up as NAN @@ -346,11 +336,11 @@ class unified_bed_leveling { return z0; } - FORCE_INLINE static float mesh_index_to_xpos(const uint8_t i) { + static inline float mesh_index_to_xpos(const uint8_t i) { return i < GRID_MAX_POINTS_X ? pgm_read_float(&_mesh_index_to_xpos[i]) : MESH_MIN_X + i * (MESH_X_DIST); } - FORCE_INLINE static float mesh_index_to_ypos(const uint8_t i) { + static inline float mesh_index_to_ypos(const uint8_t i) { return i < GRID_MAX_POINTS_Y ? pgm_read_float(&_mesh_index_to_ypos[i]) : MESH_MIN_Y + i * (MESH_Y_DIST); } diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index a261581e5d..57f21124b2 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -53,7 +53,6 @@ extern float destination[XYZE], current_position[XYZE]; #if HAS_LCD_MENU - void lcd_return_to_status(); void _lcd_ubl_output_map_lcd(); #endif @@ -128,9 +127,6 @@ * J # Grid Perform a Grid Based Leveling of the current Mesh using a grid with n points on a side. * Not specifying a grid size will invoke the 3-Point leveling function. * - * K # Kompare Kompare current Mesh with stored Mesh # replacing current Mesh with the result. This - * command literally performs a diff between two Meshes. - * * L Load Load Mesh from the previously activated location in the EEPROM. * * L # Load Load Mesh from the specified location in the EEPROM. Set this location as activated @@ -266,12 +262,20 @@ * * V # Verbosity Set the verbosity level (0-4) for extra details. (Default 0) * - * W What? Display valuable Unified Bed Leveling System data. - * * X # X Location for this command * * Y # Y Location for this command * + * With UBL_DEVEL_DEBUGGING: + * + * K # Kompare Kompare current Mesh with stored Mesh #, replacing current Mesh with the result. + * This command literally performs a diff between two Meshes. + * + * Q-1 Dump EEPROM Dump the UBL contents stored in EEPROM as HEX format. Useful for developers to help + * verify correct operation of the UBL. + * + * W What? Display valuable UBL data. + * * * Release Notes: * You MUST do M502, M500 to initialize the storage. Failure to do this will cause all @@ -327,27 +331,31 @@ // meant to invalidate the ENTIRE mesh, which cannot be done with // find_closest_mesh_point loop which only returns REACHABLE points. set_all_mesh_points_to_value(NAN); - SERIAL_PROTOCOLLNPGM("Entire Mesh invalidated.\n"); + SERIAL_ECHOLNPGM("Entire Mesh invalidated.\n"); break; // No more invalid Mesh Points to populate } z_values[location.x_index][location.y_index] = NAN; cnt++; } } - SERIAL_PROTOCOLLNPGM("Locations invalidated.\n"); + SERIAL_ECHOLNPGM("Locations invalidated.\n"); } if (parser.seen('Q')) { const int test_pattern = parser.has_value() ? parser.value_int() : -99; if (!WITHIN(test_pattern, -1, 2)) { - SERIAL_PROTOCOLLNPGM("Invalid test_pattern value. (-1 to 2)\n"); + SERIAL_ECHOLNPGM("Invalid test_pattern value. (-1 to 2)\n"); return; } - SERIAL_PROTOCOLLNPGM("Loading test_pattern values.\n"); + SERIAL_ECHOLNPGM("Loading test_pattern values.\n"); switch (test_pattern) { - case -1: - g29_eeprom_dump(); - break; + + #if ENABLED(UBL_DEVEL_DEBUGGING) + case -1: + g29_eeprom_dump(); + break; + #endif + case 0: for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a bowl shape - similar to for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { // a poorly calibrated Delta. @@ -357,12 +365,14 @@ } } break; + case 1: for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) { // Create a diagonal line several Mesh cells thick that is raised z_values[x][x] += 9.999f; z_values[x][x + (x < GRID_MAX_POINTS_Y - 1) ? 1 : -1] += 9.999f; // We want the altered line several mesh points thick } break; + case 2: // Allow the user to specify the height because 10mm is a little extreme in some cases. for (uint8_t x = (GRID_MAX_POINTS_X) / 3; x < 2 * (GRID_MAX_POINTS_X) / 3; x++) // Create a rectangular raised area in @@ -395,7 +405,7 @@ if (parser.seen('P')) { if (WITHIN(g29_phase_value, 0, 1) && storage_slot == -1) { storage_slot = 0; - SERIAL_PROTOCOLLNPGM("Default storage slot 0 selected."); + SERIAL_ECHOLNPGM("Default storage slot 0 selected."); } switch (g29_phase_value) { @@ -404,7 +414,7 @@ // Zero Mesh Data // reset(); - SERIAL_PROTOCOLLNPGM("Mesh zeroed."); + SERIAL_ECHOLNPGM("Mesh zeroed."); break; #if HAS_BED_PROBE @@ -415,13 +425,13 @@ // if (!parser.seen('C')) { invalidate(); - SERIAL_PROTOCOLLNPGM("Mesh invalidated. Probing mesh."); + SERIAL_ECHOLNPGM("Mesh invalidated. Probing mesh."); } if (g29_verbose_level > 1) { - SERIAL_PROTOCOLPAIR("Probing Mesh Points Closest to (", g29_x_pos); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL(g29_y_pos); - SERIAL_PROTOCOLLNPGM(").\n"); + SERIAL_ECHOPAIR("Probing Mesh Points Closest to (", g29_x_pos); + SERIAL_CHAR(','); + SERIAL_ECHO(g29_y_pos); + SERIAL_ECHOLNPGM(").\n"); } probe_entire_mesh(g29_x_pos + X_PROBE_OFFSET_FROM_EXTRUDER, g29_y_pos + Y_PROBE_OFFSET_FROM_EXTRUDER, parser.seen('T'), parser.seen('E'), parser.seen('U')); @@ -436,7 +446,7 @@ // // Manually Probe Mesh in areas that can't be reached by the probe // - SERIAL_PROTOCOLLNPGM("Manually probing unreachable mesh locations."); + SERIAL_ECHOLNPGM("Manually probing unreachable mesh locations."); do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); if (parser.seen('C') && !g29_x_flag && !g29_y_flag) { @@ -459,26 +469,26 @@ if (parser.seen('B')) { g29_card_thickness = parser.has_value() ? parser.value_float() : measure_business_card_thickness((float) Z_CLEARANCE_BETWEEN_PROBES); if (ABS(g29_card_thickness) > 1.5f) { - SERIAL_PROTOCOLLNPGM("?Error in Business Card measurement."); + SERIAL_ECHOLNPGM("?Error in Business Card measurement."); return; } } if (!position_is_reachable(g29_x_pos, g29_y_pos)) { - SERIAL_PROTOCOLLNPGM("XY outside printable radius."); + SERIAL_ECHOLNPGM("XY outside printable radius."); return; } const float height = parser.floatval('H', Z_CLEARANCE_BETWEEN_PROBES); manually_probe_remaining_mesh(g29_x_pos, g29_y_pos, height, g29_card_thickness, parser.seen('T')); - SERIAL_PROTOCOLLNPGM("G29 P2 finished."); + SERIAL_ECHOLNPGM("G29 P2 finished."); report_current_position(); #else - SERIAL_PROTOCOLLNPGM("?P2 is only available when an LCD is present."); + SERIAL_ECHOLNPGM("?P2 is only available when an LCD is present."); return; #endif @@ -543,7 +553,7 @@ #if HAS_LCD_MENU fine_tune_mesh(g29_x_pos, g29_y_pos, parser.seen('T')); #else - SERIAL_PROTOCOLLNPGM("?P4 is only available when an LCD is present."); + SERIAL_ECHOLNPGM("?P4 is only available when an LCD is present."); return; #endif break; @@ -554,19 +564,24 @@ } } - // - // Much of the 'What?' command can be eliminated. But until we are fully debugged, it is - // good to have the extra information. Soon... we prune this to just a few items - // - if (parser.seen('W')) g29_what_command(); + #if ENABLED(UBL_DEVEL_DEBUGGING) - // - // When we are fully debugged, this may go away. But there are some valid - // use cases for the users. So we can wait and see what to do with it. - // + // + // Much of the 'What?' command can be eliminated. But until we are fully debugged, it is + // good to have the extra information. Soon... we prune this to just a few items + // + if (parser.seen('W')) g29_what_command(); + + // + // When we are fully debugged, this may go away. But there are some valid + // use cases for the users. So we can wait and see what to do with it. + // + + if (parser.seen('K')) // Kompare Current Mesh Data to Specified Stored Mesh + g29_compare_current_mesh_to_stored_mesh(); + + #endif // UBL_DEVEL_DEBUGGING - if (parser.seen('K')) // Kompare Current Mesh Data to Specified Stored Mesh - g29_compare_current_mesh_to_stored_mesh(); // // Load a Mesh from the EEPROM @@ -578,20 +593,20 @@ int16_t a = settings.calc_num_meshes(); if (!a) { - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); + SERIAL_ECHOLNPGM("?EEPROM storage not available."); return; } if (!WITHIN(g29_storage_slot, 0, a - 1)) { - SERIAL_PROTOCOLLNPGM("?Invalid storage slot."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); + SERIAL_ECHOLNPGM("?Invalid storage slot."); + SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1); return; } settings.load_mesh(g29_storage_slot); storage_slot = g29_storage_slot; - SERIAL_PROTOCOLLNPGM("Done."); + SERIAL_ECHOLNPGM("Done."); } // @@ -607,20 +622,20 @@ int16_t a = settings.calc_num_meshes(); if (!a) { - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); + SERIAL_ECHOLNPGM("?EEPROM storage not available."); goto LEAVE; } if (!WITHIN(g29_storage_slot, 0, a - 1)) { - SERIAL_PROTOCOLLNPGM("?Invalid storage slot."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); + SERIAL_ECHOLNPGM("?Invalid storage slot."); + SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1); goto LEAVE; } settings.store_mesh(g29_storage_slot); storage_slot = g29_storage_slot; - SERIAL_PROTOCOLLNPGM("Done."); + SERIAL_ECHOLNPGM("Done."); } if (parser.seen('T')) @@ -629,10 +644,10 @@ LEAVE: #if HAS_LCD_MENU - lcd_reset_alert_level(); - lcd_quick_feedback(true); - lcd_reset_status(); - lcd_external_control = false; + ui.reset_alert_level(); + ui.quick_feedback(); + ui.reset_status(); + ui.release(); #endif return; @@ -660,14 +675,10 @@ sum_of_diff_squared += sq(z_values[x][y] - mean); SERIAL_ECHOLNPAIR("# of samples: ", n); - SERIAL_ECHOPGM("Mean Mesh Height: "); - SERIAL_ECHO_F(mean, 6); - SERIAL_EOL(); + SERIAL_ECHOLNPAIR_F("Mean Mesh Height: ", mean, 6); const float sigma = SQRT(sum_of_diff_squared / (n + 1)); - SERIAL_ECHOPGM("Standard Deviation: "); - SERIAL_ECHO_F(sigma, 6); - SERIAL_EOL(); + SERIAL_ECHOLNPAIR_F("Standard Deviation: ", sigma, 6); if (cflag) for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) @@ -683,32 +694,6 @@ z_values[x][y] += g29_constant; } - #if HAS_LCD_MENU - - typedef void (*clickFunc_t)(); - - bool click_and_hold(const clickFunc_t func=NULL) { - if (is_lcd_clicked()) { - lcd_quick_feedback(false); // Do NOT clear button status! If cleared, the code - // code can not look for a 'click and hold' - const millis_t nxt = millis() + 1500UL; - while (is_lcd_clicked()) { // Loop while the encoder is pressed. Uses hardware flag! - idle(); // idle, of course - if (ELAPSED(millis(), nxt)) { // After 1.5 seconds - lcd_quick_feedback(true); - if (func) (*func)(); - wait_for_release(); - safe_delay(50); // Debounce the Encoder wheel - return true; - } - } - } - safe_delay(15); - return false; - } - - #endif // HAS_LCD_MENU - #if HAS_BED_PROBE /** * Probe all invalidated locations of the mesh that can be reached by the probe. @@ -718,10 +703,10 @@ mesh_index_pair location; #if HAS_LCD_MENU - lcd_external_control = true; + ui.capture(); #endif - save_ubl_active_state_and_disable(); // we don't do bed level correction because we want the raw data when we probe + save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained DEPLOY_PROBE(); uint16_t count = GRID_MAX_POINTS; @@ -730,15 +715,14 @@ if (do_ubl_mesh_map) display_map(g29_map_type); #if HAS_LCD_MENU - if (is_lcd_clicked()) { - SERIAL_PROTOCOLLNPGM("\nMesh only partially populated.\n"); - lcd_quick_feedback(false); + if (ui.button_pressed()) { + ui.quick_feedback(false); // Preserve button state for click-and-hold + SERIAL_ECHOLNPGM("\nMesh only partially populated.\n"); STOW_PROBE(); - while (is_lcd_clicked()) idle(); - lcd_external_control = false; + ui.wait_for_release(); + ui.quick_feedback(); + ui.release(); restore_ubl_active_state_and_leave(); - lcd_quick_feedback(true); - safe_delay(50); // Debounce the Encoder wheel return; } #endif @@ -772,14 +756,33 @@ ); } - #endif // HAS_BED_PROBE #if HAS_LCD_MENU + typedef void (*clickFunc_t)(); + + bool click_and_hold(const clickFunc_t func=NULL) { + if (ui.button_pressed()) { + ui.quick_feedback(false); // Preserve button state for click-and-hold + const millis_t nxt = millis() + 1500UL; + while (ui.button_pressed()) { // Loop while the encoder is pressed. Uses hardware flag! + idle(); // idle, of course + if (ELAPSED(millis(), nxt)) { // After 1.5 seconds + ui.quick_feedback(); + if (func) (*func)(); + ui.wait_for_release(); + return true; + } + } + } + serial_delay(15); + return false; + } + void unified_bed_leveling::move_z_with_encoder(const float &multiplier) { - wait_for_release(); - while (!is_lcd_clicked()) { + ui.wait_for_release(); + while (!ui.button_pressed()) { idle(); gcode.reset_stepper_timeout(); // Keep steppers powered if (encoder_diff) { @@ -796,26 +799,26 @@ return current_position[Z_AXIS]; } - static void echo_and_take_a_measurement() { SERIAL_PROTOCOLLNPGM(" and take a measurement."); } + static void echo_and_take_a_measurement() { SERIAL_ECHOLNPGM(" and take a measurement."); } float unified_bed_leveling::measure_business_card_thickness(float in_height) { - lcd_external_control = true; + ui.capture(); save_ubl_active_state_and_disable(); // Disable bed level correction for probing do_blocking_move_to(0.5f * (MESH_MAX_X - (MESH_MIN_X)), 0.5f * (MESH_MAX_Y - (MESH_MIN_Y)), in_height); //, MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) * 0.5f); planner.synchronize(); - SERIAL_PROTOCOLPGM("Place shim under nozzle"); + SERIAL_ECHOPGM("Place shim under nozzle"); LCD_MESSAGEPGM(MSG_UBL_BC_INSERT); - lcd_return_to_status(); + ui.return_to_status(); echo_and_take_a_measurement(); const float z1 = measure_point_with_encoder(); do_blocking_move_to_z(current_position[Z_AXIS] + SIZE_OF_LITTLE_RAISE); planner.synchronize(); - SERIAL_PROTOCOLPGM("Remove shim"); + SERIAL_ECHOPGM("Remove shim"); LCD_MESSAGEPGM(MSG_UBL_BC_REMOVE); echo_and_take_a_measurement(); @@ -826,12 +829,11 @@ const float thickness = ABS(z1 - z2); if (g29_verbose_level > 1) { - SERIAL_PROTOCOLPGM("Business Card is "); - SERIAL_PROTOCOL_F(thickness, 4); - SERIAL_PROTOCOLLNPGM("mm thick."); + SERIAL_ECHOPAIR_F("Business Card is ", thickness, 4); + SERIAL_ECHOLNPGM("mm thick."); } - lcd_external_control = false; + ui.release(); restore_ubl_active_state_and_leave(); @@ -839,22 +841,22 @@ } void abort_manual_probe_remaining_mesh() { - SERIAL_PROTOCOLLNPGM("\nMesh only partially populated."); + SERIAL_ECHOLNPGM("\nMesh only partially populated."); do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE); - lcd_external_control = false; + ui.release(); KEEPALIVE_STATE(IN_HANDLER); - lcd_quick_feedback(true); + ui.quick_feedback(); ubl.restore_ubl_active_state_and_leave(); } void unified_bed_leveling::manually_probe_remaining_mesh(const float &rx, const float &ry, const float &z_clearance, const float &thick, const bool do_ubl_mesh_map) { - lcd_external_control = true; + ui.capture(); - save_ubl_active_state_and_disable(); // we don't do bed level correction because we want the raw data when we probe + save_ubl_active_state_and_disable(); // No bed level correction so only raw data is obtained do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_clearance); - lcd_return_to_status(); + ui.return_to_status(); mesh_index_pair location; do { @@ -873,7 +875,7 @@ do_blocking_move_to_z(z_clearance); KEEPALIVE_STATE(PAUSED_FOR_USER); - lcd_external_control = true; + ui.capture(); if (do_ubl_mesh_map) display_map(g29_map_type); // show user where we're probing @@ -885,20 +887,17 @@ move_z_with_encoder(z_step); if (click_and_hold()) { - SERIAL_PROTOCOLLNPGM("\nMesh only partially populated."); + SERIAL_ECHOLNPGM("\nMesh only partially populated."); do_blocking_move_to_z(Z_CLEARANCE_DEPLOY_PROBE); - lcd_external_control = false; + ui.release(); KEEPALIVE_STATE(IN_HANDLER); restore_ubl_active_state_and_leave(); return; } z_values[location.x_index][location.y_index] = current_position[Z_AXIS] - thick; - if (g29_verbose_level > 2) { - SERIAL_PROTOCOLPGM("Mesh Point Measured at: "); - SERIAL_PROTOCOL_F(z_values[location.x_index][location.y_index], 6); - SERIAL_EOL(); - } + if (g29_verbose_level > 2) + SERIAL_ECHOLNPAIR_F("Mesh Point Measured at: ", z_values[location.x_index][location.y_index], 6); SERIAL_FLUSH(); // Prevent host M105 buffer overrun. } while (location.x_index >= 0 && location.y_index >= 0); @@ -908,14 +907,127 @@ KEEPALIVE_STATE(IN_HANDLER); do_blocking_move_to(rx, ry, Z_CLEARANCE_DEPLOY_PROBE); } + + inline void set_message_with_feedback(PGM_P const msg_P) { + ui.set_status_P(msg_P); + ui.quick_feedback(); + } + + void abort_fine_tune() { + ui.return_to_status(); + do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); + set_message_with_feedback(PSTR(MSG_EDITING_STOPPED)); + } + + void unified_bed_leveling::fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map) { + if (!parser.seen('R')) // fine_tune_mesh() is special. If no repetition count flag is specified + g29_repetition_cnt = 1; // do exactly one mesh location. Otherwise use what the parser decided. + + #if ENABLED(UBL_MESH_EDIT_MOVES_Z) + const float h_offset = parser.seenval('H') ? parser.value_linear_units() : 0; + if (!WITHIN(h_offset, 0, 10)) { + SERIAL_ECHOLNPGM("Offset out of bounds. (0 to 10mm)\n"); + return; + } + #endif + + mesh_index_pair location; + + if (!position_is_reachable(rx, ry)) { + SERIAL_ECHOLNPGM("(X,Y) outside printable radius."); + return; + } + + save_ubl_active_state_and_disable(); + + LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH); + ui.capture(); // Take over control of the LCD encoder + + do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); // Move to the given XY with probe clearance + + #if ENABLED(UBL_MESH_EDIT_MOVES_Z) + do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset + #endif + + uint16_t not_done[16]; + memset(not_done, 0xFF, sizeof(not_done)); + do { + location = find_closest_mesh_point_of_type(SET_IN_BITMAP, rx, ry, USE_NOZZLE_AS_REFERENCE, not_done); + + if (location.x_index < 0) break; // Stop when there are no more reachable points + + bitmap_clear(not_done, location.x_index, location.y_index); // Mark this location as 'adjusted' so a new + // location is used on the next loop + + const float rawx = mesh_index_to_xpos(location.x_index), + rawy = mesh_index_to_ypos(location.y_index); + + if (!position_is_reachable(rawx, rawy)) break; // SHOULD NOT OCCUR because find_closest_mesh_point_of_type will only return reachable + + do_blocking_move_to(rawx, rawy, Z_CLEARANCE_BETWEEN_PROBES); // Move the nozzle to the edit point with probe clearance + + #if ENABLED(UBL_MESH_EDIT_MOVES_Z) + do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset before editing + #endif + + KEEPALIVE_STATE(PAUSED_FOR_USER); + + if (do_ubl_mesh_map) display_map(g29_map_type); // Display the current point + + ui.refresh(); + + float new_z = z_values[location.x_index][location.y_index]; + if (isnan(new_z)) new_z = 0; // Invalid points begin at 0 + new_z = FLOOR(new_z * 1000) * 0.001f; // Chop off digits after the 1000ths place + + lcd_mesh_edit_setup(new_z); + + do { + new_z = lcd_mesh_edit(); + #if ENABLED(UBL_MESH_EDIT_MOVES_Z) + do_blocking_move_to_z(h_offset + new_z); // Move the nozzle as the point is edited + #endif + idle(); + SERIAL_FLUSH(); // Prevent host M105 buffer overrun. + } while (!ui.button_pressed()); + + if (!lcd_map_control) ui.return_to_status(); // Just editing a single point? Return to status + + if (click_and_hold(abort_fine_tune)) goto FINE_TUNE_EXIT; // If the click is held down, abort editing + + z_values[location.x_index][location.y_index] = new_z; // Save the updated Z value + + serial_delay(20); // No switch noise + ui.refresh(); + + } while (location.x_index >= 0 && --g29_repetition_cnt > 0); + + FINE_TUNE_EXIT: + + ui.release(); + KEEPALIVE_STATE(IN_HANDLER); + + if (do_ubl_mesh_map) display_map(g29_map_type); + restore_ubl_active_state_and_leave(); + + do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); + + LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH); + SERIAL_ECHOLNPGM("Done Editing Mesh"); + + if (lcd_map_control) + ui.goto_screen(_lcd_ubl_output_map_lcd); + else + ui.return_to_status(); + } + #endif // HAS_LCD_MENU bool unified_bed_leveling::g29_parameter_parsing() { bool err_flag = false; #if HAS_LCD_MENU - LCD_MESSAGEPGM(MSG_UBL_DOING_G29); - lcd_quick_feedback(true); + set_message_with_feedback(PSTR(MSG_UBL_DOING_G29)); #endif g29_constant = 0; @@ -930,14 +1042,14 @@ g29_repetition_cnt = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS; NOMORE(g29_repetition_cnt, GRID_MAX_POINTS); if (g29_repetition_cnt < 1) { - SERIAL_PROTOCOLLNPGM("?(R)epetition count invalid (1+).\n"); + SERIAL_ECHOLNPGM("?(R)epetition count invalid (1+).\n"); return UBL_ERR; } } g29_verbose_level = parser.seen('V') ? parser.value_int() : 0; if (!WITHIN(g29_verbose_level, 0, 4)) { - SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0-4).\n"); + SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0-4).\n"); err_flag = true; } @@ -945,7 +1057,7 @@ const int pv = parser.value_int(); #if !HAS_BED_PROBE if (pv == 1) { - SERIAL_PROTOCOLLNPGM("G29 P1 requires a probe.\n"); + SERIAL_ECHOLNPGM("G29 P1 requires a probe.\n"); err_flag = true; } else @@ -953,7 +1065,7 @@ { g29_phase_value = pv; if (!WITHIN(g29_phase_value, 0, 6)) { - SERIAL_PROTOCOLLNPGM("?(P)hase value invalid (0-6).\n"); + SERIAL_ECHOLNPGM("?(P)hase value invalid (0-6).\n"); err_flag = true; } } @@ -963,17 +1075,17 @@ #if HAS_BED_PROBE g29_grid_size = parser.has_value() ? parser.value_int() : 0; if (g29_grid_size && !WITHIN(g29_grid_size, 2, 9)) { - SERIAL_PROTOCOLLNPGM("?Invalid grid size (J) specified (2-9).\n"); + SERIAL_ECHOLNPGM("?Invalid grid size (J) specified (2-9).\n"); err_flag = true; } #else - SERIAL_PROTOCOLLNPGM("G29 J action requires a probe.\n"); + SERIAL_ECHOLNPGM("G29 J action requires a probe.\n"); err_flag = true; #endif } if (g29_x_flag != g29_y_flag) { - SERIAL_PROTOCOLLNPGM("Both X & Y locations must be specified.\n"); + SERIAL_ECHOLNPGM("Both X & Y locations must be specified.\n"); err_flag = true; } @@ -991,7 +1103,7 @@ */ if (parser.seen('A')) { if (parser.seen('D')) { - SERIAL_PROTOCOLLNPGM("?Can't activate and deactivate at the same time.\n"); + SERIAL_ECHOLNPGM("?Can't activate and deactivate at the same time.\n"); return UBL_ERR; } set_bed_leveling_enabled(true); @@ -1010,7 +1122,7 @@ if (parser.seenval('F')) { const float fh = parser.value_float(); if (!WITHIN(fh, 0, 100)) { - SERIAL_PROTOCOLLNPGM("?(F)ade height for Bed Level Correction not plausible.\n"); + SERIAL_ECHOLNPGM("?(F)ade height for Bed Level Correction not plausible.\n"); return UBL_ERR; } set_z_fade_height(fh); @@ -1019,7 +1131,7 @@ g29_map_type = parser.intval('T'); if (!WITHIN(g29_map_type, 0, 2)) { - SERIAL_PROTOCOLLNPGM("Invalid map type.\n"); + SERIAL_ECHOLNPGM("Invalid map type.\n"); return UBL_ERR; } return UBL_OK; @@ -1037,8 +1149,7 @@ if (ubl_state_recursion_chk != 1) { SERIAL_ECHOLNPGM("save_ubl_active_state_and_disabled() called multiple times in a row."); #if HAS_LCD_MENU - LCD_MESSAGEPGM(MSG_UBL_SAVE_ERROR); - lcd_quick_feedback(true); + set_message_with_feedback(PSTR(MSG_UBL_SAVE_ERROR)); #endif return; } @@ -1052,8 +1163,7 @@ if (--ubl_state_recursion_chk) { SERIAL_ECHOLNPGM("restore_ubl_active_state_and_leave() called too many times."); #if HAS_LCD_MENU - LCD_MESSAGEPGM(MSG_UBL_RESTORE_ERROR); - lcd_quick_feedback(true); + set_message_with_feedback(PSTR(MSG_UBL_RESTORE_ERROR)); #endif return; } @@ -1061,170 +1171,6 @@ set_bed_leveling_enabled(ubl_state_at_invocation); } - /** - * Much of the 'What?' command can be eliminated. But until we are fully debugged, it is - * good to have the extra information. Soon... we prune this to just a few items - */ - void unified_bed_leveling::g29_what_command() { - report_state(); - - if (storage_slot == -1) - SERIAL_PROTOCOLPGM("No Mesh Loaded."); - else { - SERIAL_PROTOCOLPAIR("Mesh ", storage_slot); - SERIAL_PROTOCOLPGM(" Loaded."); - } - SERIAL_EOL(); - safe_delay(50); - - SERIAL_PROTOCOLLNPAIR("UBL object count: ", (int)ubl_cnt); - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - SERIAL_PROTOCOLPGM("planner.z_fade_height : "); - SERIAL_PROTOCOL_F(planner.z_fade_height, 4); - SERIAL_EOL(); - #endif - - adjust_mesh_to_mean(g29_c_flag, g29_constant); - - #if HAS_BED_PROBE - SERIAL_PROTOCOLPGM("zprobe_zoffset: "); - SERIAL_PROTOCOL_F(zprobe_zoffset, 7); - SERIAL_EOL(); - #endif - - SERIAL_ECHOLNPAIR("MESH_MIN_X " STRINGIFY(MESH_MIN_X) "=", MESH_MIN_X); - safe_delay(50); - SERIAL_ECHOLNPAIR("MESH_MIN_Y " STRINGIFY(MESH_MIN_Y) "=", MESH_MIN_Y); - safe_delay(50); - SERIAL_ECHOLNPAIR("MESH_MAX_X " STRINGIFY(MESH_MAX_X) "=", MESH_MAX_X); - safe_delay(50); - SERIAL_ECHOLNPAIR("MESH_MAX_Y " STRINGIFY(MESH_MAX_Y) "=", MESH_MAX_Y); - safe_delay(50); - SERIAL_ECHOLNPAIR("GRID_MAX_POINTS_X ", GRID_MAX_POINTS_X); - safe_delay(50); - SERIAL_ECHOLNPAIR("GRID_MAX_POINTS_Y ", GRID_MAX_POINTS_Y); - safe_delay(50); - SERIAL_ECHOLNPAIR("MESH_X_DIST ", MESH_X_DIST); - SERIAL_ECHOLNPAIR("MESH_Y_DIST ", MESH_Y_DIST); - safe_delay(50); - - SERIAL_PROTOCOLPGM("X-Axis Mesh Points at: "); - for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { - SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(mesh_index_to_xpos(i)), 3); - SERIAL_PROTOCOLPGM(" "); - safe_delay(25); - } - SERIAL_EOL(); - - SERIAL_PROTOCOLPGM("Y-Axis Mesh Points at: "); - for (uint8_t i = 0; i < GRID_MAX_POINTS_Y; i++) { - SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(mesh_index_to_ypos(i)), 3); - SERIAL_PROTOCOLPGM(" "); - safe_delay(25); - } - SERIAL_EOL(); - - #if HAS_KILL - SERIAL_PROTOCOLPAIR("Kill pin on :", KILL_PIN); - SERIAL_PROTOCOLLNPAIR(" state:", READ(KILL_PIN)); - #endif - SERIAL_EOL(); - safe_delay(50); - - #if ENABLED(UBL_DEVEL_DEBUGGING) - SERIAL_PROTOCOLLNPAIR("ubl_state_at_invocation :", ubl_state_at_invocation); - SERIAL_EOL(); - SERIAL_PROTOCOLLNPAIR("ubl_state_recursion_chk :", ubl_state_recursion_chk); - SERIAL_EOL(); - safe_delay(50); - - SERIAL_PROTOCOLPAIR("Meshes go from ", hex_address((void*)settings.meshes_start_index())); - SERIAL_PROTOCOLLNPAIR(" to ", hex_address((void*)settings.meshes_end_index())); - safe_delay(50); - - SERIAL_PROTOCOLLNPAIR("sizeof(ubl) : ", (int)sizeof(ubl)); - SERIAL_EOL(); - SERIAL_PROTOCOLLNPAIR("z_value[][] size: ", (int)sizeof(z_values)); - SERIAL_EOL(); - safe_delay(25); - - SERIAL_PROTOCOLLNPAIR("EEPROM free for UBL: ", hex_address((void*)(settings.meshes_end_index() - settings.meshes_start_index()))); - safe_delay(50); - - SERIAL_PROTOCOLPAIR("EEPROM can hold ", settings.calc_num_meshes()); - SERIAL_PROTOCOLLNPGM(" meshes.\n"); - safe_delay(25); - #endif // UBL_DEVEL_DEBUGGING - - if (!sanity_check()) { - echo_name(); - SERIAL_PROTOCOLLNPGM(" sanity checks passed."); - } - } - - /** - * When we are fully debugged, the EEPROM dump command will get deleted also. But - * right now, it is good to have the extra information. Soon... we prune this. - */ - void unified_bed_leveling::g29_eeprom_dump() { - uint8_t cccc; - - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("EEPROM Dump:"); - persistentStore.access_start(); - for (uint16_t i = 0; i < persistentStore.capacity(); i += 16) { - if (!(i & 0x3)) idle(); - print_hex_word(i); - SERIAL_ECHOPGM(": "); - for (uint16_t j = 0; j < 16; j++) { - persistentStore.read_data(i + j, &cccc, sizeof(uint8_t)); - print_hex_byte(cccc); - SERIAL_ECHO(' '); - } - SERIAL_EOL(); - } - SERIAL_EOL(); - persistentStore.access_finish(); - } - - /** - * When we are fully debugged, this may go away. But there are some valid - * use cases for the users. So we can wait and see what to do with it. - */ - void unified_bed_leveling::g29_compare_current_mesh_to_stored_mesh() { - int16_t a = settings.calc_num_meshes(); - - if (!a) { - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); - return; - } - - if (!parser.has_value()) { - SERIAL_PROTOCOLLNPGM("?Storage slot # required."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); - return; - } - - g29_storage_slot = parser.value_int(); - - if (!WITHIN(g29_storage_slot, 0, a - 1)) { - SERIAL_PROTOCOLLNPGM("?Invalid storage slot."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); - return; - } - - float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; - settings.load_mesh(g29_storage_slot, &tmp_z_values); - - SERIAL_PROTOCOLPAIR("Subtracting mesh in slot ", g29_storage_slot); - SERIAL_PROTOCOLLNPGM(" from current mesh."); - - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) - z_values[x][y] -= tmp_z_values[x][y]; - } - mesh_index_pair unified_bed_leveling::find_furthest_invalid_mesh_point() { bool found_a_NAN = false, found_a_real = false; @@ -1339,119 +1285,6 @@ return out_mesh; } - #if HAS_LCD_MENU - - void abort_fine_tune() { - lcd_return_to_status(); - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - LCD_MESSAGEPGM(MSG_EDITING_STOPPED); - lcd_quick_feedback(true); - } - - void unified_bed_leveling::fine_tune_mesh(const float &rx, const float &ry, const bool do_ubl_mesh_map) { - if (!parser.seen('R')) // fine_tune_mesh() is special. If no repetition count flag is specified - g29_repetition_cnt = 1; // do exactly one mesh location. Otherwise use what the parser decided. - - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - const float h_offset = parser.seenval('H') ? parser.value_linear_units() : 0; - if (!WITHIN(h_offset, 0, 10)) { - SERIAL_PROTOCOLLNPGM("Offset out of bounds. (0 to 10mm)\n"); - return; - } - #endif - - mesh_index_pair location; - - if (!position_is_reachable(rx, ry)) { - SERIAL_PROTOCOLLNPGM("(X,Y) outside printable radius."); - return; - } - - save_ubl_active_state_and_disable(); - - LCD_MESSAGEPGM(MSG_UBL_FINE_TUNE_MESH); - lcd_external_control = true; // Take over control of the LCD encoder - - do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); // Move to the given XY with probe clearance - - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset - #endif - - uint16_t not_done[16]; - memset(not_done, 0xFF, sizeof(not_done)); - do { - location = find_closest_mesh_point_of_type(SET_IN_BITMAP, rx, ry, USE_NOZZLE_AS_REFERENCE, not_done); - - if (location.x_index < 0) break; // Stop when there are no more reachable points - - bitmap_clear(not_done, location.x_index, location.y_index); // Mark this location as 'adjusted' so a new - // location is used on the next loop - - const float rawx = mesh_index_to_xpos(location.x_index), - rawy = mesh_index_to_ypos(location.y_index); - - if (!position_is_reachable(rawx, rawy)) break; // SHOULD NOT OCCUR because find_closest_mesh_point_of_type will only return reachable - - do_blocking_move_to(rawx, rawy, Z_CLEARANCE_BETWEEN_PROBES); // Move the nozzle to the edit point with probe clearance - - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset); // Move Z to the given 'H' offset before editing - #endif - - KEEPALIVE_STATE(PAUSED_FOR_USER); - - if (do_ubl_mesh_map) display_map(g29_map_type); // Display the current point - - lcd_refresh(); - - float new_z = z_values[location.x_index][location.y_index]; - if (isnan(new_z)) new_z = 0; // Invalid points begin at 0 - new_z = FLOOR(new_z * 1000) * 0.001f; // Chop off digits after the 1000ths place - - lcd_mesh_edit_setup(new_z); - - do { - new_z = lcd_mesh_edit(); - #if ENABLED(UBL_MESH_EDIT_MOVES_Z) - do_blocking_move_to_z(h_offset + new_z); // Move the nozzle as the point is edited - #endif - idle(); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } while (!is_lcd_clicked()); - - if (!lcd_map_control) lcd_return_to_status(); // Just editing a single point? Return to status - - if (click_and_hold(abort_fine_tune)) goto FINE_TUNE_EXIT; // If the click is held down, abort editing - - z_values[location.x_index][location.y_index] = new_z; // Save the updated Z value - - safe_delay(20); // No switch noise - lcd_refresh(); - - } while (location.x_index >= 0 && --g29_repetition_cnt > 0); - - FINE_TUNE_EXIT: - - lcd_external_control = false; - KEEPALIVE_STATE(IN_HANDLER); - - if (do_ubl_mesh_map) display_map(g29_map_type); - restore_ubl_active_state_and_leave(); - - do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); - - LCD_MESSAGEPGM(MSG_UBL_DONE_EDITING_MESH); - SERIAL_ECHOLNPGM("Done Editing Mesh"); - - if (lcd_map_control) - lcd_goto_screen(_lcd_ubl_output_map_lcd); - else - lcd_return_to_status(); - } - - #endif // HAS_LCD_MENU - /** * 'Smart Fill': Scan from the outward edges of the mesh towards the center. * If an invalid location is found, use the next two points (if valid) to @@ -1594,29 +1427,23 @@ #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { SERIAL_CHAR('('); - SERIAL_PROTOCOL_F(rx, 7); + SERIAL_ECHO_F(rx, 7); SERIAL_CHAR(','); - SERIAL_PROTOCOL_F(ry, 7); + SERIAL_ECHO_F(ry, 7); SERIAL_ECHOPGM(") logical: "); SERIAL_CHAR('('); - SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(rx), 7); + SERIAL_ECHO_F(LOGICAL_X_POSITION(rx), 7); SERIAL_CHAR(','); - SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(ry), 7); - SERIAL_ECHOPGM(") measured: "); - SERIAL_PROTOCOL_F(measured_z, 7); - SERIAL_ECHOPGM(" correction: "); - SERIAL_PROTOCOL_F(get_z_correction(rx, ry), 7); + SERIAL_ECHO_F(LOGICAL_Y_POSITION(ry), 7); + SERIAL_ECHOPAIR_F(") measured: ", measured_z, 7); + SERIAL_ECHOPAIR_F(" correction: ", get_z_correction(rx, ry), 7); } #endif measured_z -= get_z_correction(rx, ry) /* + zprobe_zoffset */ ; #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM(" final >>>---> "); - SERIAL_PROTOCOL_F(measured_z, 7); - SERIAL_EOL(); - } + if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR_F(" final >>>---> ", measured_z, 7); #endif if (g29_verbose_level > 3) { serial_spaces(16); @@ -1642,12 +1469,11 @@ vector_3 normal = vector_3(lsf_results.A, lsf_results.B, 1).get_normal(); if (g29_verbose_level > 2) { - SERIAL_ECHOPGM("bed plane normal = ["); - SERIAL_PROTOCOL_F(normal.x, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(normal.y, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(normal.z, 7); + SERIAL_ECHOPAIR_F("bed plane normal = [", normal.x, 7); + SERIAL_CHAR(','); + SERIAL_ECHO_F(normal.y, 7); + SERIAL_CHAR(','); + SERIAL_ECHO_F(normal.z, 7); SERIAL_ECHOLNPGM("]"); } @@ -1661,14 +1487,13 @@ #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM("before rotation = ["); - SERIAL_PROTOCOL_F(x_tmp, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(y_tmp, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(z_tmp, 7); + SERIAL_ECHOPAIR_F("before rotation = [", x_tmp, 7); + SERIAL_CHAR(','); + SERIAL_ECHO_F(y_tmp, 7); + SERIAL_CHAR(','); + SERIAL_ECHO_F(z_tmp, 7); SERIAL_ECHOPGM("] ---> "); - safe_delay(20); + serial_delay(20); } #endif @@ -1676,14 +1501,13 @@ #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPGM("after rotation = ["); - SERIAL_PROTOCOL_F(x_tmp, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(y_tmp, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(z_tmp, 7); + SERIAL_ECHOPAIR_F("after rotation = [", x_tmp, 7); + SERIAL_CHAR(','); + SERIAL_ECHO_F(y_tmp, 7); + SERIAL_CHAR(','); + SERIAL_ECHO_F(z_tmp, 7); SERIAL_ECHOLNPGM("]"); - safe_delay(55); + serial_delay(55); } #endif @@ -1694,22 +1518,17 @@ #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { rotation.debug(PSTR("rotation matrix:\n")); - SERIAL_ECHOPGM("LSF Results A="); - SERIAL_PROTOCOL_F(lsf_results.A, 7); - SERIAL_ECHOPGM(" B="); - SERIAL_PROTOCOL_F(lsf_results.B, 7); - SERIAL_ECHOPGM(" D="); - SERIAL_PROTOCOL_F(lsf_results.D, 7); - SERIAL_EOL(); - safe_delay(55); + SERIAL_ECHOPAIR_F("LSF Results A=", lsf_results.A, 7); + SERIAL_ECHOPAIR_F(" B=", lsf_results.B, 7); + SERIAL_ECHOLNPAIR_F(" D=", lsf_results.D, 7); + serial_delay(55); - SERIAL_ECHOPGM("bed plane normal = ["); - SERIAL_PROTOCOL_F(normal.x, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(normal.y, 7); - SERIAL_PROTOCOLCHAR(','); - SERIAL_PROTOCOL_F(normal.z, 7); - SERIAL_ECHOPGM("]\n"); + SERIAL_ECHOPAIR_F("bed plane normal = [", normal.x, 7); + SERIAL_CHAR(','); + SERIAL_ECHO_F(normal.y, 7); + SERIAL_CHAR(','); + SERIAL_ECHO_F(normal.z, 7); + SERIAL_ECHOLNPGM("]"); SERIAL_EOL(); /** @@ -1724,45 +1543,31 @@ float t, t1, d; t = normal.x * (PROBE_PT_1_X) + normal.y * (PROBE_PT_1_Y); d = t + normal.z * z1; - SERIAL_ECHOPGM("D from 1st point: "); - SERIAL_ECHO_F(d, 6); - SERIAL_ECHOPGM(" Z error: "); - SERIAL_ECHO_F(normal.z*z1-get_z_correction(PROBE_PT_1_X, PROBE_PT_1_Y), 6); - SERIAL_EOL(); + SERIAL_ECHOPAIR_F("D from 1st point: ", d, 6); + SERIAL_ECHOLNPAIR_F(" Z error: ", normal.z*z1-get_z_correction(PROBE_PT_1_X, PROBE_PT_1_Y), 6); t = normal.x * (PROBE_PT_2_X) + normal.y * (PROBE_PT_2_Y); d = t + normal.z * z2; SERIAL_EOL(); - SERIAL_ECHOPGM("D from 2nd point: "); - SERIAL_ECHO_F(d, 6); - SERIAL_ECHOPGM(" Z error: "); - SERIAL_ECHO_F(normal.z*z2-get_z_correction(PROBE_PT_2_X, PROBE_PT_2_Y), 6); - SERIAL_EOL(); + SERIAL_ECHOPAIR_F("D from 2nd point: ", d, 6); + SERIAL_ECHOLNPAIR_F(" Z error: ", normal.z*z2-get_z_correction(PROBE_PT_2_X, PROBE_PT_2_Y), 6); t = normal.x * (PROBE_PT_3_X) + normal.y * (PROBE_PT_3_Y); d = t + normal.z * z3; - SERIAL_ECHOPGM("D from 3rd point: "); - SERIAL_ECHO_F(d, 6); - SERIAL_ECHOPGM(" Z error: "); - SERIAL_ECHO_F(normal.z*z3-get_z_correction(PROBE_PT_3_X, PROBE_PT_3_Y), 6); - SERIAL_EOL(); + SERIAL_ECHOPAIR_F("D from 3rd point: ", d, 6); + SERIAL_ECHOLNPAIR_F(" Z error: ", normal.z*z3-get_z_correction(PROBE_PT_3_X, PROBE_PT_3_Y), 6); t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT); d = t + normal.z * 0; - SERIAL_ECHOPGM("D from home location with Z=0 : "); - SERIAL_ECHO_F(d, 6); - SERIAL_EOL(); + SERIAL_ECHOLNPAIR_F("D from home location with Z=0 : ", d, 6); t = normal.x * (Z_SAFE_HOMING_X_POINT) + normal.y * (Z_SAFE_HOMING_Y_POINT); d = t + get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT); // normal.z * 0; - SERIAL_ECHOPGM("D from home location using mesh value for Z: "); - SERIAL_ECHO_F(d, 6); + SERIAL_ECHOPAIR_F("D from home location using mesh value for Z: ", d, 6); SERIAL_ECHOPAIR(" Z error: (", Z_SAFE_HOMING_X_POINT); - SERIAL_ECHOPAIR(",", Z_SAFE_HOMING_Y_POINT ); - SERIAL_ECHOPGM(") = "); - SERIAL_ECHO_F(get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT), 6); - SERIAL_EOL(); + SERIAL_ECHOPAIR(",", Z_SAFE_HOMING_Y_POINT); + SERIAL_ECHOLNPAIR_F(") = ", get_z_correction(Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT), 6); #endif } // DEBUGGING(LEVELING) #endif @@ -1825,4 +1630,153 @@ } #endif // UBL_G29_P31 + #if ENABLED(UBL_DEVEL_DEBUGGING) + /** + * Much of the 'What?' command can be eliminated. But until we are fully debugged, it is + * good to have the extra information. Soon... we prune this to just a few items + */ + void unified_bed_leveling::g29_what_command() { + report_state(); + + if (storage_slot == -1) + SERIAL_ECHOPGM("No Mesh Loaded."); + else { + SERIAL_ECHOPAIR("Mesh ", storage_slot); + SERIAL_ECHOPGM(" Loaded."); + } + SERIAL_EOL(); + serial_delay(50); + + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + SERIAL_ECHOLNPAIR_F("planner.z_fade_height : ", planner.z_fade_height, 4); + #endif + + adjust_mesh_to_mean(g29_c_flag, g29_constant); + + #if HAS_BED_PROBE + SERIAL_ECHOLNPAIR_F("zprobe_zoffset: ", zprobe_zoffset, 7); + #endif + + SERIAL_ECHOLNPAIR("MESH_MIN_X " STRINGIFY(MESH_MIN_X) "=", MESH_MIN_X); serial_delay(50); + SERIAL_ECHOLNPAIR("MESH_MIN_Y " STRINGIFY(MESH_MIN_Y) "=", MESH_MIN_Y); serial_delay(50); + SERIAL_ECHOLNPAIR("MESH_MAX_X " STRINGIFY(MESH_MAX_X) "=", MESH_MAX_X); serial_delay(50); + SERIAL_ECHOLNPAIR("MESH_MAX_Y " STRINGIFY(MESH_MAX_Y) "=", MESH_MAX_Y); serial_delay(50); + SERIAL_ECHOLNPAIR("GRID_MAX_POINTS_X ", GRID_MAX_POINTS_X); serial_delay(50); + SERIAL_ECHOLNPAIR("GRID_MAX_POINTS_Y ", GRID_MAX_POINTS_Y); serial_delay(50); + SERIAL_ECHOLNPAIR("MESH_X_DIST ", MESH_X_DIST); + SERIAL_ECHOLNPAIR("MESH_Y_DIST ", MESH_Y_DIST); serial_delay(50); + + SERIAL_ECHOPGM("X-Axis Mesh Points at: "); + for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { + SERIAL_ECHO_F(LOGICAL_X_POSITION(mesh_index_to_xpos(i)), 3); + SERIAL_ECHOPGM(" "); + serial_delay(25); + } + SERIAL_EOL(); + + SERIAL_ECHOPGM("Y-Axis Mesh Points at: "); + for (uint8_t i = 0; i < GRID_MAX_POINTS_Y; i++) { + SERIAL_ECHO_F(LOGICAL_Y_POSITION(mesh_index_to_ypos(i)), 3); + SERIAL_ECHOPGM(" "); + serial_delay(25); + } + SERIAL_EOL(); + + #if HAS_KILL + SERIAL_ECHOPAIR("Kill pin on :", KILL_PIN); + SERIAL_ECHOLNPAIR(" state:", READ(KILL_PIN)); + #endif + SERIAL_EOL(); + serial_delay(50); + + #if ENABLED(UBL_DEVEL_DEBUGGING) + SERIAL_ECHOLNPAIR("ubl_state_at_invocation :", ubl_state_at_invocation); SERIAL_EOL(); + SERIAL_ECHOLNPAIR("ubl_state_recursion_chk :", ubl_state_recursion_chk); SERIAL_EOL(); + serial_delay(50); + + SERIAL_ECHOPAIR("Meshes go from ", hex_address((void*)settings.meshes_start_index())); + SERIAL_ECHOLNPAIR(" to ", hex_address((void*)settings.meshes_end_index())); + serial_delay(50); + + SERIAL_ECHOLNPAIR("sizeof(ubl) : ", (int)sizeof(ubl)); SERIAL_EOL(); + SERIAL_ECHOLNPAIR("z_value[][] size: ", (int)sizeof(z_values)); SERIAL_EOL(); + serial_delay(25); + + SERIAL_ECHOLNPAIR("EEPROM free for UBL: ", hex_address((void*)(settings.meshes_end_index() - settings.meshes_start_index()))); + serial_delay(50); + + SERIAL_ECHOPAIR("EEPROM can hold ", settings.calc_num_meshes()); + SERIAL_ECHOLNPGM(" meshes.\n"); + serial_delay(25); + #endif // UBL_DEVEL_DEBUGGING + + if (!sanity_check()) { + echo_name(); + SERIAL_ECHOLNPGM(" sanity checks passed."); + } + } + + /** + * When we are fully debugged, the EEPROM dump command will get deleted also. But + * right now, it is good to have the extra information. Soon... we prune this. + */ + void unified_bed_leveling::g29_eeprom_dump() { + uint8_t cccc; + + SERIAL_ECHO_MSG("EEPROM Dump:"); + persistentStore.access_start(); + for (uint16_t i = 0; i < persistentStore.capacity(); i += 16) { + if (!(i & 0x3)) idle(); + print_hex_word(i); + SERIAL_ECHOPGM(": "); + for (uint16_t j = 0; j < 16; j++) { + persistentStore.read_data(i + j, &cccc, sizeof(uint8_t)); + print_hex_byte(cccc); + SERIAL_CHAR(' '); + } + SERIAL_EOL(); + } + SERIAL_EOL(); + persistentStore.access_finish(); + } + + /** + * When we are fully debugged, this may go away. But there are some valid + * use cases for the users. So we can wait and see what to do with it. + */ + void unified_bed_leveling::g29_compare_current_mesh_to_stored_mesh() { + int16_t a = settings.calc_num_meshes(); + + if (!a) { + SERIAL_ECHOLNPGM("?EEPROM storage not available."); + return; + } + + if (!parser.has_value()) { + SERIAL_ECHOLNPGM("?Storage slot # required."); + SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1); + return; + } + + g29_storage_slot = parser.value_int(); + + if (!WITHIN(g29_storage_slot, 0, a - 1)) { + SERIAL_ECHOLNPGM("?Invalid storage slot."); + SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1); + return; + } + + float tmp_z_values[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; + settings.load_mesh(g29_storage_slot, &tmp_z_values); + + SERIAL_ECHOPAIR("Subtracting mesh in slot ", g29_storage_slot); + SERIAL_ECHOLNPGM(" from current mesh."); + + for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) + for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) + z_values[x][y] -= tmp_z_values[x][y]; + } + + #endif // UBL_DEVEL_DEBUGGING + #endif // AUTO_BED_LEVELING_UBL diff --git a/Marlin/src/feature/dac/stepper_dac.cpp b/Marlin/src/feature/dac/stepper_dac.cpp index b5ea77a029..a83db09752 100644 --- a/Marlin/src/feature/dac/stepper_dac.cpp +++ b/Marlin/src/feature/dac/stepper_dac.cpp @@ -103,8 +103,7 @@ void dac_current_set_percents(const uint8_t pct[XYZE]) { void dac_print_values() { if (!dac_present) return; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Stepper current values in % (Amps):"); + SERIAL_ECHO_MSG("Stepper current values in % (Amps):"); SERIAL_ECHO_START(); SERIAL_ECHOPAIR(" X:", dac_perc(X_AXIS)); SERIAL_ECHOPAIR(" (", dac_amps(X_AXIS)); diff --git a/Marlin/src/feature/fanmux.cpp b/Marlin/src/feature/fanmux.cpp index 3457fe49b4..ad22f15030 100644 --- a/Marlin/src/feature/fanmux.cpp +++ b/Marlin/src/feature/fanmux.cpp @@ -36,7 +36,7 @@ void fanmux_switch(const uint8_t e) { #if PIN_EXISTS(FANMUX1) WRITE(FANMUX1_PIN, TEST(e, 1) ? HIGH : LOW); #if PIN_EXISTS(FANMUX2) - WRITE(FANMUX2, TEST(e, 2) ? HIGH : LOW); + WRITE(FANMUX2_PIN, TEST(e, 2) ? HIGH : LOW); #endif #endif } diff --git a/Marlin/src/feature/leds/leds.h b/Marlin/src/feature/leds/leds.h index 224e3cc200..77654d44a3 100644 --- a/Marlin/src/feature/leds/leds.h +++ b/Marlin/src/feature/leds/leds.h @@ -146,7 +146,7 @@ public: #endif ); - FORCE_INLINE void set_color(uint8_t r, uint8_t g, uint8_t b + inline void set_color(uint8_t r, uint8_t g, uint8_t b #if HAS_WHITE_LED , uint8_t w=0 #if ENABLED(NEOPIXEL_LED) @@ -164,23 +164,23 @@ public: ); } - FORCE_INLINE static void set_off() { set_color(LEDColorOff()); } - FORCE_INLINE static void set_green() { set_color(LEDColorGreen()); } - FORCE_INLINE static void set_white() { set_color(LEDColorWhite()); } + static inline void set_off() { set_color(LEDColorOff()); } + static inline void set_green() { set_color(LEDColorGreen()); } + static inline void set_white() { set_color(LEDColorWhite()); } #if ENABLED(LED_COLOR_PRESETS) static const LEDColor defaultLEDColor; - FORCE_INLINE static void set_default() { set_color(defaultLEDColor); } - FORCE_INLINE static void set_red() { set_color(LEDColorRed()); } - FORCE_INLINE static void set_orange() { set_color(LEDColorOrange()); } - FORCE_INLINE static void set_yellow() { set_color(LEDColorYellow()); } - FORCE_INLINE static void set_blue() { set_color(LEDColorBlue()); } - FORCE_INLINE static void set_indigo() { set_color(LEDColorIndigo()); } - FORCE_INLINE static void set_violet() { set_color(LEDColorViolet()); } + static inline void set_default() { set_color(defaultLEDColor); } + static inline void set_red() { set_color(LEDColorRed()); } + static inline void set_orange() { set_color(LEDColorOrange()); } + static inline void set_yellow() { set_color(LEDColorYellow()); } + static inline void set_blue() { set_color(LEDColorBlue()); } + static inline void set_indigo() { set_color(LEDColorIndigo()); } + static inline void set_violet() { set_color(LEDColorViolet()); } #endif #if ENABLED(PRINTER_EVENT_LEDS) - FORCE_INLINE static LEDColor get_color() { return lights_on ? color : LEDColorOff(); } + static inline LEDColor get_color() { return lights_on ? color : LEDColorOff(); } #endif #if ENABLED(LED_CONTROL_MENU) || ENABLED(PRINTER_EVENT_LEDS) @@ -189,7 +189,7 @@ public: #endif #if ENABLED(LED_CONTROL_MENU) static void toggle(); // swap "off" with color - FORCE_INLINE static void update() { set_color(color); } + static inline void update() { set_color(color); } #endif }; diff --git a/Marlin/src/feature/leds/printer_event_leds.h b/Marlin/src/feature/leds/printer_event_leds.h index 632650ee8b..bae891dd70 100644 --- a/Marlin/src/feature/leds/printer_event_leds.h +++ b/Marlin/src/feature/leds/printer_event_leds.h @@ -38,23 +38,23 @@ private: public: #if HAS_TEMP_HOTEND - FORCE_INLINE static LEDColor onHotendHeatingStart() { old_intensity = 0; return leds.get_color(); } + static inline LEDColor onHotendHeatingStart() { old_intensity = 0; return leds.get_color(); } static void onHotendHeating(const float &start, const float ¤t, const float &target); #endif #if HAS_HEATED_BED - FORCE_INLINE static LEDColor onBedHeatingStart() { old_intensity = 127; return leds.get_color(); } + static inline LEDColor onBedHeatingStart() { old_intensity = 127; return leds.get_color(); } static void onBedHeating(const float &start, const float ¤t, const float &target); #endif #if HAS_TEMP_HOTEND || HAS_HEATED_BED - FORCE_INLINE static void onHeatingDone() { leds.set_color(LEDColorWhite()); } - FORCE_INLINE static void onPidTuningDone(LEDColor c) { leds.set_color(c); } + static inline void onHeatingDone() { leds.set_color(LEDColorWhite()); } + static inline void onPidTuningDone(LEDColor c) { leds.set_color(c); } #endif #if ENABLED(SDSUPPORT) - FORCE_INLINE static void onPrintCompleted() { + static inline void onPrintCompleted() { leds.set_green(); #if HAS_LEDS_OFF_FLAG leds_off_after_print = true; @@ -64,7 +64,7 @@ public: #endif } - FORCE_INLINE static void onResumeAfterWait() { + static inline void onResumeAfterWait() { #if HAS_LEDS_OFF_FLAG if (leds_off_after_print) { leds.set_off(); diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index b26babf730..f1fdde6cc5 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -45,10 +45,7 @@ #include "../feature/runout.h" #endif -#if HAS_LCD_MENU - #include "../lcd/ultralcd.h" -#endif - +#include "../lcd/ultralcd.h" #include "../libs/buzzer.h" #include "../libs/nozzle.h" #include "pause.h" @@ -96,8 +93,7 @@ static bool ensure_safe_temperature(const AdvancedPauseMode mode=ADVANCED_PAUSE_ #if ENABLED(PREVENT_COLD_EXTRUSION) if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_HOTEND_TOO_COLD); + SERIAL_ERROR_MSG(MSG_ERR_HOTEND_TOO_COLD); return false; } #endif @@ -145,8 +141,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l #if HAS_LCD_MENU if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT, mode); #endif - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT); + SERIAL_ECHO_MSG(MSG_FILAMENT_CHANGE_INSERT); #if HAS_BUZZER filament_change_beep(max_beep_count, true); @@ -339,8 +334,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u #endif if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_HOTEND_TOO_COLD); + SERIAL_ERROR_MSG(MSG_ERR_HOTEND_TOO_COLD); #if HAS_LCD_MENU if (show_lcd) { // Show status screen @@ -399,14 +393,19 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u } /** + * For Paused Print: + * - Show "Press button (or M108) to resume" + * + * For Filament Change: * - Show "Insert filament and press button to continue" + * * - Wait for a click before returning - * - Heaters can time out, reheated before accepting a click + * - Heaters can time out and must reheat before continuing * * Used by M125 and M600 */ -#if HAS_LCD_MENU && ENABLED(EMERGENCY_PARSER) +#if (HAS_LCD_MENU || ENABLED(EXTENSIBLE_UI)) && ENABLED(EMERGENCY_PARSER) #define _PMSG(L) L #elif ENABLED(EMERGENCY_PARSER) #define _PMSG(L) L##_M108 @@ -462,8 +461,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep #if HAS_LCD_MENU lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_HEAT); #endif - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(_PMSG(MSG_FILAMENT_CHANGE_HEAT)); + SERIAL_ECHO_MSG(_PMSG(MSG_FILAMENT_CHANGE_HEAT)); // Wait for LCD click or M108 while (wait_for_user) idle(true); @@ -526,7 +524,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le SERIAL_ECHOPAIR("\nextruder_duplication_enabled:", extruder_duplication_enabled); SERIAL_ECHOPAIR("\nactive_extruder:", active_extruder); SERIAL_ECHOPGM("\n\n"); - */ + //*/ if (!did_pause_print) return; @@ -585,9 +583,10 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le } #endif - #if ENABLED(ULTRA_LCD) - lcd_reset_status(); - #endif + // Resume the print job timer if it was running + if (print_job_timer.isPaused()) print_job_timer.start(); + + ui.reset_status(); } #endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/feature/pause.h b/Marlin/src/feature/pause.h index 87cfe05f7c..6cc901c1d9 100644 --- a/Marlin/src/feature/pause.h +++ b/Marlin/src/feature/pause.h @@ -92,4 +92,4 @@ bool load_filament(const float &slow_load_length=0, const float &fast_load_lengt bool unload_filament(const float &unload_length, const bool show_lcd=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT); -#endif //ADVANCED_PAUSE_FEATURE +#endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index 24f02041b2..892166ba1a 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -39,7 +39,7 @@ millis_t Power::lastPowerOn; bool Power::is_power_needed() { #if ENABLED(AUTO_POWER_FANS) - for (uint8_t i = 0; i < FAN_COUNT; i++) if (fan_speed[i]) return true; + FANS_LOOP(i) if (fan_speed[i]) return true; #endif #if ENABLED(AUTO_POWER_E_FANS) diff --git a/Marlin/src/feature/power_loss_recovery.cpp b/Marlin/src/feature/power_loss_recovery.cpp index 10e8246670..9302837af7 100644 --- a/Marlin/src/feature/power_loss_recovery.cpp +++ b/Marlin/src/feature/power_loss_recovery.cpp @@ -29,247 +29,145 @@ #if ENABLED(POWER_LOSS_RECOVERY) #include "power_loss_recovery.h" +#include "../core/macros.h" +bool PrintJobRecovery::enabled; // Initialized by settings.load() + +SdFile PrintJobRecovery::file; +job_recovery_info_t PrintJobRecovery::info; + +#include "../sd/cardreader.h" #include "../lcd/ultralcd.h" #include "../gcode/queue.h" +#include "../gcode/gcode.h" #include "../module/motion.h" #include "../module/planner.h" #include "../module/printcounter.h" #include "../module/temperature.h" -#include "../sd/cardreader.h" #include "../core/serial.h" #if ENABLED(FWRETRACT) #include "fwretract.h" #endif -// Recovery data -job_recovery_info_t job_recovery_info; -JobRecoveryPhase job_recovery_phase = JOB_RECOVERY_IDLE; -uint8_t job_recovery_commands_count; //=0 -char job_recovery_commands[BUFSIZE + APPEND_CMD_COUNT][MAX_CMD_SIZE]; +PrintJobRecovery recovery; -extern uint8_t commands_in_queue, cmd_queue_index_r; +/** + * Clear the recovery info + */ +void PrintJobRecovery::init() { memset(&info, 0, sizeof(info)); } -#if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - void debug_print_job_recovery(const bool recovery) { - SERIAL_PROTOCOLLNPGM("---- Job Recovery Info ----"); - SERIAL_PROTOCOLPAIR("valid_head:", int(job_recovery_info.valid_head)); - SERIAL_PROTOCOLLNPAIR(" valid_foot:", int(job_recovery_info.valid_foot)); - if (job_recovery_info.valid_head) { - if (job_recovery_info.valid_head == job_recovery_info.valid_foot) { - SERIAL_PROTOCOLPGM("current_position: "); - LOOP_XYZE(i) { - SERIAL_PROTOCOL(job_recovery_info.current_position[i]); - if (i < E_AXIS) SERIAL_CHAR(','); - } - SERIAL_EOL(); - SERIAL_PROTOCOLLNPAIR("feedrate: ", job_recovery_info.feedrate); +/** + * Enable or disable then call changed() + */ +void PrintJobRecovery::enable(const bool onoff) { + enabled = onoff; + changed(); +} - #if HOTENDS > 1 - SERIAL_PROTOCOLLNPAIR("active_hotend: ", int(job_recovery_info.active_hotend)); - #endif - - SERIAL_PROTOCOLPGM("target_temperature: "); - HOTEND_LOOP() { - SERIAL_PROTOCOL(job_recovery_info.target_temperature[e]); - if (e < HOTENDS - 1) SERIAL_CHAR(','); - } - SERIAL_EOL(); - - #if HAS_HEATED_BED - SERIAL_PROTOCOLLNPAIR("target_temperature_bed: ", job_recovery_info.target_temperature_bed); - #endif - - #if FAN_COUNT - SERIAL_PROTOCOLPGM("fan_speed: "); - for (int8_t i = 0; i < FAN_COUNT; i++) { - SERIAL_PROTOCOL(job_recovery_info.fan_speed[i]); - if (i < FAN_COUNT - 1) SERIAL_CHAR(','); - } - SERIAL_EOL(); - #endif - - #if HAS_LEVELING - SERIAL_PROTOCOLPAIR("leveling: ", int(job_recovery_info.leveling)); - SERIAL_PROTOCOLLNPAIR(" fade: ", int(job_recovery_info.fade)); - #endif - #if ENABLED(FWRETRACT) - SERIAL_PROTOCOLPGM("retract: "); - for (int8_t e = 0; e < EXTRUDERS; e++) { - SERIAL_PROTOCOL(job_recovery_info.retract[e]); - if (e < EXTRUDERS - 1) SERIAL_CHAR(','); - } - SERIAL_EOL(); - SERIAL_PROTOCOLLNPAIR("retract_hop: ", job_recovery_info.retract_hop); - #endif - SERIAL_PROTOCOLLNPAIR("cmd_queue_index_r: ", int(job_recovery_info.cmd_queue_index_r)); - SERIAL_PROTOCOLLNPAIR("commands_in_queue: ", int(job_recovery_info.commands_in_queue)); - if (recovery) - for (uint8_t i = 0; i < job_recovery_commands_count; i++) SERIAL_PROTOCOLLNPAIR("> ", job_recovery_commands[i]); - else - for (uint8_t i = 0; i < job_recovery_info.commands_in_queue; i++) SERIAL_PROTOCOLLNPAIR("> ", job_recovery_info.command_queue[i]); - SERIAL_PROTOCOLLNPAIR("sd_filename: ", job_recovery_info.sd_filename); - SERIAL_PROTOCOLLNPAIR("sdpos: ", job_recovery_info.sdpos); - SERIAL_PROTOCOLLNPAIR("print_job_elapsed: ", job_recovery_info.print_job_elapsed); - } - else - SERIAL_PROTOCOLLNPGM("INVALID DATA"); - } - SERIAL_PROTOCOLLNPGM("---------------------------"); - } -#endif // DEBUG_POWER_LOSS_RECOVERY +/** + * The enabled state was changed: + * - Enabled: Purge the job recovery file + * - Disabled: Write the job recovery file + */ +void PrintJobRecovery::changed() { + if (!enabled) + purge(); + else if (IS_SD_PRINTING()) + save(true); +} /** * Check for Print Job Recovery during setup() * - * If a saved state exists, populate job_recovery_commands with - * commands to restore the machine state and continue the file. + * If a saved state exists send 'M1000 S' to initiate job recovery. */ -void check_print_job_recovery() { - memset(&job_recovery_info, 0, sizeof(job_recovery_info)); - ZERO(job_recovery_commands); - - if (!card.cardOK) card.initsd(); - - if (card.cardOK) { - - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - SERIAL_PROTOCOLLNPAIR("Init job recovery info. Size: ", int(sizeof(job_recovery_info))); - #endif - - if (card.jobRecoverFileExists()) { - card.openJobRecoveryFile(true); - card.loadJobRecoveryInfo(); - card.closeJobRecoveryFile(); - //card.removeJobRecoveryFile(); - - if (job_recovery_info.valid_head && job_recovery_info.valid_head == job_recovery_info.valid_foot) { - - uint8_t ind = 0; - - #if HAS_LEVELING - strcpy_P(job_recovery_commands[ind++], PSTR("M420 S0 Z0")); // Leveling off before G92 or G28 - #endif - - strcpy_P(job_recovery_commands[ind++], PSTR("G92.0 Z0")); // Ensure Z is equal to 0 - strcpy_P(job_recovery_commands[ind++], PSTR("G1 Z2")); // Raise Z by 2mm (we hope!) - strcpy_P(job_recovery_commands[ind++], PSTR("G28 R0" - #if ENABLED(MARLIN_DEV_MODE) - " S" - #elif !IS_KINEMATIC - " X Y" // Home X and Y for Cartesian - #endif - )); - - char str_1[16], str_2[16]; - - #if HAS_LEVELING - if (job_recovery_info.fade || job_recovery_info.leveling) { - // Restore leveling state before G92 sets Z - // This ensures the steppers correspond to the native Z - dtostrf(job_recovery_info.fade, 1, 1, str_1); - sprintf_P(job_recovery_commands[ind++], PSTR("M420 S%i Z%s"), int(job_recovery_info.leveling), str_1); - } - #endif - - #if ENABLED(FWRETRACT) - for (uint8_t e = 0; e < EXTRUDERS; e++) { - if (job_recovery_info.retract[e] != 0.0) - fwretract.current_retract[e] = job_recovery_info.retract[e]; - fwretract.retracted[e] = true; - } - fwretract.current_hop = job_recovery_info.retract_hop; - #endif - - dtostrf(job_recovery_info.current_position[Z_AXIS] + 2, 1, 3, str_1); - dtostrf(job_recovery_info.current_position[E_AXIS] - #if ENABLED(SAVE_EACH_CMD_MODE) - - 5 - #endif - , 1, 3, str_2 - ); - sprintf_P(job_recovery_commands[ind++], PSTR("G92.0 Z%s E%s"), str_1, str_2); // Current Z + 2 and E - - uint8_t r = job_recovery_info.cmd_queue_index_r, c = job_recovery_info.commands_in_queue; - while (c--) { - strcpy(job_recovery_commands[ind++], job_recovery_info.command_queue[r]); - r = (r + 1) % BUFSIZE; - } - - if (job_recovery_info.sd_filename[0] == '/') job_recovery_info.sd_filename[0] = ' '; - sprintf_P(job_recovery_commands[ind++], PSTR("M23 %s"), job_recovery_info.sd_filename); - sprintf_P(job_recovery_commands[ind++], PSTR("M24 S%ld T%ld"), job_recovery_info.sdpos, job_recovery_info.print_job_elapsed); - - job_recovery_commands_count = ind; - - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - debug_print_job_recovery(true); - #endif - } - else { - if (job_recovery_info.valid_head != job_recovery_info.valid_foot) - LCD_ALERTMESSAGEPGM("INVALID DATA"); - memset(&job_recovery_info, 0, sizeof(job_recovery_info)); - } +void PrintJobRecovery::check() { + if (enabled) { + if (!card.flag.cardOK) card.initsd(); + if (card.flag.cardOK) { + load(); + if (!valid()) return purge(); + enqueue_and_echo_commands_P(PSTR("M1000 S")); } } } +/** + * Delete the recovery file and clear the recovery data + */ +void PrintJobRecovery::purge() { + init(); + card.removeJobRecoveryFile(); +} + +/** + * Load the recovery data, if it exists + */ +void PrintJobRecovery::load() { + if (exists()) { + open(true); + (void)file.read(&info, sizeof(info)); + close(); + } + #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) + debug(PSTR("Load")); + #endif +} + /** * Save the current machine state to the power-loss recovery file */ -void save_job_recovery_info() { +void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=true*/) { + #if SAVE_INFO_INTERVAL_MS > 0 - static millis_t next_save_ms; // = 0; // Init on reset + static millis_t next_save_ms; // = 0 millis_t ms = millis(); #endif - if ( - // Save on every command - #if ENABLED(SAVE_EACH_CMD_MODE) - true - #else - // Save if power loss pin is triggered - #if PIN_EXISTS(POWER_LOSS) - READ(POWER_LOSS_PIN) == POWER_LOSS_STATE || + + if (force + #if DISABLED(SAVE_EACH_CMD_MODE) // Always save state when enabled + #if PIN_EXISTS(POWER_LOSS) // Save if power loss pin is triggered + || READ(POWER_LOSS_PIN) == POWER_LOSS_STATE #endif - // Save if interval is elapsed - #if SAVE_INFO_INTERVAL_MS > 0 - ELAPSED(ms, next_save_ms) || + #if SAVE_INFO_INTERVAL_MS > 0 // Save if interval is elapsed + || ELAPSED(ms, next_save_ms) #endif - // Save on every new Z height - (current_position[Z_AXIS] > 0 && current_position[Z_AXIS] > job_recovery_info.current_position[Z_AXIS]) + // Save every time Z is higher than the last call + || current_position[Z_AXIS] > info.current_position[Z_AXIS] #endif ) { + #if SAVE_INFO_INTERVAL_MS > 0 next_save_ms = ms + SAVE_INFO_INTERVAL_MS; #endif - // Head and foot will match if valid data was saved - if (!++job_recovery_info.valid_head) ++job_recovery_info.valid_head; // non-zero in sequence - job_recovery_info.valid_foot = job_recovery_info.valid_head; + // Set Head and Foot to matching non-zero values + if (!++info.valid_head) ++info.valid_head; // non-zero in sequence + //if (!IS_SD_PRINTING()) info.valid_head = 0; + info.valid_foot = info.valid_head; // Machine state - COPY(job_recovery_info.current_position, current_position); - job_recovery_info.feedrate = feedrate_mm_s; + COPY(info.current_position, current_position); + info.feedrate = uint16_t(feedrate_mm_s * 60.0f); #if HOTENDS > 1 - job_recovery_info.active_hotend = active_extruder; + info.active_hotend = active_extruder; #endif - COPY(job_recovery_info.target_temperature, thermalManager.target_temperature); + COPY(info.target_temperature, thermalManager.target_temperature); #if HAS_HEATED_BED - job_recovery_info.target_temperature_bed = thermalManager.target_temperature_bed; + info.target_temperature_bed = thermalManager.target_temperature_bed; #endif #if FAN_COUNT - COPY(job_recovery_info.fan_speed, fan_speed); + COPY(info.fan_speed, fan_speed); #endif #if HAS_LEVELING - job_recovery_info.leveling = planner.leveling_active; - job_recovery_info.fade = ( + info.leveling = planner.leveling_active; + info.fade = ( #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) planner.z_fade_height #else @@ -279,35 +177,240 @@ void save_job_recovery_info() { #endif #if ENABLED(FWRETRACT) - COPY(job_recovery_info.retract, fwretract.current_retract); - job_recovery_info.retract_hop = fwretract.current_hop; + COPY(info.retract, fwretract.current_retract); + info.retract_hop = fwretract.current_hop; #endif // Commands in the queue - job_recovery_info.cmd_queue_index_r = cmd_queue_index_r; - job_recovery_info.commands_in_queue = commands_in_queue; - COPY(job_recovery_info.command_queue, command_queue); + info.commands_in_queue = save_queue ? commands_in_queue : 0; + info.cmd_queue_index_r = cmd_queue_index_r; + COPY(info.command_queue, command_queue); // Elapsed print job time - job_recovery_info.print_job_elapsed = print_job_timer.duration(); + info.print_job_elapsed = print_job_timer.duration(); // SD file position - card.getAbsFilename(job_recovery_info.sd_filename); - job_recovery_info.sdpos = card.getIndex(); + card.getAbsFilename(info.sd_filename); + info.sdpos = card.getIndex(); - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - SERIAL_PROTOCOLLNPGM("Saving..."); - debug_print_job_recovery(false); - #endif + write(); - card.openJobRecoveryFile(false); - (void)card.saveJobRecoveryInfo(); - - // If power-loss pin was triggered, write just once then kill + // KILL now if the power-loss pin was triggered #if PIN_EXISTS(POWER_LOSS) - if (READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) kill(MSG_POWER_LOSS_RECOVERY); + if (READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) kill(PSTR(MSG_OUTAGE_RECOVERY)); #endif } } +/** + * Save the recovery info the recovery file + */ +void PrintJobRecovery::write() { + + #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) + debug(PSTR("Write")); + #endif + + open(false); + file.seekSet(0); + const int16_t ret = file.write(&info, sizeof(info)); + #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) + if (ret == -1) SERIAL_ECHOLNPGM("Power-loss file write failed."); + #else + UNUSED(ret); + #endif +} + +/** + * Resume the saved print job + */ +void PrintJobRecovery::resume() { + + #define RECOVERY_ZRAISE 2 + + #if HAS_LEVELING + // Make sure leveling is off before any G92 and G28 + gcode.process_subcommands_now_P(PSTR("M420 S0 Z0")); + #endif + + // Set Z to 0, raise Z by 2mm, and Home (XY only for Cartesian) with no raise + // (Only do simulated homing in Marlin Dev Mode.) + gcode.process_subcommands_now_P(PSTR("G92.0 Z0|G1 Z" STRINGIFY(RECOVERY_ZRAISE) "|G28 R0" + #if ENABLED(MARLIN_DEV_MODE) + " S" + #elif !IS_KINEMATIC + " X Y" + #endif + )); + + // Pretend that all axes are homed + axis_homed = axis_known_position = xyz_bits; + + char cmd[40], str_1[16], str_2[16]; + + // Select the previously active tool (with no_move) + #if EXTRUDERS > 1 + sprintf_P(cmd, PSTR("T%i S"), info.active_hotend); + gcode.process_subcommands_now(cmd); + #endif + + #if HAS_HEATED_BED + const int16_t bt = info.target_temperature_bed; + if (bt) { + // Restore the bed temperature + sprintf_P(cmd, PSTR("M190 S%i"), bt); + gcode.process_subcommands_now(cmd); + } + #endif + + // Restore all hotend temperatures + HOTEND_LOOP() { + const int16_t et = info.target_temperature[e]; + if (et) { + #if HOTENDS > 1 + sprintf_P(cmd, PSTR("T%i"), e); + gcode.process_subcommands_now(cmd); + #endif + sprintf_P(cmd, PSTR("M109 S%i"), et); + gcode.process_subcommands_now(cmd); + } + } + + // Restore print cooling fan speeds + FANS_LOOP(i) { + uint8_t f = info.fan_speed[i]; + if (f) { + sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f); + gcode.process_subcommands_now(cmd); + } + } + + // Restore retract and hop state + #if ENABLED(FWRETRACT) + for (uint8_t e = 0; e < EXTRUDERS; e++) { + if (info.retract[e] != 0.0) + fwretract.current_retract[e] = info.retract[e]; + fwretract.retracted[e] = true; + } + fwretract.current_hop = info.retract_hop; + #endif + + #if HAS_LEVELING + // Restore leveling state before 'G92 Z' to ensure + // the Z stepper count corresponds to the native Z. + if (info.fade || info.leveling) { + dtostrf(info.fade, 1, 1, str_1); + sprintf_P(cmd, PSTR("M420 S%i Z%s"), int(info.leveling), str_1); + gcode.process_subcommands_now(cmd); + } + #endif + + // Restore Z (plus raise) and E positions with G92.0 + dtostrf(info.current_position[Z_AXIS] + RECOVERY_ZRAISE, 1, 3, str_1); + dtostrf(info.current_position[E_AXIS] + #if ENABLED(SAVE_EACH_CMD_MODE) + - 5 // Extra extrusion on restart + #endif + , 1, 3, str_2 + ); + sprintf_P(cmd, PSTR("G92.0 Z%s E%s"), str_1, str_2); + gcode.process_subcommands_now(cmd); + + // Move back to the saved XY + dtostrf(info.current_position[X_AXIS], 1, 3, str_1); + dtostrf(info.current_position[Y_AXIS], 1, 3, str_2); + sprintf_P(cmd, PSTR("G1 X%s Y%s F3000"), str_1, str_2); + gcode.process_subcommands_now(cmd); + + // Move back to the saved Z + dtostrf(info.current_position[Z_AXIS], 1, 3, str_1); + sprintf_P(cmd, PSTR("G1 Z%s F200"), str_1); + gcode.process_subcommands_now(cmd); + + // Restore the feedrate + sprintf_P(cmd, PSTR("G1 F%d"), info.feedrate); + gcode.process_subcommands_now(cmd); + + // Process commands from the old pending queue + uint8_t c = info.commands_in_queue, r = info.cmd_queue_index_r; + for (; c--; r = (r + 1) % BUFSIZE) + gcode.process_subcommands_now(info.command_queue[r]); + + // Resume the SD file from the last position + char *fn = info.sd_filename; + while (*fn == '/') fn++; + sprintf_P(cmd, PSTR("M23 %s"), fn); + gcode.process_subcommands_now(cmd); + sprintf_P(cmd, PSTR("M24 S%ld T%ld"), info.sdpos, info.print_job_elapsed); + gcode.process_subcommands_now(cmd); +} + +#if ENABLED(DEBUG_POWER_LOSS_RECOVERY) + + void PrintJobRecovery::debug(PGM_P const prefix) { + serialprintPGM(prefix); + SERIAL_ECHOPAIR(" Job Recovery Info...\nvalid_head:", int(info.valid_head)); + SERIAL_ECHOLNPAIR(" valid_foot:", int(info.valid_foot)); + if (info.valid_head) { + if (info.valid_head == info.valid_foot) { + SERIAL_ECHOPGM("current_position: "); + LOOP_XYZE(i) { + SERIAL_ECHO(info.current_position[i]); + if (i < E_AXIS) SERIAL_CHAR(','); + } + SERIAL_EOL(); + SERIAL_ECHOLNPAIR("feedrate: ", info.feedrate); + + #if HOTENDS > 1 + SERIAL_ECHOLNPAIR("active_hotend: ", int(info.active_hotend)); + #endif + + SERIAL_ECHOPGM("target_temperature: "); + HOTEND_LOOP() { + SERIAL_ECHO(info.target_temperature[e]); + if (e < HOTENDS - 1) SERIAL_CHAR(','); + } + SERIAL_EOL(); + + #if HAS_HEATED_BED + SERIAL_ECHOLNPAIR("target_temperature_bed: ", info.target_temperature_bed); + #endif + + #if FAN_COUNT + SERIAL_ECHOPGM("fan_speed: "); + for (int8_t i = 0; i < FAN_COUNT; i++) { + SERIAL_ECHO(int(info.fan_speed[i])); + if (i < FAN_COUNT - 1) SERIAL_CHAR(','); + } + SERIAL_EOL(); + #endif + + #if HAS_LEVELING + SERIAL_ECHOPAIR("leveling: ", int(info.leveling)); + SERIAL_ECHOLNPAIR(" fade: ", int(info.fade)); + #endif + #if ENABLED(FWRETRACT) + SERIAL_ECHOPGM("retract: "); + for (int8_t e = 0; e < EXTRUDERS; e++) { + SERIAL_ECHO(info.retract[e]); + if (e < EXTRUDERS - 1) SERIAL_CHAR(','); + } + SERIAL_EOL(); + SERIAL_ECHOLNPAIR("retract_hop: ", info.retract_hop); + #endif + SERIAL_ECHOLNPAIR("cmd_queue_index_r: ", int(info.cmd_queue_index_r)); + SERIAL_ECHOLNPAIR("commands_in_queue: ", int(info.commands_in_queue)); + for (uint8_t i = 0; i < info.commands_in_queue; i++) SERIAL_ECHOLNPAIR("> ", info.command_queue[i]); + SERIAL_ECHOLNPAIR("sd_filename: ", info.sd_filename); + SERIAL_ECHOLNPAIR("sdpos: ", info.sdpos); + SERIAL_ECHOLNPAIR("print_job_elapsed: ", info.print_job_elapsed); + } + else + SERIAL_ECHOLNPGM("INVALID DATA"); + } + SERIAL_ECHOLNPGM("---"); + } + +#endif // DEBUG_POWER_LOSS_RECOVERY + #endif // POWER_LOSS_RECOVERY diff --git a/Marlin/src/feature/power_loss_recovery.h b/Marlin/src/feature/power_loss_recovery.h index d5a0aea69d..d2222c779c 100644 --- a/Marlin/src/feature/power_loss_recovery.h +++ b/Marlin/src/feature/power_loss_recovery.h @@ -26,7 +26,6 @@ */ #include "../sd/cardreader.h" -#include "../core/millis_t.h" #include "../inc/MarlinConfigPre.h" #define SAVE_INFO_INTERVAL_MS 0 @@ -37,7 +36,9 @@ typedef struct { uint8_t valid_head; // Machine state - float current_position[NUM_AXIS], feedrate; + float current_position[NUM_AXIS]; + + uint16_t feedrate; #if HOTENDS > 1 uint8_t active_hotend; @@ -63,7 +64,7 @@ typedef struct { #endif // Command queue - uint8_t cmd_queue_index_r, commands_in_queue; + uint8_t commands_in_queue, cmd_queue_index_r; char command_queue[BUFSIZE][MAX_CMD_SIZE]; // SD Filename and position @@ -74,26 +75,46 @@ typedef struct { millis_t print_job_elapsed; uint8_t valid_foot; + } job_recovery_info_t; -extern job_recovery_info_t job_recovery_info; +class PrintJobRecovery { + public: + static SdFile file; + static job_recovery_info_t info; -enum JobRecoveryPhase : unsigned char { - JOB_RECOVERY_IDLE, - JOB_RECOVERY_MAYBE, - JOB_RECOVERY_YES, - JOB_RECOVERY_DONE + static void init(); + + static bool enabled; + static void enable(const bool onoff); + static void changed(); + + static void check(); + static void resume(); + + static inline bool exists() { return card.jobRecoverFileExists(); } + static inline void open(const bool read) { card.openJobRecoveryFile(read); } + static inline void close() { file.close(); } + + static void purge(); + static void load(); + static void save(const bool force= + #if ENABLED(SAVE_EACH_CMD_MODE) + true + #else + false + #endif + , const bool save_queue=true + ); + + static inline bool valid() { return info.valid_head && info.valid_head == info.valid_foot; } + + #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) + static void debug(PGM_P const prefix); + #endif + + private: + static void write(); }; -extern JobRecoveryPhase job_recovery_phase; -#if HAS_LEVELING - #define APPEND_CMD_COUNT 9 -#else - #define APPEND_CMD_COUNT 7 -#endif - -extern char job_recovery_commands[BUFSIZE + APPEND_CMD_COUNT][MAX_CMD_SIZE]; -extern uint8_t job_recovery_commands_count; - -void check_print_job_recovery(); -void save_job_recovery_info(); +extern PrintJobRecovery recovery; diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp index a51cf5b9e8..3dcb82673c 100644 --- a/Marlin/src/feature/runout.cpp +++ b/Marlin/src/feature/runout.cpp @@ -30,23 +30,28 @@ #include "runout.h" -FilamentRunoutSensor runout; +FilamentMonitor runout; -bool FilamentSensorBase::enabled = true, - FilamentSensorBase::filament_ran_out; // = false +bool FilamentMonitorBase::enabled = true, + FilamentMonitorBase::filament_ran_out; // = false -void FilamentSensorTypeBase::filament_present(const uint8_t extruder) { - runout.filament_present(extruder); +/** + * Called by FilamentSensorSwitch::run when filament is detected. + * Called by FilamentSensorEncoder::block_completed when motion is detected. + */ +void FilamentSensorBase::filament_present(const uint8_t extruder) { + runout.filament_present(extruder); // calls response.filament_present(extruder) } -uint8_t FilamentSensorTypeEncoder::motion_detected, - FilamentSensorTypeEncoder::old_state; // = 0 +#if ENABLED(FILAMENT_MOTION_SENSOR) + uint8_t FilamentSensorEncoder::motion_detected; +#endif #if FILAMENT_RUNOUT_DISTANCE_MM > 0 float RunoutResponseDelayed::runout_distance_mm = FILAMENT_RUNOUT_DISTANCE_MM; - int32_t RunoutResponseDelayed::steps_since_detection[EXTRUDERS]; + volatile float RunoutResponseDelayed::runout_mm_countdown[EXTRUDERS]; #else - uint8_t RunoutResponseDebounced::runout_count; // = 0 + int8_t RunoutResponseDebounced::runout_count; // = 0 #endif #endif // FILAMENT_RUNOUT_SENSOR diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index 0cd12b5711..463f99d40b 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -38,7 +38,7 @@ //#define FILAMENT_RUNOUT_SENSOR_DEBUG -class FilamentSensorBase { +class FilamentMonitorBase { public: static bool enabled; @@ -47,16 +47,17 @@ class FilamentSensorBase { }; template -class TFilamentSensor : public FilamentSensorBase { +class TFilamentMonitor : public FilamentMonitorBase { private: typedef RESPONSE_T response_t; typedef SENSOR_T sensor_t; - static response_t response; - static sensor_t sensor; + static response_t response; + static sensor_t sensor; public: - static void setup() { + static inline void setup() { sensor.setup(); + reset(); } static inline void reset() { @@ -64,24 +65,37 @@ class TFilamentSensor : public FilamentSensorBase { response.reset(); } - // The sensor calls this method when filament is present + // Call this method when filament is present, + // so the response can reset its counter. static inline void filament_present(const uint8_t extruder) { response.filament_present(extruder); } - static inline void block_complete(const block_t *b) { - response.block_complete(b); - sensor.block_complete(b); + // Handle a block completion. RunoutResponseDelayed uses this to + // add up the length of filament moved while the filament is out. + static inline void block_completed(const block_t* const b) { + if (enabled) { + response.block_completed(b); + sensor.block_completed(b); + } } - static void run() { + // Give the response a chance to update its counter. + static inline void run() { if (enabled && !filament_ran_out && (IS_SD_PRINTING() || print_job_timer.isRunning())) { + #if FILAMENT_RUNOUT_DISTANCE_MM > 0 + cli(); // Prevent RunoutResponseDelayed::block_completed from accumulating here + #endif response.run(); sensor.run(); - if (response.has_runout()) { + const bool ran_out = response.has_run_out(); + #if FILAMENT_RUNOUT_DISTANCE_MM > 0 + sei(); + #endif + if (ran_out) { filament_ran_out = true; #if ENABLED(EXTENSIBLE_UI) - UI::onFilamentRunout(); + ExtUI::onFilamentRunout(); #endif enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT)); planner.synchronize(); @@ -92,12 +106,12 @@ class TFilamentSensor : public FilamentSensorBase { /*************************** FILAMENT PRESENCE SENSORS ***************************/ -class FilamentSensorTypeBase { +class FilamentSensorBase { protected: static void filament_present(const uint8_t extruder); public: - static void setup() { + static inline void setup() { #if ENABLED(FIL_RUNOUT_PULLUP) #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLUP(P) #elif ENABLED(FIL_RUNOUT_PULLDOWN) @@ -124,14 +138,8 @@ class FilamentSensorTypeBase { #endif } - #if FIL_RUNOUT_INVERTING - #define FIL_RUNOUT_INVERT_MASK (_BV(NUM_RUNOUT_SENSORS) - 1) - #else - #define FIL_RUNOUT_INVERT_MASK 0 - #endif - - // Return a bitmask of all runout sensor states - static uint8_t poll_runout_pins() { + // Return a bitmask of runout pin states + static inline uint8_t poll_runout_pins() { return ( (READ(FIL_RUNOUT_PIN ) ? _BV(0) : 0) #if NUM_RUNOUT_SENSORS > 1 @@ -149,159 +157,194 @@ class FilamentSensorTypeBase { #endif #endif #endif - ) ^ FIL_RUNOUT_INVERT_MASK; + ); } -}; -/** - * This sensor is a simple endstop - * switch in the path of the filament. It detects - * filament runout, but not stripouts or jams. - */ - -class FilamentSensorTypeSwitch : public FilamentSensorTypeBase { - private: - static bool poll_runout_pin(const uint8_t extruder) { - const uint8_t runout_bits = poll_runout_pins(); - #if NUM_RUNOUT_SENSORS == 1 - return runout_bits; // A single sensor applying to all extruders - #else - #if ENABLED(DUAL_X_CARRIAGE) - if (dual_x_carriage_mode == DXC_DUPLICATION_MODE || dual_x_carriage_mode == DXC_SCALED_DUPLICATION_MODE) - return runout_bits; // Any extruder - else - #elif ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) - if (extruder_duplication_enabled) - return runout_bits; // Any extruder - else + // Return a bitmask of runout flag states (1 bits always indicates runout) + static inline uint8_t poll_runout_states() { + return poll_runout_pins() ^ uint8_t( + #if DISABLED(FIL_RUNOUT_INVERTING) + _BV(NUM_RUNOUT_SENSORS) - 1 + #else + 0 #endif - return TEST(runout_bits, extruder); // Specific extruder - #endif - } - - public: - FORCE_INLINE static void block_complete(const block_t *b) {} - - FORCE_INLINE static void run() { - if (!poll_runout_pin(active_extruder)) - filament_present(active_extruder); + ); } }; -// This filament sensor uses a magnetic encoder disc and a hall -// effect sensor (or a slitted disc and an optical sensor). The state -// will toggle between 0 and 1 with filament movement. It can detect -// filament runout and stripouts or jams. +#if ENABLED(FILAMENT_MOTION_SENSOR) -class FilamentSensorTypeEncoder : public FilamentSensorTypeBase { - private: - static uint8_t motion_detected, old_state; + /** + * This sensor uses a magnetic encoder disc and a Hall effect + * sensor (or a slotted disc and optical sensor). The state + * will toggle between 0 and 1 on filament movement. It can detect + * filament runout and stripouts or jams. + */ + class FilamentSensorEncoder : public FilamentSensorBase { + private: + static uint8_t motion_detected; - static void poll_motion_sensor() { - const uint8_t new_state = poll_runout_pins(), - change = old_state ^ new_state; - old_state = new_state; + static inline void poll_motion_sensor() { + static uint8_t old_state; + const uint8_t new_state = poll_runout_pins(), + change = old_state ^ new_state; + old_state = new_state; - #ifdef FILAMENT_RUNOUT_SENSOR_DEBUG - if (change) SERIAL_PROTOCOLLNPAIR("motion detected: ", change); - #endif + #ifdef FILAMENT_RUNOUT_SENSOR_DEBUG + if (change) { + SERIAL_ECHOPGM("Motion detected:"); + for (uint8_t e = 0; e < NUM_RUNOUT_SENSORS; e++) + if (TEST(change, e)) { SERIAL_CHAR(' '); SERIAL_CHAR('0' + e); } + SERIAL_EOL(); + } + #endif - motion_detected |= change; - } + motion_detected |= change; + } - public: - static void block_complete(const block_t *b) { - // If the just-executed block caused the sensor wheel - // to turn, reset the runout counter for that extruder. - if (TEST(motion_detected, b->extruder)) - filament_present(b->extruder); + public: + static inline void block_completed(const block_t* const b) { + // If the sensor wheel has moved since the last call to + // this method reset the runout counter for the extruder. + if (TEST(motion_detected, b->extruder)) + filament_present(b->extruder); - // Clear motion triggers for next block - motion_detected = 0; - } + // Clear motion triggers for next block + motion_detected = 0; + } - FORCE_INLINE static void run() { poll_motion_sensor(); } -}; + static inline void run() { poll_motion_sensor(); } + }; + +#else + + /** + * This is a simple endstop switch in the path of the filament. + * It can detect filament runout, but not stripouts or jams. + */ + class FilamentSensorSwitch : public FilamentSensorBase { + private: + static inline bool poll_runout_state(const uint8_t extruder) { + const uint8_t runout_states = poll_runout_states(); + #if NUM_RUNOUT_SENSORS == 1 + UNUSED(extruder); + return runout_states; // A single sensor applying to all extruders + #else + #if ENABLED(DUAL_X_CARRIAGE) + if (dual_x_carriage_mode == DXC_DUPLICATION_MODE || dual_x_carriage_mode == DXC_SCALED_DUPLICATION_MODE) + return runout_states; // Any extruder + else + #elif ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) + if (extruder_duplication_enabled) + return runout_states; // Any extruder + else + #endif + return TEST(runout_states, extruder); // Specific extruder + #endif + } + + public: + static inline void block_completed(const block_t* const b) { UNUSED(b); } + + static inline void run() { + const bool out = poll_runout_state(active_extruder); + if (!out) filament_present(active_extruder); + #ifdef FILAMENT_RUNOUT_SENSOR_DEBUG + static bool was_out = false; + if (out != was_out) { + was_out = out; + SERIAL_ECHOPGM("Filament "); + serialprintPGM(out ? PSTR("OUT\n") : PSTR("IN\n")); + } + #endif + } + }; + + +#endif // !FILAMENT_MOTION_SENSOR /********************************* RESPONSE TYPE *********************************/ #if FILAMENT_RUNOUT_DISTANCE_MM > 0 - // The RunoutResponseDelayed will trigger an runout event only after - // RUNOUT_DISTANCE_MM of filament have been fed after a runout condition. + // RunoutResponseDelayed triggers a runout event only if the length + // of filament specified by FILAMENT_RUNOUT_DISTANCE_MM has been fed + // during a runout condition. class RunoutResponseDelayed { private: - static int32_t steps_since_detection[EXTRUDERS]; - - static float get_mm_since_runout(const uint8_t extruder) { - return (steps_since_detection[extruder] / planner.settings.axis_steps_per_mm[E_AXIS_N(extruder)]); - } + static volatile float runout_mm_countdown[EXTRUDERS]; public: static float runout_distance_mm; - FORCE_INLINE static bool has_runout() { - return get_mm_since_runout(active_extruder) > runout_distance_mm; - } - - static inline void filament_present(const uint8_t extruder) { - steps_since_detection[extruder] = 0; + static inline void reset() { + LOOP_L_N(i, EXTRUDERS) filament_present(i); } static inline void run() { #ifdef FILAMENT_RUNOUT_SENSOR_DEBUG - static uint16_t r = 0; - if ((r++ % 24000) == 0) { - SERIAL_PROTOCOLPGM("mm since filament detection: "); - LOOP_L_N(i, NUM_RUNOUT_SENSORS) { - if (i > 0) SERIAL_PROTOCOLPGM(", "); - SERIAL_PROTOCOL(get_mm_since_runout(i)); + static millis_t t = 0; + const millis_t ms = millis(); + if (ELAPSED(ms, t)) { + t = millis() + 1000UL; + LOOP_L_N(i, EXTRUDERS) { + serialprintPGM(i ? PSTR(", ") : PSTR("Remaining mm: ")); + SERIAL_ECHO(runout_mm_countdown[i]); } SERIAL_EOL(); } #endif } - static void reset() { - LOOP_L_N(i, NUM_RUNOUT_SENSORS) steps_since_detection[i] = 0; + static inline bool has_run_out() { + return runout_mm_countdown[active_extruder] < 0; } - static inline void block_complete(const block_t *b) { - steps_since_detection[b->extruder] += TEST(b->direction_bits, E_AXIS) ? -b->steps[E_AXIS] : b->steps[E_AXIS]; + static inline void filament_present(const uint8_t extruder) { + runout_mm_countdown[extruder] = runout_distance_mm; + } + + static inline void block_completed(const block_t* const b) { + if (b->steps[X_AXIS] || b->steps[Y_AXIS] || b->steps[Z_AXIS]) { + // Only trigger on extrusion with XYZ movement to allow filament change and retract/recover. + const uint8_t e = b->extruder; + const int32_t steps = b->steps[E_AXIS]; + runout_mm_countdown[e] -= (TEST(b->direction_bits, E_AXIS) ? -steps : steps) * planner.steps_to_mm[E_AXIS_N(e)]; + } } }; #else // !FILAMENT_RUNOUT_DISTANCE_MM - // The RunoutResponseDebounced will trigger an runout event after - // a runout condition is detected FIL_RUNOUT_THRESHOLD times in a row. + // RunoutResponseDebounced triggers a runout event after a runout + // condition has been detected runout_threshold times in a row. class RunoutResponseDebounced { private: - static constexpr uint8_t FIL_RUNOUT_THRESHOLD = 5; - static uint8_t runout_count; + static constexpr int8_t runout_threshold = 5; + static int8_t runout_count; public: - FORCE_INLINE static bool has_runout() { return runout_count > FIL_RUNOUT_THRESHOLD; } - FORCE_INLINE static void block_complete(const block_t *b) {} - FORCE_INLINE static void filament_present(const uint8_t extruder) { runout_count = 0; UNUSED(extruder); } - FORCE_INLINE static void run() { runout_count++; } - FORCE_INLINE static void reset() { runout_count = 0; } + static inline void reset() { runout_count = runout_threshold; } + static inline void run() { runout_count--; } + static inline bool has_run_out() { return runout_count < 0; } + static inline void block_completed(const block_t* const b) { UNUSED(b); } + static inline void filament_present(const uint8_t extruder) { runout_count = runout_threshold; UNUSED(extruder); } }; #endif // !FILAMENT_RUNOUT_DISTANCE_MM /********************************* TEMPLATE SPECIALIZATION *********************************/ -typedef TFilamentSensor< +typedef TFilamentMonitor< #if FILAMENT_RUNOUT_DISTANCE_MM > 0 #if ENABLED(FILAMENT_MOTION_SENSOR) - RunoutResponseDelayed, FilamentSensorTypeEncoder + RunoutResponseDelayed, FilamentSensorEncoder #else - RunoutResponseDelayed, FilamentSensorTypeSwitch + RunoutResponseDelayed, FilamentSensorSwitch #endif #else - RunoutResponseDebounced, FilamentSensorTypeSwitch + RunoutResponseDebounced, FilamentSensorSwitch #endif -> FilamentRunoutSensor; +> FilamentMonitor; -extern FilamentRunoutSensor runout; +extern FilamentMonitor runout; diff --git a/Marlin/src/feature/solenoid.cpp b/Marlin/src/feature/solenoid.cpp index 33b442ccc5..4b9b5d48ca 100644 --- a/Marlin/src/feature/solenoid.cpp +++ b/Marlin/src/feature/solenoid.cpp @@ -59,8 +59,7 @@ void enable_solenoid(const uint8_t num) { break; #endif default: - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_INVALID_SOLENOID); + SERIAL_ECHO_MSG(MSG_INVALID_SOLENOID); break; } } diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index 07128df4fc..c9c612e820 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -358,12 +358,12 @@ template static void tmc_status(TMC &st, const TMC_debug_enum i, const float spmm) { - SERIAL_ECHO('\t'); + SERIAL_CHAR('\t'); switch (i) { case TMC_CODES: st.printLabel(); break; case TMC_ENABLED: serialprintPGM(st.isEnabled() ? PSTR("true") : PSTR("false")); break; case TMC_CURRENT: SERIAL_ECHO(st.getMilliamps()); break; - case TMC_RMS_CURRENT: SERIAL_PROTOCOL(st.rms_current()); break; + case TMC_RMS_CURRENT: SERIAL_ECHO(st.rms_current()); break; case TMC_MAX_CURRENT: SERIAL_PRINT((float)st.rms_current() * 1.41, 0); break; case TMC_IRUN: SERIAL_PRINT(st.irun(), DEC); @@ -408,12 +408,12 @@ #if HAS_DRIVER(TMC2660) template void tmc_status(TMCMarlin &st, const TMC_debug_enum i, const float) { - SERIAL_ECHO('\t'); + SERIAL_CHAR('\t'); switch (i) { case TMC_CODES: st.printLabel(); break; case TMC_ENABLED: serialprintPGM(st.isEnabled() ? PSTR("true") : PSTR("false")); break; case TMC_CURRENT: SERIAL_ECHO(st.getMilliamps()); break; - case TMC_RMS_CURRENT: SERIAL_PROTOCOL(st.rms_current()); break; + case TMC_RMS_CURRENT: SERIAL_ECHO(st.rms_current()); break; case TMC_MAX_CURRENT: SERIAL_PRINT((float)st.rms_current() * 1.41, 0); break; case TMC_IRUN: SERIAL_PRINT(st.cs(), DEC); diff --git a/Marlin/src/feature/twibus.cpp b/Marlin/src/feature/twibus.cpp index ef1fa742a0..179e8d1f58 100644 --- a/Marlin/src/feature/twibus.cpp +++ b/Marlin/src/feature/twibus.cpp @@ -44,8 +44,7 @@ void TWIBus::reset() { void TWIBus::address(const uint8_t adr) { if (!WITHIN(adr, 8, 127)) { - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Bad I2C address (8-127)"); + SERIAL_ECHO_MSG("Bad I2C address (8-127)"); } this->addr = adr; diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 5bb7556554..0be62b6cfe 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -38,6 +38,7 @@ #include "../../module/planner.h" #include "../../module/stepper.h" #include "../../module/motion.h" +#include "../../module/tool_change.h" #include "../../module/temperature.h" #include "../../lcd/ultralcd.h" @@ -162,21 +163,15 @@ int8_t g26_prime_flag; * If the LCD is clicked, cancel, wait for release, return true */ bool user_canceled() { - if (!is_lcd_clicked()) return false; // Return if the button isn't pressed - lcd_setstatusPGM(PSTR("Mesh Validation Stopped."), 99); + if (!ui.button_pressed()) return false; // Return if the button isn't pressed + ui.set_status_P(PSTR("Mesh Validation Stopped."), 99); #if HAS_LCD_MENU - lcd_quick_feedback(true); + ui.quick_feedback(); #endif - wait_for_release(); + ui.wait_for_release(); return true; } - bool exit_from_g26() { - lcd_setstatusPGM(PSTR("Leaving G26"), -1); - wait_for_release(); - return G26_ERR; - } - #endif mesh_index_pair find_closest_circle_to_print(const float &X, const float &Y) { @@ -232,11 +227,11 @@ void move_to(const float &rx, const float &ry, const float &z, const float &e_de if (z != last_z) { last_z = z; - feed_value = planner.settings.max_feedrate_mm_s[Z_AXIS]/(3.0); // Base the feed rate off of the configured Z_AXIS feed rate + feed_value = planner.settings.max_feedrate_mm_s[Z_AXIS]/(2.0); // Base the feed rate off of the configured Z_AXIS feed rate destination[X_AXIS] = current_position[X_AXIS]; destination[Y_AXIS] = current_position[Y_AXIS]; - destination[Z_AXIS] = z; // We know the last_z==z or we wouldn't be in this block of code. + destination[Z_AXIS] = z; // We know the last_z!=z or we wouldn't be in this block of code. destination[E_AXIS] = current_position[E_AXIS]; G26_line_to_destination(feed_value); @@ -245,7 +240,7 @@ void move_to(const float &rx, const float &ry, const float &z, const float &e_de // Check if X or Y is involved in the movement. // Yes: a 'normal' movement. No: a retract() or recover() - feed_value = has_xy_component ? PLANNER_XY_FEEDRATE() / 10.0 : planner.settings.max_feedrate_mm_s[E_AXIS] / 1.5; + feed_value = has_xy_component ? PLANNER_XY_FEEDRATE() / 3.0 : planner.settings.max_feedrate_mm_s[E_AXIS] / 1.5; if (g26_debug_flag) SERIAL_ECHOLNPAIR("in move_to() feed_value for XY:", feed_value); @@ -412,58 +407,50 @@ inline bool look_for_lines_to_connect() { * wait for them to get up to temperature. */ inline bool turn_on_heaters() { - millis_t next = millis() + 5000UL; + + SERIAL_ECHOLNPGM("Waiting for heatup."); + #if HAS_HEATED_BED - #if ENABLED(ULTRA_LCD) - if (g26_bed_temp > 25) { - lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99); - lcd_quick_feedback(true); + + if (g26_bed_temp > 25) { + #if ENABLED(ULTRA_LCD) + ui.set_status_P(PSTR("G26 Heating Bed."), 99); + ui.quick_feedback(); #if HAS_LCD_MENU - lcd_external_control = true; + ui.capture(); #endif - #endif - thermalManager.setTargetBed(g26_bed_temp); - while (ABS(thermalManager.degBed() - g26_bed_temp) > 3) { + #endif + thermalManager.setTargetBed(g26_bed_temp); - #if HAS_LCD_MENU - if (is_lcd_clicked()) return exit_from_g26(); + // Wait for the temperature to stabilize + if (!thermalManager.wait_for_bed(true + #if G26_CLICK_CAN_CANCEL + , true #endif - - if (ELAPSED(millis(), next)) { - next = millis() + 5000UL; - thermalManager.print_heaterstates(); - SERIAL_EOL(); - } - idle(); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } - #if ENABLED(ULTRA_LCD) - } - lcd_setstatusPGM(PSTR("G26 Heating Nozzle."), 99); - lcd_quick_feedback(true); - #endif - #endif - - // Start heating the nozzle and wait for it to reach temperature. - thermalManager.setTargetHotend(g26_hotend_temp, 0); - while (ABS(thermalManager.degHotend(0) - g26_hotend_temp) > 3) { - - #if HAS_LCD_MENU - if (is_lcd_clicked()) return exit_from_g26(); - #endif - - if (ELAPSED(millis(), next)) { - next = millis() + 5000UL; - thermalManager.print_heaterstates(); - SERIAL_EOL(); + ) + ) return G26_ERR; } - idle(); - SERIAL_FLUSH(); // Prevent host M105 buffer overrun. - } + + #endif // HAS_HEATED_BED + + // Start heating the active nozzle + #if ENABLED(ULTRA_LCD) + ui.set_status_P(PSTR("G26 Heating Nozzle."), 99); + ui.quick_feedback(); + #endif + thermalManager.setTargetHotend(g26_hotend_temp, active_extruder); + + // Wait for the temperature to stabilize + if (!thermalManager.wait_for_hotend(active_extruder, true + #if G26_CLICK_CAN_CANCEL + , true + #endif + ) + ) return G26_ERR; #if ENABLED(ULTRA_LCD) - lcd_reset_status(); - lcd_quick_feedback(true); + ui.reset_status(); + ui.quick_feedback(); #endif return G26_OK; @@ -481,16 +468,16 @@ inline bool prime_nozzle() { if (g26_prime_flag == -1) { // The user wants to control how much filament gets purged - lcd_external_control = true; - lcd_setstatusPGM(PSTR("User-Controlled Prime"), 99); - lcd_chirp(); + ui.capture(); + ui.set_status_P(PSTR("User-Controlled Prime"), 99); + ui.chirp(); set_destination_from_current(); recover_filament(destination); // Make sure G26 doesn't think the filament is retracted(). - while (!is_lcd_clicked()) { - lcd_chirp(); + while (!ui.button_pressed()) { + ui.chirp(); destination[E_AXIS] += 0.25; #if ENABLED(PREVENT_LENGTHY_EXTRUDE) Total_Prime += 0.25; @@ -504,18 +491,18 @@ inline bool prime_nozzle() { // action to give the user a more responsive 'Stop'. } - wait_for_release(); + ui.wait_for_release(); - lcd_setstatusPGM(PSTR("Done Priming"), 99); - lcd_quick_feedback(true); - lcd_external_control = false; + ui.set_status_P(PSTR("Done Priming"), 99); + ui.quick_feedback(); + ui.release(); } else #endif { #if ENABLED(ULTRA_LCD) - lcd_setstatusPGM(PSTR("Fixed Length Prime."), 99); - lcd_quick_feedback(true); + ui.set_status_P(PSTR("Fixed Length Prime."), 99); + ui.quick_feedback(); #endif set_destination_from_current(); destination[E_AXIS] += g26_prime_length; @@ -553,17 +540,21 @@ float valid_trig_angle(float d) { * Q Retraction multiplier * R Repetitions (number of grid points) * S Nozzle Size (diameter) in mm + * T Tool index to change to, if included * U Random deviation (50 if no value given) * X X position * Y Y position */ void GcodeSuite::G26() { - SERIAL_ECHOLNPGM("G26 command started. Waiting for heater(s)."); + SERIAL_ECHOLNPGM("G26 starting..."); // Don't allow Mesh Validation without homing first, // or if the parameter parsing did not go OK, abort if (axis_unhomed_error()) return; + // Change the tool first, if specified + if (parser.seenval('T')) tool_change(parser.value_int()); + g26_extrusion_multiplier = EXTRUSION_MULTIPLIER; g26_retraction_multiplier = RETRACTION_MULTIPLIER; g26_layer_height = MESH_TEST_LAYER_HEIGHT; @@ -582,7 +573,7 @@ void GcodeSuite::G26() { if (parser.seenval('B')) { g26_bed_temp = parser.value_celsius(); if (g26_bed_temp && !WITHIN(g26_bed_temp, 40, 140)) { - SERIAL_PROTOCOLLNPGM("?Specified bed temperature not plausible (40-140C)."); + SERIAL_ECHOLNPGM("?Specified bed temperature not plausible (40-140C)."); return; } } @@ -590,7 +581,7 @@ void GcodeSuite::G26() { if (parser.seenval('L')) { g26_layer_height = parser.value_linear_units(); if (!WITHIN(g26_layer_height, 0.0, 2.0)) { - SERIAL_PROTOCOLLNPGM("?Specified layer height not plausible."); + SERIAL_ECHOLNPGM("?Specified layer height not plausible."); return; } } @@ -599,12 +590,12 @@ void GcodeSuite::G26() { if (parser.has_value()) { g26_retraction_multiplier = parser.value_float(); if (!WITHIN(g26_retraction_multiplier, 0.05, 15.0)) { - SERIAL_PROTOCOLLNPGM("?Specified Retraction Multiplier not plausible."); + SERIAL_ECHOLNPGM("?Specified Retraction Multiplier not plausible."); return; } } else { - SERIAL_PROTOCOLLNPGM("?Retraction Multiplier must be specified."); + SERIAL_ECHOLNPGM("?Retraction Multiplier must be specified."); return; } } @@ -612,7 +603,7 @@ void GcodeSuite::G26() { if (parser.seenval('S')) { g26_nozzle = parser.value_float(); if (!WITHIN(g26_nozzle, 0.1, 1.0)) { - SERIAL_PROTOCOLLNPGM("?Specified nozzle size not plausible."); + SERIAL_ECHOLNPGM("?Specified nozzle size not plausible."); return; } } @@ -622,7 +613,7 @@ void GcodeSuite::G26() { #if HAS_LCD_MENU g26_prime_flag = -1; #else - SERIAL_PROTOCOLLNPGM("?Prime length must be specified when not using an LCD."); + SERIAL_ECHOLNPGM("?Prime length must be specified when not using an LCD."); return; #endif } @@ -630,7 +621,7 @@ void GcodeSuite::G26() { g26_prime_flag++; g26_prime_length = parser.value_linear_units(); if (!WITHIN(g26_prime_length, 0.0, 25.0)) { - SERIAL_PROTOCOLLNPGM("?Specified prime length not plausible."); + SERIAL_ECHOLNPGM("?Specified prime length not plausible."); return; } } @@ -639,7 +630,7 @@ void GcodeSuite::G26() { if (parser.seenval('F')) { g26_filament_diameter = parser.value_linear_units(); if (!WITHIN(g26_filament_diameter, 1.0, 4.0)) { - SERIAL_PROTOCOLLNPGM("?Specified filament size not plausible."); + SERIAL_ECHOLNPGM("?Specified filament size not plausible."); return; } } @@ -652,7 +643,7 @@ void GcodeSuite::G26() { if (parser.seenval('H')) { g26_hotend_temp = parser.value_celsius(); if (!WITHIN(g26_hotend_temp, 165, 280)) { - SERIAL_PROTOCOLLNPGM("?Specified nozzle temperature not plausible."); + SERIAL_ECHOLNPGM("?Specified nozzle temperature not plausible."); return; } } @@ -668,21 +659,21 @@ void GcodeSuite::G26() { g26_repeats = parser.intval('R', GRID_MAX_POINTS + 1); #else if (!parser.seen('R')) { - SERIAL_PROTOCOLLNPGM("?(R)epeat must be specified when not using an LCD."); + SERIAL_ECHOLNPGM("?(R)epeat must be specified when not using an LCD."); return; } else g26_repeats = parser.has_value() ? parser.value_int() : GRID_MAX_POINTS + 1; #endif if (g26_repeats < 1) { - SERIAL_PROTOCOLLNPGM("?(R)epeat value not plausible; must be at least 1."); + SERIAL_ECHOLNPGM("?(R)epeat value not plausible; must be at least 1."); return; } g26_x_pos = parser.seenval('X') ? RAW_X_POSITION(parser.value_linear_units()) : current_position[X_AXIS]; g26_y_pos = parser.seenval('Y') ? RAW_Y_POSITION(parser.value_linear_units()) : current_position[Y_AXIS]; if (!position_is_reachable(g26_x_pos, g26_y_pos)) { - SERIAL_PROTOCOLLNPGM("?Specified X,Y coordinate out of bounds."); + SERIAL_ECHOLNPGM("?Specified X,Y coordinate out of bounds."); return; } @@ -724,7 +715,7 @@ void GcodeSuite::G26() { move_to(destination, g26_ooze_amount); #if HAS_LCD_MENU - lcd_external_control = true; + ui.capture(); #endif //debug_current_and_destination(PSTR("Starting G26 Mesh Validation Pattern.")); @@ -828,6 +819,19 @@ void GcodeSuite::G26() { recover_filament(destination); const float save_feedrate = feedrate_mm_s; feedrate_mm_s = PLANNER_XY_FEEDRATE() / 10.0; + + if (g26_debug_flag) { + SERIAL_ECHOPAIR(" plan_arc(ex=", endpoint[X_AXIS]); + SERIAL_ECHOPAIR(", ey=", endpoint[Y_AXIS]); + SERIAL_ECHOPAIR(", ez=", endpoint[Z_AXIS]); + SERIAL_ECHOPAIR(", len=", arc_length); + SERIAL_ECHOPAIR(") -> (ex=", current_position[X_AXIS]); + SERIAL_ECHOPAIR(", ey=", current_position[Y_AXIS]); + SERIAL_ECHOPAIR(", ez=", current_position[Z_AXIS]); + SERIAL_CHAR(')'); + SERIAL_EOL(); + } + plan_arc(endpoint, arc_offset, false); // Draw a counter-clockwise arc feedrate_mm_s = save_feedrate; set_destination_from_current(); @@ -890,7 +894,7 @@ void GcodeSuite::G26() { } while (--g26_repeats && location.x_index >= 0 && location.y_index >= 0); LEAVE: - lcd_setstatusPGM(PSTR("Leaving G26"), -1); + ui.set_status_P(PSTR("Leaving G26"), -1); retract_filament(destination); destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES; @@ -899,22 +903,22 @@ void GcodeSuite::G26() { move_to(destination, 0); // Raise the nozzle //debug_current_and_destination(PSTR("done doing Z-Raise.")); - destination[X_AXIS] = g26_x_pos; // Move back to the starting position + destination[X_AXIS] = g26_x_pos; // Move back to the starting position destination[Y_AXIS] = g26_y_pos; - //destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES; // Keep the nozzle where it is + //destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES; // Keep the nozzle where it is - move_to(destination, 0); // Move back to the starting position + move_to(destination, 0); // Move back to the starting position //debug_current_and_destination(PSTR("done doing X/Y move.")); #if HAS_LCD_MENU - lcd_external_control = false; // Give back control of the LCD Panel! + ui.release(); // Give back control of the LCD #endif if (!g26_keep_heaters_on) { #if HAS_HEATED_BED thermalManager.setTargetBed(0); #endif - thermalManager.setTargetHotend(0, 0); + thermalManager.setTargetHotend(active_extruder, 0); } } diff --git a/Marlin/src/gcode/bedlevel/M420.cpp b/Marlin/src/gcode/bedlevel/M420.cpp index 7fed4f9996..b3b60806ff 100644 --- a/Marlin/src/gcode/bedlevel/M420.cpp +++ b/Marlin/src/gcode/bedlevel/M420.cpp @@ -95,13 +95,13 @@ void GcodeSuite::M420() { const int16_t a = settings.calc_num_meshes(); if (!a) { - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); + SERIAL_ECHOLNPGM("?EEPROM storage not available."); return; } if (!WITHIN(storage_slot, 0, a - 1)) { - SERIAL_PROTOCOLLNPGM("?Invalid storage slot."); - SERIAL_PROTOCOLLNPAIR("?Use 0 to ", a - 1); + SERIAL_ECHOLNPGM("?Invalid storage slot."); + SERIAL_ECHOLNPAIR("?Use 0 to ", a - 1); return; } @@ -110,7 +110,7 @@ void GcodeSuite::M420() { #else - SERIAL_PROTOCOLLNPGM("?EEPROM storage not available."); + SERIAL_ECHOLNPGM("?EEPROM storage not available."); return; #endif @@ -206,13 +206,12 @@ void GcodeSuite::M420() { set_bed_leveling_enabled(to_enable); // Error if leveling failed to enable or reenable - if (to_enable && !planner.leveling_active) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M420_FAILED); - } + if (to_enable && !planner.leveling_active) + SERIAL_ERROR_MSG(MSG_ERR_M420_FAILED); SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("Bed Leveling ", planner.leveling_active ? MSG_ON : MSG_OFF); + SERIAL_ECHOPGM("Bed Leveling "); + serialprintln_onoff(planner.leveling_active); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) SERIAL_ECHO_START(); diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 547ef15612..fc76bf639e 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -293,15 +293,13 @@ G29_TYPE GcodeSuite::G29() { const bool seen_w = parser.seen('W'); if (seen_w) { if (!leveling_is_valid()) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("No bilinear grid"); + SERIAL_ERROR_MSG("No bilinear grid"); G29_RETURN(false); } const float rz = parser.seenval('Z') ? RAW_Z_POSITION(parser.value_linear_units()) : current_position[Z_AXIS]; if (!WITHIN(rz, -10, 10)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Bad Z value"); + SERIAL_ERROR_MSG("Bad Z value"); G29_RETURN(false); } @@ -343,7 +341,7 @@ G29_TYPE GcodeSuite::G29() { verbose_level = parser.intval('V'); if (!WITHIN(verbose_level, 0, 4)) { - SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0-4)."); + SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0-4)."); G29_RETURN(false); } @@ -364,11 +362,11 @@ G29_TYPE GcodeSuite::G29() { if (parser.seenval('P')) abl_grid_points_x = abl_grid_points_y = parser.value_int(); if (!WITHIN(abl_grid_points_x, 2, GRID_MAX_POINTS_X)) { - SERIAL_PROTOCOLLNPGM("?Probe points (X) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."); + SERIAL_ECHOLNPGM("?Probe points (X) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_X) ")."); G29_RETURN(false); } if (!WITHIN(abl_grid_points_y, 2, GRID_MAX_POINTS_Y)) { - SERIAL_PROTOCOLLNPGM("?Probe points (Y) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); + SERIAL_ECHOLNPGM("?Probe points (Y) is implausible (2-" STRINGIFY(GRID_MAX_POINTS_Y) ")."); G29_RETURN(false); } @@ -410,7 +408,7 @@ G29_TYPE GcodeSuite::G29() { || !position_is_reachable_by_probe(right_probe_bed_position, back_probe_bed_position) #endif ) { - SERIAL_PROTOCOLLNPGM("? (L,R,F,B) out of bounds."); + SERIAL_ECHOLNPGM("? (L,R,F,B) out of bounds."); G29_RETURN(false); } @@ -421,8 +419,8 @@ G29_TYPE GcodeSuite::G29() { #endif // ABL_GRID if (verbose_level > 0) { - SERIAL_PROTOCOLPGM("G29 Auto Bed Leveling"); - if (dryrun) SERIAL_PROTOCOLPGM(" (DRYRUN)"); + SERIAL_ECHOPGM("G29 Auto Bed Leveling"); + if (dryrun) SERIAL_ECHOPGM(" (DRYRUN)"); SERIAL_EOL(); } @@ -491,26 +489,26 @@ G29_TYPE GcodeSuite::G29() { // Abort current G29 procedure, go back to idle state if (seenA && g29_in_progress) { - SERIAL_PROTOCOLLNPGM("Manual G29 aborted"); + SERIAL_ECHOLNPGM("Manual G29 aborted"); #if HAS_SOFTWARE_ENDSTOPS soft_endstops_enabled = enable_soft_endstops; #endif set_bed_leveling_enabled(abl_should_enable); g29_in_progress = false; #if ENABLED(LCD_BED_LEVELING) - lcd_wait_for_move = false; + ui.wait_for_bl_move = false; #endif } // Query G29 status if (verbose_level || seenQ) { - SERIAL_PROTOCOLPGM("Manual G29 "); + SERIAL_ECHOPGM("Manual G29 "); if (g29_in_progress) { - SERIAL_PROTOCOLPAIR("point ", MIN(abl_probe_index + 1, abl_points)); - SERIAL_PROTOCOLLNPAIR(" of ", abl_points); + SERIAL_ECHOPAIR("point ", MIN(abl_probe_index + 1, abl_points)); + SERIAL_ECHOLNPAIR(" of ", abl_points); } else - SERIAL_PROTOCOLLNPGM("idle"); + SERIAL_ECHOLNPGM("idle"); } if (no_action) G29_RETURN(false); @@ -553,9 +551,9 @@ G29_TYPE GcodeSuite::G29() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_PROTOCOLPAIR("Save X", xCount); - SERIAL_PROTOCOLPAIR(" Y", yCount); - SERIAL_PROTOCOLLNPAIR(" Z", measured_z + zoffset); + SERIAL_ECHOPAIR("Save X", xCount); + SERIAL_ECHOPAIR(" Y", yCount); + SERIAL_ECHOLNPAIR(" Z", measured_z + zoffset); } #endif @@ -609,7 +607,7 @@ G29_TYPE GcodeSuite::G29() { // Leveling done! Fall through to G29 finishing code below - SERIAL_PROTOCOLLNPGM("Grid probing done."); + SERIAL_ECHOLNPGM("Grid probing done."); // Re-enable software endstops, if needed #if HAS_SOFTWARE_ENDSTOPS @@ -633,7 +631,7 @@ G29_TYPE GcodeSuite::G29() { } else { - SERIAL_PROTOCOLLNPGM("3-point probing done."); + SERIAL_ECHOLNPGM("3-point probing done."); // Re-enable software endstops, if needed #if HAS_SOFTWARE_ENDSTOPS @@ -790,7 +788,7 @@ G29_TYPE GcodeSuite::G29() { #if ENABLED(PROBE_MANUALLY) g29_in_progress = false; #if ENABLED(LCD_BED_LEVELING) - lcd_wait_for_move = false; + ui.wait_for_bl_move = false; #endif #endif @@ -829,18 +827,12 @@ G29_TYPE GcodeSuite::G29() { mean /= abl_points; if (verbose_level) { - SERIAL_PROTOCOLPGM("Eqn coefficients: a: "); - SERIAL_PROTOCOL_F(plane_equation_coefficients[0], 8); - SERIAL_PROTOCOLPGM(" b: "); - SERIAL_PROTOCOL_F(plane_equation_coefficients[1], 8); - SERIAL_PROTOCOLPGM(" d: "); - SERIAL_PROTOCOL_F(plane_equation_coefficients[2], 8); + SERIAL_ECHOPAIR_F("Eqn coefficients: a: ", plane_equation_coefficients[0], 8); + SERIAL_ECHOPAIR_F(" b: ", plane_equation_coefficients[1], 8); + SERIAL_ECHOPAIR_F(" d: ", plane_equation_coefficients[2], 8); + if (verbose_level > 2) + SERIAL_ECHOPAIR_F("\nMean of sampled points: ", mean, 8); SERIAL_EOL(); - if (verbose_level > 2) { - SERIAL_PROTOCOLPGM("Mean of sampled points: "); - SERIAL_PROTOCOL_F(mean, 8); - SERIAL_EOL(); - } } // Create the matrix but don't correct the position yet @@ -852,7 +844,7 @@ G29_TYPE GcodeSuite::G29() { // Show the Topography map if enabled if (do_topography_map) { - SERIAL_PROTOCOLLNPGM("\nBed Height Topography:\n" + SERIAL_ECHOLNPGM("\nBed Height Topography:\n" " +--- BACK --+\n" " | |\n" " L | (+) | R\n" @@ -879,17 +871,17 @@ G29_TYPE GcodeSuite::G29() { NOMORE(min_diff, eqnBVector[ind] - z_tmp); if (diff >= 0.0) - SERIAL_PROTOCOLPGM(" +"); // Include + for column alignment + SERIAL_ECHOPGM(" +"); // Include + for column alignment else - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOL_F(diff, 5); + SERIAL_CHAR(' '); + SERIAL_ECHO_F(diff, 5); } // xx SERIAL_EOL(); } // yy SERIAL_EOL(); if (verbose_level > 3) { - SERIAL_PROTOCOLLNPGM("\nCorrected Bed Height vs. Bed Topology:"); + SERIAL_ECHOLNPGM("\nCorrected Bed Height vs. Bed Topology:"); for (int8_t yy = abl_grid_points_y - 1; yy >= 0; yy--) { for (uint8_t xx = 0; xx < abl_grid_points_x; xx++) { @@ -902,11 +894,11 @@ G29_TYPE GcodeSuite::G29() { float diff = eqnBVector[ind] - z_tmp - min_diff; if (diff >= 0.0) - SERIAL_PROTOCOLPGM(" +"); + SERIAL_ECHOPGM(" +"); // Include + for column alignment else - SERIAL_PROTOCOLCHAR(' '); - SERIAL_PROTOCOL_F(diff, 5); + SERIAL_CHAR(' '); + SERIAL_ECHO_F(diff, 5); } // xx SERIAL_EOL(); } // yy diff --git a/Marlin/src/gcode/bedlevel/abl/M421.cpp b/Marlin/src/gcode/bedlevel/abl/M421.cpp index 8f3683af8c..b3b35832e8 100644 --- a/Marlin/src/gcode/bedlevel/abl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/abl/M421.cpp @@ -45,14 +45,10 @@ void GcodeSuite::M421() { hasZ = parser.seen('Z'), hasQ = !hasZ && parser.seen('Q'); - if (!hasI || !hasJ || !(hasZ || hasQ)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS); - } - else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY); - } + if (!hasI || !hasJ || !(hasZ || hasQ)) + SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS); + else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) + SERIAL_ERROR_MSG(MSG_ERR_MESH_XY); else { z_values[ix][iy] = parser.value_linear_units() + (hasQ ? z_values[ix][iy] : 0); #if ENABLED(ABL_BILINEAR_SUBDIVISION) diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index 16a7393e76..c56737ff68 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -39,7 +39,7 @@ #include "../../../module/stepper.h" // Save 130 bytes with non-duplication of PSTR -inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_PROTOCOLLNPGM(" not entered."); } +inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_ECHOLNPGM(" not entered."); } /** * G29: Mesh-based Z probe, probes a grid and produces a @@ -47,20 +47,13 @@ inline void echo_not_entered(const char c) { SERIAL_CHAR(c); SERIAL_PROTOCOLLNPG * * Parameters With MESH_BED_LEVELING: * - * S0 Produce a mesh report + * S0 Report the current mesh values * S1 Start probing mesh points * S2 Probe the next mesh point - * S3 Xn Yn Zn.nn Manually modify a single point + * S3 In Jn Zn.nn Manually modify a single point * S4 Zn.nn Set z offset. Positive away from bed, negative closer to bed. * S5 Reset and disable mesh * - * The S0 report the points as below - * - * +----> X-axis 1-n - * | - * | - * v Y-axis 1-n - * */ void GcodeSuite::G29() { @@ -71,26 +64,27 @@ void GcodeSuite::G29() { MeshLevelingState state = (MeshLevelingState)parser.byteval('S', (int8_t)MeshReport); if (!WITHIN(state, 0, 5)) { - SERIAL_PROTOCOLLNPGM("S out of range (0-5)."); + SERIAL_ECHOLNPGM("S out of range (0-5)."); return; } - int8_t px, py; + int8_t ix, iy; switch (state) { case MeshReport: + SERIAL_ECHOPGM("Mesh Bed Leveling "); if (leveling_is_valid()) { - SERIAL_PROTOCOLLNPAIR("State: ", planner.leveling_active ? MSG_ON : MSG_OFF); + serialprintln_onoff(planner.leveling_active); mbl.report_mesh(); } else - SERIAL_PROTOCOLLNPGM("Mesh bed leveling has no data."); + SERIAL_ECHOLNPGM("has no data."); break; case MeshStart: mbl.reset(); mbl_probe_index = 0; - if (!lcd_wait_for_move) { + if (!ui.wait_for_bl_move) { enqueue_and_echo_commands_P(PSTR("G28\nG29 S2")); return; } @@ -98,7 +92,7 @@ void GcodeSuite::G29() { case MeshNext: if (mbl_probe_index < 0) { - SERIAL_PROTOCOLLNPGM("Start mesh probing with \"G29 S1\" first."); + SERIAL_ECHOLNPGM("Start mesh probing with \"G29 S1\" first."); return; } // For each G29 S2... @@ -125,8 +119,8 @@ void GcodeSuite::G29() { soft_endstops_enabled = false; #endif - mbl.zigzag(mbl_probe_index++, px, py); - _manual_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]); + mbl.zigzag(mbl_probe_index++, ix, iy); + _manual_goto_xy(mbl.index_to_xpos[ix], mbl.index_to_ypos[iy]); } else { // One last "return to the bed" (as originally coded) at completion @@ -136,7 +130,7 @@ void GcodeSuite::G29() { // After recording the last point, activate home and activate mbl_probe_index = -1; - SERIAL_PROTOCOLLNPGM("Mesh probing done."); + SERIAL_ECHOLNPGM("Mesh probing done."); BUZZ(100, 659); BUZZ(100, 698); @@ -151,36 +145,36 @@ void GcodeSuite::G29() { #endif #if ENABLED(LCD_BED_LEVELING) - lcd_wait_for_move = false; + ui.wait_for_bl_move = false; #endif } break; case MeshSet: - if (parser.seenval('X')) { - px = parser.value_int() - 1; - if (!WITHIN(px, 0, GRID_MAX_POINTS_X - 1)) { - SERIAL_PROTOCOLPAIR("X out of range (0-", int(GRID_MAX_POINTS_X)); - SERIAL_PROTOCOLLNPGM(")"); + if (parser.seenval('I')) { + ix = parser.value_int(); + if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1)) { + SERIAL_ECHOPAIR("I out of range (0-", int(GRID_MAX_POINTS_X - 1)); + SERIAL_ECHOLNPGM(")"); return; } } else - return echo_not_entered('X'); + return echo_not_entered('J'); - if (parser.seenval('Y')) { - py = parser.value_int() - 1; - if (!WITHIN(py, 0, GRID_MAX_POINTS_Y - 1)) { - SERIAL_PROTOCOLPAIR("Y out of range (0-", int(GRID_MAX_POINTS_Y)); - SERIAL_PROTOCOLLNPGM(")"); + if (parser.seenval('J')) { + iy = parser.value_int(); + if (!WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) { + SERIAL_ECHOPAIR("J out of range (0-", int(GRID_MAX_POINTS_Y - 1)); + SERIAL_ECHOLNPGM(")"); return; } } else - return echo_not_entered('Y'); + return echo_not_entered('J'); if (parser.seenval('Z')) - mbl.z_values[px][py] = parser.value_linear_units(); + mbl.z_values[ix][iy] = parser.value_linear_units(); else return echo_not_entered('Z'); break; @@ -199,8 +193,8 @@ void GcodeSuite::G29() { } // switch(state) if (state == MeshNext) { - SERIAL_PROTOCOLPAIR("MBL G29 point ", MIN(mbl_probe_index, GRID_MAX_POINTS)); - SERIAL_PROTOCOLLNPAIR(" of ", int(GRID_MAX_POINTS)); + SERIAL_ECHOPAIR("MBL G29 point ", MIN(mbl_probe_index, GRID_MAX_POINTS)); + SERIAL_ECHOLNPAIR(" of ", int(GRID_MAX_POINTS)); } report_current_position(); diff --git a/Marlin/src/gcode/bedlevel/mbl/M421.cpp b/Marlin/src/gcode/bedlevel/mbl/M421.cpp index 3e0cd7f016..9392136b3b 100644 --- a/Marlin/src/gcode/bedlevel/mbl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/M421.cpp @@ -48,14 +48,10 @@ void GcodeSuite::M421() { const int8_t iy = hasJ ? parser.value_int() : hasY ? mbl.probe_index_y(RAW_Y_POSITION(parser.value_linear_units())) : -1; const bool hasZ = parser.seen('Z'), hasQ = !hasZ && parser.seen('Q'); - if (int(hasI && hasJ) + int(hasX && hasY) != 1 || !(hasZ || hasQ)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS); - } - else if (ix < 0 || iy < 0) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY); - } + if (int(hasI && hasJ) + int(hasX && hasY) != 1 || !(hasZ || hasQ)) + SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS); + else if (ix < 0 || iy < 0) + SERIAL_ERROR_MSG(MSG_ERR_MESH_XY); else mbl.set_z(ix, iy, parser.value_linear_units() + (hasQ ? mbl.z_values[ix][iy] : 0)); } diff --git a/Marlin/src/gcode/bedlevel/ubl/M421.cpp b/Marlin/src/gcode/bedlevel/ubl/M421.cpp index e8597eee22..4f50e9546a 100644 --- a/Marlin/src/gcode/bedlevel/ubl/M421.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/M421.cpp @@ -56,14 +56,10 @@ void GcodeSuite::M421() { iy = location.y_index; } - if (int(hasC) + int(hasI && hasJ) != 1 || !(hasZ || hasQ || hasN)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M421_PARAMETERS); - } - else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_MESH_XY); - } + if (int(hasC) + int(hasI && hasJ) != 1 || !(hasZ || hasQ || hasN)) + SERIAL_ERROR_MSG(MSG_ERR_M421_PARAMETERS); + else if (!WITHIN(ix, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(iy, 0, GRID_MAX_POINTS_Y - 1)) + SERIAL_ERROR_MSG(MSG_ERR_MESH_XY); else ubl.z_values[ix][iy] = hasN ? NAN : parser.value_linear_units() + (hasQ ? ubl.z_values[ix][iy] : 0); } diff --git a/Marlin/src/gcode/bedlevel/ubl/M49.cpp b/Marlin/src/gcode/bedlevel/ubl/M49.cpp index b83ffad61b..e6150a6e08 100644 --- a/Marlin/src/gcode/bedlevel/ubl/M49.cpp +++ b/Marlin/src/gcode/bedlevel/ubl/M49.cpp @@ -33,7 +33,7 @@ void GcodeSuite::M49() { g26_debug_flag ^= true; - SERIAL_PROTOCOLPGM("G26 Debug: "); + SERIAL_ECHOPGM("G26 Debug: "); serialprintPGM(g26_debug_flag ? PSTR("On\n") : PSTR("Off\n")); } diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 8a40e2bd61..eb4f4ef75b 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -92,8 +92,7 @@ // Disallow Z homing if X or Y are unknown if (!TEST(axis_known_position, X_AXIS) || !TEST(axis_known_position, Y_AXIS)) { LCD_MESSAGEPGM(MSG_ERR_Z_HOMING); - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_Z_HOMING); + SERIAL_ECHO_MSG(MSG_ERR_Z_HOMING); return; } @@ -135,8 +134,7 @@ } else { LCD_MESSAGEPGM(MSG_ZPROBE_OUT); - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ZPROBE_OUT); + SERIAL_ECHO_MSG(MSG_ZPROBE_OUT); } #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -425,7 +423,7 @@ void GcodeSuite::G28(const bool always_home_all) { tool_change(old_tool_index, 0, NO_FETCH); #endif - lcd_refresh(); + ui.refresh(); report_current_position(); #if ENABLED(NANODLP_Z_SYNC) diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 3aba869824..6843b57ec4 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -109,28 +109,28 @@ void ac_cleanup( } void print_signed_float(PGM_P const prefix, const float &f) { - SERIAL_PROTOCOLPGM(" "); + SERIAL_ECHOPGM(" "); serialprintPGM(prefix); - SERIAL_PROTOCOLCHAR(':'); + SERIAL_CHAR(':'); if (f >= 0) SERIAL_CHAR('+'); - SERIAL_PROTOCOL_F(f, 2); + SERIAL_ECHO_F(f, 2); } /** * - Print the delta settings */ static void print_calibration_settings(const bool end_stops, const bool tower_angles) { - SERIAL_PROTOCOLPAIR(".Height:", delta_height); + SERIAL_ECHOPAIR(".Height:", delta_height); if (end_stops) { print_signed_float(PSTR("Ex"), delta_endstop_adj[A_AXIS]); print_signed_float(PSTR("Ey"), delta_endstop_adj[B_AXIS]); print_signed_float(PSTR("Ez"), delta_endstop_adj[C_AXIS]); } if (end_stops && tower_angles) { - SERIAL_PROTOCOLPAIR(" Radius:", delta_radius); + SERIAL_ECHOPAIR(" Radius:", delta_radius); SERIAL_EOL(); SERIAL_CHAR('.'); - SERIAL_PROTOCOL_SP(13); + SERIAL_ECHO_SP(13); } if (tower_angles) { print_signed_float(PSTR("Tx"), delta_tower_angle_trim[A_AXIS]); @@ -138,11 +138,11 @@ static void print_calibration_settings(const bool end_stops, const bool tower_an print_signed_float(PSTR("Tz"), delta_tower_angle_trim[C_AXIS]); } if ((!end_stops && tower_angles) || (end_stops && !tower_angles)) { // XOR - SERIAL_PROTOCOLPAIR(" Radius:", delta_radius); + SERIAL_ECHOPAIR(" Radius:", delta_radius); } #if HAS_BED_PROBE if (!end_stops && !tower_angles) { - SERIAL_PROTOCOL_SP(30); + SERIAL_ECHO_SP(30); print_signed_float(PSTR("Offset"), zprobe_zoffset); } #endif @@ -153,7 +153,7 @@ static void print_calibration_settings(const bool end_stops, const bool tower_an * - Print the probe results */ static void print_calibration_results(const float z_pt[NPP + 1], const bool tower_points, const bool opposite_points) { - SERIAL_PROTOCOLPGM(". "); + SERIAL_ECHOPGM(". "); print_signed_float(PSTR("c"), z_pt[CEN]); if (tower_points) { print_signed_float(PSTR(" x"), z_pt[__A]); @@ -163,7 +163,7 @@ static void print_calibration_results(const float z_pt[NPP + 1], const bool towe if (tower_points && opposite_points) { SERIAL_EOL(); SERIAL_CHAR('.'); - SERIAL_PROTOCOL_SP(13); + SERIAL_ECHO_SP(13); } if (opposite_points) { print_signed_float(PSTR("yz"), z_pt[_BC]); @@ -438,7 +438,7 @@ void GcodeSuite::G33() { const int8_t probe_points = set_up ? 2 : parser.intval('P', DELTA_CALIBRATION_DEFAULT_POINTS); if (!WITHIN(probe_points, -1, 10)) { - SERIAL_PROTOCOLLNPGM("?(P)oints is implausible (-1 - 10)."); + SERIAL_ECHOLNPGM("?(P)oints is implausible (-1 - 10)."); return; } @@ -446,19 +446,19 @@ void GcodeSuite::G33() { const float calibration_precision = set_up ? Z_CLEARANCE_BETWEEN_PROBES / 5.0 : parser.floatval('C', 0.0); if (calibration_precision < 0) { - SERIAL_PROTOCOLLNPGM("?(C)alibration precision is implausible (>=0)."); + SERIAL_ECHOLNPGM("?(C)alibration precision is implausible (>=0)."); return; } const int8_t force_iterations = parser.intval('F', 0); if (!WITHIN(force_iterations, 0, 30)) { - SERIAL_PROTOCOLLNPGM("?(F)orce iteration is implausible (0 - 30)."); + SERIAL_ECHOLNPGM("?(F)orce iteration is implausible (0 - 30)."); return; } const int8_t verbose_level = parser.byteval('V', 1); if (!WITHIN(verbose_level, 0, 3)) { - SERIAL_PROTOCOLLNPGM("?(V)erbose level is implausible (0 - 3)."); + SERIAL_ECHOLNPGM("?(V)erbose level is implausible (0 - 3)."); return; } @@ -503,14 +503,14 @@ void GcodeSuite::G33() { delta_tower_angle_trim[C_AXIS] }; - SERIAL_PROTOCOLLNPGM("G33 Auto Calibrate"); + SERIAL_ECHOLNPGM("G33 Auto Calibrate"); if (!_1p_calibration && !_0p_calibration) { // test if the outer radius is reachable LOOP_CAL_RAD(axis) { const float a = RADIANS(210 + (360 / NPP) * (axis - 1)), r = delta_calibration_radius; if (!position_is_reachable(cos(a) * r, sin(a) * r)) { - SERIAL_PROTOCOLLNPGM("?(M665 B)ed radius is implausible."); + SERIAL_ECHOLNPGM("?(M665 B)ed radius is implausible."); return; } } @@ -519,10 +519,10 @@ void GcodeSuite::G33() { // Report settings PGM_P checkingac = PSTR("Checking... AC"); serialprintPGM(checkingac); - if (verbose_level == 0) SERIAL_PROTOCOLPGM(" (DRY-RUN)"); - if (set_up) SERIAL_PROTOCOLPGM(" (SET-UP)"); + if (verbose_level == 0) SERIAL_ECHOPGM(" (DRY-RUN)"); + if (set_up) SERIAL_ECHOPGM(" (SET-UP)"); SERIAL_EOL(); - lcd_setstatusPGM(checkingac); + ui.set_status_P(checkingac); print_calibration_settings(_endstop_results, _angle_results); @@ -540,7 +540,7 @@ void GcodeSuite::G33() { // Probe the points zero_std_dev_old = zero_std_dev; if (!probe_calibration_points(z_at_pt, probe_points, towers_set, stow_after_each, set_up)) { - SERIAL_PROTOCOLLNPGM("Correct delta settings with M665 and M666"); + SERIAL_ECHOLNPGM("Correct delta settings with M665 and M666"); return AC_CLEANUP(); } zero_std_dev = std_dev_points(z_at_pt, _0p_calibration, _1p_calibration, _4p_calibration, _4p_opposite_points); @@ -665,16 +665,15 @@ void GcodeSuite::G33() { if (verbose_level != 0) { // !dry run if ((zero_std_dev >= test_precision && iterations > force_iterations) || zero_std_dev <= calibration_precision) { // end iterations - SERIAL_PROTOCOLPGM("Calibration OK"); - SERIAL_PROTOCOL_SP(32); + SERIAL_ECHOPGM("Calibration OK"); + SERIAL_ECHO_SP(32); #if HAS_BED_PROBE if (zero_std_dev >= test_precision && !_1p_calibration && !_0p_calibration) - SERIAL_PROTOCOLPGM("rolling back."); + SERIAL_ECHOPGM("rolling back."); else #endif { - SERIAL_PROTOCOLPGM("std dev:"); - SERIAL_PROTOCOL_F(zero_std_dev_min, 3); + SERIAL_ECHOPAIR_F("std dev:", zero_std_dev_min, 3); } SERIAL_EOL(); char mess[21]; @@ -683,7 +682,7 @@ void GcodeSuite::G33() { sprintf_P(&mess[15], PSTR("0.%03i"), (int)LROUND(zero_std_dev_min * 1000.0)); else sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev_min)); - lcd_setstatus(mess); + ui.set_status(mess); print_calibration_settings(_endstop_results, _angle_results); serialprintPGM(save_message); SERIAL_EOL(); @@ -694,12 +693,10 @@ void GcodeSuite::G33() { sprintf_P(mess, PSTR("Iteration : %02i"), (int)iterations); else strcpy_P(mess, PSTR("No convergence")); - SERIAL_PROTOCOL(mess); - SERIAL_PROTOCOL_SP(32); - SERIAL_PROTOCOLPGM("std dev:"); - SERIAL_PROTOCOL_F(zero_std_dev, 3); - SERIAL_EOL(); - lcd_setstatus(mess); + SERIAL_ECHO(mess); + SERIAL_ECHO_SP(32); + SERIAL_ECHOLNPAIR_F("std dev:", zero_std_dev, 3); + ui.set_status(mess); if (verbose_level > 1) print_calibration_settings(_endstop_results, _angle_results); } @@ -707,10 +704,8 @@ void GcodeSuite::G33() { else { // dry run PGM_P enddryrun = PSTR("End DRY-RUN"); serialprintPGM(enddryrun); - SERIAL_PROTOCOL_SP(35); - SERIAL_PROTOCOLPGM("std dev:"); - SERIAL_PROTOCOL_F(zero_std_dev, 3); - SERIAL_EOL(); + SERIAL_ECHO_SP(35); + SERIAL_ECHOLNPAIR_F("std dev:", zero_std_dev, 3); char mess[21]; strcpy_P(mess, enddryrun); @@ -719,7 +714,7 @@ void GcodeSuite::G33() { sprintf_P(&mess[15], PSTR("0.%03i"), (int)LROUND(zero_std_dev * 1000.0)); else sprintf_P(&mess[15], PSTR("%03i.x"), (int)LROUND(zero_std_dev)); - lcd_setstatus(mess); + ui.set_status(mess); } ac_home(); } diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index fbeb7b8669..33d0aa2f2e 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -263,19 +263,19 @@ void GcodeSuite::G34() { void GcodeSuite::M422() { const int8_t zstepper = parser.intval('S') - 1; if (!WITHIN(zstepper, 0, Z_STEPPER_COUNT - 1)) { - SERIAL_PROTOCOLLNPGM("?(S) Z-Stepper index invalid."); + SERIAL_ECHOLNPGM("?(S) Z-Stepper index invalid."); return; } const float x_pos = parser.floatval('X', z_auto_align_xpos[zstepper]); if (!WITHIN(x_pos, X_MIN_POS, X_MAX_POS)) { - SERIAL_PROTOCOLLNPGM("?(X) out of bounds."); + SERIAL_ECHOLNPGM("?(X) out of bounds."); return; } const float y_pos = parser.floatval('Y', z_auto_align_ypos[zstepper]); if (!WITHIN(y_pos, Y_MIN_POS, Y_MAX_POS)) { - SERIAL_PROTOCOLLNPGM("?(Y) out of bounds."); + SERIAL_ECHOLNPGM("?(Y) out of bounds."); return; } diff --git a/Marlin/src/gcode/calibrate/M100.cpp b/Marlin/src/gcode/calibrate/M100.cpp index e24c2c23d9..075004b01d 100644 --- a/Marlin/src/gcode/calibrate/M100.cpp +++ b/Marlin/src/gcode/calibrate/M100.cpp @@ -117,7 +117,7 @@ inline int32_t count_test_bytes(const char * const ptr) { print_hex_byte(ptr[i]); SERIAL_CHAR(' '); } - safe_delay(25); + serial_delay(25); SERIAL_CHAR('|'); // Point out non test bytes for (uint8_t i = 0; i < 16; i++) { char ccc = (char)ptr[i]; // cast to char before automatically casting to char on assignment, in case the compiler is broken @@ -131,7 +131,7 @@ inline int32_t count_test_bytes(const char * const ptr) { } SERIAL_EOL(); ptr += 16; - safe_delay(25); + serial_delay(25); idle(); } } @@ -170,7 +170,7 @@ inline int check_for_free_memory_corruption(PGM_P const title) { // safe_delay(20); // boards. // while ( !READ(63)) // idle(); - safe_delay(20); + serial_delay(20); #if ENABLED(M100_FREE_MEMORY_DUMPER) M100_dump_routine(PSTR(" Memory corruption detected with sp 0) - SERIAL_PROTOCOLLNPGM("M48 Z-Probe Repeatability Test"); + SERIAL_ECHOLNPGM("M48 Z-Probe Repeatability Test"); const int8_t n_samples = parser.byteval('P', 10); if (!WITHIN(n_samples, 4, 50)) { - SERIAL_PROTOCOLLNPGM("?Sample size not plausible (4-50)."); + SERIAL_ECHOLNPGM("?Sample size not plausible (4-50)."); return; } @@ -77,14 +77,14 @@ void GcodeSuite::M48() { Y_probe_location = parser.linearval('Y', Y_current + Y_PROBE_OFFSET_FROM_EXTRUDER); if (!position_is_reachable_by_probe(X_probe_location, Y_probe_location)) { - SERIAL_PROTOCOLLNPGM("? (X,Y) out of bounds."); + SERIAL_ECHOLNPGM("? (X,Y) out of bounds."); return; } bool seen_L = parser.seen('L'); uint8_t n_legs = seen_L ? parser.value_byte() : 0; if (n_legs > 15) { - SERIAL_PROTOCOLLNPGM("?Number of legs in movement not plausible (0-15)."); + SERIAL_ECHOLNPGM("?Number of legs in movement not plausible (0-15)."); return; } if (n_legs == 1) n_legs = 2; @@ -98,7 +98,7 @@ void GcodeSuite::M48() { * we don't want to use that as a starting point for each probe. */ if (verbose_level > 2) - SERIAL_PROTOCOLLNPGM("Positioning the probe..."); + SERIAL_ECHOLNPGM("Positioning the probe..."); // Disable bed level correction in M48 because we want the raw data when we probe @@ -178,7 +178,7 @@ void GcodeSuite::M48() { } #endif if (verbose_level > 3) { - SERIAL_PROTOCOLPGM("Going to:"); + SERIAL_ECHOPGM("Going to:"); SERIAL_ECHOPAIR(" X", X_current); SERIAL_ECHOPAIR(" Y", Y_current); SERIAL_ECHOLNPAIR(" Z", current_position[Z_AXIS]); @@ -215,22 +215,15 @@ void GcodeSuite::M48() { sigma = SQRT(sum / (n + 1)); if (verbose_level > 0) { if (verbose_level > 1) { - SERIAL_PROTOCOL(n + 1); - SERIAL_PROTOCOLPGM(" of "); - SERIAL_PROTOCOL((int)n_samples); - SERIAL_PROTOCOLPGM(": z: "); - SERIAL_PROTOCOL_F(sample_set[n], 3); + SERIAL_ECHO(n + 1); + SERIAL_ECHOPAIR(" of ", (int)n_samples); + SERIAL_ECHOPAIR_F(": z: ", sample_set[n], 3); if (verbose_level > 2) { - SERIAL_PROTOCOLPGM(" mean: "); - SERIAL_PROTOCOL_F(mean, 4); - SERIAL_PROTOCOLPGM(" sigma: "); - SERIAL_PROTOCOL_F(sigma, 6); - SERIAL_PROTOCOLPGM(" min: "); - SERIAL_PROTOCOL_F(min, 3); - SERIAL_PROTOCOLPGM(" max: "); - SERIAL_PROTOCOL_F(max, 3); - SERIAL_PROTOCOLPGM(" range: "); - SERIAL_PROTOCOL_F(max-min, 3); + SERIAL_ECHOPAIR_F(" mean: ", mean, 4); + SERIAL_ECHOPAIR_F(" sigma: ", sigma, 6); + SERIAL_ECHOPAIR_F(" min: ", min, 3); + SERIAL_ECHOPAIR_F(" max: ", max, 3); + SERIAL_ECHOPAIR_F(" range: ", max-min, 3); } SERIAL_EOL(); } @@ -242,23 +235,16 @@ void GcodeSuite::M48() { STOW_PROBE(); if (probing_good) { - SERIAL_PROTOCOLLNPGM("Finished!"); + SERIAL_ECHOLNPGM("Finished!"); if (verbose_level > 0) { - SERIAL_PROTOCOLPGM("Mean: "); - SERIAL_PROTOCOL_F(mean, 6); - SERIAL_PROTOCOLPGM(" Min: "); - SERIAL_PROTOCOL_F(min, 3); - SERIAL_PROTOCOLPGM(" Max: "); - SERIAL_PROTOCOL_F(max, 3); - SERIAL_PROTOCOLPGM(" Range: "); - SERIAL_PROTOCOL_F(max-min, 3); - SERIAL_EOL(); + SERIAL_ECHOPAIR_F("Mean: ", mean, 6); + SERIAL_ECHOPAIR_F(" Min: ", min, 3); + SERIAL_ECHOPAIR_F(" Max: ", max, 3); + SERIAL_ECHOLNPAIR_F(" Range: ", max-min, 3); } - SERIAL_PROTOCOLPGM("Standard Deviation: "); - SERIAL_PROTOCOL_F(sigma, 6); - SERIAL_EOL(); + SERIAL_ECHOLNPAIR_F("Standard Deviation: ", sigma, 6); SERIAL_EOL(); } diff --git a/Marlin/src/gcode/calibrate/M665.cpp b/Marlin/src/gcode/calibrate/M665.cpp index d0514ba598..78c5fdc8b8 100644 --- a/Marlin/src/gcode/calibrate/M665.cpp +++ b/Marlin/src/gcode/calibrate/M665.cpp @@ -84,8 +84,7 @@ if (sumAPX == 1) scara_home_offset[A_AXIS] = parser.value_float(); else { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Only one of A, P, or X is allowed."); + SERIAL_ERROR_MSG("Only one of A, P, or X is allowed."); return; } } @@ -96,8 +95,7 @@ if (sumBTY == 1) scara_home_offset[B_AXIS] = parser.value_float(); else { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Only one of B, T, or Y is allowed."); + SERIAL_ERROR_MSG("Only one of B, T, or Y is allowed."); return; } } diff --git a/Marlin/src/gcode/calibrate/M852.cpp b/Marlin/src/gcode/calibrate/M852.cpp index 71805a5b1a..9c946cd5a9 100644 --- a/Marlin/src/gcode/calibrate/M852.cpp +++ b/Marlin/src/gcode/calibrate/M852.cpp @@ -93,9 +93,7 @@ void GcodeSuite::M852() { if (!ijk) { SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SKEW_FACTOR " XY: "); - SERIAL_ECHO_F(planner.skew_factor.xy, 6); - SERIAL_EOL(); + SERIAL_ECHOLNPAIR_F(MSG_SKEW_FACTOR " XY: ", planner.skew_factor.xy, 6); #if ENABLED(SKEW_CORRECTION_FOR_Z) SERIAL_ECHOPAIR(" XZ: ", planner.skew_factor.xz); SERIAL_ECHOLNPAIR(" YZ: ", planner.skew_factor.yz); diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index 8b3562fb79..26bf108d40 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -34,7 +34,8 @@ */ void GcodeSuite::M200() { - if (get_target_extruder_from_command()) return; + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; if (parser.seen('D')) { // setting any extruder filament size disables volumetric on the assumption that @@ -55,11 +56,12 @@ */ void GcodeSuite::M201() { - GET_TARGET_EXTRUDER(); + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; LOOP_XYZE(i) { if (parser.seen(axis_codes[i])) { - const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0); + const uint8_t a = (i == E_AXIS ? E_AXIS_N(target_extruder) : i); planner.settings.max_acceleration_mm_per_s2[a] = parser.value_axis_units((AxisEnum)a); } } @@ -74,11 +76,12 @@ void GcodeSuite::M201() { */ void GcodeSuite::M203() { - GET_TARGET_EXTRUDER(); + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; LOOP_XYZE(i) if (parser.seen(axis_codes[i])) { - const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0); + const uint8_t a = (i == E_AXIS ? E_AXIS_N(target_extruder) : i); planner.settings.max_feedrate_mm_s[a] = parser.value_axis_units((AxisEnum)a); } } @@ -97,7 +100,7 @@ void GcodeSuite::M204() { SERIAL_ECHOLNPAIR(" T", planner.settings.travel_acceleration); } else { - planner.synchronize(); + //planner.synchronize(); // 'S' for legacy compatibility. Should NOT BE USED for new development if (parser.seenval('S')) planner.settings.travel_acceleration = planner.settings.acceleration = parser.value_linear_units(); if (parser.seenval('P')) planner.settings.acceleration = parser.value_linear_units(); @@ -131,7 +134,7 @@ void GcodeSuite::M205() { #endif if (!parser.seen("BST" J_PARAM XYZE_PARAM)) return; - planner.synchronize(); + //planner.synchronize(); if (parser.seen('B')) planner.settings.min_segment_time_us = parser.value_ulong(); if (parser.seen('S')) planner.settings.min_feedrate_mm_s = parser.value_linear_units(); if (parser.seen('T')) planner.settings.min_travel_feedrate_mm_s = parser.value_linear_units(); @@ -144,10 +147,8 @@ void GcodeSuite::M205() { planner.recalculate_max_e_jerk(); #endif } - else { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("?J out of range (0.01 to 0.3)"); - } + else + SERIAL_ERROR_MSG("?J out of range (0.01 to 0.3)"); } #endif #if HAS_CLASSIC_JERK diff --git a/Marlin/src/gcode/config/M217.cpp b/Marlin/src/gcode/config/M217.cpp index c9e2c56a5f..f23b9550f9 100644 --- a/Marlin/src/gcode/config/M217.cpp +++ b/Marlin/src/gcode/config/M217.cpp @@ -48,6 +48,10 @@ void M217_report(const bool eeprom=false) { SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(toolchange_settings.change_point.y)); #endif + #else + + UNUSED(eeprom); + #endif SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(toolchange_settings.z_raise)); diff --git a/Marlin/src/gcode/config/M218.cpp b/Marlin/src/gcode/config/M218.cpp index 4f7a353ae5..df17bd5647 100644 --- a/Marlin/src/gcode/config/M218.cpp +++ b/Marlin/src/gcode/config/M218.cpp @@ -40,7 +40,9 @@ * Z */ void GcodeSuite::M218() { - if (get_target_extruder_from_command() || target_extruder == 0) return; + + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; if (parser.seenval('X')) hotend_offset[X_AXIS][target_extruder] = parser.value_linear_units(); if (parser.seenval('Y')) hotend_offset[Y_AXIS][target_extruder] = parser.value_linear_units(); diff --git a/Marlin/src/gcode/config/M221.cpp b/Marlin/src/gcode/config/M221.cpp index e5d4204f5e..7129427862 100644 --- a/Marlin/src/gcode/config/M221.cpp +++ b/Marlin/src/gcode/config/M221.cpp @@ -27,7 +27,10 @@ * M221: Set extrusion percentage (M221 T0 S95) */ void GcodeSuite::M221() { - if (get_target_extruder_from_command()) return; + + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; + if (parser.seenval('S')) { planner.flow_percentage[target_extruder] = parser.value_int(); planner.refresh_e_factor(target_extruder); diff --git a/Marlin/src/gcode/config/M281.cpp b/Marlin/src/gcode/config/M281.cpp index 08e6f56334..f06ab05fdc 100644 --- a/Marlin/src/gcode/config/M281.cpp +++ b/Marlin/src/gcode/config/M281.cpp @@ -21,7 +21,7 @@ */ #include "../../inc/MarlinConfig.h" -#if HAS_SERVOS && ENABLED(EDITABLE_SERVO_ANGLES) +#if ENABLED(EDITABLE_SERVO_ANGLES) #include "../gcode.h" #include "../../module/servo.h" @@ -53,4 +53,4 @@ void GcodeSuite::M281() { } } -#endif // HAS_SERVOS && EDITABLE_SERVO_ANGLES +#endif // EDITABLE_SERVO_ANGLES diff --git a/Marlin/src/gcode/config/M301.cpp b/Marlin/src/gcode/config/M301.cpp index f61896ac73..73cde734ad 100644 --- a/Marlin/src/gcode/config/M301.cpp +++ b/Marlin/src/gcode/config/M301.cpp @@ -70,10 +70,8 @@ void GcodeSuite::M301() { #endif SERIAL_EOL(); } - else { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER); - } + else + SERIAL_ERROR_MSG(MSG_INVALID_EXTRUDER); } #endif // PIDTEMP diff --git a/Marlin/src/gcode/config/M43.cpp b/Marlin/src/gcode/config/M43.cpp index 2115a1d26e..963e882ac7 100644 --- a/Marlin/src/gcode/config/M43.cpp +++ b/Marlin/src/gcode/config/M43.cpp @@ -89,22 +89,20 @@ inline void toggle_pins() { inline void servo_probe_test() { #if !(NUM_SERVOS > 0 && HAS_SERVO_0) - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("SERVO not setup"); + SERIAL_ERROR_MSG("SERVO not setup"); #elif !HAS_Z_SERVO_PROBE - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Z_PROBE_SERVO_NR not setup"); + SERIAL_ERROR_MSG("Z_PROBE_SERVO_NR not setup"); #else // HAS_Z_SERVO_PROBE const uint8_t probe_index = parser.byteval('P', Z_PROBE_SERVO_NR); - SERIAL_PROTOCOLLNPGM("Servo probe test"); - SERIAL_PROTOCOLLNPAIR(". using index: ", probe_index); - SERIAL_PROTOCOLLNPAIR(". deploy angle: ", servo_angles[probe_index][0]); - SERIAL_PROTOCOLLNPAIR(". stow angle: ", servo_angles[probe_index][1]); + SERIAL_ECHOLNPGM("Servo probe test"); + SERIAL_ECHOLNPAIR(". using index: ", probe_index); + SERIAL_ECHOLNPAIR(". deploy angle: ", servo_angles[probe_index][0]); + SERIAL_ECHOLNPAIR(". stow angle: ", servo_angles[probe_index][1]); bool probe_inverting; @@ -112,14 +110,14 @@ inline void servo_probe_test() { #define PROBE_TEST_PIN Z_MIN_PIN - SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN pin: ", PROBE_TEST_PIN); - SERIAL_PROTOCOLLNPGM(". uses Z_MIN_ENDSTOP_INVERTING (ignores Z_MIN_PROBE_ENDSTOP_INVERTING)"); - SERIAL_PROTOCOLPGM(". Z_MIN_ENDSTOP_INVERTING: "); + SERIAL_ECHOLNPAIR(". probe uses Z_MIN pin: ", PROBE_TEST_PIN); + SERIAL_ECHOLNPGM(". uses Z_MIN_ENDSTOP_INVERTING (ignores Z_MIN_PROBE_ENDSTOP_INVERTING)"); + SERIAL_ECHOPGM(". Z_MIN_ENDSTOP_INVERTING: "); #if Z_MIN_ENDSTOP_INVERTING - SERIAL_PROTOCOLLNPGM("true"); + SERIAL_ECHOLNPGM("true"); #else - SERIAL_PROTOCOLLNPGM("false"); + SERIAL_ECHOLNPGM("false"); #endif probe_inverting = Z_MIN_ENDSTOP_INVERTING; @@ -127,21 +125,21 @@ inline void servo_probe_test() { #elif ENABLED(Z_MIN_PROBE_ENDSTOP) #define PROBE_TEST_PIN Z_MIN_PROBE_PIN - SERIAL_PROTOCOLLNPAIR(". probe uses Z_MIN_PROBE_PIN: ", PROBE_TEST_PIN); - SERIAL_PROTOCOLLNPGM(". uses Z_MIN_PROBE_ENDSTOP_INVERTING (ignores Z_MIN_ENDSTOP_INVERTING)"); - SERIAL_PROTOCOLPGM(". Z_MIN_PROBE_ENDSTOP_INVERTING: "); + SERIAL_ECHOLNPAIR(". probe uses Z_MIN_PROBE_PIN: ", PROBE_TEST_PIN); + SERIAL_ECHOLNPGM(". uses Z_MIN_PROBE_ENDSTOP_INVERTING (ignores Z_MIN_ENDSTOP_INVERTING)"); + SERIAL_ECHOPGM(". Z_MIN_PROBE_ENDSTOP_INVERTING: "); #if Z_MIN_PROBE_ENDSTOP_INVERTING - SERIAL_PROTOCOLLNPGM("true"); + SERIAL_ECHOLNPGM("true"); #else - SERIAL_PROTOCOLLNPGM("false"); + SERIAL_ECHOLNPGM("false"); #endif probe_inverting = Z_MIN_PROBE_ENDSTOP_INVERTING; #endif - SERIAL_PROTOCOLLNPGM(". deploy & stow 4 times"); + SERIAL_ECHOLNPGM(". deploy & stow 4 times"); SET_INPUT_PULLUP(PROBE_TEST_PIN); uint8_t i = 0; bool deploy_state, stow_state; @@ -153,26 +151,26 @@ inline void servo_probe_test() { safe_delay(500); stow_state = READ(PROBE_TEST_PIN); } while (++i < 4); - if (probe_inverting != deploy_state) SERIAL_PROTOCOLLNPGM("WARNING - INVERTING setting probably backwards"); + if (probe_inverting != deploy_state) SERIAL_ECHOLNPGM("WARNING - INVERTING setting probably backwards"); if (deploy_state != stow_state) { - SERIAL_PROTOCOLLNPGM("BLTouch clone detected"); + SERIAL_ECHOLNPGM("BLTouch clone detected"); if (deploy_state) { - SERIAL_PROTOCOLLNPGM(". DEPLOYED state: HIGH (logic 1)"); - SERIAL_PROTOCOLLNPGM(". STOWED (triggered) state: LOW (logic 0)"); + SERIAL_ECHOLNPGM(". DEPLOYED state: HIGH (logic 1)"); + SERIAL_ECHOLNPGM(". STOWED (triggered) state: LOW (logic 0)"); } else { - SERIAL_PROTOCOLLNPGM(". DEPLOYED state: LOW (logic 0)"); - SERIAL_PROTOCOLLNPGM(". STOWED (triggered) state: HIGH (logic 1)"); + SERIAL_ECHOLNPGM(". DEPLOYED state: LOW (logic 0)"); + SERIAL_ECHOLNPGM(". STOWED (triggered) state: HIGH (logic 1)"); } #if ENABLED(BLTOUCH) - SERIAL_PROTOCOLLNPGM("ERROR: BLTOUCH enabled - set this device up as a Z Servo Probe with inverting as true."); + SERIAL_ECHOLNPGM("ERROR: BLTOUCH enabled - set this device up as a Z Servo Probe with inverting as true."); #endif } else { // measure active signal length MOVE_SERVO(probe_index, servo_angles[Z_PROBE_SERVO_NR][0]); // Deploy safe_delay(500); - SERIAL_PROTOCOLLNPGM("please trigger probe"); + SERIAL_ECHOLNPGM("please trigger probe"); uint16_t probe_counter = 0; // Allow 30 seconds max for operator to trigger probe @@ -188,11 +186,11 @@ inline void servo_probe_test() { safe_delay(2); if (probe_counter == 50) - SERIAL_PROTOCOLLNPGM("Z Servo Probe detected"); // >= 100mS active time + SERIAL_ECHOLNPGM("Z Servo Probe detected"); // >= 100mS active time else if (probe_counter >= 2) - SERIAL_PROTOCOLLNPAIR("BLTouch compatible probe detected - pulse width (+/- 4mS): ", probe_counter * 2); // allow 4 - 100mS pulse + SERIAL_ECHOLNPAIR("BLTouch compatible probe detected - pulse width (+/- 4mS): ", probe_counter * 2); // allow 4 - 100mS pulse else - SERIAL_PROTOCOLLNPGM("noise detected - please re-run test"); // less than 2mS pulse + SERIAL_ECHOLNPGM("noise detected - please re-run test"); // less than 2mS pulse MOVE_SERVO(probe_index, servo_angles[Z_PROBE_SERVO_NR][1]); // Stow @@ -200,7 +198,7 @@ inline void servo_probe_test() { } // for loop waiting for trigger - if (probe_counter == 0) SERIAL_PROTOCOLLNPGM("trigger not detected"); + if (probe_counter == 0) SERIAL_ECHOLNPGM("trigger not detected"); } // measure active signal length @@ -245,9 +243,9 @@ void GcodeSuite::M43() { // Enable or disable endstop monitoring if (parser.seen('E')) { endstops.monitor_flag = parser.value_bool(); - SERIAL_PROTOCOLPGM("endstop monitor "); + SERIAL_ECHOPGM("endstop monitor "); serialprintPGM(endstops.monitor_flag ? PSTR("en") : PSTR("dis")); - SERIAL_PROTOCOLLNPGM("abled"); + SERIAL_ECHOLNPGM("abled"); return; } @@ -266,7 +264,7 @@ void GcodeSuite::M43() { // Watch until click, M108, or reset if (parser.boolval('W')) { - SERIAL_PROTOCOLLNPGM("Watching pins"); + SERIAL_ECHOLNPGM("Watching pins"); #ifdef ARDUINO_ARCH_SAM NOLESS(first_pin, 2); // don't hijack the UART pins diff --git a/Marlin/src/gcode/config/M92.cpp b/Marlin/src/gcode/config/M92.cpp index e0dd1eb26e..cb438d4142 100644 --- a/Marlin/src/gcode/config/M92.cpp +++ b/Marlin/src/gcode/config/M92.cpp @@ -31,21 +31,22 @@ */ void GcodeSuite::M92() { - GET_TARGET_EXTRUDER(); + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; LOOP_XYZE(i) { if (parser.seen(axis_codes[i])) { if (i == E_AXIS) { - const float value = parser.value_per_axis_units((AxisEnum)(E_AXIS + TARGET_EXTRUDER)); + const float value = parser.value_per_axis_units((AxisEnum)(E_AXIS_N(target_extruder))); if (value < 20) { - float factor = planner.settings.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] / value; // increase e constants if M92 E14 is given for netfab. + float factor = planner.settings.axis_steps_per_mm[E_AXIS_N(target_extruder)] / value; // increase e constants if M92 E14 is given for netfab. #if HAS_CLASSIC_JERK && (DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE)) planner.max_jerk[E_AXIS] *= factor; #endif - planner.settings.max_feedrate_mm_s[E_AXIS + TARGET_EXTRUDER] *= factor; - planner.max_acceleration_steps_per_s2[E_AXIS + TARGET_EXTRUDER] *= factor; + planner.settings.max_feedrate_mm_s[E_AXIS_N(target_extruder)] *= factor; + planner.max_acceleration_steps_per_s2[E_AXIS_N(target_extruder)] *= factor; } - planner.settings.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] = value; + planner.settings.axis_steps_per_mm[E_AXIS_N(target_extruder)] = value; } else { planner.settings.axis_steps_per_mm[i] = parser.value_per_axis_units((AxisEnum)i); diff --git a/Marlin/src/gcode/control/M17_M18_M84.cpp b/Marlin/src/gcode/control/M17_M18_M84.cpp index e4b94d99b6..33a6eae5ff 100644 --- a/Marlin/src/gcode/control/M17_M18_M84.cpp +++ b/Marlin/src/gcode/control/M17_M18_M84.cpp @@ -63,7 +63,7 @@ void GcodeSuite::M18_M84() { #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL) if (ubl.lcd_map_control) { ubl.lcd_map_control = false; - set_defer_return_to_status(false); + ui.defer_status_screen(false); } #endif } diff --git a/Marlin/src/gcode/control/M211.cpp b/Marlin/src/gcode/control/M211.cpp index 4b06ce9fbe..83db00a3bd 100644 --- a/Marlin/src/gcode/control/M211.cpp +++ b/Marlin/src/gcode/control/M211.cpp @@ -35,12 +35,8 @@ void GcodeSuite::M211() { SERIAL_ECHO_START(); SERIAL_ECHOPGM(MSG_SOFT_ENDSTOPS); - #if HAS_SOFTWARE_ENDSTOPS - if (parser.seen('S')) soft_endstops_enabled = parser.value_bool(); - serialprintPGM(soft_endstops_enabled ? PSTR(MSG_ON) : PSTR(MSG_OFF)); - #else - SERIAL_ECHOPGM(MSG_OFF); - #endif + if (parser.seen('S')) soft_endstops_enabled = parser.value_bool(); + serialprint_onoff(soft_endstops_enabled); SERIAL_ECHOPGM(MSG_SOFT_MIN); SERIAL_ECHOPAIR( MSG_X, LOGICAL_X_POSITION(soft_endstop_min[X_AXIS])); SERIAL_ECHOPAIR(" " MSG_Y, LOGICAL_Y_POSITION(soft_endstop_min[Y_AXIS])); diff --git a/Marlin/src/gcode/control/M605.cpp b/Marlin/src/gcode/control/M605.cpp index 3530881f50..bcd0cf7b76 100644 --- a/Marlin/src/gcode/control/M605.cpp +++ b/Marlin/src/gcode/control/M605.cpp @@ -153,7 +153,8 @@ planner.synchronize(); extruder_duplication_enabled = parser.intval('S') == (int)DXC_DUPLICATION_MODE; SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR(MSG_DUPLICATION_MODE, extruder_duplication_enabled ? MSG_ON : MSG_OFF); + SERIAL_ECHOPGM(MSG_DUPLICATION_MODE); + serialprintln_onoff(extruder_duplication_enabled); } #endif // DUAL_NOZZLE_DUPLICATION_MODE diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index 573a44bfa3..3dbf15a794 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -83,7 +83,7 @@ #endif #if HAS_LCD_MENU - lcd_reset_status(); + ui.reset_status(); #endif } diff --git a/Marlin/src/gcode/control/M999.cpp b/Marlin/src/gcode/control/M999.cpp index 12c2cfdc59..18a7287aed 100644 --- a/Marlin/src/gcode/control/M999.cpp +++ b/Marlin/src/gcode/control/M999.cpp @@ -38,7 +38,7 @@ */ void GcodeSuite::M999() { Running = true; - lcd_reset_alert_level(); + ui.reset_alert_level(); if (parser.boolval('S')) return; diff --git a/Marlin/src/gcode/control/T.cpp b/Marlin/src/gcode/control/T.cpp index 3911b8fbc4..ba6db22440 100644 --- a/Marlin/src/gcode/control/T.cpp +++ b/Marlin/src/gcode/control/T.cpp @@ -23,7 +23,7 @@ #include "../gcode.h" #include "../../module/tool_change.h" -#if ENABLED(DEBUG_LEVELING_FEATURE) || HOTENDS > 1 +#if ENABLED(DEBUG_LEVELING_FEATURE) || EXTRUDERS > 1 #include "../../module/motion.h" #endif @@ -33,27 +33,27 @@ * F[units/min] Set the movement feedrate * S1 Don't move the tool in XY after change */ -void GcodeSuite::T(const uint8_t tmp_extruder) { +void GcodeSuite::T(const uint8_t tool_index) { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR(">>> T(", tmp_extruder); + SERIAL_ECHOPAIR(">>> T(", tool_index); SERIAL_CHAR(')'); SERIAL_EOL(); DEBUG_POS("BEFORE", current_position); } #endif - #if HOTENDS == 1 || (ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1) + #if EXTRUDERS < 2 - tool_change(tmp_extruder); + tool_change(tool_index); - #elif HOTENDS > 1 + #else tool_change( - tmp_extruder, + tool_index, MMM_TO_MMS(parser.linearval('F')), - (tmp_extruder == active_extruder) || parser.boolval('S') + (tool_index == active_extruder) || parser.boolval('S') ); #endif diff --git a/Marlin/src/gcode/eeprom/M500-M504.cpp b/Marlin/src/gcode/eeprom/M500-M504.cpp index e37b4d47d8..504e9ec69f 100644 --- a/Marlin/src/gcode/eeprom/M500-M504.cpp +++ b/Marlin/src/gcode/eeprom/M500-M504.cpp @@ -45,7 +45,7 @@ void GcodeSuite::M500() { (void)settings.save(CHAT_PORT); #if ENABLED(EXTENSIBLE_UI) - UI::onStoreSettings(); + ExtUI::onStoreSettings(); #endif } @@ -59,7 +59,7 @@ void GcodeSuite::M501() { #endif ); #if ENABLED(EXTENSIBLE_UI) - UI::onLoadSettings(); + ExtUI::onLoadSettings(); #endif } @@ -69,7 +69,7 @@ void GcodeSuite::M501() { void GcodeSuite::M502() { (void)settings.reset(CHAT_PORT); #if ENABLED(EXTENSIBLE_UI) - UI::onFactoryReset(); + ExtUI::onFactoryReset(); #endif } @@ -94,9 +94,7 @@ void GcodeSuite::M502() { * M504: Validate EEPROM Contents */ void GcodeSuite::M504() { - if (settings.validate(CHAT_PORT)) { - SERIAL_ECHO_START_P(command_queue_port[cmd_queue_index_r]); - SERIAL_ECHOLNPGM_P(command_queue_port[cmd_queue_index_r], "EEPROM OK"); - } + if (settings.validate(CHAT_PORT)) + SERIAL_ECHO_MSG_P(command_queue_port[cmd_queue_index_r], "EEPROM OK"); } #endif diff --git a/Marlin/src/gcode/feature/advance/M900.cpp b/Marlin/src/gcode/feature/advance/M900.cpp index 8b1c60d9c7..d91b4db2cc 100644 --- a/Marlin/src/gcode/feature/advance/M900.cpp +++ b/Marlin/src/gcode/feature/advance/M900.cpp @@ -40,7 +40,7 @@ void GcodeSuite::M900() { #else const uint8_t tmp_extruder = parser.seenval('T') ? parser.value_int() : active_extruder; if (tmp_extruder >= EXTRUDERS) { - SERIAL_PROTOCOLLNPGM("?T value out of range."); + SERIAL_ECHOLNPGM("?T value out of range."); return; } #endif @@ -52,7 +52,7 @@ void GcodeSuite::M900() { planner.extruder_advance_K[tmp_extruder] = newK; } else - SERIAL_PROTOCOLLNPGM("?K value out of range (0-10)."); + SERIAL_ECHOLNPGM("?K value out of range (0-10)."); } else { SERIAL_ECHO_START(); diff --git a/Marlin/src/gcode/feature/caselight/M355.cpp b/Marlin/src/gcode/feature/caselight/M355.cpp index f22936d13c..3ad14791e5 100644 --- a/Marlin/src/gcode/feature/caselight/M355.cpp +++ b/Marlin/src/gcode/feature/caselight/M355.cpp @@ -63,7 +63,6 @@ void GcodeSuite::M355() { else SERIAL_ECHOLNPAIR("Case light: ", case_light_brightness); } #else - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M355_NONE); + SERIAL_ERROR_MSG(MSG_ERR_M355_NONE); #endif } diff --git a/Marlin/src/gcode/feature/filwidth/M404-M407.cpp b/Marlin/src/gcode/feature/filwidth/M404-M407.cpp index a096feef17..069745e1d3 100644 --- a/Marlin/src/gcode/feature/filwidth/M404-M407.cpp +++ b/Marlin/src/gcode/feature/filwidth/M404-M407.cpp @@ -38,10 +38,8 @@ void GcodeSuite::M404() { filament_width_nominal = parser.value_linear_units(); planner.volumetric_area_nominal = CIRCLE_AREA(filament_width_nominal * 0.5); } - else { - SERIAL_PROTOCOLPGM("Filament dia (nominal mm):"); - SERIAL_PROTOCOLLN(filament_width_nominal); - } + else + SERIAL_ECHOLNPAIR("Filament dia (nominal mm):", filament_width_nominal); } /** @@ -79,8 +77,7 @@ void GcodeSuite::M406() { * M407: Get measured filament diameter on serial output */ void GcodeSuite::M407() { - SERIAL_PROTOCOLPGM("Filament dia (measured mm):"); - SERIAL_PROTOCOLLN(filament_width_meas); + SERIAL_ECHOLNPAIR("Filament dia (measured mm):", filament_width_meas); } #endif // FILAMENT_WIDTH_SENSOR diff --git a/Marlin/src/gcode/feature/i2c/M260_M261.cpp b/Marlin/src/gcode/feature/i2c/M260_M261.cpp index 918e764c40..0721cc1da3 100644 --- a/Marlin/src/gcode/feature/i2c/M260_M261.cpp +++ b/Marlin/src/gcode/feature/i2c/M260_M261.cpp @@ -68,13 +68,10 @@ void GcodeSuite::M261() { uint8_t bytes = parser.byteval('B', 1); - if (i2c.addr && bytes && bytes <= TWIBUS_BUFFER_SIZE) { + if (i2c.addr && bytes && bytes <= TWIBUS_BUFFER_SIZE) i2c.relay(bytes); - } - else { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Bad i2c request"); - } + else + SERIAL_ERROR_MSG("Bad i2c request"); } #endif diff --git a/Marlin/src/gcode/feature/macro/M810-M819.cpp b/Marlin/src/gcode/feature/macro/M810-M819.cpp index 3e8a0e04b4..10f33b60e5 100644 --- a/Marlin/src/gcode/feature/macro/M810-M819.cpp +++ b/Marlin/src/gcode/feature/macro/M810-M819.cpp @@ -45,10 +45,8 @@ void GcodeSuite::M810_819() { if (len) { // Set a macro - if (len > GCODE_MACROS_SLOT_SIZE) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Macro too long."); - } + if (len > GCODE_MACROS_SLOT_SIZE) + SERIAL_ERROR_MSG("Macro too long."); else { char c, *s = parser.string_arg, *d = gcode_macros[index]; do { diff --git a/Marlin/src/gcode/feature/pause/M125.cpp b/Marlin/src/gcode/feature/pause/M125.cpp index ed98b8fc2c..5794f6af33 100644 --- a/Marlin/src/gcode/feature/pause/M125.cpp +++ b/Marlin/src/gcode/feature/pause/M125.cpp @@ -68,15 +68,17 @@ void GcodeSuite::M125() { park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0); #endif - const bool job_running = print_job_timer.isRunning(), - sd_printing = IS_SD_PRINTING(); + #if ENABLED(SDSUPPORT) + const bool sd_printing = IS_SD_PRINTING(); + #else + constexpr bool sd_printing = false; + #endif if (pause_print(retract, park_point)) { if (!sd_printing) { wait_for_confirmation(); resume_print(); } - if (job_running) print_job_timer.start(); } } diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index 92b431c435..0e01c9ddfe 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -54,7 +54,8 @@ void GcodeSuite::M600() { point_t park_point = NOZZLE_PARK_POINT; - if (get_target_extruder_from_command()) return; + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; #if ENABLED(DUAL_X_CARRIAGE) int8_t DXC_ext = target_extruder; @@ -128,8 +129,6 @@ void GcodeSuite::M600() { #endif ); - const bool job_running = print_job_timer.isRunning(); - if (pause_print(retract, park_point, unload_length, true DXC_PASS)) { wait_for_confirmation(true, beep_count DXC_PASS); resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count DXC_PASS); @@ -140,9 +139,6 @@ void GcodeSuite::M600() { if (active_extruder_before_filament_change != active_extruder) tool_change(active_extruder_before_filament_change, 0, true); #endif - - // Resume the print job timer if it was running - if (job_running) print_job_timer.start(); } #endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/gcode/feature/pause/M603.cpp b/Marlin/src/gcode/feature/pause/M603.cpp index 08236187dd..e4a5e5eaa9 100644 --- a/Marlin/src/gcode/feature/pause/M603.cpp +++ b/Marlin/src/gcode/feature/pause/M603.cpp @@ -43,7 +43,8 @@ */ void GcodeSuite::M603() { - if (get_target_extruder_from_command()) return; + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; // Unload length if (parser.seen('U')) { diff --git a/Marlin/src/gcode/feature/pause/M701_M702.cpp b/Marlin/src/gcode/feature/pause/M701_M702.cpp index a50b4efe72..fa9be253e2 100644 --- a/Marlin/src/gcode/feature/pause/M701_M702.cpp +++ b/Marlin/src/gcode/feature/pause/M701_M702.cpp @@ -55,7 +55,9 @@ void GcodeSuite::M701() { if (axis_unhomed_error()) park_point.z = 0; #endif - if (get_target_extruder_from_command()) return; + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; + // Z axis lift if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); @@ -121,7 +123,8 @@ void GcodeSuite::M702() { if (axis_unhomed_error()) park_point.z = 0; #endif - if (get_target_extruder_from_command()) return; + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; // Z axis lift if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); @@ -154,8 +157,8 @@ void GcodeSuite::M702() { #endif { // Unload length - const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) : - fc_settings[target_extruder].unload_length); + const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) + : fc_settings[target_extruder].unload_length); unload_filament(unload_length, true, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT); } diff --git a/Marlin/src/gcode/feature/powerloss/M1000.cpp b/Marlin/src/gcode/feature/powerloss/M1000.cpp new file mode 100644 index 0000000000..21862aa552 --- /dev/null +++ b/Marlin/src/gcode/feature/powerloss/M1000.cpp @@ -0,0 +1,65 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../../inc/MarlinConfig.h" + +#if ENABLED(POWER_LOSS_RECOVERY) + +#include "../../gcode.h" +#include "../../../feature/power_loss_recovery.h" +#include "../../../module/motion.h" +#include "../../../lcd/ultralcd.h" + +void menu_job_recovery(); + +#if ENABLED(DEBUG_POWER_LOSS_RECOVERY) + + inline void plr_error(PGM_P const prefix) { + SERIAL_ECHO_START(); + serialprintPGM(prefix); + SERIAL_ECHOLNPGM(" Power-Loss Recovery Data"); + } + +#endif + +/** + * M1000: Resume from power-loss (undocumented) + * - With 'S' go to the Resume/Cancel menu + * - With no parameters, run recovery commands + */ +void GcodeSuite::M1000() { + + if (recovery.valid()) { + if (parser.seen('S')) + ui.goto_screen(menu_job_recovery); + else + recovery.resume(); + } + else { + #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) + plr_error(recovery.info.valid_head ? PSTR("No") : PSTR("Invalid")); + #endif + } + +} + +#endif // POWER_LOSS_RECOVERY diff --git a/Marlin/src/gcode/feature/powerloss/M413.cpp b/Marlin/src/gcode/feature/powerloss/M413.cpp new file mode 100644 index 0000000000..b63645a2a6 --- /dev/null +++ b/Marlin/src/gcode/feature/powerloss/M413.cpp @@ -0,0 +1,58 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../../inc/MarlinConfig.h" + +#if ENABLED(POWER_LOSS_RECOVERY) + +#include "../../gcode.h" +#include "../../../feature/power_loss_recovery.h" +#include "../../../module/motion.h" +#include "../../../lcd/ultralcd.h" + +/** + * M413: Enable / Disable power-loss recovery + * + * Parameters + * S[bool] - Flag to enable / disable. + * If omitted, report current state. + */ +void GcodeSuite::M413() { + + if (parser.seen('S')) + recovery.enable(parser.value_bool()); + else { + SERIAL_ECHO_START(); + SERIAL_ECHOPGM("Power-loss recovery "); + serialprintln_onoff(recovery.enabled); + } + + #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) + if (parser.seen('R') || parser.seen('L')) recovery.load(); + if (parser.seen('W')) recovery.save(true); + if (parser.seen('P')) recovery.purge(); + if (parser.seen('E')) serialprintPGM(recovery.exists() ? PSTR("BIN Exists\n") : PSTR("No BIN\n")); + if (parser.seen('V')) serialprintPGM(recovery.valid() ? PSTR("Valid\n") : PSTR("Invalid\n")); + #endif +} + +#endif // POWER_LOSS_RECOVERY diff --git a/Marlin/src/gcode/feature/runout/M412.cpp b/Marlin/src/gcode/feature/runout/M412.cpp new file mode 100644 index 0000000000..577f9d705d --- /dev/null +++ b/Marlin/src/gcode/feature/runout/M412.cpp @@ -0,0 +1,45 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../../inc/MarlinConfig.h" + +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + +#include "../../gcode.h" +#include "../../../feature/runout.h" + +/** + * M412: Enable / Disable filament runout detection + */ +void GcodeSuite::M412() { + if (parser.seen('S')) { + runout.reset(); + runout.enabled = parser.value_bool(); + } + else { + SERIAL_ECHO_START(); + SERIAL_ECHOPGM("Filament runout "); + serialprintln_onoff(runout.enabled); + } +} + +#endif // FILAMENT_RUNOUT_SENSOR diff --git a/Marlin/src/gcode/feature/trinamic/M906.cpp b/Marlin/src/gcode/feature/trinamic/M906.cpp index 66f8efd28f..1ff2825466 100644 --- a/Marlin/src/gcode/feature/trinamic/M906.cpp +++ b/Marlin/src/gcode/feature/trinamic/M906.cpp @@ -73,7 +73,8 @@ void GcodeSuite::M906() { #endif break; case E_AXIS: { - if (get_target_extruder_from_command()) return; + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; switch (target_extruder) { #if AXIS_IS_TMC(E0) case 0: TMC_SET_CURRENT(E0); break; diff --git a/Marlin/src/gcode/feature/trinamic/M911-M915.cpp b/Marlin/src/gcode/feature/trinamic/M911-M915.cpp index 6651930285..ee134067e3 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M915.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M915.cpp @@ -232,7 +232,8 @@ #endif break; case E_AXIS: { - if (get_target_extruder_from_command()) return; + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; switch (target_extruder) { #if AXIS_HAS_STEALTHCHOP(E0) case 0: TMC_SET_PWMTHRS_E(0); break; diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 1281f4519e..8aea242a46 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -38,7 +38,6 @@ GcodeSuite gcode; #include "../Marlin.h" // for idle() and suspend_auto_report -uint8_t GcodeSuite::target_extruder; millis_t GcodeSuite::previous_move_ms; bool GcodeSuite::axis_relative_modes[] = AXIS_RELATIVE_MODES; @@ -58,26 +57,21 @@ bool GcodeSuite::axis_relative_modes[] = AXIS_RELATIVE_MODES; #endif /** - * Set target_extruder from the T parameter or the active_extruder - * - * Returns TRUE if the target is invalid + * Get the target extruder from the T parameter or the active_extruder + * Return -1 if the T parameter is out of range */ -bool GcodeSuite::get_target_extruder_from_command() { +int8_t GcodeSuite::get_target_extruder_from_command() { if (parser.seenval('T')) { const int8_t e = parser.value_byte(); if (e >= EXTRUDERS) { SERIAL_ECHO_START(); - SERIAL_CHAR('M'); - SERIAL_ECHO(parser.codenum); - SERIAL_ECHOLNPAIR(" " MSG_INVALID_EXTRUDER " ", e); - return true; + SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum); + SERIAL_ECHOLNPAIR(" " MSG_INVALID_EXTRUDER " ", int(e)); + return -1; } - target_extruder = e; + return e; } - else - target_extruder = active_extruder; - - return false; + return active_extruder; } /** @@ -539,7 +533,9 @@ void GcodeSuite::process_parsed_command( case 302: M302(); break; // M302: Allow cold extrudes (set the minimum extrude temperature) #endif - case 303: M303(); break; // M303: PID autotune + #if HAS_PID_HEATING + case 303: M303(); break; // M303: PID autotune + #endif #if ENABLED(MORGAN_SCARA) case 360: if (M360()) return; break; // M360: SCARA Theta pos1 @@ -568,6 +564,10 @@ void GcodeSuite::process_parsed_command( case 407: M407(); break; // M407: Display measured filament diameter #endif + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + case 412: M412(); break; // M412: Enable/Disable filament runout detection + #endif + #if HAS_LEVELING case 420: M420(); break; // M420: Enable/Disable Bed Leveling #endif @@ -695,6 +695,11 @@ void GcodeSuite::process_parsed_command( case 999: M999(); break; // M999: Restart after being Stopped + #if ENABLED(POWER_LOSS_RECOVERY) + case 413: M413(); break; // M413: Enable/disable/query Power-Loss Recovery + case 1000: M1000(); break; // M1000: Resume from power-loss + #endif + default: parser.unknown_command_error(); break; } break; @@ -785,16 +790,13 @@ void GcodeSuite::process_next_command() { switch (busy_state) { case IN_HANDLER: case IN_PROCESS: - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_BUSY_PROCESSING); + SERIAL_ECHO_MSG(MSG_BUSY_PROCESSING); break; case PAUSED_FOR_USER: - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_BUSY_PAUSED_FOR_USER); + SERIAL_ECHO_MSG(MSG_BUSY_PAUSED_FOR_USER); break; case PAUSED_FOR_INPUT: - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_BUSY_PAUSED_FOR_INPUT); + SERIAL_ECHO_MSG(MSG_BUSY_PAUSED_FOR_INPUT); break; default: break; diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index cb29abed56..42671b6243 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -78,7 +78,7 @@ * M3 - Turn laser/spindle on, set spindle/laser speed/power, set rotation to clockwise * M4 - Turn laser/spindle on, set spindle/laser speed/power, set rotation to counter-clockwise * M5 - Turn laser/spindle off - * M12 - Set up closed loop control system. More features coming soon. (Requires EXTERNAL_CLOSED_LOOP_CONTROLLER) + * M12 - Set up closed loop control system. (Requires EXTERNAL_CLOSED_LOOP_CONTROLLER) * M17 - Enable/Power all stepper motors * M18 - Disable all stepper motors; same as M84 * M20 - List SD card. (Requires SDSUPPORT) @@ -196,6 +196,8 @@ * M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR) * M407 - Display measured filament diameter in millimeters. (Requires FILAMENT_WIDTH_SENSOR) * M410 - Quickstop. Abort all planned moves. + * M412 - Enable / Disable Filament Runout Detection. (Requires FILAMENT_RUNOUT_SENSOR) + * M413 - Enable / Disable Power-Loss Recovery. (Requires POWER_LOSS_RECOVERY) * M420 - Enable/Disable Leveling (with current values) S1=enable S0=disable (Requires MESH_BED_LEVELING or ABL) * M421 - Set a single Z coordinate in the Mesh Leveling grid. X Y Z (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, or AUTO_BED_LEVELING_UBL) * M422 - Set Z Stepper automatic alignment position using probe. X Y A (Requires Z_STEPPER_AUTO_ALIGN) @@ -266,8 +268,6 @@ public: GcodeSuite() {} - static uint8_t target_extruder; - static bool axis_relative_modes[]; #if ENABLED(CNC_WORKSPACE_PLANES) @@ -289,8 +289,9 @@ public: static millis_t previous_move_ms; FORCE_INLINE static void reset_stepper_timeout() { previous_move_ms = millis(); } - static bool get_target_extruder_from_command(); + static int8_t get_target_extruder_from_command(); static void get_destination_from_command(); + static void process_parsed_command( #if USE_EXECUTE_COMMANDS_IMMEDIATE const bool no_ok = false @@ -305,17 +306,6 @@ public: FORCE_INLINE static void home_all_axes() { G28(true); } - /** - * Multi-stepper support for M92, M201, M203 - */ - #if ENABLED(DISTINCT_E_FACTORS) - #define GET_TARGET_EXTRUDER() if (gcode.get_target_extruder_from_command()) return - #define TARGET_EXTRUDER gcode.target_extruder - #else - #define GET_TARGET_EXTRUDER() NOOP - #define TARGET_EXTRUDER 0 - #endif - #if ENABLED(HOST_KEEPALIVE_FEATURE) /** * States for managing Marlin and host communication @@ -668,7 +658,9 @@ private: static void M302(); #endif - static void M303(); + #if HAS_PID_HEATING + static void M303(); + #endif #if ENABLED(PIDTEMPBED) static void M304(); @@ -708,6 +700,10 @@ private: static void M407(); #endif + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + static void M412(); + #endif + #if HAS_LEVELING static void M420(); static void M421(); @@ -827,7 +823,12 @@ private: static void M999(); - static void T(const uint8_t tmp_extruder); + #if ENABLED(POWER_LOSS_RECOVERY) + static void M413(); + static void M1000(); + #endif + + static void T(const uint8_t tool_index); }; diff --git a/Marlin/src/gcode/geometry/G53-G59.cpp b/Marlin/src/gcode/geometry/G53-G59.cpp index f1e9ff27d0..98181b0f62 100644 --- a/Marlin/src/gcode/geometry/G53-G59.cpp +++ b/Marlin/src/gcode/geometry/G53-G59.cpp @@ -80,7 +80,7 @@ inline void GcodeSuite::G53() { void G54_59(uint8_t subcode=0) { const int8_t _space = parser.codenum - 54 + subcode; if (gcode.select_coordinate_system(_space)) { - SERIAL_PROTOCOLLNPAIR("Select workspace ", _space); + SERIAL_ECHOLNPAIR("Select workspace ", _space); report_current_position(); } } diff --git a/Marlin/src/gcode/geometry/M206_M428.cpp b/Marlin/src/gcode/geometry/M206_M428.cpp index 086108b18f..e6d4842eb6 100644 --- a/Marlin/src/gcode/geometry/M206_M428.cpp +++ b/Marlin/src/gcode/geometry/M206_M428.cpp @@ -69,8 +69,7 @@ void GcodeSuite::M428() { if (!WITHIN(diff[i], -20, 20) && home_dir((AxisEnum)i) > 0) diff[i] = -current_position[i]; if (!WITHIN(diff[i], -20, 20)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M428_TOO_FAR); + SERIAL_ERROR_MSG(MSG_ERR_M428_TOO_FAR); LCD_ALERTMESSAGEPGM("Err: Too far!"); BUZZ(200, 40); return; diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index 9d1a48b55b..edd9df2cf6 100644 --- a/Marlin/src/gcode/host/M114.cpp +++ b/Marlin/src/gcode/host/M114.cpp @@ -34,7 +34,7 @@ SERIAL_CHAR(' '); SERIAL_CHAR(axis_codes[i]); SERIAL_CHAR(':'); - SERIAL_PROTOCOL(dtostrf(pos[i], 8, precision, str)); + SERIAL_ECHO(dtostrf(pos[i], 8, precision, str)); } SERIAL_EOL(); } @@ -43,7 +43,7 @@ void report_current_position_detail() { - SERIAL_PROTOCOLPGM("\nLogical:"); + SERIAL_ECHOPGM("\nLogical:"); const float logical[XYZ] = { LOGICAL_X_POSITION(current_position[X_AXIS]), LOGICAL_Y_POSITION(current_position[Y_AXIS]), @@ -51,17 +51,17 @@ }; report_xyz(logical); - SERIAL_PROTOCOLPGM("Raw: "); + SERIAL_ECHOPGM("Raw: "); report_xyz(current_position); float leveled[XYZ] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; #if HAS_LEVELING - SERIAL_PROTOCOLPGM("Leveled:"); + SERIAL_ECHOPGM("Leveled:"); planner.apply_leveling(leveled); report_xyz(leveled); - SERIAL_PROTOCOLPGM("UnLevel:"); + SERIAL_ECHOPGM("UnLevel:"); float unleveled[XYZ] = { leveled[X_AXIS], leveled[Y_AXIS], leveled[Z_AXIS] }; planner.unapply_leveling(unleveled); report_xyz(unleveled); @@ -69,9 +69,9 @@ #if IS_KINEMATIC #if IS_SCARA - SERIAL_PROTOCOLPGM("ScaraK: "); + SERIAL_ECHOPGM("ScaraK: "); #else - SERIAL_PROTOCOLPGM("DeltaK: "); + SERIAL_ECHOPGM("DeltaK: "); #endif inverse_kinematics(leveled); // writes delta[] report_xyz(delta); @@ -79,12 +79,12 @@ planner.synchronize(); - SERIAL_PROTOCOLPGM("Stepper:"); + SERIAL_ECHOPGM("Stepper:"); LOOP_XYZE(i) { SERIAL_CHAR(' '); SERIAL_CHAR(axis_codes[i]); SERIAL_CHAR(':'); - SERIAL_PROTOCOL(stepper.position((AxisEnum)i)); + SERIAL_ECHO(stepper.position((AxisEnum)i)); } SERIAL_EOL(); @@ -93,11 +93,11 @@ planner.get_axis_position_degrees(A_AXIS), planner.get_axis_position_degrees(B_AXIS) }; - SERIAL_PROTOCOLPGM("Degrees:"); + SERIAL_ECHOPGM("Degrees:"); report_xyze(deg, 2); #endif - SERIAL_PROTOCOLPGM("FromStp:"); + SERIAL_ECHOPGM("FromStp:"); get_cartesian_from_steppers(); // writes cartes[XYZ] (with forward kinematics) const float from_steppers[XYZE] = { cartes[X_AXIS], cartes[Y_AXIS], cartes[Z_AXIS], planner.get_axis_position_mm(E_AXIS) }; report_xyze(from_steppers); @@ -108,7 +108,7 @@ from_steppers[Z_AXIS] - leveled[Z_AXIS], from_steppers[E_AXIS] - current_position[E_AXIS] }; - SERIAL_PROTOCOLPGM("Differ: "); + SERIAL_ECHOPGM("Differ: "); report_xyze(diff); } diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index 8f30773246..e161e38151 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -29,10 +29,10 @@ #if ENABLED(EXTENDED_CAPABILITIES_REPORT) static void cap_line(PGM_P const name, bool ena=false) { - SERIAL_PROTOCOLPGM("Cap:"); + SERIAL_ECHOPGM("Cap:"); serialprintPGM(name); SERIAL_CHAR(':'); - SERIAL_PROTOCOLLN(int(ena ? 1 : 0)); + SERIAL_ECHOLN(int(ena ? 1 : 0)); } #endif @@ -47,7 +47,7 @@ void GcodeSuite::M115() { #define CAPLINE(STR,...) cap_line(PSTR(STR), __VA_ARGS__) #endif - SERIAL_PROTOCOLLNPGM_P(port, MSG_M115_REPORT); + SERIAL_ECHOLNPGM_P(port, MSG_M115_REPORT); #if ENABLED(EXTENDED_CAPABILITIES_REPORT) @@ -153,13 +153,6 @@ void GcodeSuite::M115() { #endif ); - // PAREN_COMMENTS - cap_line(PSTR("PAREN_COMMENTS") - #if ENABLED(PAREN_COMMENTS) - , true - #endif - ); - // MOTION_MODES (M80-M89) cap_line(PSTR("MOTION_MODES") #if ENABLED(GCODE_MOTION_MODES) diff --git a/Marlin/src/gcode/lcd/M0_M1.cpp b/Marlin/src/gcode/lcd/M0_M1.cpp index 505fef340e..04ee285ce5 100644 --- a/Marlin/src/gcode/lcd/M0_M1.cpp +++ b/Marlin/src/gcode/lcd/M0_M1.cpp @@ -62,11 +62,11 @@ void GcodeSuite::M0_M1() { #if HAS_LCD_MENU if (has_message) - lcd_setstatus(args, true); + ui.set_status(args, true); else { LCD_MESSAGEPGM(MSG_USERWAIT); #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0 - dontExpireStatus(); + ui.reset_progress_bar_timeout(); #endif } @@ -94,7 +94,7 @@ void GcodeSuite::M0_M1() { #endif #if HAS_LCD_MENU - lcd_reset_status(); + ui.reset_status(); #endif wait_for_user = false; diff --git a/Marlin/src/gcode/lcd/M117.cpp b/Marlin/src/gcode/lcd/M117.cpp index 0f508d8eb9..1db6b004f9 100644 --- a/Marlin/src/gcode/lcd/M117.cpp +++ b/Marlin/src/gcode/lcd/M117.cpp @@ -28,6 +28,6 @@ */ void GcodeSuite::M117() { - lcd_setstatus(parser.string_arg); + ui.set_status(parser.string_arg); } diff --git a/Marlin/src/gcode/lcd/M145.cpp b/Marlin/src/gcode/lcd/M145.cpp index 9052a6493e..b8c9ae999e 100644 --- a/Marlin/src/gcode/lcd/M145.cpp +++ b/Marlin/src/gcode/lcd/M145.cpp @@ -37,24 +37,22 @@ */ void GcodeSuite::M145() { const uint8_t material = (uint8_t)parser.intval('S'); - if (material >= COUNT(lcd_preheat_hotend_temp)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_MATERIAL_INDEX); - } + if (material >= COUNT(ui.preheat_hotend_temp)) + SERIAL_ERROR_MSG(MSG_ERR_MATERIAL_INDEX); else { int v; if (parser.seenval('H')) { v = parser.value_int(); - lcd_preheat_hotend_temp[material] = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15); + ui.preheat_hotend_temp[material] = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15); } if (parser.seenval('F')) { v = parser.value_int(); - lcd_preheat_fan_speed[material] = (uint8_t)constrain(v, 0, 255); + ui.preheat_fan_speed[material] = (uint8_t)constrain(v, 0, 255); } #if TEMP_SENSOR_BED != 0 if (parser.seenval('B')) { v = parser.value_int(); - lcd_preheat_bed_temp[material] = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15); + ui.preheat_bed_temp[material] = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15); } #endif } diff --git a/Marlin/src/gcode/lcd/M250.cpp b/Marlin/src/gcode/lcd/M250.cpp index bede88126a..6fc659dccd 100644 --- a/Marlin/src/gcode/lcd/M250.cpp +++ b/Marlin/src/gcode/lcd/M250.cpp @@ -31,10 +31,8 @@ * M250: Read and optionally set the LCD contrast */ void GcodeSuite::M250() { - if (parser.seen('C')) set_lcd_contrast(parser.value_int()); - SERIAL_PROTOCOLPGM("lcd contrast value: "); - SERIAL_PROTOCOL(lcd_contrast); - SERIAL_EOL(); + if (parser.seen('C')) ui.set_contrast(parser.value_int()); + SERIAL_ECHOLNPAIR("LCD Contrast: ", ui.contrast); } #endif // HAS_LCD_CONTRAST diff --git a/Marlin/src/gcode/lcd/M73.cpp b/Marlin/src/gcode/lcd/M73.cpp index c721d5b363..78697aecf3 100644 --- a/Marlin/src/gcode/lcd/M73.cpp +++ b/Marlin/src/gcode/lcd/M73.cpp @@ -38,10 +38,8 @@ * This has no effect during an SD print job */ void GcodeSuite::M73() { - if (!IS_SD_PRINTING() && parser.seen('P')) { - progress_bar_percent = parser.value_byte(); - NOMORE(progress_bar_percent, 100); - } + if (parser.seen('P') && !IS_SD_PRINTING()) + ui.set_progress(parser.value_byte()); } #endif // ULTRA_LCD && LCD_SET_PROGRESS_MANUALLY diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index 0ae3f8574f..b0473ed41f 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -70,6 +70,9 @@ void plan_arc( float r_P = -offset[0], r_Q = -offset[1]; const float radius = HYPOT(r_P, r_Q), + #if ENABLED(AUTO_BED_LEVELING_UBL) + start_L = current_position[l_axis], + #endif center_P = current_position[p_axis] - r_P, center_Q = current_position[q_axis] - r_Q, rt_X = cart[p_axis] - center_P, @@ -179,7 +182,11 @@ void plan_arc( // Update raw location raw[p_axis] = center_P + r_P; raw[q_axis] = center_Q + r_Q; - raw[l_axis] += linear_per_segment; + #if ENABLED(AUTO_BED_LEVELING_UBL) + raw[l_axis] = start_L; + #else + raw[l_axis] += linear_per_segment; + #endif raw[E_AXIS] += extruder_per_segment; clamp_to_software_endstops(raw); @@ -198,6 +205,9 @@ void plan_arc( // Ensure last segment arrives at target location. COPY(raw, cart); + #if ENABLED(AUTO_BED_LEVELING_UBL) + raw[l_axis] = start_L; + #endif #if HAS_LEVELING && !PLANNER_LEVELING planner.apply_leveling(raw); @@ -209,6 +219,9 @@ void plan_arc( #endif ); + #if ENABLED(AUTO_BED_LEVELING_UBL) + raw[l_axis] = start_L; + #endif COPY(current_position, raw); } // plan_arc @@ -280,10 +293,9 @@ void GcodeSuite::G2_G3(const bool clockwise) { #if ENABLED(ARC_P_CIRCLES) // P indicates number of circles to do int8_t circles_to_do = parser.byteval('P'); - if (!WITHIN(circles_to_do, 0, 100)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_ARC_ARGS); - } + if (!WITHIN(circles_to_do, 0, 100)) + SERIAL_ERROR_MSG(MSG_ERR_ARC_ARGS); + while (circles_to_do--) plan_arc(current_position, arc_offset, clockwise); #endif @@ -292,11 +304,8 @@ void GcodeSuite::G2_G3(const bool clockwise) { plan_arc(destination, arc_offset, clockwise); reset_stepper_timeout(); } - else { - // Bad arguments - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_ARC_ARGS); - } + else + SERIAL_ERROR_MSG(MSG_ERR_ARC_ARGS); } } diff --git a/Marlin/src/gcode/motion/G4.cpp b/Marlin/src/gcode/motion/G4.cpp index 7d53cb0304..fcee5df401 100644 --- a/Marlin/src/gcode/motion/G4.cpp +++ b/Marlin/src/gcode/motion/G4.cpp @@ -38,7 +38,7 @@ void GcodeSuite::G4() { SERIAL_ECHOLNPGM(MSG_Z_MOVE_COMP); #endif - if (!lcd_hasstatus()) LCD_MESSAGEPGM(MSG_DWELL); + if (!ui.has_status()) LCD_MESSAGEPGM(MSG_DWELL); dwell(dwell_ms); } diff --git a/Marlin/src/gcode/motion/G5.cpp b/Marlin/src/gcode/motion/G5.cpp index 8cd70da15d..0f526a6c97 100644 --- a/Marlin/src/gcode/motion/G5.cpp +++ b/Marlin/src/gcode/motion/G5.cpp @@ -50,8 +50,7 @@ void GcodeSuite::G5() { #if ENABLED(CNC_WORKSPACE_PLANES) if (workspace_plane != PLANE_XY) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_BAD_PLANE_MODE); + SERIAL_ERROR_MSG(MSG_ERR_BAD_PLANE_MODE); return; } #endif diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index 38a5455b64..c13da8a28c 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -241,12 +241,12 @@ public: static inline uint32_t value_ulong() { return value_ptr ? strtoul(value_ptr, NULL, 10) : 0UL; } // Code value for use as time - FORCE_INLINE static millis_t value_millis() { return value_ulong(); } - FORCE_INLINE static millis_t value_millis_from_seconds() { return (millis_t)(value_float() * 1000); } + static inline millis_t value_millis() { return value_ulong(); } + static inline millis_t value_millis_from_seconds() { return (millis_t)(value_float() * 1000); } // Reduce to fewer bits - FORCE_INLINE static int16_t value_int() { return (int16_t)value_long(); } - FORCE_INLINE static uint16_t value_ushort() { return (uint16_t)value_long(); } + static inline int16_t value_int() { return (int16_t)value_long(); } + static inline uint16_t value_ushort() { return (uint16_t)value_long(); } static inline uint8_t value_byte() { return (uint8_t)constrain(value_long(), 0, 255); } // Bool is true with no value or non-zero @@ -279,18 +279,18 @@ public: return (axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); } - FORCE_INLINE static float linear_value_to_mm(const float v) { return v * linear_unit_factor; } - FORCE_INLINE static float axis_value_to_mm(const AxisEnum axis, const float v) { return v * axis_unit_factor(axis); } - FORCE_INLINE static float per_axis_value(const AxisEnum axis, const float v) { return v / axis_unit_factor(axis); } + static inline float linear_value_to_mm(const float v) { return v * linear_unit_factor; } + static inline float axis_value_to_mm(const AxisEnum axis, const float v) { return v * axis_unit_factor(axis); } + static inline float per_axis_value(const AxisEnum axis, const float v) { return v / axis_unit_factor(axis); } #else - FORCE_INLINE static float mm_to_linear_unit(const float mm) { return mm; } - FORCE_INLINE static float mm_to_volumetric_unit(const float mm) { return mm; } + static inline float mm_to_linear_unit(const float mm) { return mm; } + static inline float mm_to_volumetric_unit(const float mm) { return mm; } - FORCE_INLINE static float linear_value_to_mm(const float v) { return v; } - FORCE_INLINE static float axis_value_to_mm(const AxisEnum axis, const float v) { UNUSED(axis); return v; } - FORCE_INLINE static float per_axis_value(const AxisEnum axis, const float v) { UNUSED(axis); return v; } + static inline float linear_value_to_mm(const float v) { return v; } + static inline float axis_value_to_mm(const AxisEnum axis, const float v) { UNUSED(axis); return v; } + static inline float per_axis_value(const AxisEnum axis, const float v) { UNUSED(axis); return v; } #endif @@ -307,10 +307,10 @@ public: #if HAS_LCD_MENU && DISABLED(DISABLE_M503) - FORCE_INLINE static char temp_units_code() { + static inline char temp_units_code() { return input_temp_units == TEMPUNIT_K ? 'K' : input_temp_units == TEMPUNIT_F ? 'F' : 'C'; } - FORCE_INLINE static PGM_P temp_units_name() { + static inline PGM_P temp_units_name() { return input_temp_units == TEMPUNIT_K ? PSTR("Kelvin") : input_temp_units == TEMPUNIT_F ? PSTR("Fahrenheit") : PSTR("Celsius"); } static inline float to_temp_units(const float &f) { @@ -355,27 +355,27 @@ public: #else // !TEMPERATURE_UNITS_SUPPORT - FORCE_INLINE static float value_celsius() { return value_float(); } - FORCE_INLINE static float value_celsius_diff() { return value_float(); } + static inline float value_celsius() { return value_float(); } + static inline float value_celsius_diff() { return value_float(); } #define TEMP_UNIT(N) (N) #endif // !TEMPERATURE_UNITS_SUPPORT - FORCE_INLINE static float value_feedrate() { return value_linear_units(); } + static inline float value_feedrate() { return value_linear_units(); } void unknown_command_error(); // Provide simple value accessors with default option - FORCE_INLINE static float floatval(const char c, const float dval=0.0) { return seenval(c) ? value_float() : dval; } - FORCE_INLINE static bool boolval(const char c, const bool dval=false) { return seenval(c) ? value_bool() : (seen(c) ? true : dval); } - FORCE_INLINE static uint8_t byteval(const char c, const uint8_t dval=0) { return seenval(c) ? value_byte() : dval; } - FORCE_INLINE static int16_t intval(const char c, const int16_t dval=0) { return seenval(c) ? value_int() : dval; } - FORCE_INLINE static uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; } - FORCE_INLINE static int32_t longval(const char c, const int32_t dval=0) { return seenval(c) ? value_long() : dval; } - FORCE_INLINE static uint32_t ulongval(const char c, const uint32_t dval=0) { return seenval(c) ? value_ulong() : dval; } - FORCE_INLINE static float linearval(const char c, const float dval=0) { return seenval(c) ? value_linear_units() : dval; } - FORCE_INLINE static float celsiusval(const char c, const float dval=0) { return seenval(c) ? value_celsius() : dval; } + static inline float floatval(const char c, const float dval=0.0) { return seenval(c) ? value_float() : dval; } + static inline bool boolval(const char c, const bool dval=false) { return seenval(c) ? value_bool() : (seen(c) ? true : dval); } + static inline uint8_t byteval(const char c, const uint8_t dval=0) { return seenval(c) ? value_byte() : dval; } + static inline int16_t intval(const char c, const int16_t dval=0) { return seenval(c) ? value_int() : dval; } + static inline uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; } + static inline int32_t longval(const char c, const int32_t dval=0) { return seenval(c) ? value_long() : dval; } + static inline uint32_t ulongval(const char c, const uint32_t dval=0) { return seenval(c) ? value_ulong() : dval; } + static inline float linearval(const char c, const float dval=0) { return seenval(c) ? value_linear_units() : dval; } + static inline float celsiusval(const char c, const float dval=0) { return seenval(c) ? value_celsius() : dval; } }; diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index 0c8472e05c..531b939f13 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -55,9 +55,9 @@ void GcodeSuite::G30() { const float measured_z = probe_pt(xpos, ypos, raise_after, 1); if (!isnan(measured_z)) { - SERIAL_PROTOCOLPAIR_F("Bed X: ", xpos); - SERIAL_PROTOCOLPAIR_F(" Y: ", ypos); - SERIAL_PROTOCOLLNPAIR_F(" Z: ", measured_z); + SERIAL_ECHOPAIR("Bed X: ", FIXFLOAT(xpos)); + SERIAL_ECHOPAIR(" Y: ", FIXFLOAT(ypos)); + SERIAL_ECHOLNPAIR(" Z: ", FIXFLOAT(measured_z)); } clean_up_after_endstop_or_probe_move(); diff --git a/Marlin/src/gcode/probe/G38.cpp b/Marlin/src/gcode/probe/G38.cpp index 6bf09b8bac..04b7de4f2e 100644 --- a/Marlin/src/gcode/probe/G38.cpp +++ b/Marlin/src/gcode/probe/G38.cpp @@ -108,10 +108,7 @@ void GcodeSuite::G38(const bool is_38_2) { if (ABS(destination[i] - current_position[i]) >= G38_MINIMUM_MOVE) { if (!parser.seenval('F')) feedrate_mm_s = homing_feedrate((AxisEnum)i); // If G38.2 fails throw an error - if (!G38_run_probe() && is_38_2) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Failed to reach target"); - } + if (!G38_run_probe() && is_38_2) SERIAL_ERROR_MSG("Failed to reach target"); break; } diff --git a/Marlin/src/gcode/probe/M851.cpp b/Marlin/src/gcode/probe/M851.cpp index 7699b5b5de..8cb5f0e446 100644 --- a/Marlin/src/gcode/probe/M851.cpp +++ b/Marlin/src/gcode/probe/M851.cpp @@ -32,18 +32,13 @@ void GcodeSuite::M851() { if (parser.seenval('Z')) { const float value = parser.value_linear_units(); if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) - { zprobe_zoffset = value; - } - else { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("?Z out of range (" STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " to " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX) ")"); - } + else + SERIAL_ERROR_MSG("?Z out of range (" STRINGIFY(Z_PROBE_OFFSET_RANGE_MIN) " to " STRINGIFY(Z_PROBE_OFFSET_RANGE_MAX) ")"); return; } SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_PROBE_Z_OFFSET); - SERIAL_ECHOLNPAIR(": ", zprobe_zoffset); + SERIAL_ECHOLNPAIR(MSG_PROBE_Z_OFFSET ": ", zprobe_zoffset); } #endif // HAS_BED_PROBE diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 70c2b3e0ce..b73e2af02b 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -221,17 +221,17 @@ void ok_to_send() { if (port < 0) return; #endif if (!send_ok[cmd_queue_index_r]) return; - SERIAL_PROTOCOLPGM_P(port, MSG_OK); + SERIAL_ECHOPGM_P(port, MSG_OK); #if ENABLED(ADVANCED_OK) char* p = command_queue[cmd_queue_index_r]; if (*p == 'N') { - SERIAL_PROTOCOL_P(port, ' '); + SERIAL_ECHO_P(port, ' '); SERIAL_ECHO_P(port, *p++); while (NUMERIC_SIGNED(*p)) SERIAL_ECHO_P(port, *p++); } - SERIAL_PROTOCOLPGM_P(port, " P"); SERIAL_PROTOCOL_P(port, int(BLOCK_BUFFER_SIZE - planner.movesplanned() - 1)); - SERIAL_PROTOCOLPGM_P(port, " B"); SERIAL_PROTOCOL_P(port, BUFSIZE - commands_in_queue); + SERIAL_ECHOPGM_P(port, " P"); SERIAL_ECHO_P(port, int(BLOCK_BUFFER_SIZE - planner.movesplanned() - 1)); + SERIAL_ECHOPGM_P(port, " B"); SERIAL_ECHO_P(port, BUFSIZE - commands_in_queue); #endif SERIAL_EOL_P(port); } @@ -246,15 +246,15 @@ void flush_and_request_resend() { if (port < 0) return; #endif SERIAL_FLUSH_P(port); - SERIAL_PROTOCOLPGM_P(port, MSG_RESEND); - SERIAL_PROTOCOLLN_P(port, gcode_LastN + 1); + SERIAL_ECHOPGM_P(port, MSG_RESEND); + SERIAL_ECHOLN_P(port, gcode_LastN + 1); ok_to_send(); } void gcode_line_error(PGM_P err, uint8_t port) { SERIAL_ERROR_START_P(port); serialprintPGM_P(port, err); - SERIAL_ERRORLN_P(port, gcode_LastN); + SERIAL_ECHOLN_P(port, gcode_LastN); flush_and_request_resend(); serial_count[port] = 0; } @@ -503,7 +503,7 @@ static int read_serial(const uint8_t index) { break; case StreamState::STREAM_COMPLETE: stream_state = StreamState::STREAM_RESET; - card.binary_mode = false; + card.flag.binary_mode = false; card.closefile(); CARD_ECHO_P("echo: "); CARD_ECHO_P(card.filename); @@ -514,7 +514,7 @@ static int read_serial(const uint8_t index) { return; case StreamState::STREAM_FAILED: stream_state = StreamState::STREAM_RESET; - card.binary_mode = false; + card.flag.binary_mode = false; card.closefile(); card.removeFile(card.filename); CARD_ECHOLN_P("echo: File transfer failed"); @@ -549,7 +549,7 @@ inline void get_serial_commands() { ; #if ENABLED(FAST_FILE_TRANSFER) - if (card.saving && card.binary_mode) { + if (card.flag.saving && card.flag.binary_mode) { /** * For binary stream file transfer, use serial_line_buffer as the working * receive buffer (which limits the packet size to MAX_CMD_SIZE). @@ -630,7 +630,7 @@ inline void get_serial_commands() { gcode_LastN = gcode_N; } #if ENABLED(SDSUPPORT) - else if (card.saving && strcmp(command, "M29") != 0) // No line number with M29 in Pronterface + else if (card.flag.saving && strcmp(command, "M29") != 0) // No line number with M29 in Pronterface return gcode_line_error(PSTR(MSG_ERR_NO_CHECKSUM), i); #endif @@ -648,7 +648,7 @@ inline void get_serial_commands() { #if ENABLED(BEZIER_CURVE_SUPPORT) case 5: #endif - SERIAL_ERRORLNPGM(MSG_ERR_STOPPED); + SERIAL_ECHOLNPGM(MSG_ERR_STOPPED); LCD_MESSAGEPGM(MSG_STOPPED); break; } @@ -754,7 +754,7 @@ inline void get_serial_commands() { if (IS_SD_PRINTING()) sd_count = 0; // If a sub-file was printing, continue from call point else { - SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED); + SERIAL_ECHOLNPGM(MSG_FILE_PRINTED); #if ENABLED(PRINTER_EVENT_LEDS) printerEventLEDs.onPrintCompleted(); #if HAS_RESUME_CONTINUE @@ -769,10 +769,9 @@ inline void get_serial_commands() { #endif // PRINTER_EVENT_LEDS } } - else if (n == -1) { - SERIAL_ERROR_START(); - SERIAL_ECHOLNPGM(MSG_SD_ERR_READ); - } + else if (n == -1) + SERIAL_ERROR_MSG(MSG_SD_ERR_READ); + if (sd_char == '#') stop_buffering = true; sd_comment_mode = false; // for new command @@ -809,22 +808,6 @@ inline void get_serial_commands() { } } - #if ENABLED(POWER_LOSS_RECOVERY) - - inline bool drain_job_recovery_commands() { - static uint8_t job_recovery_commands_index = 0; // Resets on reboot - if (job_recovery_commands_count) { - if (_enqueuecommand(job_recovery_commands[job_recovery_commands_index])) { - ++job_recovery_commands_index; - if (!--job_recovery_commands_count) job_recovery_phase = JOB_RECOVERY_DONE; - } - return true; - } - return false; - } - - #endif - #endif // SDSUPPORT /** @@ -840,11 +823,6 @@ void get_available_commands() { get_serial_commands(); - #if ENABLED(POWER_LOSS_RECOVERY) - // Commands for power-loss recovery take precedence - if (job_recovery_phase == JOB_RECOVERY_YES && drain_job_recovery_commands()) return; - #endif - #if ENABLED(SDSUPPORT) get_sdcard_commands(); #endif @@ -859,12 +837,12 @@ void advance_command_queue() { #if ENABLED(SDSUPPORT) - if (card.saving) { + if (card.flag.saving) { char* command = command_queue[cmd_queue_index_r]; if (strstr_P(command, PSTR("M29"))) { // M29 closes the file card.closefile(); - SERIAL_PROTOCOLLNPGM(MSG_FILE_SAVED); + SERIAL_ECHOLNPGM(MSG_FILE_SAVED); #if !defined(__AVR__) || !defined(USBCON) #if ENABLED(SERIAL_STATS_DROPPED_RX) @@ -881,7 +859,7 @@ void advance_command_queue() { else { // Write the string from the read buffer to SD card.write_command(command); - if (card.logging) + if (card.flag.logging) gcode.process_next_command(); // The card is saving because it's logging else ok_to_send(); @@ -890,7 +868,7 @@ void advance_command_queue() { else { gcode.process_next_command(); #if ENABLED(POWER_LOSS_RECOVERY) - if (card.cardOK && IS_SD_PRINTING()) save_job_recovery_info(); + if (IS_SD_PRINTING()) recovery.save(); #endif } diff --git a/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp b/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp index a8de7f44b7..b06765051d 100644 --- a/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp +++ b/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp @@ -28,6 +28,7 @@ #include "../../sd/cardreader.h" #include "../../module/printcounter.h" #include "../../module/stepper.h" +#include "../../lcd/ultralcd.h" #if ENABLED(POWER_LOSS_RECOVERY) #include "../../feature/power_loss_recovery.h" @@ -49,13 +50,13 @@ void GcodeSuite::M20() { const int16_t port = command_queue_port[cmd_queue_index_r]; #endif - SERIAL_PROTOCOLLNPGM_P(port, MSG_BEGIN_FILE_LIST); + SERIAL_ECHOLNPGM_P(port, MSG_BEGIN_FILE_LIST); card.ls( #if NUM_SERIAL > 1 port #endif ); - SERIAL_PROTOCOLLNPGM_P(port, MSG_END_FILE_LIST); + SERIAL_ECHOLNPGM_P(port, MSG_END_FILE_LIST); } /** @@ -90,27 +91,24 @@ void GcodeSuite::M24() { #if ENABLED(POWER_LOSS_RECOVERY) if (parser.seenval('S')) card.setIndex(parser.value_long()); + if (parser.seenval('T')) print_job_timer.resume(parser.value_long()); #endif card.startFileprint(); - - #if ENABLED(POWER_LOSS_RECOVERY) - if (parser.seenval('T')) - print_job_timer.resume(parser.value_long()); - else - #endif - print_job_timer.start(); + print_job_timer.start(); + ui.reset_status(); } /** * M25: Pause SD Print */ void GcodeSuite::M25() { - card.pauseSDPrint(); - print_job_timer.pause(); - #if ENABLED(PARK_HEAD_ON_PAUSE) - enqueue_and_echo_commands_P(PSTR("M125")); // Must be enqueued with pauseSDPrint set to be last in the buffer + M125(); + #else + card.pauseSDPrint(); + print_job_timer.pause(); + ui.reset_status(); #endif } @@ -118,7 +116,7 @@ void GcodeSuite::M25() { * M26: Set SD Card file index */ void GcodeSuite::M26() { - if (card.cardOK && parser.seenval('S')) + if (card.flag.cardOK && parser.seenval('S')) card.setIndex(parser.value_long()); } @@ -178,7 +176,7 @@ void GcodeSuite::M28() { } // Binary transfer mode - if ((card.binary_mode = binary_mode)) { + if ((card.flag.binary_mode = binary_mode)) { SERIAL_ECHO_START_P(port); SERIAL_ECHO_P(port, " preparing to receive: "); SERIAL_ECHOLN_P(port, p); @@ -202,14 +200,14 @@ void GcodeSuite::M28() { * Processed in write to file routine */ void GcodeSuite::M29() { - // card.saving = false; + // card.flag.saving = false; } /** * M30 : Delete SD Card file */ void GcodeSuite::M30() { - if (card.cardOK) { + if (card.flag.cardOK) { card.closefile(); card.removeFile(parser.string_arg); } @@ -228,7 +226,7 @@ void GcodeSuite::M30() { void GcodeSuite::M32() { if (IS_SD_PRINTING()) planner.synchronize(); - if (card.cardOK) { + if (card.flag.cardOK) { const bool call_procedure = parser.boolval('P'); card.openFile(parser.string_arg, true, call_procedure); @@ -286,7 +284,7 @@ void GcodeSuite::M32() { * M524: Abort the current SD print job (started with M24) */ void GcodeSuite::M524() { - if (IS_SD_PRINTING()) card.abort_sd_printing = true; + if (IS_SD_PRINTING()) card.flag.abort_sd_printing = true; } /** diff --git a/Marlin/src/gcode/stats/M31.cpp b/Marlin/src/gcode/stats/M31.cpp index 958556e544..98eb3a973b 100644 --- a/Marlin/src/gcode/stats/M31.cpp +++ b/Marlin/src/gcode/stats/M31.cpp @@ -40,7 +40,7 @@ void GcodeSuite::M31() { char buffer[21]; duration_t elapsed = print_job_timer.duration(); elapsed.toString(buffer); - lcd_setstatus(buffer); + ui.set_status(buffer); SERIAL_ECHO_START_P(port); SERIAL_ECHOLNPAIR_P(port, "Print time: ", buffer); diff --git a/Marlin/src/gcode/stats/M75-M78.cpp b/Marlin/src/gcode/stats/M75-M78.cpp index 742bd3f2eb..0f06b8a6df 100644 --- a/Marlin/src/gcode/stats/M75-M78.cpp +++ b/Marlin/src/gcode/stats/M75-M78.cpp @@ -33,7 +33,7 @@ void GcodeSuite::M75() { print_job_timer.start(); #if ENABLED(EXTENSIBLE_UI) - UI::onPrintTimerStarted(); + ExtUI::onPrintTimerStarted(); #endif } @@ -43,7 +43,7 @@ void GcodeSuite::M75() { void GcodeSuite::M76() { print_job_timer.pause(); #if ENABLED(EXTENSIBLE_UI) - UI::onPrintTimerPaused(); + ExtUI::onPrintTimerPaused(); #endif } @@ -53,7 +53,7 @@ void GcodeSuite::M76() { void GcodeSuite::M77() { print_job_timer.stop(); #if ENABLED(EXTENSIBLE_UI) - UI::onPrintTimerStopped(); + ExtUI::onPrintTimerStopped(); #endif } diff --git a/Marlin/src/gcode/temperature/M104_M109.cpp b/Marlin/src/gcode/temperature/M104_M109.cpp index 4868f2b4d3..39d65dc1a6 100644 --- a/Marlin/src/gcode/temperature/M104_M109.cpp +++ b/Marlin/src/gcode/temperature/M104_M109.cpp @@ -39,21 +39,26 @@ * M104: Set hot end temperature */ void GcodeSuite::M104() { - if (get_target_extruder_from_command()) return; + if (DEBUGGING(DRYRUN)) return; - const uint8_t e = target_extruder; + #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 + constexpr int8_t target_extruder = 0; + #else + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; + #endif if (parser.seenval('S')) { const int16_t temp = parser.value_celsius(); #if ENABLED(SINGLENOZZLE) - singlenozzle_temp[e] = temp; - if (e != active_extruder) return; + singlenozzle_temp[target_extruder] = temp; + if (target_extruder != active_extruder) return; #endif - thermalManager.setTargetHotend(temp, e); + thermalManager.setTargetHotend(temp, target_extruder); #if ENABLED(DUAL_X_CARRIAGE) - if (dxc_is_duplicating() && e == 0) + if (dxc_is_duplicating() && target_extruder == 0) thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1); #endif @@ -66,7 +71,7 @@ void GcodeSuite::M104() { */ if (temp <= (EXTRUDE_MINTEMP) / 2) { print_job_timer.stop(); - lcd_reset_status(); + ui.reset_status(); } #endif } @@ -82,9 +87,15 @@ void GcodeSuite::M104() { */ void GcodeSuite::M109() { - if (get_target_extruder_from_command()) return; if (DEBUGGING(DRYRUN)) return; + #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 + constexpr int8_t target_extruder = 0; + #else + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; + #endif + const bool no_wait_for_cooling = parser.seenval('S'), set_temp = no_wait_for_cooling || parser.seenval('R'); if (set_temp) { @@ -108,7 +119,7 @@ void GcodeSuite::M109() { */ if (parser.value_celsius() <= (EXTRUDE_MINTEMP) / 2) { print_job_timer.stop(); - lcd_reset_status(); + ui.reset_status(); } else print_job_timer.start(); diff --git a/Marlin/src/gcode/temperature/M105.cpp b/Marlin/src/gcode/temperature/M105.cpp index 4216c417e7..45d8be4a7e 100644 --- a/Marlin/src/gcode/temperature/M105.cpp +++ b/Marlin/src/gcode/temperature/M105.cpp @@ -31,22 +31,23 @@ * M105: Read hot end and bed temperature */ void GcodeSuite::M105() { - if (get_target_extruder_from_command()) return; + + const int8_t target_extruder = get_target_extruder_from_command(); + if (target_extruder < 0) return; #if NUM_SERIAL > 1 const int16_t port = command_queue_port[cmd_queue_index_r]; #endif #if HAS_TEMP_SENSOR - SERIAL_PROTOCOLPGM_P(port, MSG_OK); - thermalManager.print_heaterstates( + SERIAL_ECHOPGM_P(port, MSG_OK); + thermalManager.print_heater_states(target_extruder #if NUM_SERIAL > 1 - port + , port #endif ); #else // !HAS_TEMP_SENSOR - SERIAL_ERROR_START_P(port); - SERIAL_ERRORLNPGM_P(port, MSG_ERR_NO_THERMISTORS); + SERIAL_ERROR_MSG_P(port, MSG_ERR_NO_THERMISTORS); #endif SERIAL_EOL_P(port); diff --git a/Marlin/src/gcode/temperature/M140_M190.cpp b/Marlin/src/gcode/temperature/M140_M190.cpp index 8a42eb85be..2da964f05a 100644 --- a/Marlin/src/gcode/temperature/M140_M190.cpp +++ b/Marlin/src/gcode/temperature/M140_M190.cpp @@ -64,7 +64,7 @@ void GcodeSuite::M190() { } else return; - lcd_setstatusPGM(thermalManager.isHeatingBed() ? PSTR(MSG_BED_HEATING) : PSTR(MSG_BED_COOLING)); + ui.set_status_P(thermalManager.isHeatingBed() ? PSTR(MSG_BED_HEATING) : PSTR(MSG_BED_COOLING)); thermalManager.wait_for_bed(no_wait_for_cooling); } diff --git a/Marlin/src/gcode/temperature/M303.cpp b/Marlin/src/gcode/temperature/M303.cpp index 583ea9d7e4..f701277854 100644 --- a/Marlin/src/gcode/temperature/M303.cpp +++ b/Marlin/src/gcode/temperature/M303.cpp @@ -20,6 +20,10 @@ * */ +#include "../../inc/MarlinConfig.h" + +#if HAS_PID_HEATING + #include "../gcode.h" #include "../../module/temperature.h" @@ -32,26 +36,36 @@ * U with a non-zero value will apply the result to current settings */ void GcodeSuite::M303() { - #if HAS_PID_HEATING - const int e = parser.intval('E'), c = parser.intval('C', 5); - const bool u = parser.boolval('U'); - int16_t temp = parser.celsiusval('S', e < 0 ? 70 : 150); + const int8_t e = parser.intval('E'); - if (WITHIN(e, 0, HOTENDS - 1)) - target_extruder = e; - - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(NOT_BUSY); + if (!WITHIN(e, 0 + #if ENABLED(PIDTEMPBED) + -1 #endif - - thermalManager.PID_autotune(temp, e, c, u); - - #if DISABLED(BUSY_WHILE_HEATING) - KEEPALIVE_STATE(IN_HANDLER); + , + #if ENABLED(PIDTEMP) + HOTENDS #endif - #else - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_M303_DISABLED); + -1 + )) { + SERIAL_ECHOLNPGM(MSG_PID_BAD_EXTRUDER_NUM); + return; + } + + const int c = parser.intval('C', 5); + const bool u = parser.boolval('U'); + const int16_t temp = parser.celsiusval('S', e < 0 ? 70 : 150); + + #if DISABLED(BUSY_WHILE_HEATING) + KEEPALIVE_STATE(NOT_BUSY); + #endif + + thermalManager.PID_autotune(temp, e, c, u); + + #if DISABLED(BUSY_WHILE_HEATING) + KEEPALIVE_STATE(IN_HANDLER); #endif } + +#endif // HAS_PID_HEATING diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 0de18de582..ad0a8d35d0 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -26,8 +26,6 @@ * Conditionals that need to be set before Configuration_adv.h or pins.h */ -#define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT)) - #if ENABLED(CARTESIO_UI) #define DOGLCD @@ -49,10 +47,10 @@ #define ULTIPANEL // this helps to implement ADC_KEYPAD menus + #define REVERSE_MENU_DIRECTION #define ENCODER_PULSES_PER_STEP 1 #define ENCODER_STEPS_PER_MENU_ITEM 1 #define ENCODER_FEEDRATE_DEADZONE 2 - #define REVERSE_MENU_DIRECTION #elif ENABLED(RADDS_DISPLAY) #define ULTIPANEL @@ -296,91 +294,37 @@ #define ULTIPANEL #endif -#define HAS_GRAPHICAL_LCD ENABLED(DOGLCD) - -#if HAS_GRAPHICAL_LCD - #ifndef LCD_WIDTH - #ifdef LCD_WIDTH_OVERRIDE - #define LCD_WIDTH LCD_WIDTH_OVERRIDE - #else - #define LCD_WIDTH 22 - #endif - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 5 - #endif -#endif - #if ENABLED(ULTIPANEL) #define NEWPANEL // Disable this if you actually have no click-encoder panel #define ULTRA_LCD - #ifndef LCD_WIDTH - #define LCD_WIDTH 20 - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 4 - #endif -#elif ENABLED(ULTRA_LCD) // no panel but just LCD - #ifndef LCD_WIDTH - #define LCD_WIDTH 16 - #endif - #ifndef LCD_HEIGHT - #define LCD_HEIGHT 2 - #endif #endif // Aliases for LCD features #define HAS_SPI_LCD ENABLED(ULTRA_LCD) -#define HAS_CHARACTER_LCD (ENABLED(ULTRA_LCD) && DISABLED(DOGLCD)) +#define HAS_GRAPHICAL_LCD ENABLED(DOGLCD) +#define HAS_CHARACTER_LCD (HAS_SPI_LCD && !HAS_GRAPHICAL_LCD) #define HAS_LCD_MENU (ENABLED(ULTIPANEL) && DISABLED(NO_LCD_MENUS)) +#define HAS_ADC_BUTTONS ENABLED(ADC_KEYPAD) +#define HAS_DIGITAL_BUTTONS (!HAS_ADC_BUTTONS && ENABLED(NEWPANEL)) +#define HAS_SHIFT_ENCODER (!HAS_ADC_BUTTONS && (ENABLED(REPRAPWORLD_KEYPAD) || (HAS_SPI_LCD && DISABLED(NEWPANEL)))) +#define HAS_ENCODER_WHEEL (!HAS_ADC_BUTTONS && ENABLED(NEWPANEL)) + +// I2C buttons must be read in the main thread +#define HAS_SLOW_BUTTONS (ENABLED(LCD_I2C_VIKI) || ENABLED(LCD_I2C_PANELOLU2)) + #if HAS_GRAPHICAL_LCD - /* Custom characters defined in font Marlin_symbols.fon which was merged to ISO10646-0-3.bdf */ - // \x00 intentionally skipped to avoid problems in strings - #define LCD_STR_REFRESH "\x01" - #define LCD_STR_FOLDER "\x02" - #define LCD_STR_ARROW_RIGHT "\x03" - #define LCD_STR_UPLEVEL "\x04" - #define LCD_STR_CLOCK "\x05" - #define LCD_STR_FEEDRATE "\x06" - #define LCD_STR_BEDTEMP "\x07" - #define LCD_STR_THERMOMETER "\x08" - #define LCD_STR_DEGREE "\x09" - - #define LCD_STR_SPECIAL_MAX '\x09' - // Maximum here is 0x1F because 0x20 is ' ' (space) and the normal charsets begin. - // Better stay below 0x10 because DISPLAY_CHARSET_HD44780_WESTERN begins here. - - // Symbol characters - #define LCD_STR_FILAM_DIA "\xf8" - #define LCD_STR_FILAM_MUL "\xa4" -#else - // Custom characters defined in the first 8 characters of the LCD - #define LCD_BEDTEMP_CHAR 0x00 // Print only as a char. This will have 'unexpected' results when used in a string! - #define LCD_DEGREE_CHAR 0x01 - #define LCD_STR_THERMOMETER "\x02" // Still used with string concatenation - #define LCD_UPLEVEL_CHAR 0x03 - #define LCD_STR_REFRESH "\x04" - #define LCD_STR_FOLDER "\x05" - #define LCD_FEEDRATE_CHAR 0x06 - #define LCD_CLOCK_CHAR 0x07 - #define LCD_STR_ARROW_RIGHT ">" /* from the default character set */ -#endif - -/** - * Default LCD contrast for dogm-like LCD displays - */ -#if HAS_GRAPHICAL_LCD - - #define HAS_LCD_CONTRAST ( \ - ENABLED(MAKRPANEL) \ - || ENABLED(CARTESIO_UI) \ - || ENABLED(VIKI2) \ - || ENABLED(AZSMZ_12864) \ - || ENABLED(miniVIKI) \ - || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ + /** + * Default LCD contrast for Graphical LCD displays + */ + #define HAS_LCD_CONTRAST ( \ + ENABLED(MAKRPANEL) \ + || ENABLED(CARTESIO_UI) \ + || ENABLED(VIKI2) \ + || ENABLED(AZSMZ_12864) \ + || ENABLED(miniVIKI) \ + || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \ ) - #if HAS_LCD_CONTRAST #ifndef LCD_CONTRAST_MIN #define LCD_CONTRAST_MIN 0 @@ -471,11 +415,11 @@ */ #if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1 #define XYZE_N (XYZ + E_STEPPERS) - #define E_AXIS_N(E) (E_AXIS + E) + #define E_AXIS_N(E) (uint8_t(E_AXIS) + E) #else #undef DISTINCT_E_FACTORS #define XYZE_N XYZE - #define E_AXIS_N(E) E_AXIS + #define E_AXIS_N(E) uint8_t(E_AXIS) #endif /** diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index a20ab25a73..253503107c 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -275,12 +275,12 @@ #elif TEMP_SENSOR_0 == -3 #define HEATER_0_USES_MAX6675 #define MAX6675_IS_MAX31855 - #define MAX6675_TMIN -270 - #define MAX6675_TMAX 1800 + #define HEATER_0_MAX6675_TMIN -270 + #define HEATER_0_MAX6675_TMAX 1800 #elif TEMP_SENSOR_0 == -2 #define HEATER_0_USES_MAX6675 - #define MAX6675_TMIN 0 - #define MAX6675_TMAX 1024 + #define HEATER_0_MAX6675_TMIN 0 + #define HEATER_0_MAX6675_TMAX 1024 #elif TEMP_SENSOR_0 == -1 #define HEATER_0_USES_AD595 #elif TEMP_SENSOR_0 == 0 @@ -294,9 +294,19 @@ #if TEMP_SENSOR_1 == -4 #define HEATER_1_USES_AD8495 #elif TEMP_SENSOR_1 == -3 - #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_1." + #if TEMP_SENSOR_0 == -2 + #error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_1 then TEMP_SENSOR_0 must match." + #endif + #define HEATER_1_USES_MAX6675 + #define HEATER_1_MAX6675_TMIN -270 + #define HEATER_1_MAX6675_TMAX 1800 #elif TEMP_SENSOR_1 == -2 - #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_1." + #if TEMP_SENSOR_0 == -3 + #error "If MAX31855 Thermocouple (-3) is used for TEMP_SENSOR_0 then TEMP_SENSOR_1 must match." + #endif + #define HEATER_1_USES_MAX6675 + #define HEATER_1_MAX6675_TMIN 0 + #define HEATER_1_MAX6675_TMAX 1024 #elif TEMP_SENSOR_1 == -1 #define HEATER_1_USES_AD595 #elif TEMP_SENSOR_1 == 0 @@ -964,6 +974,12 @@ #define Z_PROBE_SERVO_NR -1 #endif +#define HAS_SERVO_ANGLES (ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE) || (HAS_Z_SERVO_PROBE && defined(Z_PROBE_SERVO_NR))) + +#if !HAS_SERVO_ANGLES + #undef EDITABLE_SERVO_ANGLES +#endif + // Sensors #define HAS_FILAMENT_WIDTH_SENSOR (PIN_EXISTS(FILWIDTH)) @@ -1198,34 +1214,28 @@ #define _SKEW_FACTOR(a,b,c) _SKEW_SIDE(float(a),_GET_SIDE(float(a),float(b),float(c)),float(c)) #ifndef XY_SKEW_FACTOR - constexpr float XY_SKEW_FACTOR = ( - #if defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD) - _SKEW_FACTOR(XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD) - #else - 0.0 - #endif - ); + #if defined(XY_DIAG_AC) && defined(XY_DIAG_BD) && defined(XY_SIDE_AD) + #define XY_SKEW_FACTOR _SKEW_FACTOR(XY_DIAG_AC, XY_DIAG_BD, XY_SIDE_AD) + #else + #define XY_SKEW_FACTOR 0.0 + #endif #endif #ifndef XZ_SKEW_FACTOR #if defined(XY_SIDE_AD) && !defined(XZ_SIDE_AD) #define XZ_SIDE_AD XY_SIDE_AD #endif - constexpr float XZ_SKEW_FACTOR = ( - #if defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD) - _SKEW_FACTOR(XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD) - #else - 0.0 - #endif - ); + #if defined(XZ_DIAG_AC) && defined(XZ_DIAG_BD) && defined(XZ_SIDE_AD) + #define XZ_SKEW_FACTOR _SKEW_FACTOR(XZ_DIAG_AC, XZ_DIAG_BD, XZ_SIDE_AD) + #else + #define XZ_SKEW_FACTOR 0.0 + #endif #endif #ifndef YZ_SKEW_FACTOR - constexpr float YZ_SKEW_FACTOR = ( - #if defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD) - _SKEW_FACTOR(YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD) - #else - 0.0 - #endif - ); + #if defined(YZ_DIAG_AC) && defined(YZ_DIAG_BD) && defined(YZ_SIDE_AD) + #define YZ_SKEW_FACTOR _SKEW_FACTOR(YZ_DIAG_AC, YZ_DIAG_BD, YZ_SIDE_AD) + #else + #define YZ_SKEW_FACTOR 0.0 + #endif #endif #endif // SKEW_CORRECTION @@ -1619,7 +1629,7 @@ // If platform requires early initialization of watchdog to properly boot #define EARLY_WATCHDOG (ENABLED(USE_WATCHDOG) && defined(ARDUINO_ARCH_SAM)) -#define USE_EXECUTE_COMMANDS_IMMEDIATE (ENABLED(G29_RETRY_AND_RECOVER) || ENABLED(GCODE_MACROS)) +#define USE_EXECUTE_COMMANDS_IMMEDIATE (ENABLED(G29_RETRY_AND_RECOVER) || ENABLED(GCODE_MACROS) || ENABLED(POWER_LOSS_RECOVERY)) #if ENABLED(Z_TRIPLE_STEPPER_DRIVERS) #define Z_STEPPER_COUNT 3 @@ -1628,3 +1638,23 @@ #else #define Z_STEPPER_COUNT 1 #endif + +// Get LCD character width/height, which may be overridden by pins, configs, etc. +#ifndef LCD_WIDTH + #if HAS_GRAPHICAL_LCD + #define LCD_WIDTH 22 + #elif ENABLED(ULTIPANEL) + #define LCD_WIDTH 20 + #elif HAS_SPI_LCD + #define LCD_WIDTH 16 + #endif +#endif +#ifndef LCD_HEIGHT + #if HAS_GRAPHICAL_LCD + #define LCD_HEIGHT 5 + #elif ENABLED(ULTIPANEL) + #define LCD_HEIGHT 4 + #elif HAS_SPI_LCD + #define LCD_HEIGHT 2 + #endif +#endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 2fd385aad2..9892303012 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -142,7 +142,7 @@ #error "FILAMENT_CHANGE_NOZZLE_TIMEOUT is now PAUSE_PARK_NOZZLE_TIMEOUT. Please update your configuration." #elif defined(FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS) #error "FILAMENT_CHANGE_NUMBER_OF_ALERT_BEEPS is now FILAMENT_CHANGE_ALERT_BEEPS. Please update your configuration." -#elif ENABLED(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT) +#elif defined(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT) #error "FILAMENT_CHANGE_NO_STEPPER_TIMEOUT is now PAUSE_PARK_NO_STEPPER_TIMEOUT. Please update your configuration." #elif defined(PLA_PREHEAT_HOTEND_TEMP) #error "PLA_PREHEAT_HOTEND_TEMP is now PREHEAT_1_TEMP_HOTEND. Please update your configuration." @@ -335,6 +335,10 @@ #error "MBL_Z_STEP is now MESH_EDIT_Z_STEP. Please update your configuration." #elif defined(CHDK) #error "CHDK is now CHDK_PIN. Please update your Configuration_adv.h." +#elif defined(MAX6675_SS) + #error "MAX6675_SS is now MAX6675_SS_PIN. Please update your configuration and/or pins." +#elif defined(MAX6675_SS2) + #error "MAX6675_SS2 is now MAX6675_SS2_PIN. Please update your configuration and/or pins." #endif #define BOARD_MKS_13 -47 @@ -491,6 +495,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "LCD_PROGRESS_BAR does not apply to graphical displays." #elif ENABLED(FILAMENT_LCD_DISPLAY) #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both." + #elif PROGRESS_MSG_EXPIRE < 0 + #error "PROGRESS_MSG_EXPIRE must be greater than or equal to 0." #endif #elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && !HAS_GRAPHICAL_LCD #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR or Graphical LCD." @@ -1003,9 +1009,6 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "Z_PROBE_LOW_POINT must be less than or equal to 0." #endif - static_assert(int(X_PROBE_OFFSET_FROM_EXTRUDER) == (X_PROBE_OFFSET_FROM_EXTRUDER), "X_PROBE_OFFSET_FROM_EXTRUDER must be an integer value."); - static_assert(int(Y_PROBE_OFFSET_FROM_EXTRUDER) == (Y_PROBE_OFFSET_FROM_EXTRUDER), "Y_PROBE_OFFSET_FROM_EXTRUDER must be an integer value."); - #else /** @@ -1278,7 +1281,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, */ #if !HAS_HEATER_0 #error "HEATER_0_PIN not defined for this board." -#elif !PIN_EXISTS(TEMP_0) && !(defined(MAX6675_SS) && MAX6675_SS >= 0) +#elif !PIN_EXISTS(TEMP_0) && !PIN_EXISTS(MAX6675_SS) #error "TEMP_0_PIN not defined for this board." #elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR))) #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board." @@ -1289,16 +1292,18 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #endif // Pins are required for heaters -#if ENABLED(HEATER_0_USES_MAX6675) && !(defined(MAX6675_SS) && MAX6675_SS >= 0) - #error "MAX6675_SS (required for TEMP_SENSOR_0) not defined for this board." +#if ENABLED(HEATER_0_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS) + #error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board." #elif (HOTENDS > 1 || ENABLED(HEATERS_PARALLEL)) && !HAS_HEATER_1 #error "HEATER_1_PIN not defined for this board." #endif #if HOTENDS > 1 - #if TEMP_SENSOR_1 == 0 + #if ENABLED(HEATER_1_USES_MAX6675) && !PIN_EXISTS(MAX6675_SS2) + #error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board." + #elif TEMP_SENSOR_1 == 0 #error "TEMP_SENSOR_1 is required with 2 or more HOTENDS." - #elif !PIN_EXISTS(TEMP_1) + #elif !PIN_EXISTS(TEMP_1) && !PIN_EXISTS(MAX6675_SS2) #error "TEMP_1_PIN not defined for this board." #endif #if HOTENDS > 2 @@ -1685,6 +1690,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, && DISABLED(MKS_12864OLED_SSD1306) ) \ + (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && DISABLED(BQ_LCD_SMART_CONTROLLER)) \ + ENABLED(LCD_FOR_MELZI) \ + + ENABLED(MALYAN_LCD) \ + ENABLED(MKS_12864OLED) \ + ENABLED(MKS_12864OLED_SSD1306) \ + ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \ diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 9cf6204407..a41776d064 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -39,7 +39,7 @@ /** * Marlin release version identifier */ - #define SHORT_BUILD_VERSION "2.0.x_TR5" + #define SHORT_BUILD_VERSION "2.0.x_TR6" /** * Verbose version identifier which should contain a reference to the location @@ -52,7 +52,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ - #define STRING_DISTRIBUTION_DATE "2018-11-10" + #define STRING_DISTRIBUTION_DATE "2018-12-01" /** * Required minimum Configuration.h and Configuration_adv.h file versions. diff --git a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp index 7dc80b0528..b0d480073b 100644 --- a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp +++ b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp @@ -1,5 +1,5 @@ /** - * @file lcdprint_hd44780.c + * @file lcdprint_hd44780.cpp * @brief LCD print api for HD44780 * @author Yunhui Fu (yhfudev@gmail.com) * @version 1.0 @@ -19,7 +19,7 @@ #include "../ultralcd.h" #include "../../Marlin.h" -#include "ultralcd_common_HD44780.h" +#include "ultralcd_HD44780.h" #include @@ -28,18 +28,16 @@ #define LCD_CLASS LiquidCrystal #endif extern LCD_CLASS lcd; -LCD_CLASS *plcd = &lcd; int lcd_glyph_height(void) { return 1; } -//////////////////////////////////////////////////////////// typedef struct _hd44780_charmap_t { wchar_t uchar; // the unicode char uint8_t idx; // the glyph of the char in the ROM uint8_t idx2; // the char used to be combined with the idx to simulate a single char } hd44780_charmap_t; -#if defined(__AVR__) +#ifdef __AVR__ #define IV(a) U##a #else #define IV(a) L##a @@ -869,11 +867,7 @@ static const hd44780_charmap_t g_hd44780_charmap_common[] PROGMEM = { /* return v1 - v2 */ static int hd44780_charmap_compare(hd44780_charmap_t * v1, hd44780_charmap_t * v2) { - if (v1->uchar < v2->uchar) - return -1; - else if (v1->uchar > v2->uchar) - return 1; - return 0; + return (v1->uchar < v2->uchar) ? -1 : (v1->uchar > v2->uchar) ? 1 : 0; } static int pf_bsearch_cb_comp_hd4map_pgm(void *userdata, size_t idx, void * data_pin) { @@ -883,83 +877,9 @@ static int pf_bsearch_cb_comp_hd4map_pgm(void *userdata, size_t idx, void * data return hd44780_charmap_compare(&localval, (hd44780_charmap_t *)data_pin); } -#if DEBUG +void lcd_moveto(const uint8_t col, const uint8_t row) { lcd.setCursor(col, row); } -int test_hd44780_charmap(hd44780_charmap_t *data, size_t size, char *name, char flg_show_contents) { - int ret; - size_t idx = 0; - hd44780_charmap_t preval = {0, 0, 0}; - hd44780_charmap_t pinval = {0, 0, 0}; - char flg_error = 0; - - int i; - - TRACE("Test %s\n", name); - - for (i = 0; i < size; i ++) { - memcpy_P (&pinval, &(data[i]), sizeof(pinval)); - - if (flg_show_contents) { - #if 1 - TRACE("[% 4d] % 6" PRIu32 "(0x%04" PRIX32 ") --> 0x%02X,0x%02X%s\n", i, pinval.uchar, pinval.uchar, (unsigned int)(pinval.idx), (unsigned int)(pinval.idx2), (preval.uchar < pinval.uchar?"":" <--- ERROR")); - #else - TRACE("[% 4d]", i); - TRACE("% 6" PRIu32 "(0x%04" PRIX32 "),", pinval.uchar, pinval.uchar); - TRACE("0x%02X,", (unsigned int)(pinval.idx)); - TRACE("0x%02X,", (unsigned int)(pinval.idx2)); - TRACE("%s", (preval.uchar < pinval.uchar?"":" <--- ERROR")); - #endif - } - if (preval.uchar >= pinval.uchar) { - flg_error = 1; - // TRACE("Error: out of order in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar); - // return -1; - } - memcpy (&preval, &pinval, sizeof(pinval)); - - ret = pf_bsearch_r((void *)data, size, pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx); - if (ret < 0) { - flg_error = 1; - TRACE("Error: not found item in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar); - //return -1; - } - if (idx != i) { - flg_error = 1; - TRACE("Error: wrong index found item in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar); - //return -1; - } - } - if (flg_error) { - TRACE("\nError: in array %s\n\n", name); - return -1; - } - TRACE("\nPASS array %s\n\n", name); - return 0; -} - -int test_hd44780_charmap_all(void) { - int flg_error = 0; - if (test_hd44780_charmap(g_hd44780_charmap_device, NUM_ARRAY(g_hd44780_charmap_device), "g_hd44780_charmap_device", 0) < 0) { - flg_error = 1; - test_hd44780_charmap(g_hd44780_charmap_device, NUM_ARRAY(g_hd44780_charmap_device), "g_hd44780_charmap_device", 1); - } - if (test_hd44780_charmap(g_hd44780_charmap_common, NUM_ARRAY(g_hd44780_charmap_common), "g_hd44780_charmap_common", 0) < 0) { - flg_error = 1; - test_hd44780_charmap(g_hd44780_charmap_common, NUM_ARRAY(g_hd44780_charmap_common), "g_hd44780_charmap_common", 1); - } - if (flg_error) { - TRACE("\nFAILED in hd44780 tests!\n"); - return -1; - } - TRACE("\nPASS in hd44780 tests.\n"); - return 0; -} - -#endif // DEBUG - -void lcd_moveto(int col, int row) { - plcd->setCursor(col, row); -} +void lcd_put_int(const int i) { lcd.print(i); } // return < 0 on error // return the advanced cols @@ -977,16 +897,16 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { // TODO: fix the '\\' that doesnt exist in the HD44870 if (c < 128) { - plcd->write((uint8_t)c); + lcd.write((uint8_t)c); return 1; } copy_address = NULL; - ret = pf_bsearch_r((void *)g_hd44780_charmap_device, NUM_ARRAY(g_hd44780_charmap_device), pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx); + ret = pf_bsearch_r((void *)g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx); if (ret >= 0) { copy_address = (hd44780_charmap_t *)(g_hd44780_charmap_device + idx); } else { - ret = pf_bsearch_r((void *)g_hd44780_charmap_common, NUM_ARRAY(g_hd44780_charmap_common), pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx); + ret = pf_bsearch_r((void *)g_hd44780_charmap_common, COUNT(g_hd44780_charmap_common), pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx); if (ret >= 0) copy_address = (hd44780_charmap_t *)(g_hd44780_charmap_common + idx); } @@ -994,16 +914,16 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { hd44780_charmap_t localval; // found memcpy_P(&localval, copy_address, sizeof(localval)); - plcd->write(localval.idx); + lcd.write(localval.idx); if (max_length >= 2 && localval.idx2 > 0) { - plcd->write(localval.idx2); + lcd.write(localval.idx2); return 2; } return 1; } // Not found, print '?' instead - plcd->write((uint8_t)'?'); + lcd.write((uint8_t)'?'); return 1; } @@ -1038,4 +958,78 @@ int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) { return lcd_put_u8str_max_cb(utf8_str_P, read_byte_rom, max_length); } +#if ENABLED(DEBUG_LCDPRINT) + + int test_hd44780_charmap(hd44780_charmap_t *data, size_t size, char *name, char flg_show_contents) { + int ret; + size_t idx = 0; + hd44780_charmap_t preval = {0, 0, 0}; + hd44780_charmap_t pinval = {0, 0, 0}; + char flg_error = 0; + + int i; + + TRACE("Test %s\n", name); + + for (i = 0; i < size; i ++) { + memcpy_P(&pinval, &(data[i]), sizeof(pinval)); + + if (flg_show_contents) { + #if 1 + TRACE("[% 4d] % 6" PRIu32 "(0x%04" PRIX32 ") --> 0x%02X,0x%02X%s\n", i, pinval.uchar, pinval.uchar, (unsigned int)(pinval.idx), (unsigned int)(pinval.idx2), (preval.uchar < pinval.uchar?"":" <--- ERROR")); + #else + TRACE("[% 4d]", i); + TRACE("% 6" PRIu32 "(0x%04" PRIX32 "),", pinval.uchar, pinval.uchar); + TRACE("0x%02X,", (unsigned int)(pinval.idx)); + TRACE("0x%02X,", (unsigned int)(pinval.idx2)); + TRACE("%s", (preval.uchar < pinval.uchar?"":" <--- ERROR")); + #endif + } + if (preval.uchar >= pinval.uchar) { + flg_error = 1; + //TRACE("Error: out of order in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar); + //return -1; + } + memcpy(&preval, &pinval, sizeof(pinval)); + + ret = pf_bsearch_r((void *)data, size, pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx); + if (ret < 0) { + flg_error = 1; + TRACE("Error: not found item in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar); + //return -1; + } + if (idx != i) { + flg_error = 1; + TRACE("Error: wrong index found item in array %s: idx=%d, val=%d(0x%x)\n", name, i, pinval.uchar, pinval.uchar); + //return -1; + } + } + if (flg_error) { + TRACE("\nError: in array %s\n\n", name); + return -1; + } + TRACE("\nPASS array %s\n\n", name); + return 0; + } + + int test_hd44780_charmap_all(void) { + int flg_error = 0; + if (test_hd44780_charmap(g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), "g_hd44780_charmap_device", 0) < 0) { + flg_error = 1; + test_hd44780_charmap(g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), "g_hd44780_charmap_device", 1); + } + if (test_hd44780_charmap(g_hd44780_charmap_common, COUNT(g_hd44780_charmap_common), "g_hd44780_charmap_common", 0) < 0) { + flg_error = 1; + test_hd44780_charmap(g_hd44780_charmap_common, COUNT(g_hd44780_charmap_common), "g_hd44780_charmap_common", 1); + } + if (flg_error) { + TRACE("\nFAILED in hd44780 tests!\n"); + return -1; + } + TRACE("\nPASS in hd44780 tests.\n"); + return 0; + } + +#endif // DEBUG_LCDPRINT + #endif // HAS_CHARACTER_LCD diff --git a/Marlin/src/lcd/HD44780/ultralcd_impl_HD44780.cpp b/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp similarity index 83% rename from Marlin/src/lcd/HD44780/ultralcd_impl_HD44780.cpp rename to Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp index f235366d29..c309500b13 100644 --- a/Marlin/src/lcd/HD44780/ultralcd_impl_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp @@ -25,13 +25,13 @@ #if HAS_CHARACTER_LCD /** - * ultralcd_impl_HD44780.cpp + * ultralcd_HD44780.cpp * * LCD display implementations for Hitachi HD44780. * These are the most common LCD character displays. */ -#include "ultralcd_common_HD44780.h" +#include "ultralcd_HD44780.h" #include "../ultralcd.h" #include "../../sd/cardreader.h" @@ -40,6 +40,11 @@ #include "../../module/planner.h" #include "../../module/motion.h" +#if DISABLED(LCD_PROGRESS_BAR) && ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) + #include "../../feature/filwidth.h" + #include "../../gcode/parser.h" +#endif + #if ENABLED(AUTO_BED_LEVELING_UBL) #include "../../feature/bedlevel/ubl/ubl.h" #endif @@ -86,10 +91,6 @@ #endif -#if ENABLED(LCD_HAS_STATUS_INDICATORS) - static void lcd_implementation_update_indicators(); -#endif - static void createChar_P(const char c, const byte * const ptr) { byte temp[8]; for (uint8_t i = 0; i < 8; i++) @@ -101,11 +102,11 @@ static void createChar_P(const char c, const byte * const ptr) { #define LCD_STR_PROGRESS "\x03\x04\x05" #endif -void lcd_set_custom_characters( - #if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN) - const HD44780CharSet screen_charset/*=CHARSET_INFO*/ +void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARSET_INFO*/) { + #if DISABLED(LCD_PROGRESS_BAR) && DISABLED(SHOW_BOOTSCREEN) + UNUSED(screen_charset); #endif -) { + // CHARSET_BOOT #if ENABLED(SHOW_BOOTSCREEN) const static PROGMEM byte corner[4][8] = { { @@ -294,11 +295,11 @@ void lcd_set_custom_characters( else #endif { // Info Screen uses 5 special characters - createChar_P(LCD_BEDTEMP_CHAR, bedTemp); - createChar_P(LCD_DEGREE_CHAR, degree); + createChar_P(LCD_STR_BEDTEMP[0], bedTemp); + createChar_P(LCD_STR_DEGREE[0], degree); createChar_P(LCD_STR_THERMOMETER[0], thermometer); - createChar_P(LCD_FEEDRATE_CHAR, feedrate); - createChar_P(LCD_CLOCK_CHAR, clock); + createChar_P(LCD_STR_FEEDRATE[0], feedrate); + createChar_P(LCD_STR_CLOCK[0], clock); #if ENABLED(LCD_PROGRESS_BAR) if (screen_charset == CHARSET_INFO) { // 3 Progress bar characters for info screen @@ -308,7 +309,7 @@ void lcd_set_custom_characters( else #endif { - createChar_P(LCD_UPLEVEL_CHAR, uplevel); + createChar_P(LCD_STR_UPLEVEL[0], uplevel); #if ENABLED(SDSUPPORT) // SD Card sub-menu special characters createChar_P(LCD_STR_REFRESH[0], refresh); @@ -319,7 +320,7 @@ void lcd_set_custom_characters( } -void lcd_implementation_init() { +void MarlinUI::init_lcd() { #if ENABLED(LCD_I2C_TYPE_PCF8575) lcd.begin(LCD_WIDTH, LCD_HEIGHT); @@ -331,7 +332,7 @@ void lcd_implementation_init() { #elif ENABLED(LCD_I2C_TYPE_MCP23017) lcd.setMCPType(LTI_TYPE_MCP23017); lcd.begin(LCD_WIDTH, LCD_HEIGHT); - lcd_implementation_update_indicators(); + update_indicators(); #elif ENABLED(LCD_I2C_TYPE_MCP23008) lcd.setMCPType(LTI_TYPE_MCP23008); @@ -345,12 +346,12 @@ void lcd_implementation_init() { lcd.begin(LCD_WIDTH, LCD_HEIGHT); #endif - LCD_SET_CHARSET(currentScreen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU); + set_custom_characters(on_status_screen() ? CHARSET_INFO : CHARSET_MENU); lcd.clear(); } -void lcd_implementation_clear() { lcd.clear(); } +void MarlinUI::clear_lcd() { lcd.clear(); } #if ENABLED(SHOW_BOOTSCREEN) @@ -367,10 +368,7 @@ void lcd_implementation_clear() { lcd.clear(); } // Fits into, lcd_moveto(col, line); lcd_put_u8str_max_P(text, len); - while (slen < len) { - lcd_put_wchar(' '); - ++slen; - } + for (; slen < len; ++slen) lcd_put_wchar(' '); safe_delay(time); } else { @@ -385,11 +383,7 @@ void lcd_implementation_clear() { lcd.clear(); } lcd_put_u8str_max_P(p, len); // Fill with spaces - uint8_t ix = slen - i; - while (ix < len) { - lcd_put_wchar(' '); - ++ix; - } + for (uint8_t ix = slen - i; ix < len; ++ix) lcd_put_wchar(' '); // Delay safe_delay(dly); @@ -408,8 +402,8 @@ void lcd_implementation_clear() { lcd.clear(); } lcd_moveto(indent, 2); lcd_put_wchar('\x02'); lcd_put_u8str_P(PSTR( "------" )); lcd_put_wchar('\x03'); } - void lcd_bootscreen() { - LCD_SET_CHARSET(CHARSET_BOOT); + void MarlinUI::show_bootscreen() { + set_custom_characters(CHARSET_BOOT); lcd.clear(); #define LCD_EXTRA_SPACE (LCD_WIDTH-8) @@ -454,6 +448,9 @@ void lcd_implementation_clear() { lcd.clear(); } CENTER_OR_SCROLL(STRING_SPLASH_LINE1, _SPLASH_WAIT_1); #ifdef STRING_SPLASH_LINE2 CENTER_OR_SCROLL(STRING_SPLASH_LINE2, 1500); + #ifdef STRING_SPLASH_LINE3 + CENTER_OR_SCROLL(STRING_SPLASH_LINE3, 1500); + #endif #endif } #elif defined(STRING_SPLASH_LINE2) @@ -478,15 +475,15 @@ void lcd_implementation_clear() { lcd.clear(); } lcd.clear(); safe_delay(100); - LCD_SET_CHARSET(CHARSET_INFO); + set_custom_characters(CHARSET_INFO); lcd.clear(); } #endif // SHOW_BOOTSCREEN -void lcd_kill_screen() { +void MarlinUI::draw_kill_screen() { lcd_moveto(0, 0); - lcd_put_u8str(lcd_status_message); + lcd_put_u8str(status_message); #if LCD_HEIGHT < 4 lcd_moveto(0, 2); #else @@ -554,7 +551,7 @@ FORCE_INLINE void _draw_heater_status(const int8_t heater, const char prefix, co lcd_put_u8str(itostr3left(t2 + 0.5)); if (prefix >= 0) { - lcd_put_wchar(LCD_DEGREE_CHAR); + lcd_put_wchar(LCD_STR_DEGREE[0]); lcd_put_wchar(' '); if (t2 < 10) lcd_put_wchar(' '); } @@ -565,20 +562,14 @@ FORCE_INLINE void _draw_bed_status(const bool blink) { #if HAS_LEVELING planner.leveling_active && blink ? '_' : #endif - LCD_BEDTEMP_CHAR + LCD_STR_BEDTEMP[0] ), blink); } #if HAS_PRINT_PROGRESS FORCE_INLINE void _draw_print_progress() { - const uint8_t percent = ( - #if ENABLED(SDSUPPORT) - IS_SD_PRINTING() ? card.percentDone() : 0 - #else - progress_bar_percent - #endif - ); + const uint8_t progress = ui.get_progress(); lcd_put_u8str_P(PSTR( #if ENABLED(SDSUPPORT) "SD" @@ -586,8 +577,8 @@ FORCE_INLINE void _draw_bed_status(const bool blink) { "P:" #endif )); - if (percent) - lcd_put_u8str(itostr3(percent)); + if (progress) + lcd_put_u8str(itostr3(progress)); else lcd_put_u8str_P(PSTR("---")); lcd_put_wchar('%'); @@ -597,7 +588,7 @@ FORCE_INLINE void _draw_bed_status(const bool blink) { #if ENABLED(LCD_PROGRESS_BAR) - inline void lcd_draw_progress_bar(const uint8_t percent) { + void MarlinUI::draw_progress_bar(const uint8_t percent) { const int16_t tix = (int16_t)(percent * (LCD_WIDTH) * 3) / 100, cel = tix / 3, rem = tix % 3; @@ -616,7 +607,7 @@ FORCE_INLINE void _draw_bed_status(const bool blink) { #endif // LCD_PROGRESS_BAR -FORCE_INLINE void _draw_status_message(const bool blink) { +void MarlinUI::draw_status_message(const bool blink) { lcd_moveto(0, LCD_HEIGHT - 1); @@ -624,17 +615,15 @@ FORCE_INLINE void _draw_status_message(const bool blink) { // Draw the progress bar if the message has shown long enough // or if there is no message set. - #if DISABLED(LCD_SET_PROGRESS_MANUALLY) - const uint8_t progress_bar_percent = card.percentDone(); - #endif - if (progress_bar_percent > 2 && (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0])) - return lcd_draw_progress_bar(progress_bar_percent); + if (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !has_status()) { + const uint8_t progress = get_progress(); + if (progress > 2) return draw_progress_bar(progress); + } #elif ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - // Show Filament Diameter and Volumetric Multiplier % - // After allowing lcd_status_message to show for 5 seconds - if (ELAPSED(millis(), previous_lcd_status_ms + 5000UL)) { + // Alternate Status message and Filament display + if (ELAPSED(millis(), next_filament_display)) { lcd_put_u8str_P(PSTR("Dia ")); lcd_put_u8str(ftostr12ns(filament_width_meas)); lcd_put_u8str_P(PSTR(" V")); @@ -654,13 +643,13 @@ FORCE_INLINE void _draw_status_message(const bool blink) { static bool last_blink = false; // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(lcd_status_message); + uint8_t slen = utf8_strlen(status_message); // If the string fits into the LCD, just print it and do not scroll it if (slen <= LCD_WIDTH) { // The string isn't scrolling and may not fill the screen - lcd_put_u8str(lcd_status_message); + lcd_put_u8str(status_message); // Fill the rest with spaces while (slen < LCD_WIDTH) { @@ -672,7 +661,7 @@ FORCE_INLINE void _draw_status_message(const bool blink) { // String is larger than the available space in screen. // Get a pointer to the next valid UTF8 character - const char *stat = lcd_status_message + status_scroll_offset; + const char *stat = status_message + status_scroll_offset; // Get the string remaining length const uint8_t rlen = utf8_strlen(stat); @@ -692,7 +681,7 @@ FORCE_INLINE void _draw_status_message(const bool blink) { if (--chars) { // Draw a second dot if there's space lcd_put_wchar('.'); if (--chars) - lcd_put_u8str_max(lcd_status_message, chars); // Print a second copy of the message + lcd_put_u8str_max(status_message, chars); // Print a second copy of the message } } if (last_blink != blink) { @@ -701,7 +690,7 @@ FORCE_INLINE void _draw_status_message(const bool blink) { // Adjust by complete UTF8 characters if (status_scroll_offset < slen) { status_scroll_offset++; - while (!START_OF_UTF8_CHAR(lcd_status_message[status_scroll_offset])) + while (!START_OF_UTF8_CHAR(status_message[status_scroll_offset])) status_scroll_offset++; } else @@ -712,10 +701,10 @@ FORCE_INLINE void _draw_status_message(const bool blink) { UNUSED(blink); // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(lcd_status_message); + uint8_t slen = utf8_strlen(status_message); // Just print the string to the LCD - lcd_put_u8str_max(lcd_status_message, LCD_WIDTH); + lcd_put_u8str_max(status_message, LCD_WIDTH); // Fill the rest with spaces if there are missing spaces while (slen < LCD_WIDTH) { @@ -725,35 +714,47 @@ FORCE_INLINE void _draw_status_message(const bool blink) { #endif } -#if LCD_INFO_SCREEN_STYLE == 0 +/** + * LCD_INFO_SCREEN_STYLE 0 : Classic Status Screen + * + * 16x2 |000/000 B000/000| + * |0123456789012345| + * + * 16x4 |000/000 B000/000| + * |SD---% Z 000.00| + * |F---% T--:--| + * |0123456789012345| + * + * 20x2 |T000/000° B000/000° | + * |01234567890123456789| + * + * 20x4 |T000/000° B000/000° | + * |X 000 Y 000 Z000.000| + * |F---% SD---% T--:--| + * |01234567890123456789| + * + * LCD_INFO_SCREEN_STYLE 1 : Prusa-style Status Screen + * + * |T000/000° Z 000.00 | + * |B000/000° F---% | + * |SD---% T--:-- | + * |01234567890123456789| + * + * |T000/000° Z 000.00 | + * |T000/000° F---% | + * |B000/000° SD---% | + * |01234567890123456789| + */ - /** - * LCD_INFO_SCREEN_STYLE 0 : Classic Status Screen - * - * 16x2 |000/000 B000/000| - * |0123456789012345| - * - * 16x4 |000/000 B000/000| - * |SD---% Z 000.00| - * |F---% T--:--| - * |0123456789012345| - * - * 20x2 |T000/000° B000/000° | - * |01234567890123456789| - * - * 20x4 |T000/000° B000/000° | - * |X 000 Y 000 Z000.000| - * |F---% SD---% T--:--| - * |01234567890123456789| - */ +void MarlinUI::draw_status_screen() { - void lcd_impl_status_screen_0() { - const bool blink = lcd_blink(); + const bool blink = get_blink(); + lcd_moveto(0, 0); + + #if LCD_INFO_SCREEN_STYLE == 0 // ========== Line 1 ========== - lcd_moveto(0, 0); - #if LCD_WIDTH < 20 // @@ -766,11 +767,11 @@ FORCE_INLINE void _draw_status_message(const bool blink) { // #if HOTENDS > 1 lcd_moveto(8, 0); - lcd_put_wchar((char)LCD_STR_THERMOMETER[0]); + lcd_put_wchar(LCD_STR_THERMOMETER[0]); _draw_heater_status(1, -1, blink); #elif HAS_HEATED_BED lcd_moveto(8, 0); - lcd_put_wchar((char)LCD_BEDTEMP_CHAR); + lcd_put_wchar(LCD_STR_BEDTEMP[0]); _draw_heater_status(-1, -1, blink); #endif @@ -847,7 +848,7 @@ FORCE_INLINE void _draw_status_message(const bool blink) { #if LCD_HEIGHT > 3 lcd_moveto(0, 2); - lcd_put_wchar(LCD_FEEDRATE_CHAR); + lcd_put_wchar(LCD_STR_FEEDRATE[0]); lcd_put_u8str(itostr3(feedrate_percentage)); lcd_put_wchar('%'); @@ -856,7 +857,7 @@ FORCE_INLINE void _draw_status_message(const bool blink) { const uint8_t len = elapsed.toDigital(buffer), timepos = LCD_WIDTH - len - 1; lcd_moveto(timepos, 2); - lcd_put_wchar(LCD_CLOCK_CHAR); + lcd_put_wchar(LCD_STR_CLOCK[0]); lcd_put_u8str(buffer); #if LCD_WIDTH >= 20 @@ -885,39 +886,13 @@ FORCE_INLINE void _draw_status_message(const bool blink) { #endif // LCD_HEIGHT > 3 - // ========= Last Line ======== - - // - // Status Message (which may be a Progress Bar or Filament display) - // - _draw_status_message(blink); - } - -#elif LCD_INFO_SCREEN_STYLE == 1 - - /** - * LCD_INFO_SCREEN_STYLE 1 : Prusa-style Status Screen - * - * |T000/000° Z 000.00 | - * |B000/000° F---% | - * |SD---% T--:-- | - * |01234567890123456789| - * - * |T000/000° Z 000.00 | - * |T000/000° F---% | - * |B000/000° SD---% | - * |01234567890123456789| - */ - - void lcd_impl_status_screen_1() { - const bool blink = lcd_blink(); + #elif LCD_INFO_SCREEN_STYLE == 1 // ========== Line 1 ========== // // Hotend 0 Temperature // - lcd_moveto(0, 0); _draw_heater_status(0, LCD_STR_THERMOMETER[0], blink); // @@ -944,7 +919,7 @@ FORCE_INLINE void _draw_status_message(const bool blink) { #endif lcd_moveto(LCD_WIDTH - 9, 1); - lcd_put_wchar(LCD_FEEDRATE_CHAR); + lcd_put_wchar(LCD_STR_FEEDRATE[0]); lcd_put_u8str(itostr3(feedrate_percentage)); lcd_put_wchar('%'); @@ -973,34 +948,34 @@ FORCE_INLINE void _draw_status_message(const bool blink) { duration_t elapsed = print_job_timer.duration(); char buffer[14]; (void)elapsed.toDigital(buffer); - lcd_put_wchar(LCD_CLOCK_CHAR); + lcd_put_wchar(LCD_STR_CLOCK[0]); lcd_put_u8str(buffer); #endif - // ========== Line 4 ========== + #endif // LCD_INFO_SCREEN_STYLE 1 - // - // Status Message (which may be a Progress Bar or Filament display) - // - _draw_status_message(blink); - } + // ========= Last Line ======== -#endif + // + // Status Message (which may be a Progress Bar or Filament display) + // + draw_status_message(blink); +} #if HAS_LCD_MENU #if ENABLED(ADVANCED_PAUSE_FEATURE) - void lcd_implementation_hotend_status(const uint8_t row, const uint8_t extruder) { + void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) { if (row < LCD_HEIGHT) { lcd_moveto(LCD_WIDTH - 9, row); - _draw_heater_status(extruder, LCD_STR_THERMOMETER[0], lcd_blink()); + _draw_heater_status(extruder, LCD_STR_THERMOMETER[0], ui.get_blink()); } } #endif // ADVANCED_PAUSE_FEATURE - void lcd_implementation_drawmenu_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char *valstr/*=NULL*/) { + void draw_menu_item_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char *valstr/*=NULL*/) { UNUSED(invert); int8_t n = LCD_WIDTH; lcd_moveto(0, row); @@ -1013,35 +988,26 @@ FORCE_INLINE void _draw_status_message(const bool blink) { for (; n > 0; --n) lcd_put_wchar(' '); } - void lcd_implementation_drawmenu_generic(const bool sel, const uint8_t row, PGM_P pstr, const char pre_char, const char post_char) { + void draw_menu_item(const bool sel, const uint8_t row, PGM_P pstr, const char pre_char, const char post_char) { uint8_t n = LCD_WIDTH - 2; lcd_moveto(0, row); lcd_put_wchar(sel ? pre_char : ' '); n -= lcd_put_u8str_max_P(pstr, n); - while (n--) lcd_put_wchar(' '); + for (; n; --n) lcd_put_wchar(' '); lcd_put_wchar(post_char); } - void lcd_implementation_drawmenu_setting_edit_generic(const bool sel, const uint8_t row, PGM_P pstr, const char pre_char, const char* const data) { - uint8_t n = LCD_WIDTH - 2 - utf8_strlen(data); + void _draw_menu_item_edit(const bool sel, const uint8_t row, PGM_P pstr, const char* const data, const bool pgm) { + uint8_t n = LCD_WIDTH - 2 - (pgm ? utf8_strlen_P(data) : utf8_strlen(data)); lcd_moveto(0, row); - lcd_put_wchar(sel ? pre_char : ' '); + lcd_put_wchar(sel ? LCD_STR_ARROW_RIGHT[0] : ' '); n -= lcd_put_u8str_max_P(pstr, n); lcd_put_wchar(':'); - while (n--) lcd_put_wchar(' '); - lcd_put_u8str(data); - } - void lcd_implementation_drawmenu_setting_edit_generic_P(const bool sel, const uint8_t row, PGM_P pstr, const char pre_char, const char* const data) { - uint8_t n = LCD_WIDTH - 2 - utf8_strlen_P(data); - lcd_moveto(0, row); - lcd_put_wchar(sel ? pre_char : ' '); - n -= lcd_put_u8str_max_P(pstr, n); - lcd_put_wchar(':'); - while (n--) lcd_put_wchar(' '); - lcd_put_u8str_P(data); + for (; n; --n) lcd_put_wchar(' '); + if (pgm) lcd_put_u8str_P(data); else lcd_put_u8str(data); } - void lcd_implementation_drawedit(PGM_P pstr, const char* const value/*=NULL*/) { + void draw_edit_screen(PGM_P const pstr, const char* const value/*=NULL*/) { lcd_moveto(1, 1); lcd_put_u8str_P(pstr); if (value != NULL) { @@ -1056,73 +1022,22 @@ FORCE_INLINE void _draw_status_message(const bool blink) { #if ENABLED(SDSUPPORT) - static void lcd_implementation_drawmenu_sd(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard, const uint8_t concat, const char post_char) { + void draw_sd_menu_item(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir) { UNUSED(pstr); - lcd_moveto(0, row); - lcd_put_wchar(sel ? '>' : ' '); - - uint8_t n = LCD_WIDTH - concat; - const char *outstr = theCard.longest_filename(); - if (theCard.longFilename[0]) { - #if ENABLED(SCROLL_LONG_FILENAMES) - static uint8_t filename_scroll_hash; - if (sel) { - uint8_t name_hash = row; - for (uint8_t l = FILENAME_LENGTH; l--;) - name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ theCard.filename[l]; // rotate, xor - if (filename_scroll_hash != name_hash) { // If the hash changed... - filename_scroll_hash = name_hash; // Save the new hash - filename_scroll_max = MAX(0, utf8_strlen(theCard.longFilename) - n); // Update the scroll limit - filename_scroll_pos = 0; // Reset scroll to the start - lcd_status_update_delay = 8; // Don't scroll right away - } - outstr += filename_scroll_pos; - } - #else - theCard.longFilename[n] = '\0'; // cutoff at screen edge - #endif - } lcd_moveto(0, row); - lcd_put_wchar(sel ? '>' : ' '); - n -= lcd_put_u8str_max(outstr, n); - - while (n) { --n; lcd_put_wchar(' '); } - lcd_put_wchar(post_char); - } - - void lcd_implementation_drawmenu_sdfile(const bool sel, const uint8_t row, PGM_P pstr, CardReader &theCard) { - lcd_implementation_drawmenu_sd(sel, row, pstr, theCard, 2, ' '); - } - - void lcd_implementation_drawmenu_sddirectory(const bool sel, const uint8_t row, PGM_P pstr, CardReader &theCard) { - lcd_implementation_drawmenu_sd(sel, row, pstr, theCard, 2, LCD_STR_FOLDER[0]); + lcd_put_wchar(sel ? LCD_STR_ARROW_RIGHT[0] : ' '); + constexpr uint8_t maxlen = LCD_WIDTH - 2; + uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); + for (; n; --n) lcd_put_wchar(' '); + lcd_put_wchar(isDir ? LCD_STR_FOLDER[0] : ' '); } #endif // SDSUPPORT - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - - extern millis_t next_button_update_ms; - - static uint8_t lcd_implementation_read_slow_buttons() { - #if ENABLED(LCD_I2C_TYPE_MCP23017) - // Reading these buttons this is likely to be too slow to call inside interrupt context - // so they are called during normal lcd_update - uint8_t slow_bits = lcd.readButtons() << B_I2C_BTN_OFFSET; - #if ENABLED(LCD_I2C_VIKI) - if ((slow_bits & (B_MI | B_RI)) && PENDING(millis(), next_button_update_ms)) // LCD clicked - slow_bits &= ~(B_MI | B_RI); // Disable LCD clicked buttons if screen is updated - #endif // LCD_I2C_VIKI - return slow_bits; - #endif // LCD_I2C_TYPE_MCP23017 - } - - #endif // LCD_HAS_SLOW_BUTTONS - #if ENABLED(LCD_HAS_STATUS_INDICATORS) - static void lcd_implementation_update_indicators() { + static void MarlinUI::update_indicators() { // Set the LEDS - referred to as backlights by the LiquidTWI2 library static uint8_t ledsprev = 0; uint8_t leds = 0; @@ -1242,7 +1157,7 @@ FORCE_INLINE void _draw_status_message(const bool blink) { lcd_put_wchar(c); } - void lcd_implementation_ubl_plot(const uint8_t x, const uint8_t inverted_y) { + void MarlinUI::ubl_plot(const uint8_t x, const uint8_t inverted_y) { #if LCD_WIDTH >= 20 #define _LCD_W_POS 12 @@ -1292,7 +1207,7 @@ FORCE_INLINE void _draw_status_message(const bool blink) { lower_right.column = 0; lower_right.row = 0; - lcd_implementation_clear(); + clear_lcd(); x_map_pixels = (HD44780_CHAR_WIDTH) * (MESH_MAP_COLS) - 2; // Minus 2 because we are drawing a box around the map y_map_pixels = (HD44780_CHAR_HEIGHT) * (MESH_MAP_ROWS) - 2; diff --git a/Marlin/src/lcd/HD44780/ultralcd_common_HD44780.h b/Marlin/src/lcd/HD44780/ultralcd_HD44780.h similarity index 56% rename from Marlin/src/lcd/HD44780/ultralcd_common_HD44780.h rename to Marlin/src/lcd/HD44780/ultralcd_HD44780.h index 54ff9a5368..9829619f54 100644 --- a/Marlin/src/lcd/HD44780/ultralcd_common_HD44780.h +++ b/Marlin/src/lcd/HD44780/ultralcd_HD44780.h @@ -39,70 +39,6 @@ // macro name. The mapping is independent of whether the button is directly connected or // via a shift/i2c register. -#if HAS_LCD_MENU - - extern volatile uint8_t buttons; - - // - // Setup other button mappings of each panel - // - #if ENABLED(LCD_I2C_VIKI) - #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) - - // button and encoder bit positions within 'buttons' - #define B_LE (BUTTON_LEFT << B_I2C_BTN_OFFSET) // The remaining normalized buttons are all read via I2C - #define B_UP (BUTTON_UP << B_I2C_BTN_OFFSET) - #define B_MI (BUTTON_SELECT << B_I2C_BTN_OFFSET) - #define B_DW (BUTTON_DOWN << B_I2C_BTN_OFFSET) - #define B_RI (BUTTON_RIGHT << B_I2C_BTN_OFFSET) - - #undef LCD_CLICKED - #if BUTTON_EXISTS(ENC) - // the pause/stop/restart button is connected to BTN_ENC when used - #define B_ST (EN_C) // Map the pause/stop/resume button into its normalized functional name - #define LCD_CLICKED() (buttons & (B_MI|B_RI|B_ST)) // pause/stop button also acts as click until we implement proper pause/stop. - #else - #define LCD_CLICKED() (buttons & (B_MI|B_RI)) - #endif - - // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update - #define LCD_HAS_SLOW_BUTTONS - - #elif ENABLED(LCD_I2C_PANELOLU2) - - #if !BUTTON_EXISTS(ENC) // Use I2C if not directly connected to a pin - - #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) - - #define B_MI (PANELOLU2_ENCODER_C << B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later - - #undef LCD_CLICKED - #define LCD_CLICKED() (buttons & B_MI) - - // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update - #define LCD_HAS_SLOW_BUTTONS - - #endif - - #elif DISABLED(NEWPANEL) // old style ULTIPANEL - // Shift register bits correspond to buttons: - #define BL_LE 7 // Left - #define BL_UP 6 // Up - #define BL_MI 5 // Middle - #define BL_DW 4 // Down - #define BL_RI 3 // Right - #define BL_ST 2 // Red Button - #define B_LE (_BV(BL_LE)) - #define B_UP (_BV(BL_UP)) - #define B_MI (_BV(BL_MI)) - #define B_DW (_BV(BL_DW)) - #define B_RI (_BV(BL_RI)) - #define B_ST (_BV(BL_ST)) - #define LCD_CLICKED() (buttons & (B_MI|B_ST)) - #endif - -#endif // HAS_LCD_MENU - //////////////////////////////////// // Create LCD class instance and chipset-specific information #if ENABLED(LCD_I2C_TYPE_PCF8575) @@ -122,7 +58,7 @@ #define LCD_CLASS LiquidCrystal_I2C #elif ENABLED(LCD_I2C_TYPE_MCP23017) - // For the LED indicators (which may be mapped to different events in lcd_implementation_update_indicators()) + // For the LED indicators (which may be mapped to different events in update_indicators()) #define LCD_HAS_STATUS_INDICATORS #define LED_A 0x04 //100 #define LED_B 0x02 //010 diff --git a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h index 93d57bb792..e1a2ea9806 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h +++ b/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h @@ -21,56 +21,63 @@ */ #pragma once +#include "../../inc/MarlinConfig.h" + // use this file to create the public interface for device drivers that are NOT in the U8G library extern u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_sw_spi; extern u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_hw_spi; -class U8GLIB_64128N_2X_HAL : public U8GLIB -{ - public: - U8GLIB_64128N_2X_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_st7565_64128n_HAL_2x_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset) - { } - U8GLIB_64128N_2X_HAL(pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_st7565_64128n_HAL_2x_hw_spi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset) - { } + +class U8GLIB_64128N_2X_HAL : public U8GLIB { +public: + U8GLIB_64128N_2X_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) + : U8GLIB(&u8g_dev_st7565_64128n_HAL_2x_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset) + { } + U8GLIB_64128N_2X_HAL(pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) + : U8GLIB(&u8g_dev_st7565_64128n_HAL_2x_hw_spi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset) + { } }; extern u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_sw_spi; extern u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_hw_spi; -class U8GLIB_ST7920_128X64_4X_HAL : public U8GLIB -{ - public: - U8GLIB_ST7920_128X64_4X_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_st7920_128x64_HAL_4x_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset) // a0 = U8G_PIN_NONE - { } - U8GLIB_ST7920_128X64_4X_HAL(pin_t cs, pin_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_st7920_128x64_HAL_4x_hw_spi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset) // a0 = U8G_PIN_NONE - { } + +class U8GLIB_ST7920_128X64_4X_HAL : public U8GLIB { +public: + U8GLIB_ST7920_128X64_4X_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t reset = U8G_PIN_NONE) + : U8GLIB(&u8g_dev_st7920_128x64_HAL_4x_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset) // a0 = U8G_PIN_NONE + { } + U8GLIB_ST7920_128X64_4X_HAL(pin_t cs, pin_t reset = U8G_PIN_NONE) + : U8GLIB(&u8g_dev_st7920_128x64_HAL_4x_hw_spi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset) // a0 = U8G_PIN_NONE + { } }; -// AVR version uses ultralcd_st7920_u8glib_rrd_AVR.cpp, HAL version uses u8g_dev_st7920_128x64_HAL.cpp +// +// AVR version uses ultralcd_st7920_u8glib_rrd_AVR.cpp +// HAL version uses u8g_dev_st7920_128x64_HAL.cpp +// extern u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi; -class U8GLIB_ST7920_128X64_RRD : public U8GLIB -{ - public: - U8GLIB_ST7920_128X64_RRD(pin_t sck, pin_t mosi, pin_t cs, pin_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_st7920_128x64_rrd_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset) // a0 = U8G_PIN_NONE - { } + +class U8GLIB_ST7920_128X64_RRD : public U8GLIB { +public: + U8GLIB_ST7920_128X64_RRD(pin_t sck, pin_t mosi, pin_t cs, pin_t reset = U8G_PIN_NONE) + : U8GLIB(&u8g_dev_st7920_128x64_rrd_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset) // a0 = U8G_PIN_NONE + { } }; extern u8g_dev_t u8g_dev_sh1106_128x64_2x_i2c_2_wire; + class U8GLIB_SH1106_128X64_2X_I2C_2_WIRE : public U8GLIB { - public: - U8GLIB_SH1106_128X64_2X_I2C_2_WIRE(uint8_t options = U8G_I2C_OPT_NONE) - : U8GLIB(&u8g_dev_sh1106_128x64_2x_i2c_2_wire, options) - { } +public: + U8GLIB_SH1106_128X64_2X_I2C_2_WIRE(uint8_t options = U8G_I2C_OPT_NONE) + : U8GLIB(&u8g_dev_sh1106_128x64_2x_i2c_2_wire, options) + { } }; extern u8g_dev_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire; + class U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE : public U8GLIB { - public: - U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE(uint8_t options = U8G_I2C_OPT_NONE) - : U8GLIB(&u8g_dev_ssd1306_128x64_2x_i2c_2_wire, options) - { } +public: + U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE(uint8_t options = U8G_I2C_OPT_NONE) + : U8GLIB(&u8g_dev_ssd1306_128x64_2x_i2c_2_wire, options) + { } }; diff --git a/Marlin/src/lcd/dogm/dogm_Statusscreen.h b/Marlin/src/lcd/dogm/dogm_Statusscreen.h index c5701ea86b..9a0f079442 100644 --- a/Marlin/src/lcd/dogm/dogm_Statusscreen.h +++ b/Marlin/src/lcd/dogm/dogm_Statusscreen.h @@ -31,1083 +31,1146 @@ #include "../../inc/MarlinConfig.h" +#define BW(N) ((N + 7) / 8) + #if ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) /** - * Custom _Statusscreen.h files must define STATUS_SCREENWIDTH and status_screen[012]_bmp. - * There's no need to define STATUS_SCREENHEIGHT since it's calculated automatically. - * You can also define these to modify drawing and animation: + * Custom _Statusscreen.h files can define: + * - A custom logo image + * - A custom heater bitmap + * - A custom fan bitmap / animation * - * - STATUS_SCREEN_X - * - STATUS_SCREEN_{BED,FAN}_TEXT_X - * - STATUS_SCREEN_HOTEND_TEXT_X(i) - * - FAN_ANIM_FRAMES + * See the included examples for guidance */ #include "../../../_Statusscreen.h" -#else // !CUSTOM_STATUS_SCREEN_IMAGE - - // Can also be overridden in Configuration.h - // If you can afford it, try the 3-frame fan animation! - #ifndef FAN_ANIM_FRAMES - #define FAN_ANIM_FRAMES 2 + #ifdef STATUS_SCREENWIDTH + #error "Your custom _Statusscreen.h needs to be converted for Marlin 2.0." #endif - #if HAS_HEATED_BED && HOTENDS <= 3 +#endif - #define STATUS_SCREEN_X ( 8 + (HOTENDS ? 0 : 64)) - #define STATUS_SCREENWIDTH (120 - (HOTENDS ? 0 : 64)) +#if ENABLED(STATUS_COMBINE_HEATERS) + #undef STATUS_HOTEND_ANIM + #undef STATUS_BED_ANIM +#endif - #if HOTENDS == 0 +// +// Default Status Screen Heater or Hotends bitmaps +// - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 +#if !STATUS_HEATERS_WIDTH && !STATUS_HOTEND1_WIDTH + + #if ENABLED(STATUS_COMBINE_HEATERS) + + // + // Status Screen Combined Heater bitmaps + // + + #if HAS_HEATED_BED && HOTENDS == 0 + #define STATUS_HEATERS_X 80 + #endif + + #if HAS_HEATED_BED && HOTENDS <= 3 + + #define STATUS_BED_WIDTH 18 + + #if HOTENDS == 0 + + #define STATUS_HEATERS_WIDTH 18 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00100000,B10000010,B00000000, + B00010000,B01000001,B00000000, + B00010000,B01000001,B00000000, + B00100000,B10000010,B00000000, + B01000001,B00000100,B00000000, + B10000010,B00001000,B00000000, + B10000010,B00001000,B00000000, + B01000001,B00000100,B00000000, + B00100000,B10000010,B00000000, + B00000000,B00000000,B00000000, + B11111111,B11111111,B11000000, + B11111111,B11111111,B11000000 }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 + + #elif HOTENDS == 1 + + #define STATUS_HEATERS_WIDTH 90 + #define STATUS_BED_X 80 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000, + B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000, + B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000, + B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000, + B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000, + B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000, + B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000, + B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000, + B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000 }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 + + #elif HOTENDS == 2 + + #define STATUS_HEATERS_WIDTH 90 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000, + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000, + B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000, + B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000, + B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000 }; + + #else // HOTENDS > 2 + + #define STATUS_HEATERS_WIDTH 90 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000, + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000, + B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000, + B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000, + B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000, + B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000 + }; + + #endif // HOTENDS + + #else // !HAS_HEATED_BED || HOTENDS > 3 + + #if HOTENDS == 1 + + #define STATUS_HEATERS_WIDTH 11 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111111,B11110000, + B00111111,B11110000, + B00011111,B11100000, + B00011111,B11100000, + B00111111,B11110000, + B00111111,B11110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + #elif HOTENDS == 2 + + #define STATUS_HEATERS_WIDTH 36 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000, + B00111110,B11110000,B00000000,B00111100,B11110000, + B00111100,B11110000,B00000000,B00111011,B01110000, + B00111010,B11110000,B00000000,B00111111,B01110000, + B00011110,B11100000,B00000000,B00011110,B11100000, + B00011110,B11100000,B00000000,B00011101,B11100000, + B00111110,B11110000,B00000000,B00111011,B11110000, + B00111110,B11110000,B00000000,B00111000,B01110000, + B00111111,B11110000,B00000000,B00111111,B11110000, + B00001111,B11000000,B00000000,B00001111,B11000000, + B00000111,B10000000,B00000000,B00000111,B10000000, + B00000011,B00000000,B00000000,B00000011,B00000000 + }; + + #elif HOTENDS == 3 + + #define STATUS_HEATERS_WIDTH 60 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000, + B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, + B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, + B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, + B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 + }; + + #elif HOTENDS > 3 + + #define STATUS_HEATERS_WIDTH 84 + + const unsigned char status_heaters_bmp[] PROGMEM = { + B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000, + B00111110,B11110000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000, + B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000, + B00111010,B11110000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000, + B00011110,B11100000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000, + B00011110,B11100000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000, + B00111110,B11110000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000, + B00111110,B11110000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000, + B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000, + B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000, + B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000, + B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000 + }; + + #endif // HOTENDS + + #endif // !HAS_HEATED_BED || HOTENDS > 3 + + #else // !STATUS_COMBINE_HEATERS + + // + // Status Screen Hotends bitmaps + // + + #if HOTENDS + + #define STATUS_HOTEND1_WIDTH 12 + + #if HOTENDS == 1 || ENABLED(STATUS_HOTEND_NUMBERLESS) + + const unsigned char status_hotend_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111111,B11110000, + B00111111,B11110000, + B00011111,B11100000, + B00011111,B11100000, + B00111111,B11110000, + B00111111,B11110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + #ifdef STATUS_HOTEND_ANIM + + const unsigned char status_hotend_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100000,B00010000, + B00100000,B00010000, + B00010000,B00100000, + B00010000,B00100000, + B00100000,B00010000, + B00100000,B00010000, + B00110000,B00110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; + + #endif + #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; + + #if HOTENDS >= 2 + + #if HAS_HEATED_BED + #define MAX_HOTEND_BITMAPS 3 + #else + #define MAX_HOTEND_BITMAPS 4 + #endif + #if HOTENDS > MAX_HOTEND_BITMAPS + #define STATUS_HOTEND_BITMAPS MAX_HOTEND_BITMAPS + #else + #define STATUS_HOTEND_BITMAPS HOTENDS + #endif + + #ifdef STATUS_HOTEND_ANIM + + const unsigned char status_hotend1_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111110,B11110000, + B00111100,B11110000, + B00011010,B11100000, + B00011110,B11100000, + B00111110,B11110000, + B00111110,B11110000, + B00111110,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + const unsigned char status_hotend1_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100001,B00010000, + B00100011,B00010000, + B00010101,B00100000, + B00010001,B00100000, + B00100001,B00010000, + B00100001,B00010000, + B00110001,B00110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; + + const unsigned char status_hotend2_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111100,B11110000, + B00111011,B01110000, + B00011111,B01100000, + B00011110,B11100000, + B00111101,B11110000, + B00111011,B11110000, + B00111000,B01110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + const unsigned char status_hotend2_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100011,B00010000, + B00100100,B10010000, + B00010000,B10100000, + B00010001,B00100000, + B00100010,B00010000, + B00100100,B00010000, + B00110111,B10110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; + + #else + + const unsigned char status_hotend1_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111110,B11110000, + B00111100,B11110000, + B00111010,B11110000, + B00011110,B11100000, + B00011110,B11100000, + B00111110,B11110000, + B00111110,B11110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + const unsigned char status_hotend2_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111100,B11110000, + B00111011,B01110000, + B00111111,B01110000, + B00011110,B11100000, + B00011101,B11100000, + B00111011,B11110000, + B00111000,B01110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + #endif + + #endif + + #if STATUS_HOTEND_BITMAPS >= 3 + + #ifdef STATUS_HOTEND_ANIM + + const unsigned char status_hotend3_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111100,B11110000, + B00111011,B01110000, + B00011111,B01100000, + B00011100,B11100000, + B00111111,B01110000, + B00111011,B01110000, + B00111100,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + const unsigned char status_hotend3_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100011,B00010000, + B00100100,B10010000, + B00010000,B10100000, + B00010011,B00100000, + B00100000,B10010000, + B00100100,B10010000, + B00110011,B00110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; + + #else + + const unsigned char status_hotend3_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111100,B11110000, + B00111011,B01110000, + B00111111,B01110000, + B00011100,B11100000, + B00011111,B01100000, + B00111011,B01110000, + B00111100,B11110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + #endif + + #endif + + #if STATUS_HOTEND_BITMAPS >= 4 && !HAS_HEATED_BED + + #ifdef STATUS_HOTEND_ANIM + + const unsigned char status_hotend4_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111011,B01110000, + B00111011,B01110000, + B00011011,B01100000, + B00011011,B01100000, + B00111000,B00110000, + B00111111,B01110000, + B00111111,B01110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + const unsigned char status_hotend4_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100100,B10010000, + B00100100,B10010000, + B00010100,B10100000, + B00010100,B10100000, + B00100111,B11010000, + B00100000,B10010000, + B00110000,B10110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; + + #else + + const unsigned char status_hotend4_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111011,B01110000, + B00111011,B01110000, + B00111011,B01110000, + B00011011,B01100000, + B00011000,B00100000, + B00111111,B01110000, + B00111111,B01110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + #endif + + #endif + + #if STATUS_HOTEND_BITMAPS >= 5 && !HAS_HEATED_BED + + #ifdef STATUS_HOTEND_ANIM + + const unsigned char status_hotend5_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111111,B11110000, + B00111000,B01110000, + B00111011,B11110000, + B00011000,B11100000, + B00011111,B01100000, + B00111111,B01110000, + B00111011,B01110000, + B00111100,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + const unsigned char status_hotend5_b_bmp[] PROGMEM = { + B00011111,B11100000, + B00100000,B00010000, + B00100111,B10010000, + B00100100,B00010000, + B00010111,B00100000, + B00010000,B10100000, + B00100000,B10010000, + B00100100,B10010000, + B00110011,B00110000, + B00001000,B01000000, + B00000100,B10000000, + B00000011,B00000000 + }; + + #else + + const unsigned char status_hotend5_a_bmp[] PROGMEM = { + B00011111,B11100000, + B00111000,B01110000, + B00111011,B11110000, + B00111000,B11110000, + B00011111,B01100000, + B00011111,B01100000, + B00111011,B01110000, + B00111100,B11110000, + B00111111,B11110000, + B00001111,B11000000, + B00000111,B10000000, + B00000011,B00000000 + }; + + #endif + + #endif + #endif - #elif HOTENDS == 1 + #endif - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif + #endif - #elif HOTENDS == 2 +#endif // !STATUS_HEATERS_WIDTH && !STATUS_HOTEND1_WIDTH - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif +// +// Default Status Screen Bed bitmaps +// - #else // HOTENDS > 2 +#if !STATUS_BED_WIDTH && DISABLED(STATUS_COMBINE_HEATERS) && HAS_HEATED_BED && HOTENDS < 4 - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00010000,B01000001,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B10000010,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B01000001,B00000100,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B10000010,B00001000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B10000010,B00001000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B01000001,B00000100,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00100000,B10000010,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B11111111,B11111111,B11000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000 - }; - #endif + #if ENABLED(STATUS_ALT_BED_BITMAP) - #endif // HOTENDS + #define STATUS_BED_ANIM + #define STATUS_BED_WIDTH 24 + #ifndef STATUS_BED_X + #define STATUS_BED_X 72 + #endif + #define STATUS_BED_TEXT_X STATUS_BED_X + 13 - #else // !HAS_HEATED_BED || HOTENDS > 3 + const unsigned char status_bed_bmp[] PROGMEM = { + B11111111,B11111111,B11000000, + B01000000,B00000000,B00100000, + B00100000,B00000000,B00010000, + B00010000,B00000000,B00001000, + B00001000,B00000000,B00000100, + B00000100,B00000000,B00000010, + B00000011,B11111111,B11111111 + }; - #define STATUS_SCREEN_X ( 8 + (HOTENDS ? 0 : 96)) - #define STATUS_SCREENWIDTH (120 - (HOTENDS ? 0 : 96)) + const unsigned char status_bed_on_bmp[] PROGMEM = { + B00000010,B00100010,B00000000, + B00000100,B01000100,B00000000, + B00000100,B01000100,B00000000, + B00000010,B00100010,B00000000, + B00000001,B00010001,B00000000, + B11111111,B11111111,B11000000, + B01000000,B10001000,B10100000, + B00100001,B00010001,B00010000, + B00010010,B00100010,B00001000, + B00001000,B00000000,B00000100, + B00000100,B00000000,B00000010, + B00000011,B11111111,B11111111 + }; - #if HOTENDS == 0 + #else - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00000000,B11111000, - B00111001,B00000001,B00111000, - B00110111,B10000011,B11011000, - B00110111,B10000011,B11011000, - B00101111,B11000111,B11101000, - B00100111,B11000111,B11001000, - B00100001,B11111111,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100000,B01111100,B00001000, - B00100001,B11111111,B00001000, - B00100111,B11000111,B11001000, - B00101111,B11000111,B11101000, - B00110111,B10000011,B11011000, - B00110111,B10000011,B11011000, - B00111001,B00000001,B00111000, - B00111110,B00000000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00110000,B11111000, - B00111001,B11110000,B00111000, - B00110001,B11110000,B00011000, - B00110000,B11110000,B00011000, - B00100000,B11110000,B01101000, - B00100000,B00110001,B11101000, - B00100000,B00111001,B11101000, - B00100000,B01111111,B11111000, - B00111111,B11111111,B11111000, - B00111111,B11111100,B00001000, - B00101111,B00111000,B00001000, - B00101110,B00011000,B00001000, - B00101100,B00011110,B00001000, - B00110000,B00011110,B00011000, - B00110000,B00011111,B00011000, - B00111000,B00011111,B00111000, - B00111110,B00011000,B11111000, - B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00111111,B11111111,B11111000, - B00111110,B00011000,B11111000, - B00111000,B00011111,B00111000, - B00110000,B00011111,B10011000, - B00110100,B00011111,B00011000, - B00101110,B00011110,B00001000, - B00101111,B00011100,B00001000, - B00101111,B10111000,B00001000, - B00111111,B11111100,B00001000, - B00111111,B11111111,B11111000, - B00100000,B01111111,B11111000, - B00100000,B00111011,B11101000, - B00100000,B01110001,B11101000, - B00100000,B11110000,B11101000, - B00110001,B11110000,B01011000, - B00110011,B11110000,B00011000, - B00111001,B11110000,B00111000, - B00111110,B00110000,B11111000, - B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00111111,B11111111,B11110000, - B00111000,B00000000,B01110000, - B00110000,B11111100,B00110000, - B00100000,B11111100,B00010000, - B00100000,B01111000,B00010000, - B00100000,B00110000,B00010000, - B00101100,B00000000,B11010000, - B00101110,B00110001,B11010000, - B00101111,B01111011,B11010000, - B00101111,B01111011,B11010000, - B00101110,B00110001,B11010000, - B00101100,B00000000,B11010000, - B00100000,B00110000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B11111100,B00010000, - B00110000,B11111100,B00110000, - B00111000,B00000000,B01110000, - B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00111111,B11111111,B11110000, - B00111000,B00000000,B01110000, - B00110001,B10000110,B00110000, - B00100011,B10000111,B00010000, - B00100111,B10000111,B10010000, - B00101111,B10000111,B11010000, - B00101111,B00000011,B11010000, - B00100000,B00110000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B01111000,B00010000, - B00100000,B00110000,B00010000, - B00101111,B00000011,B11010000, - B00101111,B10000111,B11010000, - B00100111,B10000111,B10010000, - B00100011,B10000111,B00010000, - B00110001,B10000110,B00110000, - B00111000,B00000000,B01110000, - B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000 - }; - #endif + #define STATUS_BED_WIDTH 18 + #ifndef STATUS_BED_X + #define STATUS_BED_X 80 + #endif - #elif HOTENDS == 1 + #ifdef STATUS_BED_ANIM - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00111000,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00011110,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10111000,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111011,B11101000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01110001,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B11101000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - #endif + const unsigned char status_bed_bmp[] PROGMEM = { + B11111111,B11111111,B11000000, + B11111111,B11111111,B11000000 + }; - #elif HOTENDS == 2 + const unsigned char status_bed_on_bmp[] PROGMEM = { + B00100000,B10000010,B00000000, + B00010000,B01000001,B00000000, + B00010000,B01000001,B00000000, + B00100000,B10000010,B00000000, + B01000001,B00000100,B00000000, + B10000010,B00001000,B00000000, + B10000010,B00001000,B00000000, + B01000001,B00000100,B00000000, + B00100000,B10000010,B00000000, + B00000000,B00000000,B00000000, + B11111111,B11111111,B11000000, + B11111111,B11111111,B11000000 + }; - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - #endif + #else - #elif HOTENDS == 3 + const unsigned char status_bed_bmp[] PROGMEM = { + B00100000,B10000010,B00000000, + B00010000,B01000001,B00000000, + B00010000,B01000001,B00000000, + B00100000,B10000010,B00000000, + B01000001,B00000100,B00000000, + B10000010,B00001000,B00000000, + B10000010,B00001000,B00000000, + B01000001,B00000100,B00000000, + B00100000,B10000010,B00000000, + B00000000,B00000000,B00000000, + B11111111,B11111111,B11000000, + B11111111,B11111111,B11000000 + }; - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - #endif + #endif - #elif HOTENDS > 3 + #endif - #if FAN_ANIM_FRAMES == 3 - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00000000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B00000001,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110111,B10000011,B11011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B11000111,B11101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B11000111,B11001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100001,B11111111,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00100000,B01111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00100000,B01111100,B00001000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00100000,B01111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00100001,B11111111,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00100111,B11000111,B11001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00101111,B11000111,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00110111,B10000011,B11011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00110111,B10000011,B11011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00111001,B00000001,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00111110,B00000000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00110000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111001,B11110000,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11110000,B01101000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110001,B11101000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B00111001,B11101000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00100000,B01111111,B11111000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00111111,B11111100,B00001000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00101111,B00111000,B00001000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00101110,B00011000,B00001000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00101100,B00011110,B00001000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00110000,B00011110,B00011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00110000,B00011111,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00111000,B00011111,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00111110,B00011000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - const unsigned char status_screen2_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111110,B00011000,B11111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00011111,B00111000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00011111,B10011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00011111,B00011000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101110,B00011110,B00001000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00011100,B00001000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00101111,B10111000,B00001000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B11111100,B00001000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111111,B11111111,B11111000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00100000,B01111111,B11111000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00100000,B00111011,B11101000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00100000,B01110001,B11101000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B11110000,B11101000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00110001,B11110000,B01011000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00110011,B11110000,B00011000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00111001,B11110000,B00111000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00111110,B00110000,B11111000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00111111,B11111111,B11111000 - }; - #else - const unsigned char status_screen0_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B11111100,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B11111100,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B01111000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100000,B00110000,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101100,B00000000,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00101110,B00110001,B11010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00101111,B01111011,B11010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00101111,B01111011,B11010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00101110,B00110001,B11010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00101100,B00000000,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00100000,B01111000,B00010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00100000,B11111100,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00110000,B11111100,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - const unsigned char status_screen1_bmp[] PROGMEM = { - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11111111,B11110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,B01110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110001,B10000110,B00110000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100011,B10000111,B00010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00100111,B10000111,B10010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B10000111,B11010000, - B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00101111,B00000011,B11010000, - B00111111,B11000000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00011111,B11100000,B00000000,B00100000,B00110000,B00010000, - B01111101,B11100000,B00000000,B00111100,B11110000,B00000000,B00111100,B11110000,B00000000,B00111011,B01110000,B00000000,B00100000,B01111000,B00010000, - B01111001,B11100000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00111011,B01110000,B00000000,B00100000,B01111000,B00010000, - B01110101,B11100000,B00000000,B00111111,B01110000,B00000000,B00111111,B01110000,B00000000,B00111011,B01110000,B00000000,B00100000,B00110000,B00010000, - B00111101,B11000000,B00000000,B00011110,B11100000,B00000000,B00011100,B11100000,B00000000,B00011011,B01100000,B00000000,B00101111,B00000011,B11010000, - B00111101,B11000000,B00000000,B00011101,B11100000,B00000000,B00011111,B01100000,B00000000,B00011000,B00100000,B00000000,B00101111,B10000111,B11010000, - B01111101,B11100000,B00000000,B00111011,B11110000,B00000000,B00111011,B01110000,B00000000,B00111111,B01110000,B00000000,B00100111,B10000111,B10010000, - B01111101,B11100000,B00000000,B00111000,B01110000,B00000000,B00111100,B11110000,B00000000,B00111111,B01110000,B00000000,B00100011,B10000111,B00010000, - B01111111,B11100000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00111111,B11110000,B00000000,B00110001,B10000110,B00110000, - B00011111,B10000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00001111,B11000000,B00000000,B00111000,B00000000,B01110000, - B00001111,B00000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00000111,B10000000,B00000000,B00111111,B11111111,B11110000, - B00000110,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000 - }; - #endif +#endif // !STATUS_BED_WIDTH && !STATUS_COMBINE_HEATERS && HAS_HEATED_BED && HOTENDS < 4 - #endif // HOTENDS - - #endif // !HAS_HEATED_BED || HOTENDS > 3 - -#endif // !CUSTOM_STATUS_SCREEN_IMAGE - -#ifndef FAN_ANIM_FRAMES - #define FAN_ANIM_FRAMES 2 -#elif FAN_ANIM_FRAMES > 3 +// Can also be overridden in Configuration.h +// If you can afford it, try the 3-frame fan animation! +// Don't compile in the fan animation with no fan +#if !HAS_FAN0 + #undef STATUS_FAN_FRAMES +#elif !defined(STATUS_FAN_FRAMES) + #define STATUS_FAN_FRAMES 2 +#elif STATUS_FAN_FRAMES > 3 #error "Only 3 fan animation frames currently supported." #endif -#ifndef STATUS_SCREEN_X - #define STATUS_SCREEN_X 0 -#endif -#ifndef STATUS_SCREEN_Y - #define STATUS_SCREEN_Y 1 -#endif -#ifndef STATUS_BMP_BYTEWIDTH - #define STATUS_BMP_BYTEWIDTH ((STATUS_SCREENWIDTH + 7) / 8) -#endif -#ifndef STATUS_SCREENHEIGHT - #define STATUS_SCREENHEIGHT (sizeof(status_screen0_bmp) / (STATUS_BMP_BYTEWIDTH)) -#endif -#ifndef STATUS_SCREEN_HOTEND_TEXT_X - #define STATUS_SCREEN_HOTEND_TEXT_X(i) (5 + (i) * 25) -#endif -#ifndef STATUS_SCREEN_BED_TEXT_X - #define STATUS_SCREEN_BED_TEXT_X 81 -#endif -#ifndef STATUS_SCREEN_FAN_TEXT_X - #define STATUS_SCREEN_FAN_TEXT_X 103 -#endif -#ifndef STATUS_SCREEN_FAN_TEXT_Y - #define STATUS_SCREEN_FAN_TEXT_Y (FAN_ANIM_FRAMES > 2 ? 28 : 27) + +// +// Provide default Fan Bitmaps +// +#if !defined(STATUS_FAN_WIDTH) && STATUS_FAN_FRAMES > 0 + + // Provide a fan animation if none exists + + #if STATUS_FAN_FRAMES <= 2 + + #define STATUS_FAN_Y 2 + #define STATUS_FAN_WIDTH 20 + + const unsigned char status_fan0_bmp[] PROGMEM = { + B00111111,B11111111,B11110000, + B00111000,B00000000,B01110000, + B00110000,B11111100,B00110000, + B00100000,B11111100,B00010000, + B00100000,B01111000,B00010000, + B00100000,B00110000,B00010000, + B00101100,B00000000,B11010000, + B00101110,B00110001,B11010000, + B00101111,B01111011,B11010000, + B00101111,B01111011,B11010000, + B00101110,B00110001,B11010000, + B00101100,B00000000,B11010000, + B00100000,B00110000,B00010000, + B00100000,B01111000,B00010000, + B00100000,B11111100,B00010000, + B00110000,B11111100,B00110000, + B00111000,B00000000,B01110000, + B00111111,B11111111,B11110000 + }; + + #if STATUS_FAN_FRAMES == 2 + const unsigned char status_fan1_bmp[] PROGMEM = { + B00111111,B11111111,B11110000, + B00111000,B00000000,B01110000, + B00110001,B10000110,B00110000, + B00100011,B10000111,B00010000, + B00100111,B10000111,B10010000, + B00101111,B10000111,B11010000, + B00101111,B00000011,B11010000, + B00100000,B00110000,B00010000, + B00100000,B01111000,B00010000, + B00100000,B01111000,B00010000, + B00100000,B00110000,B00010000, + B00101111,B00000011,B11010000, + B00101111,B10000111,B11010000, + B00100111,B10000111,B10010000, + B00100011,B10000111,B00010000, + B00110001,B10000110,B00110000, + B00111000,B00000000,B01110000, + B00111111,B11111111,B11110000 + }; + #endif + + #elif STATUS_FAN_FRAMES == 3 + + #define STATUS_FAN_WIDTH 21 + + const unsigned char status_fan0_bmp[] PROGMEM = { + B00111111,B11111111,B11111000, + B00111110,B00000000,B11111000, + B00111001,B00000001,B00111000, + B00110111,B10000011,B11011000, + B00110111,B10000011,B11011000, + B00101111,B11000111,B11101000, + B00100111,B11000111,B11001000, + B00100001,B11111111,B00001000, + B00100000,B01111100,B00001000, + B00100000,B01111100,B00001000, + B00100000,B01111100,B00001000, + B00100001,B11111111,B00001000, + B00100111,B11000111,B11001000, + B00101111,B11000111,B11101000, + B00110111,B10000011,B11011000, + B00110111,B10000011,B11011000, + B00111001,B00000001,B00111000, + B00111110,B00000000,B11111000, + B00111111,B11111111,B11111000 + }; + const unsigned char status_fan1_bmp[] PROGMEM = { + B00111111,B11111111,B11111000, + B00111110,B00110000,B11111000, + B00111001,B11110000,B00111000, + B00110001,B11110000,B00011000, + B00110000,B11110000,B00011000, + B00100000,B11110000,B01101000, + B00100000,B00110001,B11101000, + B00100000,B00111001,B11101000, + B00100000,B01111111,B11111000, + B00111111,B11111111,B11111000, + B00111111,B11111100,B00001000, + B00101111,B00111000,B00001000, + B00101110,B00011000,B00001000, + B00101100,B00011110,B00001000, + B00110000,B00011110,B00011000, + B00110000,B00011111,B00011000, + B00111000,B00011111,B00111000, + B00111110,B00011000,B11111000, + B00111111,B11111111,B11111000 + }; + const unsigned char status_fan2_bmp[] PROGMEM = { + B00111111,B11111111,B11111000, + B00111110,B00011000,B11111000, + B00111000,B00011111,B00111000, + B00110000,B00011111,B10011000, + B00110100,B00011111,B00011000, + B00101110,B00011110,B00001000, + B00101111,B00011100,B00001000, + B00101111,B10111000,B00001000, + B00111111,B11111100,B00001000, + B00111111,B11111111,B11111000, + B00100000,B01111111,B11111000, + B00100000,B00111011,B11101000, + B00100000,B01110001,B11101000, + B00100000,B11110000,B11101000, + B00110001,B11110000,B01011000, + B00110011,B11110000,B00011000, + B00111001,B11110000,B00111000, + B00111110,B00110000,B11111000, + B00111111,B11111111,B11111000 + }; + + #elif STATUS_FAN_FRAMES == 4 + + #define STATUS_FAN_WIDTH 21 + + const unsigned char status_fan0_bmp[] PROGMEM = { + B00111111,B11111111,B11111000, + B00111110,B00000000,B11111000, + B00111000,B00111111,B00111000, + B00110000,B01111110,B00011000, + B00110000,B01111100,B00011000, + B00101000,B01111100,B00001000, + B00101100,B00111000,B00001000, + B00101111,B00111001,B11001000, + B00101111,B11111111,B11101000, + B00101111,B11000111,B11101000, + B00101111,B11111111,B11101000, + B00100111,B00111001,B11101000, + B00100000,B00111000,B01101000, + B00100000,B01111100,B00101000, + B00110000,B01111100,B00011000, + B00110000,B11111100,B00011000, + B00111001,B11111000,B00111000, + B00111110,B00000000,B11111000, + B00111111,B11111111,B11111000 + }; + const unsigned char status_fan1_bmp[] PROGMEM = { + B00111111,B11111111,B11111000, + B00111110,B00000000,B11111000, + B00111000,B00001111,B00111000, + B00110100,B00011111,B11011000, + B00110110,B00011111,B10011000, + B00101111,B00011111,B00001000, + B00101111,B10011110,B00001000, + B00101111,B11111100,B00001000, + B00101111,B11011100,B00001000, + B00100111,B11101111,B11001000, + B00100000,B01110111,B11101000, + B00100000,B01111111,B11101000, + B00100000,B11110011,B11101000, + B00100001,B11110001,B11101000, + B00110011,B11110000,B11011000, + B00110111,B11110000,B01011000, + B00111001,B11100000,B00111000, + B00111110,B00000000,B11111000, + B00111111,B11111111,B11111000 + }; + const unsigned char status_fan2_bmp[] PROGMEM = { + B00111111,B11111111,B11111000, + B00111110,B10000000,B11111000, + B00111001,B10000000,B00111000, + B00110111,B10000001,B11011000, + B00110111,B11000011,B11011000, + B00100111,B11000111,B11101000, + B00100011,B11000111,B11111000, + B00100001,B11111111,B10001000, + B00100000,B01101100,B00001000, + B00100000,B01101100,B00001000, + B00100000,B01101100,B00001000, + B00100011,B11111111,B00001000, + B00111111,B11000111,B10001000, + B00101111,B11000111,B11001000, + B00110111,B10000111,B11011000, + B00110111,B00000011,B11011000, + B00111000,B00000011,B00111000, + B00111110,B00000010,B11111000, + B00111111,B11111111,B11111000 + }; + const unsigned char status_fan3_bmp[] PROGMEM = { + B00111111,B11111111,B11111000, + B00111110,B00000000,B11111000, + B00111001,B11110000,B00111000, + B00110001,B11100000,B00011000, + B00110001,B11100000,B00011000, + B00100001,B11100001,B11101000, + B00100000,B11110011,B11101000, + B00100000,B01111111,B11101000, + B00100000,B01110111,B11101000, + B00101000,B11101110,B00101000, + B00101111,B11011100,B00001000, + B00101111,B11111100,B00001000, + B00101111,B10011110,B00001000, + B00101111,B00001111,B00001000, + B00110000,B00001111,B00011000, + B00110000,B00001111,B00011000, + B00111000,B00011111,B00111000, + B00111110,B00000000,B11111000, + B00111111,B11111111,B11111000 + }; + + #endif + #endif -#define BMP_SIZE (STATUS_BMP_BYTEWIDTH) * (STATUS_SCREENHEIGHT) -static_assert(sizeof(status_screen0_bmp) == BMP_SIZE, "Status header (status_screen0_bmp) dimensions don't match data."); -#if FAN_ANIM_FRAMES > 1 - static_assert(sizeof(status_screen1_bmp) == BMP_SIZE, "Status header (status_screen1_bmp) dimensions don't match data."); - #if FAN_ANIM_FRAMES > 2 - static_assert(sizeof(status_screen2_bmp) == BMP_SIZE, "Status header (status_screen2_bmp) dimensions don't match data."); - #if FAN_ANIM_FRAMES > 3 - static_assert(sizeof(status_screen3_bmp) == BMP_SIZE, "Status header (status_screen3_bmp) dimensions don't match data."); +// +// Custom Logo Bitmap Properties +// +#ifndef STATUS_LOGO_WIDTH + #define STATUS_LOGO_WIDTH 0 +#endif +#ifndef STATUS_LOGO_BYTEWIDTH + #define STATUS_LOGO_BYTEWIDTH BW(STATUS_LOGO_WIDTH) +#endif +#if STATUS_LOGO_WIDTH + #ifndef STATUS_LOGO_X + #define STATUS_LOGO_X 0 + #endif + #ifndef STATUS_LOGO_Y + #define STATUS_LOGO_Y MIN(0, 10 - (STATUS_LOGO_HEIGHT) / 2) + #endif + #ifndef STATUS_LOGO_HEIGHT + #define STATUS_LOGO_HEIGHT (sizeof(status_logo_bmp) / (STATUS_LOGO_BYTEWIDTH)) + #endif + static_assert( + sizeof(status_logo_bmp) == (STATUS_LOGO_BYTEWIDTH) * (STATUS_LOGO_HEIGHT), + "Status logo bitmap (status_logo_bmp) dimensions don't match data." + ); +#endif + +// +// Heater Bitmap Properties +// +#if STATUS_HOTEND1_WIDTH || STATUS_HEATERS_WIDTH + + #ifndef STATUS_HEATERS_XSPACE + #define STATUS_HEATERS_XSPACE 24 // Like the included bitmaps + #endif + + #ifndef STATUS_HEATERS_X + #if STATUS_LOGO_BYTEWIDTH + #define STATUS_HEATERS_X ((STATUS_LOGO_BYTEWIDTH + 0) * 8) + #else + #define STATUS_HEATERS_X 8 // Like the included bitmaps + #endif + #endif + +#endif + +#if STATUS_HOTEND1_WIDTH + + // + // Hotend images. A base hotend image and optional "ON" state image. + // + + #ifndef STATUS_HOTEND_BITMAPS + #define STATUS_HOTEND_BITMAPS 1 + #endif + + #ifndef STATUS_HOTEND2_WIDTH + #define STATUS_HOTEND2_WIDTH STATUS_HOTEND1_WIDTH + #endif + #ifndef STATUS_HOTEND3_WIDTH + #define STATUS_HOTEND3_WIDTH STATUS_HOTEND2_WIDTH + #endif + #ifndef STATUS_HOTEND4_WIDTH + #define STATUS_HOTEND4_WIDTH STATUS_HOTEND3_WIDTH + #endif + #ifndef STATUS_HOTEND5_WIDTH + #define STATUS_HOTEND5_WIDTH STATUS_HOTEND5_WIDTH + #endif + #ifndef STATUS_HOTEND6_WIDTH + #define STATUS_HOTEND6_WIDTH STATUS_HOTEND6_WIDTH + #endif + + constexpr uint8_t status_hotend_width[HOTENDS] = ARRAY_N(HOTENDS, STATUS_HOTEND1_WIDTH, STATUS_HOTEND2_WIDTH, STATUS_HOTEND3_WIDTH, STATUS_HOTEND4_WIDTH, STATUS_HOTEND5_WIDTH, STATUS_HOTEND6_WIDTH); + #define STATUS_HOTEND_WIDTH(N) status_hotend_width[N] + + #ifndef STATUS_HOTEND1_BYTEWIDTH + #define STATUS_HOTEND1_BYTEWIDTH BW(STATUS_HOTEND1_WIDTH) + #endif + #ifndef STATUS_HOTEND2_BYTEWIDTH + #define STATUS_HOTEND2_BYTEWIDTH BW(STATUS_HOTEND2_WIDTH) + #endif + #ifndef STATUS_HOTEND3_BYTEWIDTH + #define STATUS_HOTEND3_BYTEWIDTH BW(STATUS_HOTEND3_WIDTH) + #endif + #ifndef STATUS_HOTEND4_BYTEWIDTH + #define STATUS_HOTEND4_BYTEWIDTH BW(STATUS_HOTEND4_WIDTH) + #endif + #ifndef STATUS_HOTEND5_BYTEWIDTH + #define STATUS_HOTEND5_BYTEWIDTH BW(STATUS_HOTEND5_WIDTH) + #endif + #ifndef STATUS_HOTEND6_BYTEWIDTH + #define STATUS_HOTEND6_BYTEWIDTH BW(STATUS_HOTEND6_WIDTH) + #endif + + constexpr uint8_t status_hotend_bytewidth[HOTENDS] = ARRAY_N(HOTENDS, STATUS_HOTEND1_BYTEWIDTH, STATUS_HOTEND2_BYTEWIDTH, STATUS_HOTEND3_BYTEWIDTH, STATUS_HOTEND4_BYTEWIDTH, STATUS_HOTEND5_BYTEWIDTH, STATUS_HOTEND6_BYTEWIDTH); + #define STATUS_HOTEND_BYTEWIDTH(N) status_hotend_bytewidth[N] + + #ifndef STATUS_HOTEND1_X + #define STATUS_HOTEND1_X STATUS_HEATERS_X + #endif + #ifndef STATUS_HOTEND2_X + #define STATUS_HOTEND2_X STATUS_HOTEND1_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND3_X + #define STATUS_HOTEND3_X STATUS_HOTEND2_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND4_X + #define STATUS_HOTEND4_X STATUS_HOTEND3_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND5_X + #define STATUS_HOTEND5_X STATUS_HOTEND5_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND6_X + #define STATUS_HOTEND6_X STATUS_HOTEND6_X + STATUS_HEATERS_XSPACE + #endif + + #if HOTENDS > 2 + constexpr uint8_t status_hotend_x[HOTENDS] = ARRAY_N(HOTENDS, STATUS_HOTEND1_X, STATUS_HOTEND2_X, STATUS_HOTEND3_X, STATUS_HOTEND4_X, STATUS_HOTEND5_X, STATUS_HOTEND6_X); + #define STATUS_HOTEND_X(N) status_hotend_x[N] + #elif HOTENDS > 1 + #define STATUS_HOTEND_X(N) ((N) ? STATUS_HOTEND2_X : STATUS_HOTEND1_X) + #else + #define STATUS_HOTEND_X(N) STATUS_HOTEND1_X + #endif + + #ifndef STATUS_HOTEND_TEXT_X + #ifdef STATUS_HOTEND1_TEXT_X + #ifndef STATUS_HOTEND2_TEXT_X + #define STATUS_HOTEND2_TEXT_X STATUS_HOTEND1_TEXT_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND3_TEXT_X + #define STATUS_HOTEND3_TEXT_X STATUS_HOTEND2_TEXT_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND4_TEXT_X + #define STATUS_HOTEND4_TEXT_X STATUS_HOTEND3_TEXT_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND5_TEXT_X + #define STATUS_HOTEND5_TEXT_X STATUS_HOTEND5_TEXT_X + STATUS_HEATERS_XSPACE + #endif + #ifndef STATUS_HOTEND6_TEXT_X + #define STATUS_HOTEND6_TEXT_X STATUS_HOTEND6_TEXT_X + STATUS_HEATERS_XSPACE + #endif + constexpr uint8_t status_hotend_text_x[] = ARRAY_N(HOTENDS, STATUS_HOTEND1_TEXT_X, STATUS_HOTEND2_TEXT_X, STATUS_HOTEND3_TEXT_X, STATUS_HOTEND4_TEXT_X, STATUS_HOTEND5_TEXT_X, STATUS_HOTEND6_TEXT_X); + #define STATUS_HOTEND_TEXT_X(N) status_hotend_text_x[N] + #else + #define STATUS_HOTEND_TEXT_X(N) (STATUS_HOTEND1_X + 6 + (N) * (STATUS_HEATERS_XSPACE)) + #endif + #endif + + #if STATUS_HOTEND_BITMAPS > 1 + #define TEST_BITMAP_OFF status_hotend1_a_bmp + #define TEST_BITMAP_ON status_hotend1_b_bmp + #else + #define TEST_BITMAP_OFF status_hotend_a_bmp + #define TEST_BITMAP_ON status_hotend_b_bmp + #endif + #ifndef STATUS_HEATERS_HEIGHT + #define STATUS_HEATERS_HEIGHT (sizeof(TEST_BITMAP_OFF) / (STATUS_HOTEND1_BYTEWIDTH)) + #endif + #ifndef STATUS_HEATERS_Y + #define STATUS_HEATERS_Y (20 - (STATUS_HEATERS_HEIGHT)) + #endif + + #define HOTEND0_BITMAP_SIZE (STATUS_HOTEND1_BYTEWIDTH) * (STATUS_HEATERS_HEIGHT) + static_assert( + sizeof(TEST_BITMAP_OFF) == HOTEND0_BITMAP_SIZE, + "Status hotend bitmap (" STRINGIFY(TEST_BITMAP_OFF) ") dimensions don't match data." + ); + #ifdef STATUS_HOTEND_ANIM + static_assert( + sizeof(TEST_BITMAP_ON) == HOTEND0_BITMAP_SIZE, + "Status hotend bitmaps (" STRINGIFY(TEST_BITMAP_OFF) " and " STRINGIFY(TEST_BITMAP_ON) ") dimensions don't match." + ); + #endif + +#elif STATUS_HEATERS_WIDTH + + #ifndef STATUS_HEATERS_XSPACE + #define STATUS_HEATERS_XSPACE 24 + #endif + #ifndef STATUS_HOTEND_WIDTH + #define STATUS_HOTEND_WIDTH(N) 10 + #endif + #ifndef STATUS_HOTEND_X + #define STATUS_HOTEND_X(N) (STATUS_HEATERS_X + 2 + (N) * (STATUS_HEATERS_XSPACE)) + #endif + #ifndef STATUS_HOTEND_TEXT_X + #define STATUS_HOTEND_TEXT_X(N) (STATUS_HEATERS_X + 6 + (N) * (STATUS_HEATERS_XSPACE)) + #endif + #ifndef STATUS_HEATERS_BYTEWIDTH + #define STATUS_HEATERS_BYTEWIDTH BW(STATUS_HEATERS_WIDTH) + #endif + #ifndef STATUS_HEATERS_HEIGHT + #define STATUS_HEATERS_HEIGHT (sizeof(status_heaters_bmp) / (STATUS_HEATERS_BYTEWIDTH)) + #endif + #ifndef STATUS_HEATERS_Y + #define STATUS_HEATERS_Y (20 - (STATUS_HEATERS_HEIGHT)) + #endif + + static_assert( + sizeof(status_heaters_bmp) == (STATUS_HEATERS_BYTEWIDTH) * (STATUS_HEATERS_HEIGHT), + "Status heaters bitmap (status_heaters_bmp) dimensions don't match data." + ); + +#endif + +// +// Bed Bitmap Properties +// +#ifndef STATUS_BED_WIDTH + #define STATUS_BED_WIDTH 0 +#endif +#ifndef STATUS_BED_BYTEWIDTH + #define STATUS_BED_BYTEWIDTH BW(STATUS_BED_WIDTH) +#endif +#if STATUS_BED_WIDTH && !STATUS_HEATERS_WIDTH + + #ifndef STATUS_BED_X + #define STATUS_BED_X (128 - (STATUS_FAN_BYTEWIDTH + STATUS_BED_BYTEWIDTH) * 8) + #endif + + #ifndef STATUS_BED_HEIGHT + #ifdef STATUS_BED_ANIM + #define STATUS_BED_HEIGHT(S) ((S) ? sizeof(status_bed_on_bmp) / (STATUS_BED_BYTEWIDTH) : sizeof(status_bed_bmp) / (STATUS_BED_BYTEWIDTH)) + #else + #define STATUS_BED_HEIGHT(S) (sizeof(status_bed_bmp) / (STATUS_BED_BYTEWIDTH)) + #endif + #endif + + #ifndef STATUS_BED_Y + #define STATUS_BED_Y(S) (20 - STATUS_BED_HEIGHT(S)) + #endif + + #ifndef STATUS_BED_TEXT_X + #define STATUS_BED_TEXT_X (STATUS_BED_X + 8) + #endif + + static_assert( + sizeof(status_bed_bmp) == (STATUS_BED_BYTEWIDTH) * (STATUS_BED_HEIGHT(0)), + "Status bed bitmap (status_bed_bmp) dimensions don't match data." + ); + #ifdef STATUS_BED_ANIM + static_assert( + sizeof(status_bed_on_bmp) == (STATUS_BED_BYTEWIDTH) * (STATUS_BED_HEIGHT(1)), + "Status bed bitmap (status_bed_on_bmp) dimensions don't match data." + ); + #endif + +#endif + +// +// Fan Bitmap Properties +// +#ifndef STATUS_FAN_WIDTH + #define STATUS_FAN_WIDTH 0 +#endif +#ifndef STATUS_FAN_BYTEWIDTH + #define STATUS_FAN_BYTEWIDTH BW(STATUS_FAN_WIDTH) +#endif +#if STATUS_FAN_FRAMES + #ifndef STATUS_FAN_X + #define STATUS_FAN_X (128 - (STATUS_FAN_BYTEWIDTH) * 8) + #endif + #ifndef STATUS_FAN_Y + #define STATUS_FAN_Y 1 + #endif + #ifndef STATUS_FAN_TEXT_X + #define STATUS_FAN_TEXT_X 103 + #endif + #ifndef STATUS_FAN_TEXT_Y + #define STATUS_FAN_TEXT_Y 28 + #endif + #ifndef STATUS_FAN_HEIGHT + #define STATUS_FAN_HEIGHT (sizeof(status_fan0_bmp) / (STATUS_FAN_BYTEWIDTH)) + #endif + #define FAN_BMP_SIZE (STATUS_FAN_BYTEWIDTH) * (STATUS_FAN_HEIGHT) + static_assert(sizeof(status_fan0_bmp) == FAN_BMP_SIZE, "Status fan bitmap (status_fan0_bmp) dimensions don't match data."); + #if STATUS_FAN_FRAMES > 1 + static_assert(sizeof(status_fan1_bmp) == FAN_BMP_SIZE, "Status fan bitmap (status_fan1_bmp) dimensions don't match data."); + #if STATUS_FAN_FRAMES > 2 + static_assert(sizeof(status_fan2_bmp) == FAN_BMP_SIZE, "Status fan bitmap (status_fan2_bmp) dimensions don't match data."); + #if STATUS_FAN_FRAMES > 3 + static_assert(sizeof(status_fan3_bmp) == FAN_BMP_SIZE, "Status fan bitmap (status_fan3_bmp) dimensions don't match data."); + #endif #endif #endif #endif diff --git a/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h b/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h index 26e93f3a36..d8c1860924 100644 --- a/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h +++ b/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h @@ -1,9 +1,6 @@ /** * Marlin 3D Printer Firmware - * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * Copyright (C) 2018 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,92 +32,90 @@ X Font ascent = 8 descent=-2 Max Font ascent = 8 descent=-2 */ - -const u8g_fntpgm_uint8_t ISO10646_1_5x7[1328] U8G_FONT_SECTION("ISO10646_1_5x7") = { - 0x00,0x06,0x0c,0x00,0xfe,0x07,0x02,0x29,0x03,0xbf,0x01,0x7f,0xfe,0x08,0xfe,0x08, +const u8g_fntpgm_uint8_t ISO10646_1_5x7[1325] U8G_FONT_SECTION("ISO10646_1_5x7") = { + 0x00,0x06,0x0c,0x00,0xfe,0x07,0x02,0x26,0x03,0xbc,0x01,0x7f,0xfe,0x08,0xfe,0x08, 0xfe,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0xf0,0xc8,0x88,0x88,0x98,0x78,0x10,0x05, 0x08,0x08,0x06,0x00,0x00,0xc0,0xf8,0x88,0x88,0x88,0x88,0x88,0xf8,0x05,0x05,0x05, 0x06,0x00,0x01,0x20,0x30,0xf8,0x30,0x20,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x70, 0xf8,0x20,0x20,0x20,0x20,0xe0,0x05,0x09,0x09,0x06,0x00,0xff,0x20,0x70,0xa8,0xa8, - 0xb8,0x88,0x88,0x70,0x20,0x05,0x09,0x09,0x06,0x00,0xff,0xe0,0x80,0xc0,0xb0,0xa8, - 0x28,0x30,0x28,0x28,0x05,0x09,0x09,0x06,0x00,0xff,0xf8,0xa8,0x88,0x88,0x88,0x88, - 0x88,0xa8,0xf8,0x05,0x0a,0x0a,0x06,0x00,0xfe,0x20,0x50,0x50,0x50,0x50,0x88,0xa8, - 0xa8,0x88,0x70,0x03,0x03,0x03,0x06,0x00,0x03,0x40,0xa0,0x40,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0x00,0x00,0x00,0x06,0x05,0xff,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x80, - 0x80,0x80,0x80,0x00,0x80,0x03,0x03,0x03,0x06,0x01,0x05,0xa0,0xa0,0xa0,0x05,0x06, - 0x06,0x06,0x00,0x00,0x50,0xf8,0x50,0x50,0xf8,0x50,0x05,0x09,0x09,0x06,0x00,0xff, - 0x20,0x70,0xa8,0xa0,0x70,0x28,0xa8,0x70,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0xc8, - 0xc8,0x10,0x20,0x40,0x98,0x98,0x05,0x07,0x07,0x06,0x00,0x00,0x40,0xa0,0xa0,0x40, - 0xa8,0x90,0x68,0x01,0x03,0x03,0x06,0x02,0x05,0x80,0x80,0x80,0x03,0x09,0x09,0x06, - 0x01,0xff,0x20,0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20,0x03,0x09,0x09,0x06,0x01, - 0xff,0x80,0x40,0x40,0x20,0x20,0x20,0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00, - 0x20,0xa8,0x70,0x20,0x70,0xa8,0x20,0x05,0x05,0x05,0x06,0x00,0x01,0x20,0x20,0xf8, - 0x20,0x20,0x02,0x03,0x03,0x06,0x01,0xff,0xc0,0x40,0x80,0x05,0x01,0x01,0x06,0x00, - 0x03,0xf8,0x02,0x02,0x02,0x06,0x01,0x00,0xc0,0xc0,0x05,0x07,0x07,0x06,0x00,0x00, - 0x08,0x10,0x10,0x20,0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x98, - 0xa8,0xc8,0x88,0x70,0x03,0x07,0x07,0x06,0x01,0x00,0x40,0xc0,0x40,0x40,0x40,0x40, - 0xe0,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x08,0x10,0x20,0x40,0xf8,0x05,0x07, - 0x07,0x06,0x00,0x00,0xf8,0x08,0x10,0x30,0x08,0x88,0x70,0x05,0x07,0x07,0x06,0x00, - 0x00,0x10,0x30,0x50,0x90,0xf8,0x10,0x10,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80, - 0xf0,0x08,0x08,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x40,0x80,0xf0,0x88, - 0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x08,0x10,0x10,0x20,0x20,0x20,0x05, - 0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x70,0x88,0x88,0x70,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0x88,0x78,0x08,0x10,0x60,0x02,0x05,0x05,0x06,0x01,0x00,0xc0, - 0xc0,0x00,0xc0,0xc0,0x02,0x06,0x06,0x06,0x01,0xff,0xc0,0xc0,0x00,0xc0,0x40,0x80, - 0x03,0x05,0x05,0x06,0x01,0x01,0x20,0x40,0x80,0x40,0x20,0x05,0x03,0x03,0x06,0x00, - 0x02,0xf8,0x00,0xf8,0x03,0x05,0x05,0x06,0x01,0x01,0x80,0x40,0x20,0x40,0x80,0x05, - 0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x10,0x20,0x20,0x00,0x20,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0xb8,0xa8,0xb8,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x70, - 0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x48,0x48,0x70, - 0x48,0x48,0xf0,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70, - 0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x48,0x48,0x48,0x48,0x48,0xf0,0x05,0x07,0x07, - 0x06,0x00,0x00,0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00, - 0xf8,0x80,0x80,0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80, - 0x80,0x98,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xf8,0x88,0x88, - 0x88,0x03,0x07,0x07,0x06,0x01,0x00,0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x05,0x07, - 0x07,0x06,0x00,0x00,0x38,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07,0x06,0x00, - 0x00,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80, - 0x80,0x80,0x80,0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xd8,0xa8,0x88,0x88, - 0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0xc8,0xa8,0x98,0x88,0x88,0x05, - 0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06, - 0x00,0x00,0xf0,0x88,0x88,0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70, - 0x88,0x88,0x88,0xa8,0x90,0x68,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x88,0x88,0xf0, - 0xa0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x70, - 0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x05,0x07,0x07, - 0x06,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00, - 0x88,0x88,0x88,0x88,0x50,0x50,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88, - 0x88,0xa8,0xa8,0x50,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x50,0x88, - 0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x05,0x07, - 0x07,0x06,0x00,0x00,0xf8,0x08,0x10,0x20,0x40,0x80,0xf8,0x03,0x09,0x09,0x06,0x01, - 0xff,0xe0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xe0,0x05,0x07,0x07,0x06,0x00,0x00, - 0x80,0x40,0x40,0x20,0x10,0x10,0x08,0x03,0x09,0x09,0x06,0x01,0xff,0xe0,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0xe0,0x05,0x03,0x03,0x06,0x00,0x05,0x20,0x50,0x88,0x05, - 0x01,0x01,0x06,0x00,0xfe,0xf8,0x03,0x03,0x03,0x06,0x01,0x05,0x80,0x40,0x20,0x05, - 0x05,0x05,0x06,0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00,0x00, - 0x80,0x80,0xf0,0x88,0x88,0x88,0xf0,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x80,0x80, - 0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x08,0x08,0x78,0x88,0x88,0x88,0x78,0x05, - 0x05,0x05,0x06,0x00,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00, - 0x30,0x48,0x40,0xe0,0x40,0x40,0x40,0x05,0x07,0x07,0x06,0x00,0xfe,0x70,0x88,0x88, - 0x88,0x78,0x08,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0xf0,0x88,0x88,0x88, - 0x88,0x03,0x07,0x07,0x06,0x01,0x00,0x40,0x00,0xc0,0x40,0x40,0x40,0xe0,0x04,0x09, - 0x09,0x06,0x01,0xfe,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07, - 0x06,0x00,0x00,0x80,0x80,0x88,0x90,0xe0,0x90,0x88,0x03,0x07,0x07,0x06,0x01,0x00, - 0xc0,0x40,0x40,0x40,0x40,0x40,0xe0,0x05,0x05,0x05,0x06,0x00,0x00,0xd0,0xa8,0xa8, - 0xa8,0xa8,0x05,0x05,0x05,0x06,0x00,0x00,0xb0,0xc8,0x88,0x88,0x88,0x05,0x05,0x05, - 0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0xfe,0xf0,0x88, - 0x88,0x88,0xf0,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0xfe,0x78,0x88,0x88,0x88,0x78, - 0x08,0x08,0x05,0x05,0x05,0x06,0x00,0x00,0xb0,0xc8,0x80,0x80,0x80,0x05,0x05,0x05, - 0x06,0x00,0x00,0x78,0x80,0x70,0x08,0xf0,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20, - 0xf8,0x20,0x20,0x20,0x18,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0x88,0x98,0x68, - 0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0x88,0x50,0x20,0x05,0x05,0x05,0x06,0x00, - 0x00,0x88,0x88,0xa8,0xa8,0x50,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x50,0x20,0x50, - 0x88,0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x88,0x50,0x20,0x40,0x80,0x05,0x05, - 0x05,0x06,0x00,0x00,0xf8,0x10,0x20,0x40,0xf8,0x03,0x09,0x09,0x06,0x01,0xff,0x20, - 0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x20,0x01,0x09,0x09,0x06,0x02,0xff,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x03,0x09,0x09,0x06,0x01,0xff,0x80,0x40,0x40, - 0x40,0x20,0x40,0x40,0x40,0x80,0x05,0x03,0x03,0x06,0x00,0x02,0x48,0xa8,0x90,0xff - }; + 0xb8,0x88,0x88,0x70,0x20,0x05,0x06,0x06,0x06,0x00,0x01,0xe0,0x8c,0xea,0x8c,0x8a, + 0x0a,0x05,0x09,0x09,0x06,0x00,0xff,0xf8,0xa8,0x88,0x88,0x88,0x88,0x88,0xa8,0xf8, + 0x05,0x0a,0x0a,0x06,0x00,0xfe,0x20,0x50,0x50,0x50,0x50,0x88,0xa8,0xa8,0x88,0x70, + 0x03,0x03,0x03,0x06,0x00,0x03,0x40,0xa0,0x40,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00, + 0x00,0x00,0x06,0x05,0xff,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x80,0x80,0x80,0x80, + 0x00,0x80,0x03,0x03,0x03,0x06,0x01,0x05,0xa0,0xa0,0xa0,0x05,0x06,0x06,0x06,0x00, + 0x00,0x50,0xf8,0x50,0x50,0xf8,0x50,0x05,0x09,0x09,0x06,0x00,0xff,0x20,0x70,0xa8, + 0xa0,0x70,0x28,0xa8,0x70,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0xc8,0xc8,0x10,0x20, + 0x40,0x98,0x98,0x05,0x07,0x07,0x06,0x00,0x00,0x40,0xa0,0xa0,0x40,0xa8,0x90,0x68, + 0x01,0x03,0x03,0x06,0x02,0x05,0x80,0x80,0x80,0x03,0x09,0x09,0x06,0x01,0xff,0x20, + 0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20,0x03,0x09,0x09,0x06,0x01,0xff,0x80,0x40, + 0x40,0x20,0x20,0x20,0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0xa8,0x70, + 0x20,0x70,0xa8,0x20,0x05,0x05,0x05,0x06,0x00,0x01,0x20,0x20,0xf8,0x20,0x20,0x02, + 0x03,0x03,0x06,0x01,0xff,0xc0,0x40,0x80,0x05,0x01,0x01,0x06,0x00,0x03,0xf8,0x02, + 0x02,0x02,0x06,0x01,0x00,0xc0,0xc0,0x05,0x07,0x07,0x06,0x00,0x00,0x08,0x10,0x10, + 0x20,0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x98,0xa8,0xc8,0x88, + 0x70,0x03,0x07,0x07,0x06,0x01,0x00,0x40,0xc0,0x40,0x40,0x40,0x40,0xe0,0x05,0x07, + 0x07,0x06,0x00,0x00,0x70,0x88,0x08,0x10,0x20,0x40,0xf8,0x05,0x07,0x07,0x06,0x00, + 0x00,0xf8,0x08,0x10,0x30,0x08,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x10,0x30, + 0x50,0x90,0xf8,0x10,0x10,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80,0xf0,0x08,0x08, + 0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x40,0x80,0xf0,0x88,0x88,0x70,0x05, + 0x07,0x07,0x06,0x00,0x00,0xf8,0x08,0x10,0x10,0x20,0x20,0x20,0x05,0x07,0x07,0x06, + 0x00,0x00,0x70,0x88,0x88,0x70,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x70, + 0x88,0x88,0x78,0x08,0x10,0x60,0x02,0x05,0x05,0x06,0x01,0x00,0xc0,0xc0,0x00,0xc0, + 0xc0,0x02,0x06,0x06,0x06,0x01,0xff,0xc0,0xc0,0x00,0xc0,0x40,0x80,0x03,0x05,0x05, + 0x06,0x01,0x01,0x20,0x40,0x80,0x40,0x20,0x05,0x03,0x03,0x06,0x00,0x02,0xf8,0x00, + 0xf8,0x03,0x05,0x05,0x06,0x01,0x01,0x80,0x40,0x20,0x40,0x80,0x05,0x07,0x07,0x06, + 0x00,0x00,0x70,0x88,0x10,0x20,0x20,0x00,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x70, + 0x88,0xb8,0xa8,0xb8,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xf8, + 0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x48,0x48,0x70,0x48,0x48,0xf0, + 0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x05,0x07,0x07, + 0x06,0x00,0x00,0xf0,0x48,0x48,0x48,0x48,0x48,0xf0,0x05,0x07,0x07,0x06,0x00,0x00, + 0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80,0x80, + 0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x98,0x88, + 0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xf8,0x88,0x88,0x88,0x03,0x07, + 0x07,0x06,0x01,0x00,0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x05,0x07,0x07,0x06,0x00, + 0x00,0x38,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90, + 0xa0,0xc0,0xa0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0x80,0x80,0x80, + 0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xd8,0xa8,0x88,0x88,0x88,0x88,0x05, + 0x07,0x07,0x06,0x00,0x00,0x88,0x88,0xc8,0xa8,0x98,0x88,0x88,0x05,0x07,0x07,0x06, + 0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xf0, + 0x88,0x88,0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88, + 0xa8,0x90,0x68,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x88,0x88,0xf0,0xa0,0x90,0x88, + 0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x05,0x07,0x07, + 0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00, + 0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88, + 0x88,0x50,0x50,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0x88,0xa8,0xa8, + 0x50,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x50,0x88,0x88,0x05,0x07, + 0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00, + 0x00,0xf8,0x08,0x10,0x20,0x40,0x80,0xf8,0x03,0x09,0x09,0x06,0x01,0xff,0xe0,0x80, + 0x80,0x80,0x80,0x80,0x80,0x80,0xe0,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x40,0x40, + 0x20,0x10,0x10,0x08,0x03,0x09,0x09,0x06,0x01,0xff,0xe0,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0xe0,0x05,0x03,0x03,0x06,0x00,0x05,0x20,0x50,0x88,0x05,0x01,0x01,0x06, + 0x00,0xfe,0xf8,0x03,0x03,0x03,0x06,0x01,0x05,0x80,0x40,0x20,0x05,0x05,0x05,0x06, + 0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0xf0, + 0x88,0x88,0x88,0xf0,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x80,0x80,0x88,0x70,0x05, + 0x07,0x07,0x06,0x00,0x00,0x08,0x08,0x78,0x88,0x88,0x88,0x78,0x05,0x05,0x05,0x06, + 0x00,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x48,0x40, + 0xe0,0x40,0x40,0x40,0x05,0x07,0x07,0x06,0x00,0xfe,0x70,0x88,0x88,0x88,0x78,0x08, + 0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0xf0,0x88,0x88,0x88,0x88,0x03,0x07, + 0x07,0x06,0x01,0x00,0x40,0x00,0xc0,0x40,0x40,0x40,0xe0,0x04,0x09,0x09,0x06,0x01, + 0xfe,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00, + 0x80,0x80,0x88,0x90,0xe0,0x90,0x88,0x03,0x07,0x07,0x06,0x01,0x00,0xc0,0x40,0x40, + 0x40,0x40,0x40,0xe0,0x05,0x05,0x05,0x06,0x00,0x00,0xd0,0xa8,0xa8,0xa8,0xa8,0x05, + 0x05,0x05,0x06,0x00,0x00,0xb0,0xc8,0x88,0x88,0x88,0x05,0x05,0x05,0x06,0x00,0x00, + 0x70,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0xfe,0xf0,0x88,0x88,0x88,0xf0, + 0x80,0x80,0x05,0x07,0x07,0x06,0x00,0xfe,0x78,0x88,0x88,0x88,0x78,0x08,0x08,0x05, + 0x05,0x05,0x06,0x00,0x00,0xb0,0xc8,0x80,0x80,0x80,0x05,0x05,0x05,0x06,0x00,0x00, + 0x78,0x80,0x70,0x08,0xf0,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0xf8,0x20,0x20, + 0x20,0x18,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0x88,0x98,0x68,0x05,0x05,0x05, + 0x06,0x00,0x00,0x88,0x88,0x88,0x50,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88, + 0xa8,0xa8,0x50,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x05,0x07, + 0x07,0x06,0x00,0xfe,0x88,0x88,0x88,0x50,0x20,0x40,0x80,0x05,0x05,0x05,0x06,0x00, + 0x00,0xf8,0x10,0x20,0x40,0xf8,0x03,0x09,0x09,0x06,0x01,0xff,0x20,0x40,0x40,0x40, + 0x80,0x40,0x40,0x40,0x20,0x01,0x09,0x09,0x06,0x02,0xff,0x80,0x80,0x80,0x80,0x80, + 0x80,0x80,0x80,0x80,0x03,0x09,0x09,0x06,0x01,0xff,0x80,0x40,0x40,0x40,0x20,0x40, + 0x40,0x40,0x80,0x05,0x03,0x03,0x06,0x00,0x02,0x48,0xa8,0x90,0xff}; #else // extended (original) font (symbols 1 - 255) @@ -135,172 +130,172 @@ const u8g_fntpgm_uint8_t ISO10646_1_5x7[1328] U8G_FONT_SECTION("ISO10646_1_5x7") X Font ascent = 8 descent=-2 Max Font ascent =10 descent=-2 */ -const u8g_fntpgm_uint8_t ISO10646_1_5x7[2651] U8G_FONT_SECTION("ISO10646_1_5x7") = { - 0x00,0x06,0x0c,0x00,0xfe,0x07,0x02,0x29,0x03,0xbf,0x01,0xff,0xfe,0x0a,0xfe,0x08, +const u8g_fntpgm_uint8_t ISO10646_1_5x7[2648] U8G_FONT_SECTION("ISO10646_1_5x7") = { + 0x00,0x06,0x0c,0x00,0xfe,0x07,0x02,0x26,0x03,0xbc,0x01,0xff,0xfe,0x0a,0xfe,0x08, 0xfe,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0xf0,0xc8,0x88,0x88,0x98,0x78,0x10,0x05, 0x08,0x08,0x06,0x00,0x00,0xc0,0xf8,0x88,0x88,0x88,0x88,0x88,0xf8,0x05,0x05,0x05, 0x06,0x00,0x01,0x20,0x30,0xf8,0x30,0x20,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x70, 0xf8,0x20,0x20,0x20,0x20,0xe0,0x05,0x09,0x09,0x06,0x00,0xff,0x20,0x70,0xa8,0xa8, - 0xb8,0x88,0x88,0x70,0x20,0x05,0x09,0x09,0x06,0x00,0xff,0xe0,0x80,0xc0,0xb0,0xa8, - 0x28,0x30,0x28,0x28,0x05,0x09,0x09,0x06,0x00,0xff,0xf8,0xa8,0x88,0x88,0x88,0x88, - 0x88,0xa8,0xf8,0x05,0x0a,0x0a,0x06,0x00,0xfe,0x20,0x50,0x50,0x50,0x50,0x88,0xa8, - 0xa8,0x88,0x70,0x03,0x03,0x03,0x06,0x00,0x03,0x40,0xa0,0x40,0xff,0xff,0xff,0xff, + 0xb8,0x88,0x88,0x70,0x20,0x05,0x06,0x06,0x06,0x00,0x01,0xe0,0x8c,0xea,0x8c,0x8a, + 0x0a,0x05,0x09,0x09,0x06,0x00,0xff,0xf8,0xa8,0x88,0x88,0x88,0x88,0x88,0xa8,0xf8, + 0x05,0x0a,0x0a,0x06,0x00,0xfe,0x20,0x50,0x50,0x50,0x50,0x88,0xa8,0xa8,0x88,0x70, + 0x03,0x03,0x03,0x06,0x00,0x03,0x40,0xa0,0x40,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00, + 0x00,0x00,0x06,0x05,0xff,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x80,0x80,0x80,0x80, + 0x00,0x80,0x03,0x03,0x03,0x06,0x01,0x05,0xa0,0xa0,0xa0,0x05,0x06,0x06,0x06,0x00, + 0x00,0x50,0xf8,0x50,0x50,0xf8,0x50,0x05,0x09,0x09,0x06,0x00,0xff,0x20,0x70,0xa8, + 0xa0,0x70,0x28,0xa8,0x70,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0xc8,0xc8,0x10,0x20, + 0x40,0x98,0x98,0x05,0x07,0x07,0x06,0x00,0x00,0x40,0xa0,0xa0,0x40,0xa8,0x90,0x68, + 0x01,0x03,0x03,0x06,0x02,0x05,0x80,0x80,0x80,0x03,0x09,0x09,0x06,0x01,0xff,0x20, + 0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20,0x03,0x09,0x09,0x06,0x01,0xff,0x80,0x40, + 0x40,0x20,0x20,0x20,0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0xa8,0x70, + 0x20,0x70,0xa8,0x20,0x05,0x05,0x05,0x06,0x00,0x01,0x20,0x20,0xf8,0x20,0x20,0x02, + 0x03,0x03,0x06,0x01,0xff,0xc0,0x40,0x80,0x05,0x01,0x01,0x06,0x00,0x03,0xf8,0x02, + 0x02,0x02,0x06,0x01,0x00,0xc0,0xc0,0x05,0x07,0x07,0x06,0x00,0x00,0x08,0x10,0x10, + 0x20,0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x98,0xa8,0xc8,0x88, + 0x70,0x03,0x07,0x07,0x06,0x01,0x00,0x40,0xc0,0x40,0x40,0x40,0x40,0xe0,0x05,0x07, + 0x07,0x06,0x00,0x00,0x70,0x88,0x08,0x10,0x20,0x40,0xf8,0x05,0x07,0x07,0x06,0x00, + 0x00,0xf8,0x08,0x10,0x30,0x08,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x10,0x30, + 0x50,0x90,0xf8,0x10,0x10,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80,0xf0,0x08,0x08, + 0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x40,0x80,0xf0,0x88,0x88,0x70,0x05, + 0x07,0x07,0x06,0x00,0x00,0xf8,0x08,0x10,0x10,0x20,0x20,0x20,0x05,0x07,0x07,0x06, + 0x00,0x00,0x70,0x88,0x88,0x70,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x70, + 0x88,0x88,0x78,0x08,0x10,0x60,0x02,0x05,0x05,0x06,0x01,0x00,0xc0,0xc0,0x00,0xc0, + 0xc0,0x02,0x06,0x06,0x06,0x01,0xff,0xc0,0xc0,0x00,0xc0,0x40,0x80,0x03,0x05,0x05, + 0x06,0x01,0x01,0x20,0x40,0x80,0x40,0x20,0x05,0x03,0x03,0x06,0x00,0x02,0xf8,0x00, + 0xf8,0x03,0x05,0x05,0x06,0x01,0x01,0x80,0x40,0x20,0x40,0x80,0x05,0x07,0x07,0x06, + 0x00,0x00,0x70,0x88,0x10,0x20,0x20,0x00,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x70, + 0x88,0xb8,0xa8,0xb8,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0xf8, + 0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x48,0x48,0x70,0x48,0x48,0xf0, + 0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x05,0x07,0x07, + 0x06,0x00,0x00,0xf0,0x48,0x48,0x48,0x48,0x48,0xf0,0x05,0x07,0x07,0x06,0x00,0x00, + 0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80,0x80, + 0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x98,0x88, + 0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xf8,0x88,0x88,0x88,0x03,0x07, + 0x07,0x06,0x01,0x00,0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x05,0x07,0x07,0x06,0x00, + 0x00,0x38,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x90, + 0xa0,0xc0,0xa0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0x80,0x80,0x80, + 0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xd8,0xa8,0x88,0x88,0x88,0x88,0x05, + 0x07,0x07,0x06,0x00,0x00,0x88,0x88,0xc8,0xa8,0x98,0x88,0x88,0x05,0x07,0x07,0x06, + 0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xf0, + 0x88,0x88,0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88, + 0xa8,0x90,0x68,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x88,0x88,0xf0,0xa0,0x90,0x88, + 0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x05,0x07,0x07, + 0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00, + 0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88, + 0x88,0x50,0x50,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0x88,0xa8,0xa8, + 0x50,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x50,0x88,0x88,0x05,0x07, + 0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00, + 0x00,0xf8,0x08,0x10,0x20,0x40,0x80,0xf8,0x03,0x09,0x09,0x06,0x01,0xff,0xe0,0x80, + 0x80,0x80,0x80,0x80,0x80,0x80,0xe0,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x40,0x40, + 0x20,0x10,0x10,0x08,0x03,0x09,0x09,0x06,0x01,0xff,0xe0,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0xe0,0x05,0x03,0x03,0x06,0x00,0x05,0x20,0x50,0x88,0x05,0x01,0x01,0x06, + 0x00,0xfe,0xf8,0x03,0x03,0x03,0x06,0x01,0x05,0x80,0x40,0x20,0x05,0x05,0x05,0x06, + 0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0xf0, + 0x88,0x88,0x88,0xf0,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x80,0x80,0x88,0x70,0x05, + 0x07,0x07,0x06,0x00,0x00,0x08,0x08,0x78,0x88,0x88,0x88,0x78,0x05,0x05,0x05,0x06, + 0x00,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x48,0x40, + 0xe0,0x40,0x40,0x40,0x05,0x07,0x07,0x06,0x00,0xfe,0x70,0x88,0x88,0x88,0x78,0x08, + 0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0xf0,0x88,0x88,0x88,0x88,0x03,0x07, + 0x07,0x06,0x01,0x00,0x40,0x00,0xc0,0x40,0x40,0x40,0xe0,0x04,0x09,0x09,0x06,0x01, + 0xfe,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00, + 0x80,0x80,0x88,0x90,0xe0,0x90,0x88,0x03,0x07,0x07,0x06,0x01,0x00,0xc0,0x40,0x40, + 0x40,0x40,0x40,0xe0,0x05,0x05,0x05,0x06,0x00,0x00,0xd0,0xa8,0xa8,0xa8,0xa8,0x05, + 0x05,0x05,0x06,0x00,0x00,0xb0,0xc8,0x88,0x88,0x88,0x05,0x05,0x05,0x06,0x00,0x00, + 0x70,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0xfe,0xf0,0x88,0x88,0x88,0xf0, + 0x80,0x80,0x05,0x07,0x07,0x06,0x00,0xfe,0x78,0x88,0x88,0x88,0x78,0x08,0x08,0x05, + 0x05,0x05,0x06,0x00,0x00,0xb0,0xc8,0x80,0x80,0x80,0x05,0x05,0x05,0x06,0x00,0x00, + 0x78,0x80,0x70,0x08,0xf0,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0xf8,0x20,0x20, + 0x20,0x18,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0x88,0x98,0x68,0x05,0x05,0x05, + 0x06,0x00,0x00,0x88,0x88,0x88,0x50,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88, + 0xa8,0xa8,0x50,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x05,0x07, + 0x07,0x06,0x00,0xfe,0x88,0x88,0x88,0x50,0x20,0x40,0x80,0x05,0x05,0x05,0x06,0x00, + 0x00,0xf8,0x10,0x20,0x40,0xf8,0x03,0x09,0x09,0x06,0x01,0xff,0x20,0x40,0x40,0x40, + 0x80,0x40,0x40,0x40,0x20,0x01,0x09,0x09,0x06,0x02,0xff,0x80,0x80,0x80,0x80,0x80, + 0x80,0x80,0x80,0x80,0x03,0x09,0x09,0x06,0x01,0xff,0x80,0x40,0x40,0x40,0x20,0x40, + 0x40,0x40,0x80,0x05,0x03,0x03,0x06,0x00,0x02,0x48,0xa8,0x90,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0x00,0x00,0x00,0x06,0x05,0xff,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x80, - 0x80,0x80,0x80,0x00,0x80,0x03,0x03,0x03,0x06,0x01,0x05,0xa0,0xa0,0xa0,0x05,0x06, - 0x06,0x06,0x00,0x00,0x50,0xf8,0x50,0x50,0xf8,0x50,0x05,0x09,0x09,0x06,0x00,0xff, - 0x20,0x70,0xa8,0xa0,0x70,0x28,0xa8,0x70,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0xc8, - 0xc8,0x10,0x20,0x40,0x98,0x98,0x05,0x07,0x07,0x06,0x00,0x00,0x40,0xa0,0xa0,0x40, - 0xa8,0x90,0x68,0x01,0x03,0x03,0x06,0x02,0x05,0x80,0x80,0x80,0x03,0x09,0x09,0x06, - 0x01,0xff,0x20,0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20,0x03,0x09,0x09,0x06,0x01, - 0xff,0x80,0x40,0x40,0x20,0x20,0x20,0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00, - 0x20,0xa8,0x70,0x20,0x70,0xa8,0x20,0x05,0x05,0x05,0x06,0x00,0x01,0x20,0x20,0xf8, - 0x20,0x20,0x02,0x03,0x03,0x06,0x01,0xff,0xc0,0x40,0x80,0x05,0x01,0x01,0x06,0x00, - 0x03,0xf8,0x02,0x02,0x02,0x06,0x01,0x00,0xc0,0xc0,0x05,0x07,0x07,0x06,0x00,0x00, - 0x08,0x10,0x10,0x20,0x40,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x98, - 0xa8,0xc8,0x88,0x70,0x03,0x07,0x07,0x06,0x01,0x00,0x40,0xc0,0x40,0x40,0x40,0x40, - 0xe0,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x08,0x10,0x20,0x40,0xf8,0x05,0x07, - 0x07,0x06,0x00,0x00,0xf8,0x08,0x10,0x30,0x08,0x88,0x70,0x05,0x07,0x07,0x06,0x00, - 0x00,0x10,0x30,0x50,0x90,0xf8,0x10,0x10,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x80, - 0xf0,0x08,0x08,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x40,0x80,0xf0,0x88, - 0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x08,0x10,0x10,0x20,0x20,0x20,0x05, - 0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x70,0x88,0x88,0x70,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0x88,0x78,0x08,0x10,0x60,0x02,0x05,0x05,0x06,0x01,0x00,0xc0, - 0xc0,0x00,0xc0,0xc0,0x02,0x06,0x06,0x06,0x01,0xff,0xc0,0xc0,0x00,0xc0,0x40,0x80, - 0x03,0x05,0x05,0x06,0x01,0x01,0x20,0x40,0x80,0x40,0x20,0x05,0x03,0x03,0x06,0x00, - 0x02,0xf8,0x00,0xf8,0x03,0x05,0x05,0x06,0x01,0x01,0x80,0x40,0x20,0x40,0x80,0x05, - 0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x10,0x20,0x20,0x00,0x20,0x05,0x07,0x07,0x06, - 0x00,0x00,0x70,0x88,0xb8,0xa8,0xb8,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x70, - 0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x48,0x48,0x70, - 0x48,0x48,0xf0,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70, - 0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x48,0x48,0x48,0x48,0x48,0xf0,0x05,0x07,0x07, - 0x06,0x00,0x00,0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00, - 0xf8,0x80,0x80,0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80, - 0x80,0x98,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88,0xf8,0x88,0x88, - 0x88,0x03,0x07,0x07,0x06,0x01,0x00,0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x05,0x07, - 0x07,0x06,0x00,0x00,0x38,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07,0x06,0x00, - 0x00,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80, - 0x80,0x80,0x80,0x80,0xf8,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0xd8,0xa8,0x88,0x88, - 0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0xc8,0xa8,0x98,0x88,0x88,0x05, - 0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06, - 0x00,0x00,0xf0,0x88,0x88,0xf0,0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70, - 0x88,0x88,0x88,0xa8,0x90,0x68,0x05,0x07,0x07,0x06,0x00,0x00,0xf0,0x88,0x88,0xf0, - 0xa0,0x90,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x80,0x70,0x08,0x88,0x70, - 0x05,0x07,0x07,0x06,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x05,0x07,0x07, - 0x06,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00, - 0x88,0x88,0x88,0x88,0x50,0x50,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x88, - 0x88,0xa8,0xa8,0x50,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x50,0x88, - 0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x05,0x07, - 0x07,0x06,0x00,0x00,0xf8,0x08,0x10,0x20,0x40,0x80,0xf8,0x03,0x09,0x09,0x06,0x01, - 0xff,0xe0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xe0,0x05,0x07,0x07,0x06,0x00,0x00, - 0x80,0x40,0x40,0x20,0x10,0x10,0x08,0x03,0x09,0x09,0x06,0x01,0xff,0xe0,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0xe0,0x05,0x03,0x03,0x06,0x00,0x05,0x20,0x50,0x88,0x05, - 0x01,0x01,0x06,0x00,0xfe,0xf8,0x03,0x03,0x03,0x06,0x01,0x05,0x80,0x40,0x20,0x05, - 0x05,0x05,0x06,0x00,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00,0x00, - 0x80,0x80,0xf0,0x88,0x88,0x88,0xf0,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x80,0x80, - 0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x08,0x08,0x78,0x88,0x88,0x88,0x78,0x05, - 0x05,0x05,0x06,0x00,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00, - 0x30,0x48,0x40,0xe0,0x40,0x40,0x40,0x05,0x07,0x07,0x06,0x00,0xfe,0x70,0x88,0x88, - 0x88,0x78,0x08,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x80,0x80,0xf0,0x88,0x88,0x88, - 0x88,0x03,0x07,0x07,0x06,0x01,0x00,0x40,0x00,0xc0,0x40,0x40,0x40,0xe0,0x04,0x09, - 0x09,0x06,0x01,0xfe,0x10,0x00,0x30,0x10,0x10,0x10,0x10,0x90,0x60,0x05,0x07,0x07, - 0x06,0x00,0x00,0x80,0x80,0x88,0x90,0xe0,0x90,0x88,0x03,0x07,0x07,0x06,0x01,0x00, - 0xc0,0x40,0x40,0x40,0x40,0x40,0xe0,0x05,0x05,0x05,0x06,0x00,0x00,0xd0,0xa8,0xa8, - 0xa8,0xa8,0x05,0x05,0x05,0x06,0x00,0x00,0xb0,0xc8,0x88,0x88,0x88,0x05,0x05,0x05, - 0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0xfe,0xf0,0x88, - 0x88,0x88,0xf0,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0xfe,0x78,0x88,0x88,0x88,0x78, - 0x08,0x08,0x05,0x05,0x05,0x06,0x00,0x00,0xb0,0xc8,0x80,0x80,0x80,0x05,0x05,0x05, - 0x06,0x00,0x00,0x78,0x80,0x70,0x08,0xf0,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20, - 0xf8,0x20,0x20,0x20,0x18,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0x88,0x98,0x68, - 0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x88,0x88,0x50,0x20,0x05,0x05,0x05,0x06,0x00, - 0x00,0x88,0x88,0xa8,0xa8,0x50,0x05,0x05,0x05,0x06,0x00,0x00,0x88,0x50,0x20,0x50, - 0x88,0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x88,0x50,0x20,0x40,0x80,0x05,0x05, - 0x05,0x06,0x00,0x00,0xf8,0x10,0x20,0x40,0xf8,0x03,0x09,0x09,0x06,0x01,0xff,0x20, - 0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x20,0x01,0x09,0x09,0x06,0x02,0xff,0x80,0x80, - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x03,0x09,0x09,0x06,0x01,0xff,0x80,0x40,0x40, - 0x40,0x20,0x40,0x40,0x40,0x80,0x05,0x03,0x03,0x06,0x00,0x02,0x48,0xa8,0x90,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, - 0x00,0x00,0x00,0x06,0x05,0xff,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x00,0x80,0x80, - 0x80,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0xff,0x20,0x70,0xa8,0xa0,0xa8,0x70,0x20, - 0x05,0x07,0x07,0x06,0x00,0x00,0x30,0x48,0x40,0xe0,0x40,0x48,0xb0,0x05,0x05,0x05, - 0x06,0x00,0x00,0xa8,0x50,0x88,0x50,0xa8,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x50, - 0xf8,0x20,0xf8,0x20,0x20,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x80,0x80,0x00,0x80, - 0x80,0x80,0x04,0x08,0x08,0x06,0x01,0x00,0x70,0x80,0x60,0x90,0x90,0x60,0x10,0xe0, - 0x03,0x01,0x01,0x06,0x01,0x07,0xa0,0x06,0x07,0x07,0x06,0x00,0x00,0x78,0x84,0xb4, - 0xa4,0xb4,0x84,0x78,0x03,0x05,0x05,0x06,0x01,0x04,0x60,0xa0,0x60,0x00,0xe0,0x05, - 0x05,0x05,0x06,0x00,0x00,0x28,0x50,0xa0,0x50,0x28,0x05,0x03,0x03,0x06,0x00,0x01, - 0xf8,0x08,0x08,0x03,0x01,0x01,0x06,0x01,0x03,0xe0,0x06,0x07,0x07,0x06,0x00,0x00, - 0x78,0x84,0xb4,0xa4,0xa4,0x84,0x78,0x05,0x01,0x01,0x06,0x00,0x07,0xf8,0x04,0x04, - 0x04,0x06,0x01,0x05,0x60,0x90,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20, - 0xf8,0x20,0x20,0x00,0xf8,0x03,0x05,0x05,0x06,0x01,0x05,0x40,0xa0,0x20,0x40,0xe0, - 0x03,0x05,0x05,0x06,0x01,0x05,0xc0,0x20,0x40,0x20,0xc0,0x03,0x03,0x03,0x06,0x01, - 0x05,0x20,0x40,0x80,0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x88,0x98,0xe8,0x80, - 0x80,0x05,0x08,0x08,0x06,0x00,0x00,0x78,0xe8,0xe8,0xe8,0x68,0x28,0x28,0x28,0x02, - 0x02,0x02,0x06,0x02,0x03,0xc0,0xc0,0x03,0x02,0x02,0x06,0x01,0xfe,0x20,0xc0,0x03, - 0x05,0x05,0x06,0x01,0x05,0x40,0xc0,0x40,0x40,0xe0,0x03,0x05,0x05,0x06,0x01,0x05, - 0x40,0xa0,0x40,0x00,0xe0,0x05,0x05,0x05,0x06,0x00,0x00,0xa0,0x50,0x28,0x50,0xa0, - 0x05,0x0a,0x0a,0x06,0x00,0x00,0x40,0xc0,0x48,0x50,0x60,0x50,0xb0,0x50,0x78,0x10, - 0x05,0x0a,0x0a,0x06,0x00,0x00,0x40,0xc0,0x48,0x50,0x60,0x50,0xa8,0x08,0x10,0x38, - 0x05,0x0a,0x0a,0x06,0x00,0x00,0xc0,0x20,0x48,0x30,0xe0,0x50,0xb0,0x50,0x78,0x10, - 0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x00,0x20,0x20,0x40,0x88,0x70,0x05,0x0a,0x0a, - 0x06,0x00,0x00,0x40,0x20,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x0a,0x0a, - 0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x0a,0x0a, - 0x06,0x00,0x00,0x20,0x50,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x0a,0x0a, - 0x06,0x00,0x00,0x68,0xb0,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x09,0x09, - 0x06,0x00,0x00,0x50,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x0a,0x0a,0x06, - 0x00,0x00,0x20,0x50,0x20,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x07,0x07,0x06, - 0x00,0x00,0x78,0xa0,0xa0,0xf0,0xa0,0xa0,0xb8,0x05,0x09,0x09,0x06,0x00,0xfe,0x70, - 0x88,0x80,0x80,0x80,0x88,0x70,0x10,0x60,0x05,0x0a,0x0a,0x06,0x00,0x00,0x40,0x20, - 0x00,0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x05,0x0a,0x0a,0x06,0x00,0x00,0x10,0x20, - 0x00,0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x05,0x0a,0x0a,0x06,0x00,0x00,0x20,0x50, - 0x00,0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x05,0x09,0x09,0x06,0x00,0x00,0x50,0x00, - 0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x03,0x0a,0x0a,0x06,0x01,0x00,0x80,0x40,0x00, - 0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x03,0x0a,0x0a,0x06,0x01,0x00,0x20,0x40,0x00, - 0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x03,0x0a,0x0a,0x06,0x01,0x00,0x40,0xa0,0x00, - 0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x03,0x09,0x09,0x06,0x01,0x00,0xa0,0x00,0xe0, - 0x40,0x40,0x40,0x40,0x40,0xe0,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x48,0x48,0xe8, - 0x48,0x48,0x70,0x05,0x0a,0x0a,0x06,0x00,0x00,0x68,0xb0,0x00,0x88,0x88,0xc8,0xa8, - 0x98,0x88,0x88,0x05,0x0a,0x0a,0x06,0x00,0x00,0x40,0x20,0x00,0x70,0x88,0x88,0x88, - 0x88,0x88,0x70,0x05,0x0a,0x0a,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x88,0x88, - 0x88,0x88,0x70,0x05,0x0a,0x0a,0x06,0x00,0x00,0x20,0x50,0x00,0x70,0x88,0x88,0x88, - 0x88,0x88,0x70,0x05,0x0a,0x0a,0x06,0x00,0x00,0x68,0xb0,0x00,0x70,0x88,0x88,0x88, - 0x88,0x88,0x70,0x05,0x09,0x09,0x06,0x00,0x00,0x50,0x00,0x70,0x88,0x88,0x88,0x88, - 0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x01,0x88,0x50,0x20,0x50,0x88,0x05,0x09,0x09, - 0x06,0x00,0xff,0x08,0x70,0x98,0xa8,0xa8,0xa8,0xc8,0x70,0x80,0x05,0x0a,0x0a,0x06, - 0x00,0x00,0x40,0x20,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x0a,0x0a,0x06, - 0x00,0x00,0x10,0x20,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x0a,0x0a,0x06, - 0x00,0x00,0x20,0x50,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x09,0x09,0x06, - 0x00,0x00,0x50,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x0a,0x0a,0x06,0x00, - 0x00,0x10,0x20,0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x04,0x07,0x07,0x06,0x01, - 0x00,0x80,0xe0,0x90,0x90,0x90,0xe0,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88, - 0x90,0xa0,0x90,0x88,0xb0,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0x20,0x00,0x70,0x08, - 0x78,0x88,0x78,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x08,0x78,0x88, - 0x78,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x50,0x00,0x70,0x08,0x78,0x88,0x78,0x05, - 0x08,0x08,0x06,0x00,0x00,0x68,0xb0,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07, - 0x06,0x00,0x00,0x50,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x08,0x08,0x06,0x00,0x00, - 0x20,0x50,0x20,0x70,0x08,0x78,0x88,0x78,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x28, - 0x70,0xa0,0x78,0x05,0x07,0x07,0x06,0x00,0xfe,0x70,0x88,0x80,0x88,0x70,0x10,0x60, - 0x05,0x08,0x08,0x06,0x00,0x00,0x40,0x20,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x08, - 0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x08,0x08,0x06, - 0x00,0x00,0x20,0x50,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00, - 0x50,0x00,0x70,0x88,0xf0,0x80,0x70,0x03,0x08,0x08,0x06,0x01,0x00,0x80,0x40,0x00, - 0xc0,0x40,0x40,0x40,0xe0,0x03,0x08,0x08,0x06,0x01,0x00,0x20,0x40,0x00,0xc0,0x40, - 0x40,0x40,0xe0,0x03,0x08,0x08,0x06,0x01,0x00,0x40,0xa0,0x00,0xc0,0x40,0x40,0x40, - 0xe0,0x03,0x07,0x07,0x06,0x01,0x00,0xa0,0x00,0xc0,0x40,0x40,0x40,0xe0,0x05,0x09, - 0x09,0x06,0x00,0x00,0x50,0x20,0x50,0x08,0x78,0x88,0x88,0x88,0x70,0x05,0x08,0x08, - 0x06,0x00,0x00,0x68,0xb0,0x00,0xb0,0xc8,0x88,0x88,0x88,0x05,0x08,0x08,0x06,0x00, - 0x00,0x40,0x20,0x00,0x70,0x88,0x88,0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x10, - 0x20,0x00,0x70,0x88,0x88,0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x50,0x00, - 0x70,0x88,0x88,0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x68,0xb0,0x00,0x70,0x88, - 0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x50,0x00,0x70,0x88,0x88,0x88,0x70, - 0x05,0x05,0x05,0x06,0x00,0x01,0x20,0x00,0xf8,0x00,0x20,0x05,0x05,0x05,0x06,0x00, - 0x00,0x78,0x98,0xa8,0xc8,0xf0,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0x20,0x00,0x88, - 0x88,0x88,0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x88,0x88,0x88, - 0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x50,0x00,0x88,0x88,0x88,0x88,0x70, - 0x05,0x07,0x07,0x06,0x00,0x00,0x50,0x00,0x88,0x88,0x88,0x88,0x70,0x05,0x0a,0x0a, - 0x06,0x00,0xfe,0x10,0x20,0x00,0x88,0x88,0x88,0x50,0x20,0x40,0x80,0x05,0x09,0x09, - 0x06,0x00,0xfe,0x80,0x80,0xf0,0x88,0x88,0x88,0xf0,0x80,0x80,0x05,0x09,0x09,0x06, - 0x00,0xfe,0x50,0x00,0x88,0x88,0x88,0x50,0x20,0x40,0x80}; + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00, + 0x06,0x05,0xff,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x00,0x80,0x80,0x80,0x80,0x80, + 0x05,0x07,0x07,0x06,0x00,0xff,0x20,0x70,0xa8,0xa0,0xa8,0x70,0x20,0x05,0x07,0x07, + 0x06,0x00,0x00,0x30,0x48,0x40,0xe0,0x40,0x48,0xb0,0x05,0x05,0x05,0x06,0x00,0x00, + 0xa8,0x50,0x88,0x50,0xa8,0x05,0x07,0x07,0x06,0x00,0x00,0x88,0x50,0xf8,0x20,0xf8, + 0x20,0x20,0x01,0x07,0x07,0x06,0x02,0x00,0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x04, + 0x08,0x08,0x06,0x01,0x00,0x70,0x80,0x60,0x90,0x90,0x60,0x10,0xe0,0x03,0x01,0x01, + 0x06,0x01,0x07,0xa0,0x06,0x07,0x07,0x06,0x00,0x00,0x78,0x84,0xb4,0xa4,0xb4,0x84, + 0x78,0x03,0x05,0x05,0x06,0x01,0x04,0x60,0xa0,0x60,0x00,0xe0,0x05,0x05,0x05,0x06, + 0x00,0x00,0x28,0x50,0xa0,0x50,0x28,0x05,0x03,0x03,0x06,0x00,0x01,0xf8,0x08,0x08, + 0x03,0x01,0x01,0x06,0x01,0x03,0xe0,0x06,0x07,0x07,0x06,0x00,0x00,0x78,0x84,0xb4, + 0xa4,0xa4,0x84,0x78,0x05,0x01,0x01,0x06,0x00,0x07,0xf8,0x04,0x04,0x04,0x06,0x01, + 0x05,0x60,0x90,0x90,0x60,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x20,0xf8,0x20,0x20, + 0x00,0xf8,0x03,0x05,0x05,0x06,0x01,0x04,0x40,0xa0,0x20,0x40,0xe0,0x03,0x05,0x05, + 0x06,0x01,0x04,0xc0,0x20,0x40,0x20,0xc0,0x03,0x03,0x03,0x06,0x01,0x05,0x20,0x40, + 0x80,0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x88,0x98,0xe8,0x80,0x80,0x05,0x08, + 0x08,0x06,0x00,0x00,0x78,0xe8,0xe8,0xe8,0x68,0x28,0x28,0x28,0x02,0x02,0x02,0x06, + 0x02,0x03,0xc0,0xc0,0x03,0x02,0x02,0x06,0x01,0xfe,0x20,0xc0,0x03,0x05,0x05,0x06, + 0x01,0x04,0x40,0xc0,0x40,0x40,0xe0,0x03,0x05,0x05,0x06,0x01,0x05,0x40,0xa0,0x40, + 0x00,0xe0,0x05,0x05,0x05,0x06,0x00,0x00,0xa0,0x50,0x28,0x50,0xa0,0x05,0x0a,0x0a, + 0x06,0x00,0x00,0x40,0xc0,0x48,0x50,0x60,0x50,0xb0,0x50,0x78,0x10,0x05,0x0a,0x0a, + 0x06,0x00,0x00,0x40,0xc0,0x48,0x50,0x60,0x50,0xa8,0x08,0x10,0x38,0x05,0x0a,0x0a, + 0x06,0x00,0x00,0xc0,0x20,0x48,0x30,0xe0,0x50,0xb0,0x50,0x78,0x10,0x05,0x07,0x07, + 0x06,0x00,0x00,0x20,0x00,0x20,0x20,0x40,0x88,0x70,0x05,0x0a,0x0a,0x06,0x00,0x00, + 0x40,0x20,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x0a,0x0a,0x06,0x00,0x00, + 0x10,0x20,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x0a,0x0a,0x06,0x00,0x00, + 0x20,0x50,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x0a,0x0a,0x06,0x00,0x00, + 0x68,0xb0,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x09,0x09,0x06,0x00,0x00, + 0x50,0x00,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x0a,0x0a,0x06,0x00,0x00,0x20, + 0x50,0x20,0x70,0x88,0x88,0xf8,0x88,0x88,0x88,0x05,0x07,0x07,0x06,0x00,0x00,0x78, + 0xa0,0xa0,0xf0,0xa0,0xa0,0xb8,0x05,0x09,0x09,0x06,0x00,0xfe,0x70,0x88,0x80,0x80, + 0x80,0x88,0x70,0x10,0x60,0x05,0x0a,0x0a,0x06,0x00,0x00,0x40,0x20,0x00,0xf8,0x80, + 0x80,0xf0,0x80,0x80,0xf8,0x05,0x0a,0x0a,0x06,0x00,0x00,0x10,0x20,0x00,0xf8,0x80, + 0x80,0xf0,0x80,0x80,0xf8,0x05,0x0a,0x0a,0x06,0x00,0x00,0x20,0x50,0x00,0xf8,0x80, + 0x80,0xf0,0x80,0x80,0xf8,0x05,0x09,0x09,0x06,0x00,0x00,0x50,0x00,0xf8,0x80,0x80, + 0xf0,0x80,0x80,0xf8,0x03,0x0a,0x0a,0x06,0x01,0x00,0x80,0x40,0x00,0xe0,0x40,0x40, + 0x40,0x40,0x40,0xe0,0x03,0x0a,0x0a,0x06,0x01,0x00,0x20,0x40,0x00,0xe0,0x40,0x40, + 0x40,0x40,0x40,0xe0,0x03,0x0a,0x0a,0x06,0x01,0x00,0x40,0xa0,0x00,0xe0,0x40,0x40, + 0x40,0x40,0x40,0xe0,0x03,0x09,0x09,0x06,0x01,0x00,0xa0,0x00,0xe0,0x40,0x40,0x40, + 0x40,0x40,0xe0,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x48,0x48,0xe8,0x48,0x48,0x70, + 0x05,0x0a,0x0a,0x06,0x00,0x00,0x68,0xb0,0x00,0x88,0x88,0xc8,0xa8,0x98,0x88,0x88, + 0x05,0x0a,0x0a,0x06,0x00,0x00,0x40,0x20,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70, + 0x05,0x0a,0x0a,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70, + 0x05,0x0a,0x0a,0x06,0x00,0x00,0x20,0x50,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70, + 0x05,0x0a,0x0a,0x06,0x00,0x00,0x68,0xb0,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70, + 0x05,0x09,0x09,0x06,0x00,0x00,0x50,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x05, + 0x05,0x05,0x06,0x00,0x01,0x88,0x50,0x20,0x50,0x88,0x05,0x09,0x09,0x06,0x00,0xff, + 0x08,0x70,0x98,0xa8,0xa8,0xa8,0xc8,0x70,0x80,0x05,0x0a,0x0a,0x06,0x00,0x00,0x40, + 0x20,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x0a,0x0a,0x06,0x00,0x00,0x10, + 0x20,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x0a,0x0a,0x06,0x00,0x00,0x20, + 0x50,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x09,0x09,0x06,0x00,0x00,0x50, + 0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x05,0x0a,0x0a,0x06,0x00,0x00,0x10,0x20, + 0x00,0x88,0x88,0x50,0x20,0x20,0x20,0x20,0x04,0x07,0x07,0x06,0x01,0x00,0x80,0xe0, + 0x90,0x90,0x90,0xe0,0x80,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x88,0x90,0xa0,0x90, + 0x88,0xb0,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0x20,0x00,0x70,0x08,0x78,0x88,0x78, + 0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x08, + 0x08,0x06,0x00,0x00,0x20,0x50,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x08,0x08,0x06, + 0x00,0x00,0x68,0xb0,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x07,0x07,0x06,0x00,0x00, + 0x50,0x00,0x70,0x08,0x78,0x88,0x78,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x50,0x20, + 0x70,0x08,0x78,0x88,0x78,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x28,0x70,0xa0,0x78, + 0x05,0x07,0x07,0x06,0x00,0xfe,0x70,0x88,0x80,0x88,0x70,0x10,0x60,0x05,0x08,0x08, + 0x06,0x00,0x00,0x40,0x20,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x08,0x08,0x06,0x00, + 0x00,0x10,0x20,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x20, + 0x50,0x00,0x70,0x88,0xf0,0x80,0x70,0x05,0x07,0x07,0x06,0x00,0x00,0x50,0x00,0x70, + 0x88,0xf0,0x80,0x70,0x03,0x08,0x08,0x06,0x01,0x00,0x80,0x40,0x00,0xc0,0x40,0x40, + 0x40,0xe0,0x03,0x08,0x08,0x06,0x01,0x00,0x20,0x40,0x00,0xc0,0x40,0x40,0x40,0xe0, + 0x03,0x08,0x08,0x06,0x01,0x00,0x40,0xa0,0x00,0xc0,0x40,0x40,0x40,0xe0,0x03,0x07, + 0x07,0x06,0x01,0x00,0xa0,0x00,0xc0,0x40,0x40,0x40,0xe0,0x05,0x09,0x09,0x06,0x00, + 0x00,0x50,0x20,0x50,0x08,0x78,0x88,0x88,0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00, + 0x68,0xb0,0x00,0xb0,0xc8,0x88,0x88,0x88,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0x20, + 0x00,0x70,0x88,0x88,0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70, + 0x88,0x88,0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x50,0x00,0x70,0x88,0x88, + 0x88,0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x68,0xb0,0x00,0x70,0x88,0x88,0x88,0x70, + 0x05,0x07,0x07,0x06,0x00,0x00,0x50,0x00,0x70,0x88,0x88,0x88,0x70,0x05,0x05,0x05, + 0x06,0x00,0x01,0x20,0x00,0xf8,0x00,0x20,0x05,0x05,0x05,0x06,0x00,0x00,0x78,0x98, + 0xa8,0xc8,0xf0,0x05,0x08,0x08,0x06,0x00,0x00,0x40,0x20,0x00,0x88,0x88,0x88,0x88, + 0x70,0x05,0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x88,0x88,0x88,0x88,0x70,0x05, + 0x08,0x08,0x06,0x00,0x00,0x20,0x50,0x00,0x88,0x88,0x88,0x88,0x70,0x05,0x07,0x07, + 0x06,0x00,0x00,0x50,0x00,0x88,0x88,0x88,0x88,0x70,0x05,0x0a,0x0a,0x06,0x00,0xfe, + 0x10,0x20,0x00,0x88,0x88,0x88,0x50,0x20,0x40,0x80,0x05,0x09,0x09,0x06,0x00,0xfe, + 0x80,0x80,0xf0,0x88,0x88,0x88,0xf0,0x80,0x80,0x05,0x09,0x09,0x06,0x00,0xfe,0x50, + 0x00,0x88,0x88,0x88,0x50,0x20,0x40,0x80}; #endif diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_an.h b/Marlin/src/lcd/dogm/fontdata/langdata_an.h index 51210a4394..ffda82764f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_an.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_an.h @@ -5,5 +5,5 @@ */ #include -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_bg.h b/Marlin/src/lcd/dogm/fontdata/langdata_bg.h index 5ea82240aa..81444d9969 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_bg.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_bg.h @@ -64,7 +64,7 @@ const u8g_fntpgm_uint8_t fontpage_8_206_207[39] U8G_FONT_SECTION("fontpage_8_206 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x90,0xa8,0xe8,0xa8,0x90,0x04,0x05,0x05,0x06, 0x01,0x00,0x70,0x90,0x70,0x50,0x90}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(8, 144, 149, fontpage_8_144_149), // 'А' -- 'Е' FONTDATA_ITEM(8, 151, 152, fontpage_8_151_152), // 'З' -- 'И' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_ca.h b/Marlin/src/lcd/dogm/fontdata/langdata_ca.h index 51210a4394..ffda82764f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_ca.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_ca.h @@ -5,5 +5,5 @@ */ #include -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_cz.h b/Marlin/src/lcd/dogm/fontdata/langdata_cz.h index 5858e707b4..e132dc8160 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_cz.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_cz.h @@ -38,7 +38,7 @@ const u8g_fntpgm_uint8_t fontpage_2_253_254[47] U8G_FONT_SECTION("fontpage_2_253 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0xf8,0x08,0x10,0x20,0x40,0x80, 0xf8,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0xf8,0x10,0x20,0x40,0xf8}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(2, 140, 141, fontpage_2_140_141), // 'Č' -- 'č' FONTDATA_ITEM(2, 143, 143, fontpage_2_143_143), // 'ď' -- 'ď' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_da.h b/Marlin/src/lcd/dogm/fontdata/langdata_da.h index 51210a4394..ffda82764f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_da.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_da.h @@ -5,5 +5,5 @@ */ #include -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_de.h b/Marlin/src/lcd/dogm/fontdata/langdata_de.h index 51210a4394..ffda82764f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_de.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_de.h @@ -5,5 +5,5 @@ */ #include -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_el-gr.h b/Marlin/src/lcd/dogm/fontdata/langdata_el-gr.h index 558ea2fa68..76a5c66cd9 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_el-gr.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_el-gr.h @@ -40,26 +40,29 @@ const u8g_fntpgm_uint8_t fontpage_7_172_175[75] U8G_FONT_SECTION("fontpage_7_172 0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x60,0x88,0x70,0x05,0x0a,0x0a, 0x06,0x00,0xfe,0x10,0x20,0x00,0xb0,0xc8,0x88,0x88,0x88,0x08,0x08,0x03,0x08,0x08, 0x06,0x01,0x00,0x40,0x80,0x00,0x80,0x80,0x80,0xa0,0x40}; -const u8g_fntpgm_uint8_t fontpage_7_177_199[303] U8G_FONT_SECTION("fontpage_7_177_199") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xc7,0x00,0x09,0xfe,0x00, +const u8g_fntpgm_uint8_t fontpage_7_177_181[80] U8G_FONT_SECTION("fontpage_7_177_181") = { + 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xb5,0x00,0x07,0xfe,0x00, 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x68,0x90,0x90,0x90,0x68,0x05,0x09,0x09,0x06, 0x00,0xfe,0x60,0x90,0x90,0xb0,0x88,0x88,0xf0,0x80,0x80,0x05,0x07,0x07,0x06,0x00, 0xfe,0x88,0x88,0x50,0x50,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x80, - 0x70,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x60,0x88,0x70, - 0x05,0x08,0x08,0x06,0x00,0xff,0xf8,0x20,0x40,0x40,0x40,0x30,0x08,0x30,0x05,0x07, - 0x07,0x06,0x00,0xfe,0xb0,0xc8,0x88,0x88,0x88,0x08,0x08,0x04,0x07,0x07,0x06,0x01, - 0x00,0x60,0x90,0x90,0xf0,0x90,0x90,0x60,0x03,0x05,0x05,0x06,0x02,0x00,0x80,0x80, - 0x80,0xa0,0x40,0x04,0x05,0x05,0x06,0x01,0x00,0x90,0xa0,0xc0,0xa0,0x90,0x05,0x09, - 0x09,0x06,0x00,0x00,0x80,0x40,0x40,0x20,0x20,0x50,0x50,0x88,0x88,0x05,0x07,0x07, - 0x06,0x00,0xfe,0x88,0x88,0x88,0x98,0xe8,0x80,0x80,0x05,0x05,0x05,0x06,0x00,0x00, - 0x88,0x88,0x50,0x50,0x20,0x05,0x09,0x09,0x06,0x00,0xfe,0xf8,0x20,0x40,0x70,0x80, - 0x80,0x70,0x08,0x10,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x06, - 0x05,0x05,0x06,0x00,0x00,0xf8,0x50,0x50,0x54,0x48,0x05,0x07,0x07,0x06,0x00,0xfe, - 0x70,0x88,0x88,0xc8,0xb0,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0xfe,0x70,0x88,0x80, - 0x80,0x70,0x08,0x30,0x05,0x05,0x05,0x06,0x00,0x00,0x78,0x90,0x88,0x88,0x70,0x05, - 0x05,0x05,0x06,0x00,0x00,0xf8,0x20,0x20,0x28,0x10,0x05,0x05,0x05,0x06,0x00,0x00, - 0x90,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0xfe,0x10,0xa8,0xa8,0xa8,0x70, - 0x20,0x20,0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x50,0x20,0x50,0x88,0x88}; + 0x70,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x60,0x88,0x70 + }; +const u8g_fntpgm_uint8_t fontpage_7_183_199[226] U8G_FONT_SECTION("fontpage_7_183_199") = { + 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb7,0xc7,0x00,0x09,0xfe,0x00, + 0x00,0x05,0x07,0x07,0x06,0x00,0xfe,0xb0,0xc8,0x88,0x88,0x88,0x08,0x08,0x04,0x07, + 0x07,0x06,0x01,0x00,0x60,0x90,0x90,0xf0,0x90,0x90,0x60,0x03,0x05,0x05,0x06,0x02, + 0x00,0x80,0x80,0x80,0xa0,0x40,0x04,0x05,0x05,0x06,0x01,0x00,0x90,0xa0,0xc0,0xa0, + 0x90,0x05,0x09,0x09,0x06,0x00,0x00,0x80,0x40,0x40,0x20,0x20,0x50,0x50,0x88,0x88, + 0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x88,0x98,0xe8,0x80,0x80,0x05,0x05,0x05, + 0x06,0x00,0x00,0x88,0x88,0x50,0x50,0x20,0x05,0x09,0x09,0x06,0x00,0xfe,0xf8,0x20, + 0x40,0x70,0x80,0x80,0x70,0x08,0x10,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x88, + 0x88,0x70,0x06,0x05,0x05,0x06,0x00,0x00,0xf8,0x50,0x50,0x54,0x48,0x05,0x07,0x07, + 0x06,0x00,0xfe,0x70,0x88,0x88,0xc8,0xb0,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0xfe, + 0x70,0x88,0x80,0x80,0x70,0x08,0x30,0x05,0x05,0x05,0x06,0x00,0x00,0x78,0x90,0x88, + 0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x20,0x20,0x28,0x10,0x05,0x05,0x05, + 0x06,0x00,0x00,0x90,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0xfe,0x10,0xa8, + 0xa8,0xa8,0x70,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x50,0x20,0x50, + 0x88,0x88}; const u8g_fntpgm_uint8_t fontpage_7_201_201[28] U8G_FONT_SECTION("fontpage_7_201_201") = { 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc9,0xc9,0x00,0x05,0x00,0x00, 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x50,0x88,0xa8,0xa8,0x50}; @@ -72,14 +75,15 @@ const u8g_fntpgm_uint8_t fontpage_64_166_166[24] U8G_FONT_SECTION("fontpage_64_1 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa6,0xa6,0x00,0x01,0x00,0x00, 0x00,0x05,0x01,0x01,0x06,0x00,0x00,0xa8}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(7, 136, 136, fontpage_7_136_136), // 'Έ' -- 'Έ' FONTDATA_ITEM(7, 145, 157, fontpage_7_145_157), // 'Α' -- 'Ν' FONTDATA_ITEM(7, 159, 161, fontpage_7_159_161), // 'Ο' -- 'Ρ' FONTDATA_ITEM(7, 163, 167, fontpage_7_163_167), // 'Σ' -- 'Χ' FONTDATA_ITEM(7, 172, 175, fontpage_7_172_175), // 'ά' -- 'ί' - FONTDATA_ITEM(7, 177, 199, fontpage_7_177_199), // 'α' -- 'χ' + FONTDATA_ITEM(7, 177, 181, fontpage_7_177_181), // 'α' -- 'ε' + FONTDATA_ITEM(7, 183, 199, fontpage_7_183_199), // 'η' -- 'χ' FONTDATA_ITEM(7, 201, 201, fontpage_7_201_201), // 'ω' -- 'ω' FONTDATA_ITEM(7, 204, 206, fontpage_7_204_206), // 'ό' -- 'ώ' FONTDATA_ITEM(64, 166, 166, fontpage_64_166_166), // '…' -- '…' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_el.h b/Marlin/src/lcd/dogm/fontdata/langdata_el.h index 1c7e810f6d..858ec0f84f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_el.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_el.h @@ -43,26 +43,29 @@ const u8g_fntpgm_uint8_t fontpage_7_172_175[75] U8G_FONT_SECTION("fontpage_7_172 0x08,0x08,0x06,0x00,0x00,0x10,0x20,0x00,0x70,0x88,0x60,0x88,0x70,0x05,0x0a,0x0a, 0x06,0x00,0xfe,0x10,0x20,0x00,0xb0,0xc8,0x88,0x88,0x88,0x08,0x08,0x03,0x08,0x08, 0x06,0x01,0x00,0x40,0x80,0x00,0x80,0x80,0x80,0xa0,0x40}; -const u8g_fntpgm_uint8_t fontpage_7_177_199[303] U8G_FONT_SECTION("fontpage_7_177_199") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xc7,0x00,0x09,0xfe,0x00, +const u8g_fntpgm_uint8_t fontpage_7_177_181[80] U8G_FONT_SECTION("fontpage_7_177_181") = { + 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb1,0xb5,0x00,0x07,0xfe,0x00, 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x68,0x90,0x90,0x90,0x68,0x05,0x09,0x09,0x06, 0x00,0xfe,0x60,0x90,0x90,0xb0,0x88,0x88,0xf0,0x80,0x80,0x05,0x07,0x07,0x06,0x00, 0xfe,0x88,0x88,0x50,0x50,0x20,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0x00,0x70,0x80, - 0x70,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x60,0x88,0x70, - 0x05,0x08,0x08,0x06,0x00,0xff,0xf8,0x20,0x40,0x40,0x40,0x30,0x08,0x30,0x05,0x07, - 0x07,0x06,0x00,0xfe,0xb0,0xc8,0x88,0x88,0x88,0x08,0x08,0x04,0x07,0x07,0x06,0x01, - 0x00,0x60,0x90,0x90,0xf0,0x90,0x90,0x60,0x03,0x05,0x05,0x06,0x02,0x00,0x80,0x80, - 0x80,0xa0,0x40,0x04,0x05,0x05,0x06,0x01,0x00,0x90,0xa0,0xc0,0xa0,0x90,0x05,0x09, - 0x09,0x06,0x00,0x00,0x80,0x40,0x40,0x20,0x20,0x50,0x50,0x88,0x88,0x05,0x07,0x07, - 0x06,0x00,0xfe,0x88,0x88,0x88,0x98,0xe8,0x80,0x80,0x05,0x05,0x05,0x06,0x00,0x00, - 0x88,0x88,0x50,0x50,0x20,0x05,0x09,0x09,0x06,0x00,0xfe,0xf8,0x20,0x40,0x70,0x80, - 0x80,0x70,0x08,0x10,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x06, - 0x05,0x05,0x06,0x00,0x00,0xf8,0x50,0x50,0x54,0x48,0x05,0x07,0x07,0x06,0x00,0xfe, - 0x70,0x88,0x88,0xc8,0xb0,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0xfe,0x70,0x88,0x80, - 0x80,0x70,0x08,0x30,0x05,0x05,0x05,0x06,0x00,0x00,0x78,0x90,0x88,0x88,0x70,0x05, - 0x05,0x05,0x06,0x00,0x00,0xf8,0x20,0x20,0x28,0x10,0x05,0x05,0x05,0x06,0x00,0x00, - 0x90,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0xfe,0x10,0xa8,0xa8,0xa8,0x70, - 0x20,0x20,0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x50,0x20,0x50,0x88,0x88}; + 0x70,0x88,0x88,0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x60,0x88,0x70 + }; +const u8g_fntpgm_uint8_t fontpage_7_183_199[226] U8G_FONT_SECTION("fontpage_7_183_199") = { + 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb7,0xc7,0x00,0x09,0xfe,0x00, + 0x00,0x05,0x07,0x07,0x06,0x00,0xfe,0xb0,0xc8,0x88,0x88,0x88,0x08,0x08,0x04,0x07, + 0x07,0x06,0x01,0x00,0x60,0x90,0x90,0xf0,0x90,0x90,0x60,0x03,0x05,0x05,0x06,0x02, + 0x00,0x80,0x80,0x80,0xa0,0x40,0x04,0x05,0x05,0x06,0x01,0x00,0x90,0xa0,0xc0,0xa0, + 0x90,0x05,0x09,0x09,0x06,0x00,0x00,0x80,0x40,0x40,0x20,0x20,0x50,0x50,0x88,0x88, + 0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x88,0x98,0xe8,0x80,0x80,0x05,0x05,0x05, + 0x06,0x00,0x00,0x88,0x88,0x50,0x50,0x20,0x05,0x09,0x09,0x06,0x00,0xfe,0xf8,0x20, + 0x40,0x70,0x80,0x80,0x70,0x08,0x10,0x05,0x05,0x05,0x06,0x00,0x00,0x70,0x88,0x88, + 0x88,0x70,0x06,0x05,0x05,0x06,0x00,0x00,0xf8,0x50,0x50,0x54,0x48,0x05,0x07,0x07, + 0x06,0x00,0xfe,0x70,0x88,0x88,0xc8,0xb0,0x80,0x80,0x05,0x07,0x07,0x06,0x00,0xfe, + 0x70,0x88,0x80,0x80,0x70,0x08,0x30,0x05,0x05,0x05,0x06,0x00,0x00,0x78,0x90,0x88, + 0x88,0x70,0x05,0x05,0x05,0x06,0x00,0x00,0xf8,0x20,0x20,0x28,0x10,0x05,0x05,0x05, + 0x06,0x00,0x00,0x90,0x88,0x88,0x88,0x70,0x05,0x07,0x07,0x06,0x00,0xfe,0x10,0xa8, + 0xa8,0xa8,0x70,0x20,0x20,0x05,0x07,0x07,0x06,0x00,0xfe,0x88,0x88,0x50,0x20,0x50, + 0x88,0x88}; const u8g_fntpgm_uint8_t fontpage_7_201_201[28] U8G_FONT_SECTION("fontpage_7_201_201") = { 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc9,0xc9,0x00,0x05,0x00,0x00, 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x50,0x88,0xa8,0xa8,0x50}; @@ -75,7 +78,7 @@ const u8g_fntpgm_uint8_t fontpage_64_166_166[24] U8G_FONT_SECTION("fontpage_64_1 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xa6,0xa6,0x00,0x01,0x00,0x00, 0x00,0x05,0x01,0x01,0x06,0x00,0x00,0xa8}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(7, 136, 136, fontpage_7_136_136), // 'Έ' -- 'Έ' FONTDATA_ITEM(7, 145, 157, fontpage_7_145_157), // 'Α' -- 'Ν' @@ -83,7 +86,8 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(7, 163, 167, fontpage_7_163_167), // 'Σ' -- 'Χ' FONTDATA_ITEM(7, 169, 169, fontpage_7_169_169), // 'Ω' -- 'Ω' FONTDATA_ITEM(7, 172, 175, fontpage_7_172_175), // 'ά' -- 'ί' - FONTDATA_ITEM(7, 177, 199, fontpage_7_177_199), // 'α' -- 'χ' + FONTDATA_ITEM(7, 177, 181, fontpage_7_177_181), // 'α' -- 'ε' + FONTDATA_ITEM(7, 183, 199, fontpage_7_183_199), // 'η' -- 'χ' FONTDATA_ITEM(7, 201, 201, fontpage_7_201_201), // 'ω' -- 'ω' FONTDATA_ITEM(7, 204, 206, fontpage_7_204_206), // 'ό' -- 'ώ' FONTDATA_ITEM(64, 166, 166, fontpage_64_166_166), // '…' -- '…' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_en.h b/Marlin/src/lcd/dogm/fontdata/langdata_en.h index 51210a4394..ffda82764f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_en.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_en.h @@ -5,5 +5,5 @@ */ #include -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_es.h b/Marlin/src/lcd/dogm/fontdata/langdata_es.h index 51210a4394..ffda82764f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_es.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_es.h @@ -5,5 +5,5 @@ */ #include -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_eu.h b/Marlin/src/lcd/dogm/fontdata/langdata_eu.h index 51210a4394..ffda82764f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_eu.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_eu.h @@ -5,5 +5,5 @@ */ #include -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_fi.h b/Marlin/src/lcd/dogm/fontdata/langdata_fi.h index 51210a4394..ffda82764f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_fi.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_fi.h @@ -5,5 +5,5 @@ */ #include -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_fr.h b/Marlin/src/lcd/dogm/fontdata/langdata_fr.h index 51210a4394..ffda82764f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_fr.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_fr.h @@ -5,5 +5,5 @@ */ #include -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_gl.h b/Marlin/src/lcd/dogm/fontdata/langdata_gl.h index 51210a4394..ffda82764f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_gl.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_gl.h @@ -5,5 +5,5 @@ */ #include -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_hr.h b/Marlin/src/lcd/dogm/fontdata/langdata_hr.h index 88254cdc67..63fea945b2 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_hr.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_hr.h @@ -22,7 +22,7 @@ const u8g_fntpgm_uint8_t fontpage_2_254_254[31] U8G_FONT_SECTION("fontpage_2_254 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfe,0xfe,0x00,0x08,0x00,0x00, 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0xf8,0x10,0x20,0x40,0xf8}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(2, 135, 135, fontpage_2_135_135), // 'ć' -- 'ć' FONTDATA_ITEM(2, 140, 141, fontpage_2_140_141), // 'Č' -- 'č' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_it.h b/Marlin/src/lcd/dogm/fontdata/langdata_it.h index 51210a4394..ffda82764f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_it.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_it.h @@ -5,5 +5,5 @@ */ #include -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_jp-kana.h b/Marlin/src/lcd/dogm/fontdata/langdata_jp-kana.h index 2a2229e27e..e2ff9129b4 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_jp-kana.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_jp-kana.h @@ -95,7 +95,7 @@ const u8g_fntpgm_uint8_t fontpage_97_252_252[24] U8G_FONT_SECTION("fontpage_97_2 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,0x00,0x03,0x00,0x00, 0x00,0x05,0x01,0x01,0x06,0x00,0x02,0xf8}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(97, 161, 164, fontpage_97_161_164), // 'ァ' -- 'イ' FONTDATA_ITEM(97, 166, 166, fontpage_97_166_166), // 'ウ' -- 'ウ' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h b/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h index 622a536414..9f20e7b401 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_ko_KR.h @@ -424,7 +424,7 @@ const u8g_fntpgm_uint8_t fontpage_431_136_136[34] U8G_FONT_SECTION("fontpage_431 0x00,0x08,0x0b,0x0b,0x0a,0x01,0xfe,0x71,0x01,0xfd,0x01,0x71,0x49,0x89,0x49,0x71, 0x01,0x01}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(344, 240, 240, fontpage_344_240_240), // '거' -- '거' FONTDATA_ITEM(345, 224, 224, fontpage_345_224_224), // '고' -- '고' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_nl.h b/Marlin/src/lcd/dogm/fontdata/langdata_nl.h index 51210a4394..ffda82764f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_nl.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_nl.h @@ -5,5 +5,5 @@ */ #include -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_pl.h b/Marlin/src/lcd/dogm/fontdata/langdata_pl.h index 2f2e48e4b0..0cc607468e 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_pl.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_pl.h @@ -28,7 +28,7 @@ const u8g_fntpgm_uint8_t fontpage_2_252_252[30] U8G_FONT_SECTION("fontpage_2_252 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfc,0xfc,0x00,0x07,0x00,0x00, 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x20,0x00,0xf8,0x10,0x20,0x40,0xf8}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(2, 133, 133, fontpage_2_133_133), // 'ą' -- 'ą' FONTDATA_ITEM(2, 135, 135, fontpage_2_135_135), // 'ć' -- 'ć' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_pt-br.h b/Marlin/src/lcd/dogm/fontdata/langdata_pt-br.h index 51210a4394..ffda82764f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_pt-br.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_pt-br.h @@ -5,5 +5,5 @@ */ #include -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_pt.h b/Marlin/src/lcd/dogm/fontdata/langdata_pt.h index 51210a4394..ffda82764f 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_pt.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_pt.h @@ -5,5 +5,5 @@ */ #include -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {}; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_ru.h b/Marlin/src/lcd/dogm/fontdata/langdata_ru.h index 43650b54dd..85a0bde3ab 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_ru.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_ru.h @@ -67,7 +67,7 @@ const u8g_fntpgm_uint8_t fontpage_8_209_209[30] U8G_FONT_SECTION("fontpage_8_209 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd1,0xd1,0x00,0x07,0x00,0x00, 0x00,0x05,0x07,0x07,0x06,0x00,0x00,0x50,0x00,0x70,0x88,0xf0,0x80,0x70}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(8, 144, 152, fontpage_8_144_152), // 'А' -- 'И' FONTDATA_ITEM(8, 154, 168, fontpage_8_154_168), // 'К' -- 'Ш' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_sk.h b/Marlin/src/lcd/dogm/fontdata/langdata_sk.h index 37e10057c3..a75fa2c926 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_sk.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_sk.h @@ -38,15 +38,12 @@ const u8g_fntpgm_uint8_t fontpage_2_228_229[49] U8G_FONT_SECTION("fontpage_2_228 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0xf8,0x20,0x20,0x20,0x20,0x20, 0x20,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0x20,0x20,0xf8,0x20,0x20,0x20, 0x18}; -const u8g_fntpgm_uint8_t fontpage_2_239_239[31] U8G_FONT_SECTION("fontpage_2_239_239") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x08,0x00,0x00, - 0x00,0x05,0x08,0x08,0x06,0x00,0x00,0x20,0x50,0x20,0x88,0x88,0x88,0x88,0x70}; const u8g_fntpgm_uint8_t fontpage_2_253_254[47] U8G_FONT_SECTION("fontpage_2_253_254") = { 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xfd,0xfe,0x00,0x0a,0x00,0x00, 0x00,0x05,0x0a,0x0a,0x06,0x00,0x00,0x50,0x20,0x00,0xf8,0x08,0x10,0x20,0x40,0x80, 0xf8,0x05,0x08,0x08,0x06,0x00,0x00,0x50,0x20,0x00,0xf8,0x10,0x20,0x40,0xf8}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(2, 140, 143, fontpage_2_140_143), // 'Č' -- 'ď' FONTDATA_ITEM(2, 185, 186, fontpage_2_185_186), // 'Ĺ' -- 'ĺ' @@ -55,6 +52,5 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(2, 212, 213, fontpage_2_212_213), // 'Ŕ' -- 'ŕ' FONTDATA_ITEM(2, 224, 225, fontpage_2_224_225), // 'Š' -- 'š' FONTDATA_ITEM(2, 228, 229, fontpage_2_228_229), // 'Ť' -- 'ť' - FONTDATA_ITEM(2, 239, 239, fontpage_2_239_239), // 'ů' -- 'ů' FONTDATA_ITEM(2, 253, 254, fontpage_2_253_254), // 'Ž' -- 'ž' }; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_test.h b/Marlin/src/lcd/dogm/fontdata/langdata_test.h index 875071abea..033188359d 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_test.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_test.h @@ -217,7 +217,7 @@ const u8g_fntpgm_uint8_t fontpage_97_193_255[753] U8G_FONT_SECTION("fontpage_97_ 0x28,0x80,0x60,0x10,0x08,0x05,0x06,0x06,0x06,0x00,0x00,0xf8,0x08,0x08,0x08,0x08, 0x08}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(8, 128, 255, fontpage_8_128_255), // 'Ѐ' -- 'ѿ' FONTDATA_ITEM(97, 129, 191, fontpage_97_129_191), // 'め' -- 'タ' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_tr.h b/Marlin/src/lcd/dogm/fontdata/langdata_tr.h index 23850ecfd7..b85a19f547 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_tr.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_tr.h @@ -13,13 +13,14 @@ const u8g_fntpgm_uint8_t fontpage_2_176_177[43] U8G_FONT_SECTION("fontpage_2_176 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb0,0xb1,0x00,0x09,0x00,0x00, 0x00,0x03,0x09,0x09,0x06,0x01,0x00,0x40,0x00,0xe0,0x40,0x40,0x40,0x40,0x40,0xe0, 0x03,0x05,0x05,0x06,0x01,0x00,0xc0,0x40,0x40,0x40,0xe0}; -const u8g_fntpgm_uint8_t fontpage_2_223_223[30] U8G_FONT_SECTION("fontpage_2_223_223") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xdf,0xdf,0x00,0x05,0xfe,0x00, - 0x00,0x05,0x07,0x07,0x06,0x00,0xfe,0x78,0x80,0x70,0x08,0xf0,0x10,0x60}; +const u8g_fntpgm_uint8_t fontpage_2_222_223[45] U8G_FONT_SECTION("fontpage_2_222_223") = { + 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xde,0xdf,0x00,0x07,0xfe,0x00, + 0x00,0x05,0x09,0x09,0x06,0x00,0xfe,0x70,0x88,0x80,0x70,0x08,0x88,0x70,0x10,0x60, + 0x05,0x07,0x07,0x06,0x00,0xfe,0x78,0x80,0x70,0x08,0xf0,0x10,0x60}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(2, 159, 159, fontpage_2_159_159), // 'ğ' -- 'ğ' FONTDATA_ITEM(2, 176, 177, fontpage_2_176_177), // 'İ' -- 'ı' - FONTDATA_ITEM(2, 223, 223, fontpage_2_223_223), // 'ş' -- 'ş' + FONTDATA_ITEM(2, 222, 223, fontpage_2_222_223), // 'Ş' -- 'ş' }; diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_uk.h b/Marlin/src/lcd/dogm/fontdata/langdata_uk.h index 9886e41d2e..d6e8337fd8 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_uk.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_uk.h @@ -76,7 +76,7 @@ const u8g_fntpgm_uint8_t fontpage_8_214_214[29] U8G_FONT_SECTION("fontpage_8_214 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xd6,0xd6,0x00,0x06,0x00,0x00, 0x00,0x03,0x06,0x06,0x06,0x01,0x00,0x40,0x00,0xc0,0x40,0x40,0xe0}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(8, 134, 134, fontpage_8_134_134), // 'І' -- 'І' FONTDATA_ITEM(8, 144, 146, fontpage_8_144_146), // 'А' -- 'В' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h b/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h index e2e8788577..87183cd5df 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_zh_CN.h @@ -5,6 +5,9 @@ */ #include +const u8g_fntpgm_uint8_t fontpage_64_157_157[26] U8G_FONT_SECTION("fontpage_64_157_157") = { + 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9d,0x9d,0x00,0x07,0x00,0x00, + 0x00,0x05,0x03,0x03,0x06,0x00,0x04,0xd8,0x48,0x90}; const u8g_fntpgm_uint8_t fontpage_69_191_191[28] U8G_FONT_SECTION("fontpage_69_191_191") = { 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbf,0xbf,0x00,0x05,0x00,0x00, 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x08,0x18,0x28,0x48,0xf8}; @@ -261,6 +264,10 @@ const u8g_fntpgm_uint8_t fontpage_172_180_180[45] U8G_FONT_SECTION("fontpage_172 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xb4,0xb4,0x00,0x0a,0xff,0x00, 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x02,0xa0,0xeb,0xc0,0xaa,0xa0,0xbf,0xe0,0xa4, 0x80,0xaf,0xe0,0xf9,0x20,0x0f,0xe0,0x09,0x20,0x0f,0xe0,0x11,0x20}; +const u8g_fntpgm_uint8_t fontpage_172_244_244[45] U8G_FONT_SECTION("fontpage_172_244_244") = { + 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xf4,0xf4,0x00,0x0a,0xff,0x00, + 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x01,0x00,0xef,0xe0,0xa5,0x40,0xaf,0xe0,0xa4, + 0x40,0xa7,0xc0,0xe4,0x40,0x07,0xc0,0x04,0x40,0x07,0xc0,0x0c,0x60}; const u8g_fntpgm_uint8_t fontpage_173_222_222[45] U8G_FONT_SECTION("fontpage_173_222_222") = { 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xde,0xde,0x00,0x0a,0xff,0x00, 0x00,0x0a,0x0b,0x16,0x0c,0x01,0xff,0xff,0xc0,0x80,0x40,0x80,0x40,0x9e,0x40,0x92, @@ -681,10 +688,6 @@ const u8g_fntpgm_uint8_t fontpage_223_192_192[45] U8G_FONT_SECTION("fontpage_223 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0x00,0x0a,0xff,0x00, 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x44,0x80,0x3e,0x80,0x12,0xe0,0x9e,0xa0,0x53, 0xa0,0x3e,0xa0,0x28,0xa0,0xdf,0xa0,0x4a,0x40,0x52,0xa0,0x65,0x20}; -const u8g_fntpgm_uint8_t fontpage_224_237_237[43] U8G_FONT_SECTION("fontpage_224_237_237") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xed,0xed,0x00,0x09,0xff,0x00, - 0x00,0x0b,0x0a,0x14,0x0c,0x00,0xff,0xff,0xe0,0x04,0x00,0x24,0x40,0x24,0x40,0x24, - 0x80,0x4a,0x00,0x0a,0x00,0x11,0x00,0x20,0xe0,0xc0,0x40}; const u8g_fntpgm_uint8_t fontpage_224_239_239[45] U8G_FONT_SECTION("fontpage_224_239_239") = { 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x0a,0xff,0x00, 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x00,0x17,0xe0,0x54,0x80,0x58,0x80,0x50, @@ -1031,8 +1034,9 @@ const u8g_fntpgm_uint8_t fontpage_510_154_154[30] U8G_FONT_SECTION("fontpage_510 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9a,0x9a,0x00,0x08,0x00,0x00, 0x00,0x02,0x07,0x07,0x0c,0x06,0x01,0xc0,0xc0,0x00,0x00,0x00,0xc0,0xc0}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { + FONTDATA_ITEM(64, 157, 157, fontpage_64_157_157), // '”' -- '”' FONTDATA_ITEM(69, 191, 191, fontpage_69_191_191), // '⊿' -- '⊿' FONTDATA_ITEM(156, 128, 128, fontpage_156_128_128), // '一' -- '一' FONTDATA_ITEM(156, 137, 139, fontpage_156_137_139), // '三' -- '下' @@ -1095,6 +1099,7 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(169, 140, 140, fontpage_169_140_140), // '和' -- '和' FONTDATA_ITEM(171, 183, 183, fontpage_171_183_183), // '喷' -- '喷' FONTDATA_ITEM(172, 180, 180, fontpage_172_180_180), // '嘴' -- '嘴' + FONTDATA_ITEM(172, 244, 244, fontpage_172_244_244), // '噴' -- '噴' FONTDATA_ITEM(173, 222, 222, fontpage_173_222_222), // '回' -- '回' FONTDATA_ITEM(173, 224, 224, fontpage_173_224_224), // '因' -- '因' FONTDATA_ITEM(173, 254, 254, fontpage_173_254_254), // '图' -- '图' @@ -1199,7 +1204,6 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(220, 169, 169, fontpage_220_169_169), // '温' -- '温' FONTDATA_ITEM(221, 144, 144, fontpage_221_144_144), // '源' -- '源' FONTDATA_ITEM(223, 192, 192, fontpage_223_192_192), // '激' -- '激' - FONTDATA_ITEM(224, 237, 237, fontpage_224_237_237), // '灭' -- '灭' FONTDATA_ITEM(224, 239, 239, fontpage_224_239_239), // '灯' -- '灯' FONTDATA_ITEM(225, 185, 185, fontpage_225_185_185), // '点' -- '点' FONTDATA_ITEM(225, 237, 237, fontpage_225_237_237), // '热' -- '热' diff --git a/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h b/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h index 478eb92eaa..e1bb97ea3d 100644 --- a/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h +++ b/Marlin/src/lcd/dogm/fontdata/langdata_zh_TW.h @@ -5,6 +5,9 @@ */ #include +const u8g_fntpgm_uint8_t fontpage_64_157_157[26] U8G_FONT_SECTION("fontpage_64_157_157") = { + 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9d,0x9d,0x00,0x07,0x00,0x00, + 0x00,0x05,0x03,0x03,0x06,0x00,0x04,0xd8,0x48,0x90}; const u8g_fntpgm_uint8_t fontpage_69_191_191[28] U8G_FONT_SECTION("fontpage_69_191_191") = { 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xbf,0xbf,0x00,0x05,0x00,0x00, 0x00,0x05,0x05,0x05,0x06,0x00,0x00,0x08,0x18,0x28,0x48,0xf8}; @@ -663,10 +666,6 @@ const u8g_fntpgm_uint8_t fontpage_223_192_192[45] U8G_FONT_SECTION("fontpage_223 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0x00,0x0a,0xff,0x00, 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x44,0x80,0x3e,0x80,0x12,0xe0,0x9e,0xa0,0x53, 0xa0,0x3e,0xa0,0x28,0xa0,0xdf,0xa0,0x4a,0x40,0x52,0xa0,0x65,0x20}; -const u8g_fntpgm_uint8_t fontpage_224_237_237[43] U8G_FONT_SECTION("fontpage_224_237_237") = { - 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xed,0xed,0x00,0x09,0xff,0x00, - 0x00,0x0b,0x0a,0x14,0x0c,0x00,0xff,0xff,0xe0,0x04,0x00,0x24,0x40,0x24,0x40,0x24, - 0x80,0x4a,0x00,0x0a,0x00,0x11,0x00,0x20,0xe0,0xc0,0x40}; const u8g_fntpgm_uint8_t fontpage_224_239_239[45] U8G_FONT_SECTION("fontpage_224_239_239") = { 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0xef,0xef,0x00,0x0a,0xff,0x00, 0x00,0x0b,0x0b,0x16,0x0c,0x00,0xff,0x10,0x00,0x17,0xe0,0x54,0x80,0x58,0x80,0x50, @@ -1093,8 +1092,9 @@ const u8g_fntpgm_uint8_t fontpage_510_154_154[30] U8G_FONT_SECTION("fontpage_510 0x00,0x06,0x0c,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x9a,0x9a,0x00,0x08,0x00,0x00, 0x00,0x02,0x07,0x07,0x0c,0x06,0x01,0xc0,0xc0,0x00,0x00,0x00,0xc0,0xc0}; -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { + FONTDATA_ITEM(64, 157, 157, fontpage_64_157_157), // '”' -- '”' FONTDATA_ITEM(69, 191, 191, fontpage_69_191_191), // '⊿' -- '⊿' FONTDATA_ITEM(156, 128, 128, fontpage_156_128_128), // '一' -- '一' FONTDATA_ITEM(156, 137, 139, fontpage_156_137_139), // '三' -- '下' @@ -1257,7 +1257,6 @@ static const uxg_fontinfo_t g_fontinfo[] PROGMEM = { FONTDATA_ITEM(221, 150, 150, fontpage_221_150_150), // '準' -- '準' FONTDATA_ITEM(221, 171, 171, fontpage_221_171_171), // '溫' -- '溫' FONTDATA_ITEM(223, 192, 192, fontpage_223_192_192), // '激' -- '激' - FONTDATA_ITEM(224, 237, 237, fontpage_224_237_237), // '灭' -- '灭' FONTDATA_ITEM(224, 239, 239, fontpage_224_239_239), // '灯' -- '灯' FONTDATA_ITEM(226, 161, 161, fontpage_226_161_161), // '無' -- '無' FONTDATA_ITEM(227, 177, 177, fontpage_227_177_177), // '熱' -- '熱' diff --git a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp index 8a09c68084..d46eb85903 100644 --- a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp +++ b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp @@ -1,5 +1,5 @@ /** - * @file lcdprint_u8g.c + * @file lcdprint_u8g.cpp * @brief LCD print api for u8glib * @author Yunhui Fu (yhfudev@gmail.com) * @version 1.0 @@ -11,10 +11,7 @@ #if HAS_GRAPHICAL_LCD -#include -extern U8GLIB *pu8g; -#define _lcd_write(a) pu8g->print(a) -#define _lcd_setcursor(col, row) pu8g->setPrintPos((col), (row)); +#include "ultralcd_DOGM.h" #include "../ultralcd.h" #include "../../Marlin.h" @@ -23,42 +20,40 @@ extern U8GLIB *pu8g; #include "u8g_fontutf8.h" #include "../lcdprint.h" -int lcd_glyph_height(void) { - return u8g_GetFontBBXHeight(pu8g->getU8g()); -} +int lcd_glyph_height(void) { return u8g_GetFontBBXHeight(u8g.getU8g()); } -void lcd_moveto(int col, int row) { - _lcd_setcursor(col, row); -} +void lcd_moveto(const uint8_t col, const uint8_t row) { u8g.setPrintPos(col, row); } + +void lcd_put_int(const int i) { u8g.print(i); } // return < 0 on error // return the advanced pixels int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { if (c < 256) { - _lcd_write((char)c); - return u8g_GetFontBBXWidth(pu8g->getU8g()); + u8g.print((char)c); + return u8g_GetFontBBXWidth(u8g.getU8g()); } - unsigned int x = pu8g->getPrintCol(), - y = pu8g->getPrintRow(), - ret = uxg_DrawWchar(pu8g->getU8g(), x, y, c, max_length); - pu8g->setPrintPos(x + ret, y); + unsigned int x = u8g.getPrintCol(), + y = u8g.getPrintRow(), + ret = uxg_DrawWchar(u8g.getU8g(), x, y, c, max_length); + u8g.setPrintPos(x + ret, y); return ret; } int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) { - unsigned int x = pu8g->getPrintCol(), - y = pu8g->getPrintRow(), - ret = uxg_DrawUtf8Str(pu8g->getU8g(), x, y, utf8_str, max_length); - pu8g->setPrintPos(x + ret, y); + unsigned int x = u8g.getPrintCol(), + y = u8g.getPrintRow(), + ret = uxg_DrawUtf8Str(u8g.getU8g(), x, y, utf8_str, max_length); + u8g.setPrintPos(x + ret, y); return ret; } int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) { - unsigned int x = pu8g->getPrintCol(), - y = pu8g->getPrintRow(), - ret = uxg_DrawUtf8StrP(pu8g->getU8g(), x, y, utf8_str_P, max_length); - pu8g->setPrintPos(x + ret, y); + unsigned int x = u8g.getPrintCol(), + y = u8g.getPrintRow(), + ret = uxg_DrawUtf8StrP(u8g.getU8g(), x, y, utf8_str_P, max_length); + u8g.setPrintPos(x + ret, y); return ret; } diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index c49fa50a05..bff0cf1d20 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -30,11 +30,19 @@ #if HAS_GRAPHICAL_LCD && DISABLED(LIGHTWEIGHT_UI) #include "dogm_Statusscreen.h" +#include "ultralcd_DOGM.h" #include "../ultralcd.h" #include "../lcdprint.h" + #include "../../module/motion.h" #include "../../module/temperature.h" +#if ENABLED(FILAMENT_LCD_DISPLAY) + #include "../../feature/filwidth.h" + #include "../../module/planner.h" + #include "../../gcode/parser.h" +#endif + #if ENABLED(SDSUPPORT) #include "../../sd/cardreader.h" #endif @@ -43,74 +51,156 @@ #include "../../module/printcounter.h" #endif -FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t x, const uint8_t y) { - const char * const str = itostr3(temp); - lcd_moveto(x - (str[0] != ' ' ? 0 : str[1] != ' ' ? 1 : 2) * MENU_FONT_WIDTH / 2, y); - lcd_put_u8str(str); - lcd_put_u8str_P(PSTR(LCD_STR_DEGREE " ")); +FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, const uint8_t ty) { + const char *str = itostr3(temp); + const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1; + lcd_moveto(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty); + lcd_put_u8str(&str[3-len]); + lcd_put_wchar(LCD_STR_DEGREE[0]); } -#ifndef HEAT_INDICATOR_X - #define HEAT_INDICATOR_X 8 +#define XYZ_BASELINE (30 + INFO_FONT_ASCENT) +#define EXTRAS_BASELINE (40 + INFO_FONT_ASCENT) +#define STATUS_BASELINE (LCD_PIXEL_HEIGHT - INFO_FONT_DESCENT) + +#define DO_DRAW_BED (HAS_HEATED_BED && STATUS_BED_WIDTH && HOTENDS <= 3 && DISABLED(STATUS_COMBINE_HEATERS)) +#define DO_DRAW_FAN (HAS_FAN0 && STATUS_FAN_WIDTH && STATUS_FAN_FRAMES) +#define ANIM_HOTEND (HOTENDS && ENABLED(STATUS_HOTEND_ANIM)) +#define ANIM_BED (DO_DRAW_BED && ENABLED(STATUS_BED_ANIM)) + +#if ANIM_HOTEND || ANIM_BED + uint8_t heat_bits; +#endif +#if ANIM_HOTEND + #define HOTEND_ALT(N) TEST(heat_bits, N) +#else + #define HOTEND_ALT(N) false +#endif +#if ANIM_BED + #define BED_ALT() TEST(heat_bits, 7) +#else + #define BED_ALT() false #endif -FORCE_INLINE void _draw_heater_status(const uint8_t x, const int8_t heater, const bool blink) { +#define MAX_HOTEND_DRAW MIN(HOTENDS, ((LCD_PIXEL_WIDTH - (STATUS_LOGO_BYTEWIDTH + STATUS_FAN_BYTEWIDTH) * 8) / (STATUS_HEATERS_XSPACE))) +#define STATUS_HEATERS_BOT (STATUS_HEATERS_Y + STATUS_HEATERS_HEIGHT - 1) + +FORCE_INLINE void _draw_heater_status(const int8_t heater, const bool blink) { #if !HEATER_IDLE_HANDLER UNUSED(blink); #endif #if HAS_HEATED_BED const bool isBed = heater < 0; + #define IFBED(A,B) (isBed ? (A) : (B)) #else - constexpr bool isBed = false; + #define IFBED(A,B) (B) #endif + const bool isHeat = IFBED(BED_ALT(), HOTEND_ALT(heater)); + const uint8_t tx = IFBED(STATUS_BED_TEXT_X, STATUS_HOTEND_TEXT_X(heater)); + const float temp = IFBED(thermalManager.degBed(), thermalManager.degHotend(heater)), + target = IFBED(thermalManager.degTargetBed(), thermalManager.degTargetHotend(heater)); + + #if DISABLED(STATUS_HOTEND_ANIM) + #define STATIC_HOTEND true + #define HOTEND_DOT isHeat + #else + #define STATIC_HOTEND false + #define HOTEND_DOT false + #endif + + #if HAS_HEATED_BED && DISABLED(STATUS_BED_ANIM) + #define STATIC_BED true + #define BED_DOT isHeat + #else + #define STATIC_BED false + #define BED_DOT false + #endif + + #if ANIM_HOTEND && ENABLED(STATUS_HOTEND_INVERTED) + #define OFF_BMP(N) status_hotend##N##_b_bmp + #define ON_BMP(N) status_hotend##N##_a_bmp + #else + #define OFF_BMP(N) status_hotend##N##_a_bmp + #define ON_BMP(N) status_hotend##N##_b_bmp + #endif + + #if STATUS_HOTEND_BITMAPS > 1 + static const unsigned char* const status_hotend_gfx[STATUS_HOTEND_BITMAPS] PROGMEM = ARRAY_N(STATUS_HOTEND_BITMAPS, OFF_BMP(1), OFF_BMP(2), OFF_BMP(3), OFF_BMP(4), OFF_BMP(5), OFF_BMP(6)); + #if ANIM_HOTEND + static const unsigned char* const status_hotend_on_gfx[STATUS_HOTEND_BITMAPS] PROGMEM = ARRAY_N(STATUS_HOTEND_BITMAPS, ON_BMP(1), ON_BMP(2), ON_BMP(3), ON_BMP(4), ON_BMP(5), ON_BMP(6)); + #define HOTEND_BITMAP(N,S) (unsigned char*)pgm_read_ptr((S) ? &status_hotend_on_gfx[(N) % (STATUS_HOTEND_BITMAPS)] : &status_hotend_gfx[(N) % (STATUS_HOTEND_BITMAPS)]) + #else + #define HOTEND_BITMAP(N,S) (unsigned char*)pgm_read_ptr(&status_hotend_gfx[(N) % (STATUS_HOTEND_BITMAPS)]) + #endif + #elif ANIM_HOTEND + #define HOTEND_BITMAP(N,S) ((S) ? ON_BMP() : OFF_BMP()) + #else + #define HOTEND_BITMAP(N,S) status_hotend_a_bmp + #endif + + if (PAGE_CONTAINS(STATUS_HEATERS_Y, STATUS_HEATERS_BOT)) { + + #define BAR_TALL (STATUS_HEATERS_HEIGHT - 2) + + const float prop = target - 20, + perc = prop > 0 && temp >= 20 ? (temp - 20) / prop : 0; + uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f); + NOMORE(tall, BAR_TALL); + + #ifdef STATUS_HOTEND_ANIM + // Draw hotend bitmap, either whole or split by the heating percent + if (IFBED(0, 1)) { + const uint8_t hx = STATUS_HOTEND_X(heater), bw = STATUS_HOTEND_BYTEWIDTH(heater); + #if ENABLED(STATUS_HEAT_PERCENT) + if (isHeat && tall <= BAR_TALL) { + const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall; + u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, ph, HOTEND_BITMAP(heater, false)); + u8g.drawBitmapP(hx, STATUS_HEATERS_Y + ph, bw, tall + 1, HOTEND_BITMAP(heater, true) + ph * bw); + } + else + #endif + u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(heater, isHeat)); + } + #endif + + // Draw a heating progress bar, if specified + #if ENABLED(STATUS_HEAT_PERCENT) + + if (IFBED(true, STATIC_HOTEND) && isHeat) { + const uint8_t bx = IFBED(STATUS_BED_X + STATUS_BED_WIDTH, STATUS_HOTEND_X(heater) + STATUS_HOTEND_WIDTH(heater)) + 1; + u8g.drawFrame(bx, STATUS_HEATERS_Y, 3, STATUS_HEATERS_HEIGHT); + if (tall) { + const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall; + if (PAGE_OVER(STATUS_HEATERS_Y + ph)) + u8g.drawVLine(bx + 1, STATUS_HEATERS_Y + ph, tall); + } + } + + #endif + + } // PAGE_CONTAINS + if (PAGE_UNDER(7)) { #if HEATER_IDLE_HANDLER - const bool is_idle = ( - #if HAS_HEATED_BED - isBed ? thermalManager.is_bed_idle() : - #endif - thermalManager.is_heater_idle(heater) - ); - - if (blink || !is_idle) + const bool is_idle = IFBED(thermalManager.is_bed_idle(), thermalManager.is_heater_idle(heater)), + dodraw = (blink || !is_idle); + #else + constexpr bool dodraw = true; #endif - _draw_centered_temp(0.5 + ( - #if HAS_HEATED_BED - isBed ? thermalManager.degTargetBed() : - #endif - thermalManager.degTargetHotend(heater) - ), x, 7 - ); + if (dodraw) _draw_centered_temp(target + 0.5, tx, 7); } - if (PAGE_CONTAINS(21, 28)) { - _draw_centered_temp(0.5f + ( - #if HAS_HEATED_BED - isBed ? thermalManager.degBed() : - #endif - thermalManager.degHotend(heater) - ), x, 28 - ); + if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1)) + _draw_centered_temp(temp + 0.5f, tx, 28); - if (PAGE_CONTAINS(17, 20)) { - const uint8_t h = isBed ? 7 : HEAT_INDICATOR_X, - y = isBed ? 18 : 17; - if ( - #if HAS_HEATED_BED - isBed ? thermalManager.isHeatingBed() : - #endif - thermalManager.isHeatingHotend(heater) - ) { - u8g.setColorIndex(0); // white on black - u8g.drawBox(x + h, y, 2, 2); - u8g.setColorIndex(1); // black on white - } - else - u8g.drawBox(x + h, y, 2, 2); - } + if (IFBED(STATIC_BED && BED_DOT, STATIC_HOTEND && HOTEND_DOT) && PAGE_CONTAINS(17, 19)) { + u8g.setColorIndex(0); // set to white on black + u8g.drawBox(tx, IFBED(20-2, 20-3), 2, 2); + u8g.setColorIndex(1); // restore black on white } + } // @@ -135,153 +225,112 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const } } -FORCE_INLINE void lcd_implementation_status_message(const bool blink) { - #if ENABLED(STATUS_MESSAGE_SCROLLING) - static bool last_blink = false; +void MarlinUI::draw_status_screen() { - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(lcd_status_message); - - // If the string fits into the LCD, just print it and do not scroll it - if (slen <= LCD_WIDTH) { - - // The string isn't scrolling and may not fill the screen - lcd_put_u8str(lcd_status_message); - - // Fill the rest with spaces - while (slen < LCD_WIDTH) { - lcd_put_wchar(' '); - ++slen; - } - } - else { - // String is larger than the available space in screen. - - // Get a pointer to the next valid UTF8 character - const char *stat = lcd_status_message + status_scroll_offset; - - // Get the string remaining length - const uint8_t rlen = utf8_strlen(stat); - - // If we have enough characters to display - if (rlen >= LCD_WIDTH) { - // The remaining string fills the screen - Print it - lcd_put_u8str_max(stat, LCD_PIXEL_WIDTH); - } - else { - // The remaining string does not completely fill the screen - lcd_put_u8str_max(stat, LCD_PIXEL_WIDTH); // The string leaves space - uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters - - lcd_put_wchar('.'); // Always at 1+ spaces left, draw a dot - if (--chars) { // Draw a second dot if there's space - lcd_put_wchar('.'); - if (--chars) { - // Print a second copy of the message - lcd_put_u8str_max(lcd_status_message, LCD_PIXEL_WIDTH - ((rlen+2) * MENU_FONT_WIDTH)); - } - } - } - if (last_blink != blink) { - last_blink = blink; - - // Adjust by complete UTF8 characters - if (status_scroll_offset < slen) { - status_scroll_offset++; - while (!START_OF_UTF8_CHAR(lcd_status_message[status_scroll_offset])) - status_scroll_offset++; - } - else - status_scroll_offset = 0; - } - } - #else - UNUSED(blink); - - // Get the UTF8 character count of the string - uint8_t slen = utf8_strlen(lcd_status_message); - - // Just print the string to the LCD - lcd_put_u8str_max(lcd_status_message, LCD_PIXEL_WIDTH); - - // Fill the rest with spaces if there are missing spaces - while (slen < LCD_WIDTH) { - lcd_put_wchar(' '); - ++slen; - } + static char xstring[5], ystring[5], zstring[8]; + #if ENABLED(FILAMENT_LCD_DISPLAY) + static char wstring[5], mstring[4]; #endif -} -void lcd_impl_status_screen_0() { + // At the first page, generate new display values + if (first_page) { + #if ANIM_HOTEND || ANIM_BED + uint8_t new_bits = 0; + #if ANIM_HOTEND + HOTEND_LOOP() if (thermalManager.isHeatingHotend(e)) SBI(new_bits, e); + #endif + #if ANIM_BED + if (thermalManager.isHeatingBed()) SBI(new_bits, 7); + #endif + heat_bits = new_bits; + #endif + strcpy(xstring, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS]))); + strcpy(ystring, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS]))); + strcpy(zstring, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS]))); + #if ENABLED(FILAMENT_LCD_DISPLAY) + strcpy(wstring, ftostr12ns(filament_width_meas)); + strcpy(mstring, itostr3(100.0 * ( + parser.volumetric_enabled + ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] + : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] + ) + )); + #endif + } - const bool blink = lcd_blink(); + const bool blink = get_blink(); // Status Menu Font - lcd_setFont(FONT_STATUSMENU); + set_font(FONT_STATUSMENU); - // - // Fan Animation - // - // Draw the entire heading image bitmap rather than each element - // separately. This is an optimization because it's slower to draw - // multiple elements than a single bitmap. - // - // The bitmap: - // - May be offset in X - // - Includes all nozzle(s), bed(s), and the fan. - // - // TODO: - // - // - Only draw the whole header on the first - // entry to the status screen. Nozzle, bed, and - // fan outline bits don't change. - // - #if FAN_ANIM_FRAMES > 2 - static bool old_blink; - static uint8_t fan_frame; - if (old_blink != blink) { - old_blink = blink; - if (!fan_speed[0] || ++fan_frame >= FAN_ANIM_FRAMES) fan_frame = 0; - } + #if STATUS_LOGO_WIDTH + if (PAGE_CONTAINS(STATUS_LOGO_Y, STATUS_LOGO_Y + STATUS_LOGO_HEIGHT - 1)) + u8g.drawBitmapP(STATUS_LOGO_X, STATUS_LOGO_Y, STATUS_LOGO_BYTEWIDTH, STATUS_LOGO_HEIGHT, status_logo_bmp); #endif - if (PAGE_UNDER(STATUS_SCREENHEIGHT + 1)) - u8g.drawBitmapP( - STATUS_SCREEN_X, STATUS_SCREEN_Y, - (STATUS_SCREENWIDTH + 7) / 8, STATUS_SCREENHEIGHT, - #if HAS_FAN0 - #if FAN_ANIM_FRAMES > 2 - fan_frame == 1 ? status_screen1_bmp : - fan_frame == 2 ? status_screen2_bmp : - #if FAN_ANIM_FRAMES > 3 - fan_frame == 3 ? status_screen3_bmp : + #if STATUS_HEATERS_WIDTH + // Draw all heaters (and maybe the bed) in one go + if (PAGE_CONTAINS(STATUS_HEATERS_Y, STATUS_HEATERS_Y + STATUS_HEATERS_HEIGHT - 1)) + u8g.drawBitmapP(STATUS_HEATERS_X, STATUS_HEATERS_Y, STATUS_HEATERS_BYTEWIDTH, STATUS_HEATERS_HEIGHT, status_heaters_bmp); + #endif + + #if DO_DRAW_BED + #if ANIM_BED + #define BED_BITMAP(S) ((S) ? status_bed_on_bmp : status_bed_bmp) + #else + #define BED_BITMAP(S) status_bed_bmp + #endif + const uint8_t bedy = STATUS_BED_Y(BED_ALT()), bedh = STATUS_BED_HEIGHT(BED_ALT()); + if (PAGE_CONTAINS(bedy, bedy + bedh - 1)) + u8g.drawBitmapP(STATUS_BED_X, bedy, STATUS_BED_BYTEWIDTH, bedh, BED_BITMAP(BED_ALT())); + #endif + + #if DO_DRAW_FAN + #if STATUS_FAN_FRAMES > 2 + static bool old_blink; + static uint8_t fan_frame; + if (old_blink != blink) { + old_blink = blink; + if (!fan_speed[0] || ++fan_frame >= STATUS_FAN_FRAMES) fan_frame = 0; + } + #endif + if (PAGE_CONTAINS(STATUS_FAN_Y, STATUS_FAN_Y + STATUS_FAN_HEIGHT - 1)) + u8g.drawBitmapP( + STATUS_FAN_X, STATUS_FAN_Y, + STATUS_FAN_BYTEWIDTH, STATUS_FAN_HEIGHT, + #if STATUS_FAN_FRAMES > 2 + fan_frame == 1 ? status_fan1_bmp : + fan_frame == 2 ? status_fan2_bmp : + #if STATUS_FAN_FRAMES > 3 + fan_frame == 3 ? status_fan3_bmp : #endif - #else - blink && fan_speed[0] ? status_screen1_bmp : + #elif STATUS_FAN_FRAMES > 1 + blink && fan_speed[0] ? status_fan1_bmp : #endif - #endif - status_screen0_bmp - ); + status_fan0_bmp + ); + #endif // // Temperature Graphics and Info // - if (PAGE_UNDER(28)) { + if (PAGE_UNDER(6 + 1 + 12 + 1 + 6 + 1)) { // Extruders - HOTEND_LOOP() _draw_heater_status(STATUS_SCREEN_HOTEND_TEXT_X(e), e, blink); + for (uint8_t e = 0; e < MAX_HOTEND_DRAW; ++e) + _draw_heater_status(e, blink); // Heated bed - #if HOTENDS < 4 && HAS_HEATED_BED - _draw_heater_status(STATUS_SCREEN_BED_TEXT_X, -1, blink); + #if HAS_HEATED_BED && HOTENDS < 4 + _draw_heater_status(-1, blink); #endif - #if HAS_FAN0 - if (PAGE_CONTAINS(STATUS_SCREEN_FAN_TEXT_Y - 7, STATUS_SCREEN_FAN_TEXT_Y)) { - // Fan + // Fan, if a bitmap was provided + #if DO_DRAW_FAN + if (PAGE_CONTAINS(STATUS_FAN_TEXT_Y - INFO_FONT_ASCENT, STATUS_FAN_TEXT_Y - 1)) { const int per = ((int(fan_speed[0]) + 1) * 100) / 256; if (per) { - lcd_moveto(STATUS_SCREEN_FAN_TEXT_X, STATUS_SCREEN_FAN_TEXT_Y); + lcd_moveto(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y); lcd_put_u8str(itostr3(per)); lcd_put_wchar('%'); } @@ -312,17 +361,12 @@ void lcd_impl_status_screen_0() { #define PROGRESS_BAR_X 54 #define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X) - if (PAGE_CONTAINS(49, 52)) // 49-52 (or 49-51) - u8g.drawFrame( - PROGRESS_BAR_X, 49, - PROGRESS_BAR_WIDTH, 4 - ); + if (PAGE_CONTAINS(49, 52)) + u8g.drawFrame(PROGRESS_BAR_X, 49, PROGRESS_BAR_WIDTH, 4); - #if DISABLED(LCD_SET_PROGRESS_MANUALLY) - const uint8_t progress_bar_percent = card.percentDone(); - #endif + const uint8_t progress = get_progress(); - if (progress_bar_percent > 1) { + if (progress > 1) { // // Progress bar solid part @@ -331,7 +375,7 @@ void lcd_impl_status_screen_0() { if (PAGE_CONTAINS(50, 51)) // 50-51 (or just 50) u8g.drawBox( PROGRESS_BAR_X + 1, 50, - (uint16_t)((PROGRESS_BAR_WIDTH - 2) * progress_bar_percent * 0.01), 2 + (uint16_t)((PROGRESS_BAR_WIDTH - 2) * progress * 0.01), 2 ); // @@ -342,7 +386,7 @@ void lcd_impl_status_screen_0() { if (PAGE_CONTAINS(41, 48)) { // Percent complete lcd_moveto(55, 48); - lcd_put_u8str(itostr3(progress_bar_percent)); + lcd_put_u8str(itostr3(progress)); lcd_put_wchar('%'); } #endif @@ -358,12 +402,12 @@ void lcd_impl_status_screen_0() { #define SD_DURATION_X (LCD_PIXEL_WIDTH - len * MENU_FONT_WIDTH) #endif - if (PAGE_CONTAINS(41, 48)) { + if (PAGE_CONTAINS(EXTRAS_BASELINE - INFO_FONT_ASCENT, EXTRAS_BASELINE - 1)) { char buffer[13]; duration_t elapsed = print_job_timer.duration(); bool has_days = (elapsed.value >= 60*60*24L); uint8_t len = elapsed.toDigital(buffer, has_days); - lcd_moveto(SD_DURATION_X, 48); + lcd_moveto(SD_DURATION_X, EXTRAS_BASELINE); lcd_put_u8str(buffer); } @@ -373,11 +417,9 @@ void lcd_impl_status_screen_0() { // XYZ Coordinates // - #define XYZ_BASELINE (30 + INFO_FONT_ASCENT) - #define X_LABEL_POS 3 #define X_VALUE_POS 11 - #define XYZ_SPACING 40 + #define XYZ_SPACING 37 #if ENABLED(XYZ_HOLLOW_FRAME) #define XYZ_FRAME_TOP 29 @@ -387,27 +429,6 @@ void lcd_impl_status_screen_0() { #define XYZ_FRAME_HEIGHT INFO_FONT_ASCENT + 1 #endif - static char xstring[5], ystring[5], zstring[8]; - #if ENABLED(FILAMENT_LCD_DISPLAY) - static char wstring[5], mstring[4]; - #endif - - // At the first page, regenerate the XYZ strings - if (first_page) { - strcpy(xstring, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS]))); - strcpy(ystring, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS]))); - strcpy(zstring, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS]))); - #if ENABLED(FILAMENT_LCD_DISPLAY) - strcpy(wstring, ftostr12ns(filament_width_meas)); - strcpy(mstring, itostr3(100.0 * ( - parser.volumetric_enabled - ? planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - : planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] - ) - )); - #endif - } - if (PAGE_CONTAINS(XYZ_FRAME_TOP, XYZ_FRAME_TOP + XYZ_FRAME_HEIGHT - 1)) { #if ENABLED(XYZ_HOLLOW_FRAME) @@ -446,15 +467,16 @@ void lcd_impl_status_screen_0() { // // Feedrate // - #define EXTRAS_BASELINE 50 - if (PAGE_CONTAINS(EXTRAS_BASELINE - (INFO_FONT_HEIGHT - 1), EXTRAS_BASELINE)) { - lcd_setFont(FONT_MENU); - lcd_moveto(3, EXTRAS_BASELINE); + #define EXTRAS_2_BASELINE (EXTRAS_BASELINE + 3) + + if (PAGE_CONTAINS(EXTRAS_2_BASELINE - INFO_FONT_ASCENT, EXTRAS_2_BASELINE - 1)) { + set_font(FONT_MENU); + lcd_moveto(3, EXTRAS_2_BASELINE); lcd_put_wchar(LCD_STR_FEEDRATE[0]); - lcd_setFont(FONT_STATUSMENU); - lcd_moveto(12, EXTRAS_BASELINE); + set_font(FONT_STATUSMENU); + lcd_moveto(12, EXTRAS_2_BASELINE); lcd_put_u8str(itostr3(feedrate_percentage)); lcd_put_wchar('%'); @@ -462,15 +484,15 @@ void lcd_impl_status_screen_0() { // Filament sensor display if SD is disabled // #if ENABLED(FILAMENT_LCD_DISPLAY) && DISABLED(SDSUPPORT) - lcd_moveto(56, EXTRAS_BASELINE); + lcd_moveto(56, EXTRAS_2_BASELINE); lcd_put_u8str(wstring); - lcd_moveto(102, EXTRAS_BASELINE); + lcd_moveto(102, EXTRAS_2_BASELINE); lcd_put_u8str(mstring); lcd_put_wchar('%'); - lcd_setFont(FONT_MENU); - lcd_moveto(47, EXTRAS_BASELINE); + set_font(FONT_MENU); + lcd_moveto(47, EXTRAS_2_BASELINE); lcd_put_wchar(LCD_STR_FILAM_DIA[0]); // lcd_put_u8str_P(PSTR(LCD_STR_FILAM_DIA)); - lcd_moveto(93, EXTRAS_BASELINE); + lcd_moveto(93, EXTRAS_2_BASELINE); lcd_put_wchar(LCD_STR_FILAM_MUL[0]); #endif } @@ -479,16 +501,12 @@ void lcd_impl_status_screen_0() { // Status line // - #define STATUS_BASELINE (LCD_PIXEL_HEIGHT - INFO_FONT_DESCENT) - - if (PAGE_CONTAINS(STATUS_BASELINE - (INFO_FONT_ASCENT - 1), STATUS_BASELINE)) { + if (PAGE_CONTAINS(STATUS_BASELINE - INFO_FONT_ASCENT, STATUS_BASELINE + INFO_FONT_DESCENT)) { lcd_moveto(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 - lcd_implementation_status_message(blink); - } - else { + // Alternate Status message and Filament display + if (ELAPSED(millis(), next_filament_display)) { lcd_put_u8str_P(PSTR(LCD_STR_FILAM_DIA)); lcd_put_wchar(':'); lcd_put_u8str(wstring); @@ -497,10 +515,78 @@ void lcd_impl_status_screen_0() { lcd_put_u8str(mstring); lcd_put_wchar('%'); } - #else - lcd_implementation_status_message(blink); + else #endif + draw_status_message(blink); } } +void MarlinUI::draw_status_message(const bool blink) { + + // Get the UTF8 character count of the string + uint8_t slen = utf8_strlen(status_message); + + #if ENABLED(STATUS_MESSAGE_SCROLLING) + + static bool last_blink = false; + + if (slen <= LCD_WIDTH) { + // The string fits within the line. Print with no scrolling + lcd_put_u8str(status_message); + for (; slen < LCD_WIDTH; ++slen) lcd_put_wchar(' '); + } + else { + // String is longer than the available space + + // Get a pointer to the next valid UTF8 character + const char *stat = status_message + status_scroll_offset; + + // Get the string remaining length + const uint8_t rlen = utf8_strlen(stat); + + if (rlen >= LCD_WIDTH) { + // The remaining string fills the screen - Print it + lcd_put_u8str_max(stat, LCD_PIXEL_WIDTH); + } + else { + // The remaining string does not completely fill the screen + lcd_put_u8str_max(stat, LCD_PIXEL_WIDTH); // The string leaves space + uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters + + lcd_put_wchar('.'); // Always at 1+ spaces left, draw a dot + if (--chars) { // Draw a second dot if there's space + lcd_put_wchar('.'); + if (--chars) { + // Print a second copy of the message + lcd_put_u8str_max(status_message, LCD_PIXEL_WIDTH - (rlen + 2) * (MENU_FONT_WIDTH)); + } + } + } + if (last_blink != blink) { + last_blink = blink; + + // Adjust by complete UTF8 characters + if (status_scroll_offset < slen) { + status_scroll_offset++; + while (!START_OF_UTF8_CHAR(status_message[status_scroll_offset])) + status_scroll_offset++; + } + else + status_scroll_offset = 0; + } + } + + #else // !STATUS_MESSAGE_SCROLLING + + UNUSED(blink); + + // Just print the string to the LCD + lcd_put_u8str_max(status_message, LCD_PIXEL_WIDTH); + + // Fill the rest with spaces + for (; slen < LCD_WIDTH; ++slen) lcd_put_wchar(' '); + + #endif // !STATUS_MESSAGE_SCROLLING +} + #endif // HAS_GRAPHICAL_LCD && !LIGHTWEIGHT_UI diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index 515adb9389..126ef00b51 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -45,7 +45,7 @@ #if ENABLED(LIGHTWEIGHT_UI) -#include "status_screen_lite_ST7920_class.h" +#include "status_screen_lite_ST7920.h" #include "../ultralcd.h" #include "../fontutils.h" @@ -99,10 +99,6 @@ void ST7920_Lite_Status_Screen::write_str_P(PGM_P const str) { while (char c = pgm_read_byte(p_str++)) write_byte(c); } -void ST7920_Lite_Status_Screen::write_str(progmem_str str) { - write_str_P((PGM_P)str); -} - void ST7920_Lite_Status_Screen::write_number(const int16_t value, const uint8_t digits/*=3*/) { char str[7]; PGM_P fmt; @@ -230,12 +226,8 @@ void ST7920_Lite_Status_Screen::load_cgram_icon(const uint16_t addr, const void */ void ST7920_Lite_Status_Screen::draw_gdram_icon(uint8_t x, uint8_t y, const void *data) { const uint16_t *p_word = (const uint16_t *)data; - if (y > 2) { // Handle display folding - y -= 2; - x += 8; - } - --x; - --y; + // Handle display folding + if (y > 1) y -= 2, x += 8; for (int i = 0; i < 16; i++) { set_gdram_address(x, i + y * 16); begin_data(); @@ -398,24 +390,20 @@ const uint16_t feedrate_icon[] PROGMEM = { /************************** MAIN SCREEN *************************************/ -// The ST7920 does not have a degree character, but we -// can fake it by writing it to GDRAM. -// This function takes as an argument character positions -// i.e x is [1-16], while the y position is [1-4] -void ST7920_Lite_Status_Screen::draw_degree_symbol(uint8_t x, uint8_t y, bool draw) { +/** + * The ST7920 has no degree character, so draw it to GDRAM. + * This function takes character position xy + * i.e., x is [0-15], while the y position is [0-3] + */ +void ST7920_Lite_Status_Screen::draw_degree_symbol(uint8_t x, uint8_t y, const bool draw) { const uint8_t *p_bytes = degree_symbol; - if (y > 2) { - // Handle display folding - y -= 2; - x += 16; - } - x -= 1; - y -= 1; + // Handle display folding + if (y > 1) y -= 2, x += 16; const bool oddChar = x & 1; - const uint8_t x_word = x >> 1; - const uint8_t y_top = degree_symbol_y_top; - const uint8_t y_bot = y_top + sizeof(degree_symbol)/sizeof(degree_symbol[0]); - for(uint8_t i = y_top; i < y_bot; i++) { + const uint8_t x_word = x >> 1, + y_top = degree_symbol_y_top, + y_bot = y_top + sizeof(degree_symbol)/sizeof(degree_symbol[0]); + for (uint8_t i = y_top; i < y_bot; i++) { uint8_t byte = pgm_read_byte(p_bytes++); set_gdram_address(x_word, i + y * 16); begin_data(); @@ -438,14 +426,14 @@ void ST7920_Lite_Status_Screen::draw_static_elements() { load_cgram_icon(CGRAM_ICON_4_ADDR, fan2_icon); // Draw the static icons in GDRAM - draw_gdram_icon(1, 1, nozzle_icon); + draw_gdram_icon(0, 0, nozzle_icon); #if HOTENDS > 1 - draw_gdram_icon(1,2,nozzle_icon); - draw_gdram_icon(1,3,bed_icon); + draw_gdram_icon(0, 1, nozzle_icon); + draw_gdram_icon(0, 2, bed_icon); #else - draw_gdram_icon(1,2,bed_icon); + draw_gdram_icon(0, 1, bed_icon); #endif - draw_gdram_icon(6,2,feedrate_icon); + draw_gdram_icon(5, 1, feedrate_icon); // Draw the initial fan icon draw_fan_icon(false); @@ -462,15 +450,15 @@ void ST7920_Lite_Status_Screen::draw_static_elements() { void ST7920_Lite_Status_Screen::draw_progress_bar(const uint8_t value) { #if HOTENDS == 1 // If we have only one extruder, draw a long progress bar on the third line - const uint8_t top = 1, // Top in pixels - bottom = 13, // Bottom in pixels - left = 12, // Left edge, in 16-bit words - width = 4; // Width of progress bar, in 16-bit words + constexpr uint8_t top = 1, // Top in pixels + bottom = 13, // Bottom in pixels + left = 12, // Left edge, in 16-bit words + width = 4; // Width of progress bar, in 16-bit words #else - const uint8_t top = 16 + 1, - bottom = 16 + 13, - left = 5, - width = 3; + constexpr uint8_t top = 16 + 1, + bottom = 16 + 13, + left = 5, + width = 3; #endif const uint8_t char_pcnt = 100 / width; // How many percent does each 16-bit word represent? @@ -509,11 +497,11 @@ void ST7920_Lite_Status_Screen::draw_progress_bar(const uint8_t value) { // Draw centered if (value > 9) { write_number(value, 4); - write_str(F("% ")); + write_str_P(PSTR("% ")); } else { write_number(value, 3); - write_str(F("% ")); + write_str_P(PSTR("% ")); } } @@ -557,42 +545,42 @@ static struct { void ST7920_Lite_Status_Screen::draw_temps(uint8_t line, const int16_t temp, const int16_t target, bool showTarget, bool targetStateChange) { switch (line) { - case 1: set_ddram_address(DDRAM_LINE_1 + 1); break; - case 2: set_ddram_address(DDRAM_LINE_2 + 1); break; + case 0: set_ddram_address(DDRAM_LINE_1 + 1); break; + case 1: set_ddram_address(DDRAM_LINE_2 + 1); break; + case 2: set_ddram_address(DDRAM_LINE_3 + 1); break; case 3: set_ddram_address(DDRAM_LINE_3 + 1); break; - case 4: set_ddram_address(DDRAM_LINE_3 + 1); break; } begin_data(); write_number(temp); if (showTarget) { - write_str(F("\x1A")); + write_byte('\x1A'); write_number(target); }; if (targetStateChange) { - if (!showTarget) write_str(F(" ")); - draw_degree_symbol(6, line, !showTarget); - draw_degree_symbol(10, line, showTarget); + if (!showTarget) write_str_P(PSTR(" ")); + draw_degree_symbol(5, line, !showTarget); + draw_degree_symbol(9, line, showTarget); } } void ST7920_Lite_Status_Screen::draw_extruder_1_temp(const int16_t temp, const int16_t target, bool forceUpdate) { const bool show_target = target && FAR(temp, target); - draw_temps(1, temp, target, show_target, display_state.E1_show_target != show_target || forceUpdate); + draw_temps(0, temp, target, show_target, display_state.E1_show_target != show_target || forceUpdate); display_state.E1_show_target = show_target; } void ST7920_Lite_Status_Screen::draw_extruder_2_temp(const int16_t temp, const int16_t target, bool forceUpdate) { const bool show_target = target && FAR(temp, target); - draw_temps(2, temp, target, show_target, display_state.E2_show_target != show_target || forceUpdate); + draw_temps(1, temp, target, show_target, display_state.E2_show_target != show_target || forceUpdate); display_state.E2_show_target = show_target; } #if HAS_HEATED_BED void ST7920_Lite_Status_Screen::draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate) { const bool show_target = target && FAR(temp, target); - draw_temps(2 + draw_temps(1 #if HOTENDS > 1 + 1 #endif @@ -632,44 +620,38 @@ void ST7920_Lite_Status_Screen::draw_feedrate_percentage(const uint16_t percenta #endif } -void ST7920_Lite_Status_Screen::draw_status_message(const char *str) { +void ST7920_Lite_Status_Screen::draw_status_message() { + const char *str = ui.status_message; + set_ddram_address(DDRAM_LINE_4); begin_data(); - const uint8_t lcd_len = 16; #if ENABLED(STATUS_MESSAGE_SCROLLING) uint8_t slen = utf8_strlen(str); - // If the string fits into the LCD, just print it and do not scroll it - if (slen <= lcd_len) { - - // The string isn't scrolling and may not fill the screen + if (slen <= LCD_WIDTH) { + // String fits the LCD, so just print it write_str(str); - - // Fill the rest with spaces - while (slen < lcd_len) { - write_byte(' '); - ++slen; - } + for (; slen < LCD_WIDTH; ++slen) write_byte(' '); } else { // String is larger than the available space in screen. // Get a pointer to the next valid UTF8 character - const char *stat = str + status_scroll_offset; + const char *stat = str + ui.status_scroll_offset; // Get the string remaining length const uint8_t rlen = utf8_strlen(stat); // If we have enough characters to display - if (rlen >= lcd_len) { + if (rlen >= LCD_WIDTH) { // The remaining string fills the screen - Print it - write_str(stat, lcd_len); + write_str(stat, LCD_WIDTH); } else { // The remaining string does not completely fill the screen write_str(stat); // The string leaves space - uint8_t chars = lcd_len - rlen; // Amount of space left in characters + uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters write_byte('.'); // Always at 1+ spaces left, draw a dot if (--chars) { // Draw a second dot if there's space @@ -680,26 +662,21 @@ void ST7920_Lite_Status_Screen::draw_status_message(const char *str) { } // Adjust by complete UTF8 characters - if (status_scroll_offset < slen) { - status_scroll_offset++; - while (!START_OF_UTF8_CHAR(str[status_scroll_offset])) - status_scroll_offset++; + if (ui.status_scroll_offset < slen) { + ui.status_scroll_offset++; + while (!START_OF_UTF8_CHAR(str[ui.status_scroll_offset])) + ui.status_scroll_offset++; } else - status_scroll_offset = 0; + ui.status_scroll_offset = 0; } + #else - // Get the UTF8 character count of the string + uint8_t slen = utf8_strlen(str); + write_str(str, LCD_WIDTH); + for (; slen < LCD_WIDTH; ++slen) write_byte(' '); - // Just print the string to the LCD - write_str(str, lcd_len); - - // Fill the rest with spaces if there are missing spaces - while (slen < lcd_len) { - write_byte(' '); - ++slen; - } #endif } @@ -709,7 +686,7 @@ void ST7920_Lite_Status_Screen::draw_position(const float x, const float y, cons begin_data(); // If position is unknown, flash the labels. - const unsigned char alt_label = position_known ? 0 : (lcd_blink() ? ' ' : 0); + const unsigned char alt_label = position_known ? 0 : (ui.get_blink() ? ' ' : 0); dtostrf(x, -4, 0, str); write_byte(alt_label ? alt_label : 'X'); @@ -728,7 +705,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() { // We only add the target temperatures to the checksum // because the actual temps fluctuate so by updating // them only during blinks we gain a bit of stability. - const bool blink = lcd_blink(); + const bool blink = ui.get_blink(); const uint16_t feedrate_perc = feedrate_percentage; const uint8_t fs = (((uint16_t)fan_speed[0] + 1) * 100) / 256; const int16_t extruder_1_target = thermalManager.degTargetHotend(0); @@ -754,7 +731,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() { void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) { if (forceUpdate || indicators_changed()) { - const bool blink = lcd_blink(); + const bool blink = ui.get_blink(); const duration_t elapsed = print_job_timer.duration(); const uint16_t feedrate_perc = feedrate_percentage; const uint8_t fs = (((uint16_t)fan_speed[0] + 1) * 100) / 256; @@ -783,41 +760,32 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) { // Update the fan and bed animations if (fs) draw_fan_icon(blink); #if HAS_HEATED_BED - if (bed_target > 0) - draw_heat_icon(blink, true); - else - draw_heat_icon(false, false); + draw_heat_icon(bed_target > 0 && blink, bed_target > 0); #endif } } bool ST7920_Lite_Status_Screen::position_changed() { - const float x_pos = current_position[X_AXIS], - y_pos = current_position[Y_AXIS], - z_pos = current_position[Z_AXIS]; + const float x_pos = current_position[X_AXIS], y_pos = current_position[Y_AXIS], z_pos = current_position[Z_AXIS]; const uint8_t checksum = uint8_t(x_pos) ^ uint8_t(y_pos) ^ uint8_t(z_pos); - - static uint8_t last_checksum = 0; - if (last_checksum == checksum) return false; - last_checksum = checksum; - return true; + static uint8_t last_checksum = 0, changed = last_checksum != checksum; + if (changed) last_checksum = checksum; + return changed; } bool ST7920_Lite_Status_Screen::status_changed() { uint8_t checksum = 0; - for (const char *p = lcd_status_message; *p; p++) checksum ^= *p; - static uint8_t last_checksum = 0; - if (last_checksum == checksum) return false; - last_checksum = checksum; - return true; + for (const char *p = ui.status_message; *p; p++) checksum ^= *p; + static uint8_t last_checksum = 0, changed = last_checksum != checksum; + if (changed) last_checksum = checksum; + return changed; } bool ST7920_Lite_Status_Screen::blink_changed() { static uint8_t last_blink = 0; - const bool blink = lcd_blink(); - if (last_blink == blink) return false; - last_blink = blink; - return true; + const bool blink = ui.get_blink(), changed = last_blink != blink; + if (changed) last_blink = blink; + return changed; } #ifndef STATUS_EXPIRE_SECONDS @@ -831,60 +799,56 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) { #endif /** - * There is only enough room in the display for either the - * status message or the position, not both, so we choose - * one or another. Whenever the status message changes, - * we show it for a number of consecutive seconds, but - * then go back to showing the position as soon as the - * head moves, i.e: + * There's only enough room for either the status message or the position, + * so draw one or the other. When the status message changes, show it for + * a few seconds, then return to the position display once the head moves. * - * countdown > 1 -- Show status - * countdown = 1 -- Show status, until movement - * countdown = 0 -- Show position + * countdown > 1 -- Show status + * countdown = 1 -- Show status, until movement + * countdown = 0 -- Show position * - * If STATUS_EXPIRE_SECONDS is zero, the position display - * will be disabled and only the status will be shown. + * If STATUS_EXPIRE_SECONDS is zero, only the status is shown. */ if (forceUpdate || status_changed()) { #if ENABLED(STATUS_MESSAGE_SCROLLING) - status_scroll_offset = 0; + ui.status_scroll_offset = 0; #endif #if STATUS_EXPIRE_SECONDS - countdown = lcd_status_message[0] ? STATUS_EXPIRE_SECONDS : 0; + countdown = ui.status_message[0] ? STATUS_EXPIRE_SECONDS : 0; #endif - draw_status_message(lcd_status_message); + draw_status_message(); blink_changed(); // Clear changed flag } #if !STATUS_EXPIRE_SECONDS #if ENABLED(STATUS_MESSAGE_SCROLLING) else - draw_status_message(lcd_status_message); + draw_status_message(); #endif #else - else if (countdown > 1 && blink_changed()) { - countdown--; - #if ENABLED(STATUS_MESSAGE_SCROLLING) - draw_status_message(lcd_status_message); - #endif - } - else if (countdown > 0 && blink_changed()) { - if (position_changed()) { + else if (blink_changed()) { + if (countdown > 1) { countdown--; - forceUpdate = true; + #if ENABLED(STATUS_MESSAGE_SCROLLING) + draw_status_message(); + #endif + } + else if (countdown > 0) { + if (position_changed()) { + countdown--; + forceUpdate = true; + } + #if ENABLED(STATUS_MESSAGE_SCROLLING) + draw_status_message(); + #endif } - #if ENABLED(STATUS_MESSAGE_SCROLLING) - draw_status_message(lcd_status_message); - #endif } + if (countdown == 0 && (forceUpdate || position_changed() || #if DISABLED(DISABLE_REDUCED_ACCURACY_WARNING) blink_changed() #endif )) { - draw_position( - current_position[X_AXIS], - current_position[Y_AXIS], - current_position[Z_AXIS], + draw_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], #if ENABLED(DISABLE_REDUCED_ACCURACY_WARNING) true #else @@ -898,24 +862,16 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) { void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) { #if ENABLED(LCD_SET_PROGRESS_MANUALLY) || ENABLED(SDSUPPORT) - #if DISABLED(LCD_SET_PROGRESS_MANUALLY) - uint8_t progress_bar_percent = 0; - #endif - - #if ENABLED(SDSUPPORT) - // Progress bar % comes from SD when actively printing - if (IS_SD_PRINTING()) progress_bar_percent = card.percentDone(); - #endif - // Since the progress bar involves writing // quite a few bytes to GDRAM, only do this // when an update is actually necessary. static uint8_t last_progress = 0; - if (!forceUpdate && last_progress == progress_bar_percent) return; - last_progress = progress_bar_percent; - - draw_progress_bar(progress_bar_percent); + const uint8_t progress = ui.get_progress(); + if (forceUpdate || last_progress != progress) { + last_progress = progress; + draw_progress_bar(progress); + } #else @@ -956,8 +912,7 @@ void ST7920_Lite_Status_Screen::on_exit() { } // This is called prior to the KILL screen to -// clear the screen so we don't end up with a -// garbled display. +// clear the screen, preventing a garbled display. void ST7920_Lite_Status_Screen::clear_text_buffer() { cs(); reset_state_from_unknown(); @@ -966,23 +921,42 @@ void ST7920_Lite_Status_Screen::clear_text_buffer() { ncs(); } -void lcd_impl_status_screen_0() { +#if ENABLED(U8GLIB_ST7920) && !defined(U8G_HAL_LINKS) && !defined(__SAM3X8E__) + + #include "ultralcd_st7920_u8glib_rrd_AVR.h" + + void ST7920_Lite_Status_Screen::cs() { + ST7920_CS(); + current_bits.synced = false; + } + + void ST7920_Lite_Status_Screen::ncs() { + ST7920_NCS(); + current_bits.synced = false; + } + + void ST7920_Lite_Status_Screen::sync_cmd() { + ST7920_SET_CMD(); + } + + void ST7920_Lite_Status_Screen::sync_dat() { + ST7920_SET_DAT(); + } + + void ST7920_Lite_Status_Screen::write_byte(const uint8_t data) { + ST7920_WRITE_BYTE(data); + } + +#endif + +void MarlinUI::draw_status_screen() { ST7920_Lite_Status_Screen::update(false); } -/** - * In order to properly update the lite Status Screen, - * we must know when we have entered and left the - * Status Screen. Since the ultralcd code is not - * set up for doing this, we call this function before - * each update indicating whether the current screen - * is the Status Screen. - * - * This function keeps track of whether we have left or - * entered the Status Screen and calls the on_entry() - * and on_exit() methods for cleanup. - */ -void lcd_in_status(const bool inStatus) { +// This method is called before each screen update and +// fires on_entry() and on_exit() events upon entering +// or exiting the Status Screen. +void MarlinUI::lcd_in_status(const bool inStatus) { static bool lastInStatus = false; if (lastInStatus == inStatus) return; if ((lastInStatus = inStatus)) diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920_class.h b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h similarity index 95% rename from Marlin/src/lcd/dogm/status_screen_lite_ST7920_class.h rename to Marlin/src/lcd/dogm/status_screen_lite_ST7920.h index 323d951c36..8a19030d6b 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920_class.h +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h @@ -18,8 +18,6 @@ #include "../../core/macros.h" #include "../../libs/duration_t.h" -typedef const __FlashStringHelper *progmem_str; - class ST7920_Lite_Status_Screen { private: static struct st7920_state_t { @@ -47,7 +45,6 @@ class ST7920_Lite_Status_Screen { static void write_str(const char *str); static void write_str(const char *str, const uint8_t len); static void write_str_P(PGM_P const str); - static void write_str(progmem_str str); static void write_number(const int16_t value, const uint8_t digits=3); static void _extended_function_set(const bool extended, const bool graphics); @@ -74,7 +71,7 @@ class ST7920_Lite_Status_Screen { static uint8_t string_checksum(const char *str); protected: - static void draw_degree_symbol(uint8_t x, uint8_t y, bool draw); + static void draw_degree_symbol(uint8_t x, uint8_t y, const bool draw); static void draw_static_elements(); static void draw_progress_bar(const uint8_t value); static void draw_fan_icon(const bool whichIcon); @@ -86,7 +83,7 @@ class ST7920_Lite_Status_Screen { static void draw_fan_speed(const uint8_t value); static void draw_print_time(const duration_t &elapsed); static void draw_feedrate_percentage(const uint16_t percentage); - static void draw_status_message(const char *str); + static void draw_status_message(); static void draw_position(const float x, const float y, const float z, bool position_known = true); static bool indicators_changed(); diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920_spi.h b/Marlin/src/lcd/dogm/status_screen_lite_ST7920_spi.h deleted file mode 100644 index 9c59068f46..0000000000 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920_spi.h +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Lightweight Status Screen for the RepRapDiscount Full - * Graphics Smart Controller (ST7920-based 128x64 LCD) - * - * (c) 2017 Aleph Objects, Inc. - * - * The code in this page is free software: you can - * redistribute it and/or modify it under the terms of the GNU - * General Public License (GNU GPL) as published by the Free Software - * Foundation, either version 3 of the License, or (at your option) - * any later version. The code is distributed WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. - * - */ - -#include "status_screen_lite_ST7920_class.h" - -void ST7920_Lite_Status_Screen::cs() { - ST7920_CS(); - current_bits.synced = false; -} - -void ST7920_Lite_Status_Screen::ncs() { - ST7920_NCS(); - current_bits.synced = false; -} - -void ST7920_Lite_Status_Screen::sync_cmd() { - ST7920_SET_CMD(); -} - -void ST7920_Lite_Status_Screen::sync_dat() { - ST7920_SET_DAT(); -} - -void ST7920_Lite_Status_Screen::write_byte(const uint8_t data) { - ST7920_WRITE_BYTE(data); -} diff --git a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp index 1b808bdc49..890cd4217c 100644 --- a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp +++ b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp @@ -15,7 +15,6 @@ #include "../fontutils.h" #include "u8g_fontutf8.h" -//////////////////////////////////////////////////////////// typedef void font_t; /** @@ -31,7 +30,6 @@ typedef void font_t; */ typedef int (* fontgroup_cb_draw_t)(void *userdata, const font_t *fnt_current, const char *msg); -//////////////////////////////////////////////////////////// /* return v1 - v2 */ static int fontinfo_compare(uxg_fontinfo_t * v1, uxg_fontinfo_t * v2) { if (v1->page < v2->page) return -1; @@ -115,7 +113,6 @@ static void fontgroup_drawstring(font_group_t *group, const font_t *fnt_default, } } -//////////////////////////////////////////////////////////// static bool flag_fontgroup_was_inited = false; static font_group_t g_fontgroup_root = {NULL, 0}; diff --git a/Marlin/src/lcd/dogm/ultralcd_impl_DOGM.cpp b/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp similarity index 82% rename from Marlin/src/lcd/dogm/ultralcd_impl_DOGM.cpp rename to Marlin/src/lcd/dogm/ultralcd_DOGM.cpp index 47a70093f4..dee00a073c 100644 --- a/Marlin/src/lcd/dogm/ultralcd_impl_DOGM.cpp +++ b/Marlin/src/lcd/dogm/ultralcd_DOGM.cpp @@ -21,7 +21,7 @@ */ /** - * ultralcd_impl_DOGM.cpp + * ultralcd_DOGM.cpp * * Implementation of the LCD display routines for a DOGM128 graphic display. * by STB for ErikZalm/Marlin. Common LCD 128x64 pixel graphic displays. @@ -39,14 +39,13 @@ #if HAS_GRAPHICAL_LCD -#include "../ultralcd.h" - -#include -#include "HAL_LCD_class_defines.h" +#include "ultralcd_DOGM.h" #include "u8g_fontutf8.h" +#include "dogm_Bootscreen.h" + #include "../lcdprint.h" #include "../fontutils.h" -#include "dogm_Bootscreen.h" +#include "../ultralcd.h" #include "../../sd/cardreader.h" #include "../../module/temperature.h" @@ -69,22 +68,21 @@ #endif U8G_CLASS u8g(U8G_PARAM); -U8GLIB *pu8g = &u8g; #include LANGUAGE_DATA_INCL(LCD_LANGUAGE) #if HAS_LCD_CONTRAST - int16_t lcd_contrast; // Initialized by settings.load() + int16_t MarlinUI::contrast; // Initialized by settings.load() - void set_lcd_contrast(const int16_t value) { - lcd_contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); - u8g.setContrast(lcd_contrast); + void MarlinUI::set_contrast(const int16_t value) { + contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); + u8g.setContrast(contrast); } #endif -void lcd_setFont(const MarlinFont font_nr) { +void MarlinUI::set_font(const MarlinFont font_nr) { static char currentfont = 0; if (font_nr != currentfont) { switch ((currentfont = font_nr)) { @@ -141,7 +139,7 @@ void lcd_setFont(const MarlinFont font_nr) { #endif // SHOW_CUSTOM_BOOTSCREEN - void lcd_bootscreen() { + void MarlinUI::show_bootscreen() { #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) lcd_custom_bootscreen(); #endif @@ -160,7 +158,7 @@ void lcd_setFont(const MarlinFont font_nr) { u8g.firstPage(); do { u8g.drawBitmapP(offx, offy, (START_BMPWIDTH + 7) / 8, START_BMPHEIGHT, start_bmp); - lcd_setFont(FONT_MENU); + ui.set_font(FONT_MENU); #ifndef STRING_SPLASH_LINE2 const uint8_t txt1X = width - (sizeof(STRING_SPLASH_LINE1) - 1) * (MENU_FONT_WIDTH); u8g.drawStr(txt1X, (height + MENU_FONT_HEIGHT) / 2, STRING_SPLASH_LINE1); @@ -177,11 +175,11 @@ void lcd_setFont(const MarlinFont font_nr) { #endif // SHOW_BOOTSCREEN #if ENABLED(LIGHTWEIGHT_UI) - #include "status_screen_lite_ST7920_class.h" + #include "status_screen_lite_ST7920.h" #endif // Initialize or re-initialize the LCD -void lcd_implementation_init() { +void MarlinUI::init_lcd() { #if PIN_EXISTS(LCD_BACKLIGHT) // Enable LCD backlight OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); @@ -206,7 +204,7 @@ void lcd_implementation_init() { #endif #if HAS_LCD_CONTRAST - set_lcd_contrast(lcd_contrast); + refresh_contrast(); #endif #if ENABLED(LCD_SCREEN_ROT_90) @@ -217,20 +215,20 @@ void lcd_implementation_init() { u8g.setRot270(); // Rotate screen by 270° #endif - uxg_SetUtf8Fonts(g_fontinfo, NUM_ARRAY(g_fontinfo)); + uxg_SetUtf8Fonts(g_fontinfo, COUNT(g_fontinfo)); } // The kill screen is displayed for unrecoverable conditions -void lcd_kill_screen() { +void MarlinUI::draw_kill_screen() { #if ENABLED(LIGHTWEIGHT_UI) ST7920_Lite_Status_Screen::clear_text_buffer(); #endif const uint8_t h4 = u8g.getHeight() / 4; u8g.firstPage(); do { - lcd_setFont(FONT_MENU); + set_font(FONT_MENU); lcd_moveto(0, h4 * 1); - lcd_put_u8str(lcd_status_message); + lcd_put_u8str(status_message); lcd_moveto(0, h4 * 2); lcd_put_u8str_P(PSTR(MSG_HALTED)); lcd_moveto(0, h4 * 3); @@ -238,7 +236,7 @@ void lcd_kill_screen() { } while (u8g.nextPage()); } -void lcd_implementation_clear() { } // Automatically cleared by Picture Loop +void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop #if HAS_LCD_MENU @@ -246,7 +244,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop #if ENABLED(ADVANCED_PAUSE_FEATURE) - void lcd_implementation_hotend_status(const uint8_t row, const uint8_t extruder) { + void MarlinUI::draw_hotend_status(const uint8_t row, const uint8_t extruder) { row_y1 = row * (MENU_FONT_HEIGHT) + 1; row_y2 = row_y1 + MENU_FONT_HEIGHT - 1; @@ -259,20 +257,20 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop lcd_put_u8str(itostr3(thermalManager.degHotend(extruder))); lcd_put_wchar('/'); - if (lcd_blink() || !thermalManager.is_heater_idle(extruder)) + if (get_blink() || !thermalManager.is_heater_idle(extruder)) lcd_put_u8str(itostr3(thermalManager.degTargetHotend(extruder))); } #endif // ADVANCED_PAUSE_FEATURE // Set the colors for a menu item based on whether it is selected - static bool mark_as_selected(const uint8_t row, const bool isSelected) { + static bool mark_as_selected(const uint8_t row, const bool sel) { row_y1 = row * (MENU_FONT_HEIGHT) + 1; row_y2 = row_y1 + MENU_FONT_HEIGHT - 1; if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return false; - if (isSelected) { + if (sel) { #if ENABLED(MENU_HOLLOW_FRAME) u8g.drawHLine(0, row_y1 + 1, LCD_PIXEL_WIDTH); u8g.drawHLine(0, row_y2 + 2, LCD_PIXEL_WIDTH); @@ -295,7 +293,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop } // Draw a static line of text in the same idiom as a menu item - void lcd_implementation_drawmenu_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char* valstr/*=NULL*/) { + void draw_menu_item_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char* valstr/*=NULL*/) { if (mark_as_selected(row, invert)) { @@ -306,23 +304,19 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop while (--pad >= 0) { lcd_put_wchar(' '); n--; } } n -= lcd_put_u8str_max_P(pstr, n); - if (NULL != valstr) { - n -= lcd_put_u8str_max(valstr, n); - } - - while (n - MENU_FONT_WIDTH > 0) { n -= lcd_put_wchar(' '); } + if (valstr) n -= lcd_put_u8str_max(valstr, n); + while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); } } // Draw a generic menu item - void lcd_implementation_drawmenu_generic(const bool isSelected, const uint8_t row, PGM_P pstr, const char pre_char, const char post_char) { + void draw_menu_item(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char) { UNUSED(pre_char); - if (mark_as_selected(row, isSelected)) { - uint8_t n = LCD_WIDTH - 2; - n *= MENU_FONT_WIDTH; + if (mark_as_selected(row, sel)) { + uint8_t n = (LCD_WIDTH - 2) * (MENU_FONT_WIDTH); n -= lcd_put_u8str_max_P(pstr, n); - while (n - MENU_FONT_WIDTH > 0) { n -= lcd_put_wchar(' '); } + while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); lcd_moveto(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2); lcd_put_wchar(post_char); lcd_put_wchar(' '); @@ -330,20 +324,19 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop } // Draw a menu item with an editable value - void _drawmenu_setting_edit_generic(const bool isSelected, const uint8_t row, PGM_P pstr, const char* const data, const bool pgm) { - if (mark_as_selected(row, isSelected)) { + void _draw_menu_item_edit(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm) { + if (mark_as_selected(row, sel)) { const uint8_t vallen = (pgm ? utf8_strlen_P(data) : utf8_strlen((char*)data)); - uint8_t n = LCD_WIDTH - 2 - vallen; - n *= MENU_FONT_WIDTH; + uint8_t n = (LCD_WIDTH - 2 - vallen) * (MENU_FONT_WIDTH); n -= lcd_put_u8str_max_P(pstr, n); lcd_put_wchar(':'); - while (n - MENU_FONT_WIDTH > 0) { n -= lcd_put_wchar(' '); } + while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); lcd_moveto(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH) * vallen, row_y2); if (pgm) lcd_put_u8str_P(data); else lcd_put_u8str((char*)data); } } - void lcd_implementation_drawedit(PGM_P const pstr, const char* const value/*=NULL*/) { + void draw_edit_screen(PGM_P const pstr, const char* const value/*=NULL*/) { const uint8_t labellen = utf8_strlen_P(pstr), vallen = utf8_strlen(value); bool extra_row = labellen > LCD_WIDTH - 2 - vallen; @@ -356,12 +349,12 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop if (labellen + vallen + 1 > lcd_edit_width) extra_row = true; lcd_chr_fit = lcd_edit_width + 1; one_chr_width = EDIT_FONT_WIDTH; - lcd_setFont(FONT_EDIT); + ui.set_font(FONT_EDIT); } else { lcd_chr_fit = LCD_WIDTH; one_chr_width = MENU_FONT_WIDTH; - lcd_setFont(FONT_MENU); + ui.set_font(FONT_MENU); } #else constexpr uint8_t lcd_chr_fit = LCD_WIDTH, @@ -369,7 +362,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop #endif // Center the label and value lines on the middle line - uint8_t baseline = extra_row ? (LCD_PIXEL_HEIGHT) / 2 + uint8_t baseline = extra_row ? (LCD_PIXEL_HEIGHT) / 2 - 1 : (LCD_PIXEL_HEIGHT + EDIT_FONT_ASCENT) / 2; // Assume the label is alpha-numeric (with a descender) @@ -384,7 +377,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop lcd_put_wchar(':'); if (extra_row) { // Assume the value is numeric (with no descender) - baseline += EDIT_FONT_ASCENT; + baseline += EDIT_FONT_ASCENT + 2; onpage = PAGE_CONTAINS(baseline - (EDIT_FONT_ASCENT - 1), baseline); } if (onpage) { @@ -397,41 +390,16 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop #if ENABLED(SDSUPPORT) - void _drawmenu_sd(const bool isSelected, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir) { + void draw_sd_menu_item(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir) { UNUSED(pstr); - mark_as_selected(row, isSelected); - - if (!PAGE_CONTAINS(row_y1, row_y2)) return; - - constexpr uint8_t maxlen = LCD_WIDTH - 1; - const char *outstr = theCard.longest_filename(); - if (theCard.longFilename[0]) { - #if ENABLED(SCROLL_LONG_FILENAMES) - static uint8_t filename_scroll_hash; - if (isSelected) { - uint8_t name_hash = row; - for (uint8_t l = FILENAME_LENGTH; l--;) - name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ theCard.filename[l]; // rotate, xor - if (filename_scroll_hash != name_hash) { // If the hash changed... - filename_scroll_hash = name_hash; // Save the new hash - filename_scroll_max = MAX(0, utf8_strlen(theCard.longFilename) - maxlen); // Update the scroll limit - filename_scroll_pos = 0; // Reset scroll to the start - lcd_status_update_delay = 8; // Don't scroll right away - } - outstr += filename_scroll_pos; - } - #else - theCard.longFilename[maxlen] = '\0'; // cutoff at screen edge - #endif + if (mark_as_selected(row, sel)) { + if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]); + constexpr uint8_t maxlen = LCD_WIDTH - 1; + const uint8_t pixw = maxlen * (MENU_FONT_WIDTH); + uint8_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw); + while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' '); } - - if (isDir) lcd_put_wchar(LCD_STR_FOLDER[0]); - - int n; - n = lcd_put_u8str_max(outstr, maxlen * (MENU_FONT_WIDTH)); - n = maxlen * (MENU_FONT_WIDTH) - n; - while (n - MENU_FONT_WIDTH > 0) { n -= lcd_put_wchar(' '); } } #endif // SDSUPPORT @@ -446,7 +414,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop #define MAP_MAX_PIXELS_X 53 #define MAP_MAX_PIXELS_Y 49 - void lcd_implementation_ubl_plot(const uint8_t x_plot, const uint8_t y_plot) { + void MarlinUI::ubl_plot(const uint8_t x_plot, const uint8_t y_plot) { // Scale the box pixels appropriately uint8_t x_map_pixels = ((MAP_MAX_PIXELS_X - 4) / (GRID_MAX_POINTS_X)) * (GRID_MAX_POINTS_X), y_map_pixels = ((MAP_MAX_PIXELS_Y - 4) / (GRID_MAX_POINTS_Y)) * (GRID_MAX_POINTS_Y), diff --git a/Marlin/src/lcd/dogm/ultralcd_DOGM.h b/Marlin/src/lcd/dogm/ultralcd_DOGM.h new file mode 100644 index 0000000000..42c4fa742d --- /dev/null +++ b/Marlin/src/lcd/dogm/ultralcd_DOGM.h @@ -0,0 +1,176 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * ultralcd_DOGM.h + */ + +#include "../../inc/MarlinConfigPre.h" + +#include +#include "HAL_LCD_class_defines.h" + +// LCD selection +#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + #define U8G_CLASS U8GLIB_ST7920_128X64_4X + #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN) + #define U8G_PARAM LCD_PINS_RS + #else + #define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS + #endif + +#elif ENABLED(U8GLIB_ST7920) + // RepRap Discount Full Graphics Smart Controller + #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN) + #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL + #define U8G_PARAM LCD_PINS_RS // 2 stripes, HW SPI (shared with SD card, on AVR does not use standard LCD adapter) + #else + //#define U8G_CLASS U8GLIB_ST7920_128X64_4X + //#define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS // Original u8glib device. 2 stripes, SW SPI + #define U8G_CLASS U8GLIB_ST7920_128X64_RRD + #define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS // Number of stripes can be adjusted in ultralcd_st7920_u8glib_rrd.h with PAGE_HEIGHT + // AVR version ignores these pin settings + // HAL version uses these pin settings + #endif + +#elif ENABLED(CARTESIO_UI) + // The CartesioUI display + //#define U8G_CLASS U8GLIB_DOGM128_2X + //#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes + #define U8G_CLASS U8GLIB_DOGM128_2X + #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 4 stripes + +#elif ENABLED(U8GLIB_LM6059_AF) + // Based on the Adafruit ST7565 (http://www.adafruit.com/products/250) + //#define U8G_CLASS U8GLIB_LM6059 + //#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 8 stripes + #define U8G_CLASS U8GLIB_LM6059_2X + #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 4 stripes + +#elif ENABLED(U8GLIB_ST7565_64128N) + // The MaKrPanel, Mini Viki, Viki 2.0 & AZSMZ 12864 ST7565 controller + #define SMART_RAMPS (MB(RAMPS_SMART_EFB) || MB(RAMPS_SMART_EEB) || MB(RAMPS_SMART_EFF) || MB(RAMPS_SMART_EEF) || MB(RAMPS_SMART_SF)) + #if DOGLCD_SCK == SCK_PIN && DOGLCD_MOSI == MOSI_PIN && !SMART_RAMPS + #define U8G_CLASS U8GLIB_64128N_2X_HAL + #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // using HW-SPI + #else + #define U8G_CLASS U8GLIB_64128N_2X_HAL + #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // using SW-SPI + #endif + +#elif ENABLED(MKS_12864OLED_SSD1306) + // MKS 128x64 (SSD1306) OLED I2C LCD + #define U8G_CLASS U8GLIB_SSD1306_128X64 + #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 8 stripes + //#define U8G_CLASS U8GLIB_SSD1306_128X64_2X + //#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes + +#elif ENABLED(U8GLIB_SSD1306) + // Generic support for SSD1306 OLED I2C LCDs + //#define U8G_CLASS U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE + //#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes + #define U8G_CLASS U8GLIB_SSD1306_128X64_2X + #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes + +#elif ENABLED(MKS_12864OLED) + // MKS 128x64 (SH1106) OLED I2C LCD + #define U8G_CLASS U8GLIB_SH1106_128X64 + #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 8 stripes + //#define U8G_CLASS U8GLIB_SH1106_128X64_2X + //#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes +#elif ENABLED(U8GLIB_SH1106) + // Generic support for SH1106 OLED I2C LCDs + //#define U8G_CLASS U8GLIB_SH1106_128X64_2X_I2C_2_WIRE + //#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes + #define U8G_CLASS U8GLIB_SH1106_128X64_2X + #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes +#elif ENABLED(U8GLIB_SSD1309) + // Generic support for SSD1309 OLED I2C LCDs + #define U8G_CLASS U8GLIB_SSD1309_128X64 + #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) +#elif ENABLED(MINIPANEL) + // The MINIPanel display + //#define U8G_CLASS U8GLIB_MINI12864 + //#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 8 stripes + #define U8G_CLASS U8GLIB_MINI12864_2X + #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 4 stripes +#elif ENABLED(U8GLIB_SH1106_EINSTART) + // Connected via motherboard header + #define U8G_CLASS U8GLIB_SH1106_128X64 + #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, LCD_PINS_DC, LCD_PINS_RS +#else + // for regular DOGM128 display with HW-SPI + //#define U8G_CLASS U8GLIB_DOGM128 + //#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // HW-SPI Com: CS, A0 // 8 stripes + #define U8G_CLASS U8GLIB_DOGM128_2X + #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // HW-SPI Com: CS, A0 // 4 stripes +#endif + +#ifndef LCD_PIXEL_WIDTH + #define LCD_PIXEL_WIDTH 128 +#endif +#ifndef LCD_PIXEL_HEIGHT + #define LCD_PIXEL_HEIGHT 64 +#endif + +// For selective rendering within a Y range +#define PAGE_OVER(ya) ((ya) <= u8g.getU8g()->current_page.y1) // Does the current page follow a region top? +#define PAGE_UNDER(yb) ((yb) >= u8g.getU8g()->current_page.y0) // Does the current page precede a region bottom? +#define PAGE_CONTAINS(ya, yb) ((yb) >= u8g.getU8g()->current_page.y0 && (ya) <= u8g.getU8g()->current_page.y1) // Do two vertical regions overlap? + +// Only Western languages support big / small fonts +#if DISABLED(DISPLAY_CHARSET_ISO10646_1) + #undef USE_BIG_EDIT_FONT + #undef USE_SMALL_INFOFONT +#endif + +#define MENU_FONT_NAME ISO10646_1_5x7 +#define MENU_FONT_WIDTH 6 +#define MENU_FONT_ASCENT 10 +#define MENU_FONT_DESCENT 2 +#define MENU_FONT_HEIGHT (MENU_FONT_ASCENT + MENU_FONT_DESCENT) + +#if ENABLED(USE_BIG_EDIT_FONT) + #define EDIT_FONT_NAME u8g_font_9x18 + #define EDIT_FONT_WIDTH 9 + #define EDIT_FONT_ASCENT 10 + #define EDIT_FONT_DESCENT 3 +#else + #define EDIT_FONT_NAME MENU_FONT_NAME + #define EDIT_FONT_WIDTH MENU_FONT_WIDTH + #define EDIT_FONT_ASCENT MENU_FONT_ASCENT + #define EDIT_FONT_DESCENT MENU_FONT_DESCENT +#endif +#define EDIT_FONT_HEIGHT (EDIT_FONT_ASCENT + EDIT_FONT_DESCENT) + +// Get the Ascent, Descent, and total Height for the Info Screen font +#if ENABLED(USE_SMALL_INFOFONT) + extern const u8g_fntpgm_uint8_t u8g_font_6x9[]; + #define INFO_FONT_ASCENT 7 +#else + #define INFO_FONT_ASCENT 8 +#endif +#define INFO_FONT_DESCENT 2 +#define INFO_FONT_HEIGHT (INFO_FONT_ASCENT + INFO_FONT_DESCENT) +#define INFO_FONT_WIDTH 6 + +extern U8G_CLASS u8g; diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp index 039a049085..c3d1942a59 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp +++ b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp @@ -27,60 +27,7 @@ #if ENABLED(U8GLIB_ST7920) && !defined(U8G_HAL_LINKS) && !defined(__SAM3X8E__) -#include "../../HAL/shared/Delay.h" - -#define ST7920_CLK_PIN LCD_PINS_D4 -#define ST7920_DAT_PIN LCD_PINS_ENABLE -#define ST7920_CS_PIN LCD_PINS_RS - -//#define PAGE_HEIGHT 8 //128 byte framebuffer -#define PAGE_HEIGHT 16 //256 byte framebuffer -//#define PAGE_HEIGHT 32 //512 byte framebuffer - -#define LCD_PIXEL_WIDTH 128 -#define LCD_PIXEL_HEIGHT 64 - -#include - -//set optimization so ARDUINO optimizes this file -#pragma GCC optimize (3) - -// If you want you can define your own set of delays in Configuration.h -//#define ST7920_DELAY_1 DELAY_NS(0) -//#define ST7920_DELAY_2 DELAY_NS(0) -//#define ST7920_DELAY_3 DELAY_NS(0) - -#if F_CPU >= 20000000 - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(50) -#elif MB(3DRAG) || MB(K8200) || MB(K8400) || MB(SILVER_GATE) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(188) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(MINIRAMBO) || MB(EINSY_RAMBO) || MB(EINSY_RETRO) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(250) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(RAMBO) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(BQ_ZUM_MEGA_3D) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(189) -#elif defined(ARDUINO_ARCH_STM32) - #define CPU_ST7920_DELAY_1 DELAY_NS(300) - #define CPU_ST7920_DELAY_2 DELAY_NS(40) - #define CPU_ST7920_DELAY_3 DELAY_NS(340) -#elif F_CPU == 16000000 - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(63) -#else - #error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd_AVR.h'" -#endif +#include "ultralcd_st7920_u8glib_rrd_AVR.h" #ifndef ST7920_DELAY_1 #define ST7920_DELAY_1 CPU_ST7920_DELAY_1 @@ -92,13 +39,19 @@ #define ST7920_DELAY_3 CPU_ST7920_DELAY_3 #endif +// Optimize this code with -O3 +#pragma GCC optimize (3) + #define ST7920_SND_BIT \ WRITE(ST7920_CLK_PIN, LOW); ST7920_DELAY_1; \ WRITE(ST7920_DAT_PIN, val & 0x80); ST7920_DELAY_2; \ WRITE(ST7920_CLK_PIN, HIGH); ST7920_DELAY_3; \ val <<= 1 -static void ST7920_SWSPI_SND_8BIT(uint8_t val) { +// Optimize this code with -O3 +#pragma GCC optimize (3) + +void ST7920_SWSPI_SND_8BIT(uint8_t val) { ST7920_SND_BIT; // 1 ST7920_SND_BIT; // 2 ST7920_SND_BIT; // 3 @@ -109,19 +62,6 @@ static void ST7920_SWSPI_SND_8BIT(uint8_t val) { ST7920_SND_BIT; // 8 } -#if DOGM_SPI_DELAY_US > 0 - #define U8G_DELAY() DELAY_US(DOGM_SPI_DELAY_US) -#else - #define U8G_DELAY() DELAY_US(10) -#endif - -#define ST7920_CS() { WRITE(ST7920_CS_PIN,1); U8G_DELAY(); } -#define ST7920_NCS() { WRITE(ST7920_CS_PIN,0); } -#define ST7920_SET_CMD() { ST7920_SWSPI_SND_8BIT(0xF8); U8G_DELAY(); } -#define ST7920_SET_DAT() { ST7920_SWSPI_SND_8BIT(0xFA); U8G_DELAY(); } -#define ST7920_WRITE_BYTE(a) { ST7920_SWSPI_SND_8BIT((uint8_t)((a)&0xF0u)); ST7920_SWSPI_SND_8BIT((uint8_t)((a)<<4u)); U8G_DELAY(); } -#define ST7920_WRITE_BYTES(p,l) { for (uint8_t i = l + 1; --i;) { ST7920_SWSPI_SND_8BIT(*p&0xF0); ST7920_SWSPI_SND_8BIT(*p<<4); p++; } U8G_DELAY(); } - uint8_t u8g_dev_rrd_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { uint8_t i, y; switch (msg) { @@ -192,12 +132,6 @@ uint8_t u8g_dev_st7920_128x64_rrd_buf[(LCD_PIXEL_WIDTH) * (PAGE_HEIGHT) / 8] U u8g_pb_t u8g_dev_st7920_128x64_rrd_pb = {{PAGE_HEIGHT, LCD_PIXEL_HEIGHT, 0, 0, 0}, LCD_PIXEL_WIDTH, u8g_dev_st7920_128x64_rrd_buf}; u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = {u8g_dev_rrd_st7920_128x64_fn, &u8g_dev_st7920_128x64_rrd_pb, &u8g_com_null_fn}; -#if ENABLED(LIGHTWEIGHT_UI) - // We have to include the code for the lightweight UI here - // as it relies on macros that are only defined in this file. - #include "status_screen_lite_ST7920_spi.h" -#endif - #pragma GCC reset_options #endif // U8GLIB_ST7920 && !U8G_HAL_LINKS && !__SAM3X8E__ diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h new file mode 100644 index 0000000000..4e601b6179 --- /dev/null +++ b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.h @@ -0,0 +1,97 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +// NOTE - the HAL version of the rrd device uses a generic ST7920 device. See the +// file u8g_dev_st7920_128x64_HAL.cpp for the HAL version. + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(U8GLIB_ST7920) && !defined(U8G_HAL_LINKS) && !defined(__SAM3X8E__) + +#include "../../HAL/shared/Delay.h" + +#define ST7920_CLK_PIN LCD_PINS_D4 +#define ST7920_DAT_PIN LCD_PINS_ENABLE +#define ST7920_CS_PIN LCD_PINS_RS + +//#define PAGE_HEIGHT 8 //128 byte framebuffer +#define PAGE_HEIGHT 16 //256 byte framebuffer +//#define PAGE_HEIGHT 32 //512 byte framebuffer + +#define LCD_PIXEL_WIDTH 128 +#define LCD_PIXEL_HEIGHT 64 + +#include + +// If you want you can define your own set of delays in Configuration.h +//#define ST7920_DELAY_1 DELAY_NS(0) +//#define ST7920_DELAY_2 DELAY_NS(0) +//#define ST7920_DELAY_3 DELAY_NS(0) + +#if F_CPU >= 20000000 + #define CPU_ST7920_DELAY_1 DELAY_NS(0) + #define CPU_ST7920_DELAY_2 DELAY_NS(0) + #define CPU_ST7920_DELAY_3 DELAY_NS(50) +#elif MB(3DRAG) || MB(K8200) || MB(K8400) || MB(SILVER_GATE) + #define CPU_ST7920_DELAY_1 DELAY_NS(0) + #define CPU_ST7920_DELAY_2 DELAY_NS(188) + #define CPU_ST7920_DELAY_3 DELAY_NS(0) +#elif MB(MINIRAMBO) || MB(EINSY_RAMBO) || MB(EINSY_RETRO) + #define CPU_ST7920_DELAY_1 DELAY_NS(0) + #define CPU_ST7920_DELAY_2 DELAY_NS(250) + #define CPU_ST7920_DELAY_3 DELAY_NS(0) +#elif MB(RAMBO) + #define CPU_ST7920_DELAY_1 DELAY_NS(0) + #define CPU_ST7920_DELAY_2 DELAY_NS(0) + #define CPU_ST7920_DELAY_3 DELAY_NS(0) +#elif MB(BQ_ZUM_MEGA_3D) + #define CPU_ST7920_DELAY_1 DELAY_NS(0) + #define CPU_ST7920_DELAY_2 DELAY_NS(0) + #define CPU_ST7920_DELAY_3 DELAY_NS(189) +#elif defined(ARDUINO_ARCH_STM32) + #define CPU_ST7920_DELAY_1 DELAY_NS(300) + #define CPU_ST7920_DELAY_2 DELAY_NS(40) + #define CPU_ST7920_DELAY_3 DELAY_NS(340) +#elif F_CPU == 16000000 + #define CPU_ST7920_DELAY_1 DELAY_NS(0) + #define CPU_ST7920_DELAY_2 DELAY_NS(0) + #define CPU_ST7920_DELAY_3 DELAY_NS(63) +#else + #error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd_AVR.h'" +#endif + +void ST7920_SWSPI_SND_8BIT(uint8_t val); + +#if DOGM_SPI_DELAY_US > 0 + #define U8G_DELAY() DELAY_US(DOGM_SPI_DELAY_US) +#else + #define U8G_DELAY() DELAY_US(10) +#endif + +#define ST7920_CS() { WRITE(ST7920_CS_PIN,1); U8G_DELAY(); } +#define ST7920_NCS() { WRITE(ST7920_CS_PIN,0); } +#define ST7920_SET_CMD() { ST7920_SWSPI_SND_8BIT(0xF8); U8G_DELAY(); } +#define ST7920_SET_DAT() { ST7920_SWSPI_SND_8BIT(0xFA); U8G_DELAY(); } +#define ST7920_WRITE_BYTE(a) { ST7920_SWSPI_SND_8BIT((uint8_t)((a)&0xF0u)); ST7920_SWSPI_SND_8BIT((uint8_t)((a)<<4u)); U8G_DELAY(); } +#define ST7920_WRITE_BYTES(p,l) { for (uint8_t i = l + 1; --i;) { ST7920_SWSPI_SND_8BIT(*p&0xF0); ST7920_SWSPI_SND_8BIT(*p<<4); p++; } U8G_DELAY(); } + +#endif // U8GLIB_ST7920 && !U8G_HAL_LINKS && !__SAM3X8E__ diff --git a/Marlin/src/lcd/extensible_ui/lib/example.cpp b/Marlin/src/lcd/extensible_ui/lib/example.cpp index 6b8a27db66..51040cde04 100644 --- a/Marlin/src/lcd/extensible_ui/lib/example.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/example.cpp @@ -27,13 +27,13 @@ // To implement a new UI, complete the functions below and // read or update Marlin's state using the methods in the -// UI methods in "../ui_api.h" +// ExtUI methods in "../ui_api.h" // // Although it may be possible to access other state // variables from Marlin, using the API here possibly // helps ensure future compatibility. -namespace UI { +namespace ExtUI { void onStartup() { /* Initialize the display module here. The following * routines are available for access to the GPIO pins: @@ -55,8 +55,7 @@ namespace UI { void onPrintTimerPaused() {} void onPrintTimerStopped() {} void onFilamentRunout() {} - void onStatusChanged(const char* msg) {} - void onStatusChanged(progmem_str msg) {} + void onStatusChanged(const char * const msg) {} void onFactoryReset() {} void onLoadSettings() {} void onStoreSettings() {} diff --git a/Marlin/src/lcd/extensible_ui/ui_api.cpp b/Marlin/src/lcd/extensible_ui/ui_api.cpp index 8d329642c0..a9dabaa0ac 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.cpp +++ b/Marlin/src/lcd/extensible_ui/ui_api.cpp @@ -45,6 +45,7 @@ #if ENABLED(EXTENSIBLE_UI) +#include "../ultralcd.h" #include "../../gcode/queue.h" #include "../../module/motion.h" #include "../../module/planner.h" @@ -92,7 +93,8 @@ static struct { uint8_t manual_motion : 1; } flags; -namespace UI { +namespace ExtUI { + #ifdef __SAM3X8E__ /** * Implement a special millis() to allow time measurement @@ -132,13 +134,7 @@ namespace UI { // The ms count is return (uint32_t)(currTime / (F_CPU / 8000)); } - - #else - - // TODO: Implement for AVR - FORCE_INLINE uint32_t safe_millis() { return millis(); } - - #endif + #endif // __SAM3X8E__ void delay_us(unsigned long us) { DELAY_US(us); @@ -286,12 +282,14 @@ namespace UI { } void setActiveTool(const extruder_t extruder, bool no_move) { - const uint8_t e = extruder - E0; - #if DO_SWITCH_EXTRUDER || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER) - if (e != active_extruder) - tool_change(e, 0, no_move); + #if EXTRUDERS > 1 + const uint8_t e = extruder - E0; + #if DO_SWITCH_EXTRUDER || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER) + if (e != active_extruder) + tool_change(e, 0, no_move); + #endif + active_extruder = e; #endif - active_extruder = e; } extruder_t getActiveTool() { @@ -532,24 +530,26 @@ namespace UI { float getFeedrate_percent() { return feedrate_percentage; } - void enqueueCommands(progmem_str gcode) { - enqueue_and_echo_commands_P((PGM_P)gcode); + void enqueueCommands_P(PGM_P const gcode) { + enqueue_and_echo_commands_P(gcode); } bool isAxisPositionKnown(const axis_t axis) { return TEST(axis_known_position, axis); } - progmem_str getFirmwareName_str() { - return F("Marlin " SHORT_BUILD_VERSION); + PGM_P getFirmwareName_str() { + static const char firmware_name[] PROGMEM = "Marlin " SHORT_BUILD_VERSION; + return firmware_name; } void setTargetTemp_celsius(float value, const heater_t heater) { #if HAS_HEATED_BED - if (heater == BED) - thermalManager.setTargetBed(clamp(value,0,200)); + if (heater == BED) + thermalManager.setTargetBed(clamp(value,0,200)); + else #endif - thermalManager.setTargetHotend(clamp(value,0,500), heater - H0); + thermalManager.setTargetHotend(clamp(value,0,500), heater - H0); } void setTargetTemp_celsius(float value, const extruder_t extruder) { @@ -574,15 +574,15 @@ namespace UI { } bool isPrintingFromMedia() { - return IFSD(card.cardOK && card.isFileOpen(), false); + return IFSD(card.flag.cardOK && card.isFileOpen(), false); } bool isPrinting() { - return (planner.movesplanned() || IS_SD_PRINTING() || isPrintingFromMedia()); + return (planner.movesplanned() || isPrintingFromMedia() || IFSD(IS_SD_PRINTING(), false)); } bool isMediaInserted() { - return IFSD(IS_SD_INSERTED() && card.cardOK, false); + return IFSD(IS_SD_INSERTED() && card.flag.cardOK, false); } void pausePrint() { @@ -592,27 +592,28 @@ namespace UI { #if ENABLED(PARK_HEAD_ON_PAUSE) enqueue_and_echo_commands_P(PSTR("M125")); #endif - UI::onStatusChanged(PSTR(MSG_PRINT_PAUSED)); + ui.set_status_P(PSTR(MSG_PRINT_PAUSED)); #endif } void resumePrint() { #if ENABLED(SDSUPPORT) + ui.set_status_P(PSTR(MSG_FILAMENT_CHANGE_RESUME_1)); #if ENABLED(PARK_HEAD_ON_PAUSE) + wait_for_heatup = wait_for_user = false; enqueue_and_echo_commands_P(PSTR("M24")); #else card.startFileprint(); print_job_timer.start(); #endif - UI::onStatusChanged(PSTR(MSG_PRINTING)); #endif } void stopPrint() { #if ENABLED(SDSUPPORT) wait_for_heatup = wait_for_user = false; - card.abort_sd_printing = true; - UI::onStatusChanged(PSTR(MSG_PRINT_ABORTED)); + card.flag.abort_sd_printing = true; + ui.set_status_P(PSTR(MSG_PRINT_ABORTED)); #endif } @@ -620,7 +621,7 @@ namespace UI { void FileList::refresh() { num_files = 0xFFFF; } - bool FileList::seek(uint16_t pos, bool skip_range_check) { + bool FileList::seek(const uint16_t pos, const bool skip_range_check) { #if ENABLED(SDSUPPORT) if (!skip_range_check && pos > (count() - 1)) return false; const uint16_t nr = @@ -631,6 +632,8 @@ namespace UI { card.getfilename_sorted(nr); return card.filename && card.filename[0] != '\0'; + #else + return false; #endif } @@ -647,7 +650,7 @@ namespace UI { } bool FileList::isDir() { - return IFSD(card.filenameIsDir, false); + return IFSD(card.flag.filenameIsDir, false); } uint16_t FileList::count() { @@ -670,25 +673,25 @@ namespace UI { #endif } - void FileList::changeDir(const char *dirname) { + void FileList::changeDir(const char * const dirname) { #if ENABLED(SDSUPPORT) card.chdir(dirname); num_files = 0xFFFF; #endif } -} // namespace UI +} // namespace ExtUI // At the moment, we piggy-back off the ultralcd calls, but this could be cleaned up in the future -void lcd_init() { +void MarlinUI::init() { #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) SET_INPUT_PULLUP(SD_DETECT_PIN); #endif - UI::onStartup(); + ExtUI::onStartup(); } -void lcd_update() { +void MarlinUI::update() { #if ENABLED(SDSUPPORT) static bool last_sd_status; const bool sd_status = IS_SD_INSERTED(); @@ -696,63 +699,26 @@ void lcd_update() { last_sd_status = sd_status; if (sd_status) { card.initsd(); - if (card.cardOK) - UI::onMediaInserted(); + if (card.flag.cardOK) + ExtUI::onMediaInserted(); else - UI::onMediaError(); + ExtUI::onMediaError(); } else { - const bool ok = card.cardOK; + const bool ok = card.flag.cardOK; card.release(); - if (ok) UI::onMediaRemoved(); + if (ok) ExtUI::onMediaRemoved(); } } #endif // SDSUPPORT - UI::_processManualMoveToDestination(); - UI::onIdle(); + ExtUI::_processManualMoveToDestination(); + ExtUI::onIdle(); } -bool lcd_hasstatus() { return true; } -bool lcd_detected() { return true; } -void lcd_reset_alert_level() { } -void lcd_refresh() { } -void lcd_setstatus(const char * const message, const bool persist /* = false */) { UI::onStatusChanged(message); } -void lcd_setstatusPGM(const char * const message, int8_t level /* = 0 */) { UI::onStatusChanged((progmem_str)message); } -void lcd_setalertstatusPGM(const char * const message) { lcd_setstatusPGM(message, 0); } - -void lcd_reset_status() { - static const char paused[] PROGMEM = MSG_PRINT_PAUSED; - static const char printing[] PROGMEM = MSG_PRINTING; - static const char welcome[] PROGMEM = WELCOME_MSG; - PGM_P msg; - if (print_job_timer.isPaused()) - msg = paused; - #if ENABLED(SDSUPPORT) - else if (IS_SD_PRINTING()) - return lcd_setstatus(card.longest_filename(), true); - #endif - else if (print_job_timer.isRunning()) - msg = printing; - else - msg = welcome; - - lcd_setstatusPGM(msg, -1); -} - -void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) { - char buff[64]; - va_list args; - va_start(args, fmt); - vsnprintf_P(buff, sizeof(buff), fmt, args); - va_end(args); - buff[63] = '\0'; - UI::onStatusChanged(buff); -} - -void kill_screen(PGM_P msg) { +void MarlinUI::kill_screen(PGM_P const msg) { if (!flags.printer_killed) { flags.printer_killed = true; - UI::onPrinterKilled(msg); + ExtUI::onPrinterKilled(msg); } } diff --git a/Marlin/src/lcd/extensible_ui/ui_api.h b/Marlin/src/lcd/extensible_ui/ui_api.h index 806d1a3f07..1a86680a1f 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.h +++ b/Marlin/src/lcd/extensible_ui/ui_api.h @@ -45,9 +45,7 @@ #include "../../inc/MarlinConfig.h" -typedef const __FlashStringHelper *progmem_str; - -namespace UI { +namespace ExtUI { enum axis_t : uint8_t { X, Y, Z }; enum extruder_t : uint8_t { E0, E1, E2, E3, E4, E5 }; @@ -62,13 +60,13 @@ namespace UI { bool isAxisPositionKnown(const axis_t); bool canMove(const axis_t); bool canMove(const extruder_t); - void enqueueCommands(progmem_str); + void enqueueCommands_P(PGM_P const); /** * Getters and setters * Should be used by the EXTENSIBLE_UI to query or change Marlin's state. */ - progmem_str getFirmwareName_str(); + PGM_P getFirmwareName_str(); float getActualTemp_celsius(const heater_t); float getActualTemp_celsius(const extruder_t); @@ -178,7 +176,12 @@ namespace UI { * safe_millis must be called at least every 1 sec to guarantee time * yield should be called within lengthy loops */ - uint32_t safe_millis(); + #ifdef __SAM3X8E__ + uint32_t safe_millis(); + #else + FORCE_INLINE uint32_t safe_millis() { return millis(); } // TODO: Implement for AVR + #endif + void delay_us(unsigned long us); void delay_ms(unsigned long ms); void yield(); @@ -205,14 +208,14 @@ namespace UI { public: FileList(); void refresh(); - bool seek(uint16_t, bool skip_range_check = false); + bool seek(const uint16_t, const bool skip_range_check = false); const char *longFilename(); const char *shortFilename(); const char *filename(); bool isDir(); - void changeDir(const char *dirname); + void changeDir(const char * const dirname); void upDir(); bool isAtRootDir(); uint16_t count(); @@ -234,8 +237,7 @@ namespace UI { void onPrintTimerPaused(); void onPrintTimerStopped(); void onFilamentRunout(); - void onStatusChanged(const char* msg); - void onStatusChanged(progmem_str msg); + void onStatusChanged(const char * const msg); void onFactoryReset(); void onStoreSettings(); void onLoadSettings(); @@ -257,8 +259,8 @@ namespace UI { * UI_INCREMENT(TargetTemp_celsius, E0) * */ -#define UI_INCREMENT_BY(method, inc, ...) UI::set ## method(UI::get ## method (__VA_ARGS__) + inc, ##__VA_ARGS__) -#define UI_DECREMENT_BY(method, inc, ...) UI::set ## method(UI::get ## method (__VA_ARGS__) - inc, ##__VA_ARGS__) +#define UI_INCREMENT_BY(method, inc, ...) ExtUI::set ## method(ExtUI::get ## method (__VA_ARGS__) + inc, ##__VA_ARGS__) +#define UI_DECREMENT_BY(method, inc, ...) ExtUI::set ## method(ExtUI::get ## method (__VA_ARGS__) - inc, ##__VA_ARGS__) #define UI_INCREMENT(method, ...) UI_INCREMENT_BY(method, increment, ##__VA_ARGS__) #define UI_DECREMENT(method, ...) UI_DECREMENT_BY(method, increment, ##__VA_ARGS__) diff --git a/Marlin/src/lcd/fontutils.h b/Marlin/src/lcd/fontutils.h index 183c8ed399..2f4dca7dca 100644 --- a/Marlin/src/lcd/fontutils.h +++ b/Marlin/src/lcd/fontutils.h @@ -27,10 +27,6 @@ uint8_t read_byte_rom(uint8_t * str); #define wchar_t uint32_t //typedef uint32_t wchar_t; -#ifndef NUM_ARRAY - #define NUM_ARRAY(a) (sizeof(a)/sizeof((a)[0])) -#endif - typedef uint16_t pixel_len_t; #define PIXEL_LEN_NOLIMIT ((pixel_len_t)(-1)) diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index d3e91927e0..849f30f9b9 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -87,8 +87,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") #define MSG_AUTOTEMP _UxGT("Temperatura Auto.") -#define MSG_ON _UxGT("On") -#define MSG_OFF _UxGT("Off") +#define MSG_LCD_ON _UxGT("On") +#define MSG_LCD_OFF _UxGT("Off") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_bg.h b/Marlin/src/lcd/language/language_bg.h index f7471675c7..3409e770d5 100644 --- a/Marlin/src/lcd/language/language_bg.h +++ b/Marlin/src/lcd/language/language_bg.h @@ -77,8 +77,8 @@ #define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Максимум") #define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Фактор") #define MSG_AUTOTEMP _UxGT("Авто-темп.") -#define MSG_ON _UxGT("Вкл. ") -#define MSG_OFF _UxGT("Изкл. ") +#define MSG_LCD_ON _UxGT("Вкл.") +#define MSG_LCD_OFF _UxGT("Изкл.") #define MSG_A_RETRACT _UxGT("A-откат") #define MSG_A_TRAVEL _UxGT("A-travel") #define MSG_STEPS_PER_MM _UxGT("Стъпки/mm") diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index 3826cb6c3d..c871bdee0a 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -91,8 +91,8 @@ #define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fact") #define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("On ") -#define MSG_OFF _UxGT("Off") +#define MSG_LCD_ON _UxGT("On") +#define MSG_LCD_OFF _UxGT("Off") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index ba4a707bfe..e2a9256b81 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -189,8 +189,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fakt") #define MSG_AUTOTEMP _UxGT("Autoteplota") -#define MSG_ON _UxGT("Zap") -#define MSG_OFF _UxGT("Vyp") +#define MSG_LCD_ON _UxGT("Zap") +#define MSG_LCD_OFF _UxGT("Vyp") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") @@ -253,7 +253,7 @@ #define MSG_PAUSE_PRINT _UxGT("Pozastavit tisk") #define MSG_RESUME_PRINT _UxGT("Obnovit tisk") #define MSG_STOP_PRINT _UxGT("Zastavit tisk") -#define MSG_POWER_LOSS_RECOVERY _UxGT("Obnova vypadku") +#define MSG_OUTAGE_RECOVERY _UxGT("Obnova vypadku") #define MSG_CARD_MENU _UxGT("Tisknout z SD") #define MSG_NO_CARD _UxGT("Žádná SD karta") #define MSG_DWELL _UxGT("Uspáno...") diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 2b489618f4..2dcea9ee4b 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -88,8 +88,8 @@ #define MSG_MAX _UxGT(" \002 Max") #define MSG_FACTOR _UxGT(" \002 Fact") #define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("Til ") -#define MSG_OFF _UxGT("Fra") +#define MSG_LCD_ON _UxGT("Til") +#define MSG_LCD_OFF _UxGT("Fra") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 5ce8c498dc..f218efdd0c 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -201,8 +201,8 @@ #define MSG_MAX LCD_STR_THERMOMETER _UxGT(" max") #define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Faktor") #define MSG_AUTOTEMP _UxGT("Auto Temperatur") -#define MSG_ON _UxGT("Ein") -#define MSG_OFF _UxGT("Aus") +#define MSG_LCD_ON _UxGT("Ein") +#define MSG_LCD_OFF _UxGT("Aus") #define MSG_PID_P _UxGT("PID P") #define MSG_PID_I _UxGT("PID I") #define MSG_PID_D _UxGT("PID D") @@ -268,7 +268,7 @@ #define MSG_PAUSE_PRINT _UxGT("SD-Druck pausieren") #define MSG_RESUME_PRINT _UxGT("SD-Druck fortsetzen") #define MSG_STOP_PRINT _UxGT("SD-Druck abbrechen") -#define MSG_POWER_LOSS_RECOVERY _UxGT("Wiederh. n. Stroma.") +#define MSG_OUTAGE_RECOVERY _UxGT("Wiederh. n. Stroma.") #define MSG_CARD_MENU _UxGT("Druck v. SD-Karte") #define MSG_NO_CARD _UxGT("Keine SD-Karte") #define MSG_DWELL _UxGT("Warten...") diff --git a/Marlin/src/lcd/language/language_el-gr.h b/Marlin/src/lcd/language/language_el-gr.h index fc5d642bc0..85c2b82114 100644 --- a/Marlin/src/lcd/language/language_el-gr.h +++ b/Marlin/src/lcd/language/language_el-gr.h @@ -87,8 +87,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") #define MSG_AUTOTEMP _UxGT("Αυτομ. ρύθμιση θερμοκρασίας") -#define MSG_ON _UxGT("Ενεργοποιημένο") -#define MSG_OFF _UxGT("Απενεργοποιημένο") +#define MSG_LCD_ON _UxGT("Ενεργοποιημένο") +#define MSG_LCD_OFF _UxGT("Απενεργοποιημένο") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index c7ab0b28b8..38ae18cbfa 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -87,8 +87,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") #define MSG_AUTOTEMP _UxGT("Αυτομ ρύθμιση θερ/σίας") //SHORTEN -#define MSG_ON _UxGT("Ενεργοποιημένο") -#define MSG_OFF _UxGT("Απενεργοποιημένο") +#define MSG_LCD_ON _UxGT("Ενεργοποιημένο") +#define MSG_LCD_OFF _UxGT("Απενεργοποιημένο") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index b138d5c42c..111e745640 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -35,6 +35,16 @@ #endif #undef en +#ifndef THIS_LANGUAGES_SPECIAL_SYMBOLS + #define THIS_LANGUAGES_SPECIAL_SYMBOLS _UxGT("³") +#endif + +#ifdef NOT_EXTENDED_ISO10646_1_5X7 + #define MSG_CUBED _UxGT("^3") +#else + #define MSG_CUBED _UxGT("³") +#endif + #ifndef CHARSIZE #define CHARSIZE 1 #endif @@ -539,11 +549,11 @@ #ifndef MSG_AUTOTEMP #define MSG_AUTOTEMP _UxGT("Autotemp") #endif -#ifndef MSG_ON - #define MSG_ON _UxGT("On ") +#ifndef MSG_LCD_ON + #define MSG_LCD_ON _UxGT("On") #endif -#ifndef MSG_OFF - #define MSG_OFF _UxGT("Off") +#ifndef MSG_LCD_OFF + #define MSG_LCD_OFF _UxGT("Off") #endif #ifndef MSG_PID_P #define MSG_PID_P _UxGT("PID-P") @@ -672,7 +682,7 @@ #define MSG_FILAMENT _UxGT("Filament") #endif #ifndef MSG_VOLUMETRIC_ENABLED - #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") + #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm") MSG_CUBED #endif #ifndef MSG_FILAMENT_DIAM #define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") @@ -728,8 +738,8 @@ #ifndef MSG_STOP_PRINT #define MSG_STOP_PRINT _UxGT("Stop print") #endif -#ifndef MSG_POWER_LOSS_RECOVERY - #define MSG_POWER_LOSS_RECOVERY _UxGT("Power-Loss Recovery") +#ifndef MSG_OUTAGE_RECOVERY + #define MSG_OUTAGE_RECOVERY _UxGT("Outage Recovery") #endif #ifndef MSG_CARD_MENU #define MSG_CARD_MENU _UxGT("Print from SD") diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 0852215550..f216db91bf 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -95,8 +95,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") #define MSG_AUTOTEMP _UxGT("Temperatura Auto.") -#define MSG_ON _UxGT("Encender") -#define MSG_OFF _UxGT("Apagar") +#define MSG_LCD_ON _UxGT("Encender") +#define MSG_LCD_OFF _UxGT("Apagar") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") @@ -204,7 +204,7 @@ #define MSG_INFO_PROTOCOL _UxGT("Protocolo") #define MSG_CASE_LIGHT _UxGT("Luz cabina") -#if LCD_WIDTH > 19 +#if LCD_WIDTH >= 20 #define MSG_INFO_PRINT_COUNT _UxGT("Conteo de impresión") #define MSG_INFO_COMPLETED_PRINTS _UxGT("Completadas") #define MSG_INFO_PRINT_TIME _UxGT("Tiempo total de imp.") diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index 2acbb6a8d3..a1771d9178 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -182,8 +182,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fakt") #define MSG_AUTOTEMP _UxGT("Auto tenperatura") -#define MSG_ON _UxGT("On ") -#define MSG_OFF _UxGT("Off") +#define MSG_LCD_ON _UxGT("On") +#define MSG_LCD_OFF _UxGT("Off") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_fi.h b/Marlin/src/lcd/language/language_fi.h index 6155a4e9fe..cca996d13c 100644 --- a/Marlin/src/lcd/language/language_fi.h +++ b/Marlin/src/lcd/language/language_fi.h @@ -79,8 +79,8 @@ #define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Kerr") #define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("On ") -#define MSG_OFF _UxGT("Off") +#define MSG_LCD_ON _UxGT("On") +#define MSG_LCD_OFF _UxGT("Off") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 5ddc58cf80..386f7cedf4 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -184,8 +184,8 @@ #define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Facteur") #define MSG_AUTOTEMP _UxGT("Temp. Auto.") -#define MSG_ON _UxGT("Marche ") -#define MSG_OFF _UxGT("Arrêt") +#define MSG_LCD_ON _UxGT("Marche") +#define MSG_LCD_OFF _UxGT("Arrêt") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index ba9382ac46..6809a2c70c 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -87,8 +87,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") #define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("On ") -#define MSG_OFF _UxGT("Off") +#define MSG_LCD_ON _UxGT("On") +#define MSG_LCD_OFF _UxGT("Off") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index e3f60c58ea..50893a0c82 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -87,8 +87,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") #define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("On ") -#define MSG_OFF _UxGT("Off") +#define MSG_LCD_ON _UxGT("On") +#define MSG_LCD_OFF _UxGT("Off") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 78044ed39b..06ec0f6835 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -199,8 +199,8 @@ #define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fact") #define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("On ") -#define MSG_OFF _UxGT("Off") +#define MSG_LCD_ON _UxGT("On") +#define MSG_LCD_OFF _UxGT("Off") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") @@ -247,7 +247,7 @@ #define MSG_TEMPERATURE _UxGT("Temperatura") #define MSG_MOTION _UxGT("Movimento") #define MSG_FILAMENT _UxGT("Filamento") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") +#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm³") #define MSG_FILAMENT_DIAM _UxGT("Diam. filo") #define MSG_FILAMENT_UNLOAD _UxGT("Rimuovi mm") #define MSG_FILAMENT_LOAD _UxGT("Carica mm") @@ -266,7 +266,7 @@ #define MSG_PAUSE_PRINT _UxGT("Pausa stampa") #define MSG_RESUME_PRINT _UxGT("Riprendi stampa") #define MSG_STOP_PRINT _UxGT("Arresta stampa") -#define MSG_POWER_LOSS_RECOVERY _UxGT("Ripresa da PowerLoss") +#define MSG_OUTAGE_RECOVERY _UxGT("Ripresa da PowerLoss") #define MSG_CARD_MENU _UxGT("Stampa da SD") #define MSG_NO_CARD _UxGT("SD non presente") #define MSG_DWELL _UxGT("Sospensione...") diff --git a/Marlin/src/lcd/language/language_jp-kana.h b/Marlin/src/lcd/language/language_jp-kana.h index a297ba9028..b95285a85f 100644 --- a/Marlin/src/lcd/language/language_jp-kana.h +++ b/Marlin/src/lcd/language/language_jp-kana.h @@ -97,8 +97,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" サイコウ") // " Max" #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" ファクター") // " Fact" #define MSG_AUTOTEMP _UxGT("ジドウオンドセイギョ") // "Autotemp" -#define MSG_ON _UxGT("オン ") // "On " -#define MSG_OFF _UxGT("オフ ") // "Off" +#define MSG_LCD_ON _UxGT("オン") // "On" +#define MSG_LCD_OFF _UxGT("オフ") // "Off" #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_ko_KR.h b/Marlin/src/lcd/language/language_ko_KR.h index b5296809a2..d6e9023b15 100644 --- a/Marlin/src/lcd/language/language_ko_KR.h +++ b/Marlin/src/lcd/language/language_ko_KR.h @@ -194,8 +194,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") #define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("On ") -#define MSG_OFF _UxGT("Off") +#define MSG_LCD_ON _UxGT("On") +#define MSG_LCD_OFF _UxGT("Off") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") @@ -259,7 +259,7 @@ #define MSG_PAUSE_PRINT _UxGT("일시정지") #define MSG_RESUME_PRINT _UxGT("재시작") #define MSG_STOP_PRINT _UxGT("출력중지") -#define MSG_POWER_LOSS_RECOVERY _UxGT("Power-Loss Recovery") +#define MSG_OUTAGE_RECOVERY _UxGT("Outage Recovery") #define MSG_CARD_MENU _UxGT("SD 카드출력") #define MSG_NO_CARD _UxGT("SD 카드없음") #define MSG_DWELL _UxGT("슬립모드...") diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index cfe17216ea..1ab6d06836 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -95,8 +95,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") #define MSG_AUTOTEMP _UxGT("Autotemp") -#define MSG_ON _UxGT("Aan ") -#define MSG_OFF _UxGT("Uit") +#define MSG_LCD_ON _UxGT("Aan") +#define MSG_LCD_OFF _UxGT("Uit") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index a724fd74d3..63cf3cd33b 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -85,8 +85,8 @@ #define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Mnożnik") #define MSG_AUTOTEMP _UxGT("Auto. temperatura") -#define MSG_ON _UxGT("Wł. ") -#define MSG_OFF _UxGT("Wył.") +#define MSG_LCD_ON _UxGT("Wł.") +#define MSG_LCD_OFF _UxGT("Wył.") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_pt-br.h b/Marlin/src/lcd/language/language_pt-br.h index db28aac536..4e3839b663 100644 --- a/Marlin/src/lcd/language/language_pt-br.h +++ b/Marlin/src/lcd/language/language_pt-br.h @@ -40,37 +40,42 @@ #define MSG_BACK _UxGT("Voltar") #define MSG_SD_INSERTED _UxGT("Cartão inserido") #define MSG_SD_REMOVED _UxGT("Cartão removido") -#define MSG_LCD_ENDSTOPS _UxGT("Finais") +#define MSG_LCD_ENDSTOPS _UxGT("Fins de curso") +#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft Fins curso") #define MSG_MAIN _UxGT("Menu principal") -#define MSG_AUTOSTART _UxGT("Autostart") -#define MSG_DISABLE_STEPPERS _UxGT("Desabi. motores") +#define MSG_ADVANCED_SETTINGS _UxGT("Config. Avançada") +#define MSG_CONFIGURATION _UxGT("Configuração") +#define MSG_AUTOSTART _UxGT("Início automático") +#define MSG_DISABLE_STEPPERS _UxGT("Desabilit. motores") #define MSG_DEBUG_MENU _UxGT("Menu Debug") -#define MSG_PROGRESS_BAR_TEST _UxGT("Testar Barra de Prog")//resso +#define MSG_PROGRESS_BAR_TEST _UxGT("Testar Barra Progres") +#define MSG_AUTO_HOME _UxGT("Ir a origem XYZ") #define MSG_AUTO_HOME_X _UxGT("Ir na origem X") #define MSG_AUTO_HOME_Y _UxGT("Ir na origem Y") #define MSG_AUTO_HOME_Z _UxGT("Ir na origem Z") +#define MSG_AUTO_Z_ALIGN _UxGT("Auto alinhar Z") #define MSG_TMC_Z_CALIBRATION _UxGT("Calibrar Z") -#define MSG_AUTO_HOME _UxGT("Ir na origem XYZ") #define MSG_LEVEL_BED_HOMING _UxGT("Indo para origem") #define MSG_LEVEL_BED_WAITING _UxGT("Clique para Iniciar") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Próximo Ponto") #define MSG_LEVEL_BED_DONE _UxGT("Fim nivelação!") #define MSG_Z_FADE_HEIGHT _UxGT("Suavizar altura") #define MSG_SET_HOME_OFFSETS _UxGT("Compensar origem") -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Alteração feita") +#define MSG_HOME_OFFSETS_APPLIED _UxGT("Alteração aplicada") #define MSG_SET_ORIGIN _UxGT("Ajustar Origem") #define MSG_PREHEAT_1 _UxGT("Pre-aquecer " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL _UxGT("Pre-aq.Todo " PREHEAT_1_LABEL) -#define MSG_PREHEAT_1_END _UxGT("Pre-aq.Extrusora") +#define MSG_PREHEAT_1_END _UxGT("Extrusora " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_BEDONLY _UxGT("Pre-aq.Mesa " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_SETTINGS _UxGT("Ajustar " PREHEAT_1_LABEL) #define MSG_PREHEAT_2 _UxGT("Pre-aquecer " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_N _UxGT("Pre-aquecer " PREHEAT_2_LABEL) +#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") #define MSG_PREHEAT_2_ALL _UxGT("Pre-aq.Todo " PREHEAT_2_LABEL) +#define MSG_PREHEAT_2_END _UxGT("Extrusora " PREHEAT_2_LABEL) #define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq.Mesa " PREHEAT_2_LABEL) -#define MSG_PREHEAT_2_END _UxGT("Pre-aq.Extrusora") #define MSG_PREHEAT_2_SETTINGS _UxGT("Ajustar " PREHEAT_2_LABEL) +#define MSG_PREHEAT_CUSTOM _UxGT("Customizar Pre-aq.") #define MSG_COOLDOWN _UxGT("Esfriar") #define MSG_SWITCH_PS_ON _UxGT("Ligar") #define MSG_SWITCH_PS_OFF _UxGT("Desligar") @@ -82,18 +87,32 @@ #define MSG_LEVEL_CORNERS _UxGT("Nivelar Cantos") #define MSG_NEXT_CORNER _UxGT("Próximo Canto") #define MSG_EDITING_STOPPED _UxGT("Fim da Edição") +#define MSG_MESH_X _UxGT("Índice X") +#define MSG_MESH_Y _UxGT("Índice Y") +#define MSG_MESH_EDIT_Z _UxGT("Valor Z") #define MSG_USER_MENU _UxGT("Comando customizado") #define MSG_UBL_DOING_G29 _UxGT("Executando G29") #define MSG_UBL_UNHOMED _UxGT("Fora da Origam") #define MSG_UBL_TOOLS _UxGT("Ferramentas UBL") -#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") +#define MSG_UBL_LEVEL_BED _UxGT("Nivel. Mesa Unif.") + +#define MSG_IDEX_MENU _UxGT("Modo IDEX") +#define MSG_IDEX_MODE_AUTOPARK _UxGT("Auto-Estacionar") +#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplicação") +#define MSG_IDEX_MODE_SCALED_COPY _UxGT("Cópia em Escala") +#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Controle Total") +#define MSG_IDEX_X_OFFSET _UxGT("2o bico X") +#define MSG_IDEX_Y_OFFSET _UxGT("2o bico Y") +#define MSG_IDEX_Z_OFFSET _UxGT("2o bico Z") +#define MSG_IDEX_SAVE_OFFSETS _UxGT("Salvar Compensação") + #define MSG_UBL_MANUAL_MESH _UxGT("Fazer malha manual") #define MSG_UBL_BC_INSERT _UxGT("Calçar e calibrar") #define MSG_UBL_BC_INSERT2 _UxGT("Medir") #define MSG_UBL_BC_REMOVE _UxGT("Remover e calibrar") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Indo para o Próximo") +#define MSG_UBL_MOVING_TO_NEXT _UxGT("Movendo para Próximo") #define MSG_UBL_ACTIVATE_MESH _UxGT("Ativar UBL") #define MSG_UBL_DEACTIVATE_MESH _UxGT("Desativar UBL") #define MSG_UBL_SET_TEMP_BED _UxGT("Temp. Mesa") @@ -104,13 +123,13 @@ #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Editar Malha Custom") #define MSG_UBL_FINE_TUNE_MESH _UxGT("Ajuste Fino da Malha") #define MSG_UBL_DONE_EDITING_MESH _UxGT("Fim da Edição") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Montar Customi") +#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Montar Malha Custom") #define MSG_UBL_BUILD_MESH_MENU _UxGT("Montar ") #define MSG_UBL_BUILD_MESH_M1 _UxGT("Montar " PREHEAT_1_LABEL) #define MSG_UBL_BUILD_MESH_M2 _UxGT("Montar " PREHEAT_2_LABEL) -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Montar fria") +#define MSG_UBL_BUILD_COLD_MESH _UxGT("Montar Malha fria") #define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajustar Altura") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Tamanho da Elevação") +#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Quant. de Altura") #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validar Malha") #define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Checar " PREHEAT_1_LABEL) #define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Checar " PREHEAT_2_LABEL) @@ -165,13 +184,13 @@ #define MSG_INTENSITY_B _UxGT("Intensidade Azul") #define MSG_INTENSITY_W _UxGT("Intensidade Branco") #define MSG_LED_BRIGHTNESS _UxGT("Brilho") - #define MSG_MOVING _UxGT("Movendo...") #define MSG_FREE_XY _UxGT("Liberar XY") #define MSG_MOVE_X _UxGT("Mover X") #define MSG_MOVE_Y _UxGT("Mover Y") #define MSG_MOVE_Z _UxGT("Mover Z") #define MSG_MOVE_E _UxGT("Mover Extrusor") +#define MSG_HOTEND_TOO_COLD _UxGT("Extrus. mto fria") #define MSG_MOVE_01MM _UxGT("Mover 0.1mm") #define MSG_MOVE_1MM _UxGT("Mover 1mm") #define MSG_MOVE_10MM _UxGT("Mover 10mm") @@ -180,48 +199,43 @@ #define MSG_NOZZLE _UxGT("Bocal") #define MSG_BED _UxGT("Mesa") #define MSG_FAN_SPEED _UxGT("Vel. Ventoinha") +#define MSG_EXTRA_FAN_SPEED _UxGT("+Vel. Ventoinha") #define MSG_FLOW _UxGT("Vazão") #define MSG_CONTROL _UxGT("Controle") #define MSG_MIN LCD_STR_THERMOMETER _UxGT(" Min") -#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Max") +#define MSG_MAX LCD_STR_THERMOMETER _UxGT(" Máx") #define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Fator") #define MSG_AUTOTEMP _UxGT("Temp. Automática") -#define MSG_ON _UxGT("Ligado ") -#define MSG_OFF _UxGT("Desligado") +#define MSG_LCD_ON _UxGT("Ligado") +#define MSG_LCD_OFF _UxGT("Desligado") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") #define MSG_PID_C _UxGT("PID-C") #define MSG_SELECT _UxGT("Selecionar") #define MSG_ACC _UxGT("Acel.") -#define MSG_JERK _UxGT("Jogo") -#if IS_SCARA - #define MSG_VA_JERK _UxGT("jogo VA") - #define MSG_VB_JERK _UxGT("jogo VB") - #define MSG_VC_JERK _UxGT("jogo VZ") -#elif ENABLED(DELTA) - #define MSG_VA_JERK _UxGT("jogo VA") - #define MSG_VB_JERK _UxGT("jogo VB") - #define MSG_VC_JERK _UxGT("jogo VC") +#define MSG_JERK _UxGT("Arrancada") +#if IS_KINEMATIC + #define MSG_VA_JERK _UxGT("arrancada VA") + #define MSG_VB_JERK _UxGT("arrancada VB") + #define MSG_VC_JERK _UxGT("arrancada VC") #else - #define MSG_VA_JERK _UxGT("jogo VX") - #define MSG_VB_JERK _UxGT("jogo VY") - #define MSG_VC_JERK _UxGT("jogo VZ") + #define MSG_VA_JERK _UxGT("arrancada VX") + #define MSG_VB_JERK _UxGT("arrancada VY") + #define MSG_VC_JERK _UxGT("arrancada VZ") #endif -#define MSG_VE_JERK _UxGT("jogo VE") +#define MSG_VE_JERK _UxGT("arrancada VE") +#define MSG_JUNCTION_DEVIATION _UxGT("Desv. Junção") #define MSG_VELOCITY _UxGT("Velocidade") #define MSG_VMAX _UxGT("Vmax ") #define MSG_VMIN _UxGT("Vmin") #define MSG_VTRAV_MIN _UxGT("VDeslocamento min") +#define MSG_ACCELERATION _UxGT("Aceleração") #define MSG_AMAX _UxGT("Amax ") #define MSG_A_RETRACT _UxGT("Retrair A") #define MSG_A_TRAVEL _UxGT("Movimento A") #define MSG_STEPS_PER_MM _UxGT("Passo/mm") -#if IS_SCARA - #define MSG_ASTEPS _UxGT("Passo A/deg") - #define MSG_BSTEPS _UxGT("Passo B/deg") - #define MSG_CSTEPS _UxGT("Passo Z/mm") -#elif ENABLED(DELTA) +#if IS_KINEMATIC #define MSG_ASTEPS _UxGT("Passo A/mm") #define MSG_BSTEPS _UxGT("Passo B/mm") #define MSG_CSTEPS _UxGT("Passo C/mm") @@ -242,23 +256,30 @@ #define MSG_FILAMENT _UxGT("Filamento") #define MSG_VOLUMETRIC_ENABLED _UxGT("Extrusão em mm3") #define MSG_FILAMENT_DIAM _UxGT("Diâmetro Fil.") -#define MSG_ADVANCE_K _UxGT("Avançar K") +#define MSG_FILAMENT_UNLOAD _UxGT("Descarr. mm") +#define MSG_FILAMENT_LOAD _UxGT("Carregar mm") +#define MSG_ADVANCE_K _UxGT("Avanço K") #define MSG_CONTRAST _UxGT("Contraste") #define MSG_STORE_EEPROM _UxGT("Salvar Configuração") #define MSG_LOAD_EEPROM _UxGT("Ler Configuração") #define MSG_RESTORE_FAILSAFE _UxGT("Restauro seguro") #define MSG_INIT_EEPROM _UxGT("Iniciar EEPROM") -#define MSG_REFRESH LCD_STR_REFRESH _UxGT(" Atualização") +#define MSG_SD_UPDATE _UxGT("Atualiz. SD") +#define MSG_RESET_PRINTER _UxGT("Resetar Impressora") +#define MSG_REFRESH _UxGT("Atualização") #define MSG_WATCH _UxGT("Informações") #define MSG_PREPARE _UxGT("Preparar") #define MSG_TUNE _UxGT("Ajustar") #define MSG_PAUSE_PRINT _UxGT("Pausar impressão") #define MSG_RESUME_PRINT _UxGT("Resumir impressão") #define MSG_STOP_PRINT _UxGT("Parar impressão") +#define MSG_OUTAGE_RECOVERY _UxGT("Recuperar Impressão") #define MSG_CARD_MENU _UxGT("Imprimir do SD") #define MSG_NO_CARD _UxGT("Sem cartão SD") -#define MSG_DWELL _UxGT("ZzZzZz...") +#define MSG_DWELL _UxGT("Dormindo...") #define MSG_USERWAIT _UxGT("Clique para retomar") +#define MSG_PRINT_PAUSED _UxGT("Impressão Pausada") +#define MSG_PRINTING _UxGT("Imprimindo...") #define MSG_PRINT_ABORTED _UxGT("Impressão Abortada") #define MSG_NO_MOVE _UxGT("Sem movimento") #define MSG_KILLED _UxGT("PARADA DE EMERGÊNCIA") @@ -270,8 +291,17 @@ #define MSG_CONTROL_RETRACT_RECOVER _UxGT("Des-Retrair mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Des-RetTroca mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Des-Retrair V") +#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("Des-RetTroca V") #define MSG_AUTORETRACT _UxGT("Retração Automática") +#define MSG_FILAMENT_SWAP_LENGTH _UxGT("Distancia Retração") +#define MSG_TOOL_CHANGE _UxGT("Mudar Ferramenta") +#define MSG_TOOL_CHANGE_ZLIFT _UxGT("Levantar Z") +#define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Preparar Veloc.") +#define MSG_SINGLENOZZLE_RETRACT_SPD _UxGT("Veloc. Retração") #define MSG_FILAMENTCHANGE _UxGT("Trocar Filamento") +#define MSG_FILAMENTLOAD _UxGT("Carregar Filamento") +#define MSG_FILAMENTUNLOAD _UxGT("Descarreg. Filamento") +#define MSG_FILAMENTUNLOAD_ALL _UxGT("Descarregar Todos") #define MSG_INIT_SDCARD _UxGT("Iniciar SD") #define MSG_CHANGE_SDCARD _UxGT("Trocar SD") #define MSG_ZPROBE_OUT _UxGT("Sonda fora da mesa") @@ -279,8 +309,10 @@ #define MSG_BLTOUCH _UxGT("BLTouch") #define MSG_BLTOUCH_SELFTEST _UxGT("Testar BLTouch") #define MSG_BLTOUCH_RESET _UxGT("Reiniciar BLTouch") -#define MSG_BLTOUCH_DEPLOY _UxGT("Implantar BLTouch") -#define MSG_BLTOUCH_STOW _UxGT("Condicionar BLTouch") +#define MSG_BLTOUCH_DEPLOY _UxGT("Estender BLTouch") +#define MSG_BLTOUCH_STOW _UxGT("Recolher BLTouch") +#define MSG_MANUAL_DEPLOY _UxGT("Estender Sonda-Z") +#define MSG_MANUAL_STOW _UxGT("Recolher Sonda-Z") #define MSG_HOME _UxGT("Home") #define MSG_FIRST _UxGT("Primeiro") @@ -288,16 +320,26 @@ #define MSG_BABYSTEP_X _UxGT("Passinho X") #define MSG_BABYSTEP_Y _UxGT("Passinho Y") #define MSG_BABYSTEP_Z _UxGT("Passinho Z") -#define MSG_ENDSTOP_ABORT _UxGT("Fim de Curso") +#define MSG_ENDSTOP_ABORT _UxGT("Abortar Fim de Curso") #define MSG_HEATING_FAILED_LCD _UxGT("Aquecimento falhou") +#define MSG_HEATING_FAILED_LCD_BED _UxGT("Aquecer mesa falhou") #define MSG_ERR_REDUNDANT_TEMP _UxGT("Erro:Temp Redundante") #define MSG_THERMAL_RUNAWAY _UxGT("ESCAPE TÉRMICO") +#define MSG_THERMAL_RUNAWAY_BED _UxGT("ESCAPE TÉRMICO MESA") #define MSG_ERR_MAXTEMP _UxGT("Erro:Temp Máxima") #define MSG_ERR_MINTEMP _UxGT("Erro:Temp Mínima") #define MSG_ERR_MAXTEMP_BED _UxGT("Erro:Temp Mesa Máx") #define MSG_ERR_MINTEMP_BED _UxGT("Erro:Temp Mesa Mín") +#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST +#define MSG_HALTED _UxGT("IMPRESSORA PAROU") +#define MSG_PLEASE_RESET _UxGT("Favor resetar") +#define MSG_SHORT_DAY _UxGT("d") +#define MSG_SHORT_HOUR _UxGT("h") +#define MSG_SHORT_MINUTE _UxGT("m") #define MSG_HEATING _UxGT("Aquecendo...") -#define MSG_BED_HEATING _UxGT("Aquecendo base...") +#define MSG_COOLING _UxGT("Resfriando...") +#define MSG_BED_HEATING _UxGT("Aquecendo mesa...") +#define MSG_BED_COOLING _UxGT("Esfriando mesa...") #define MSG_DELTA_CALIBRATE _UxGT("Calibrar Delta") #define MSG_DELTA_CALIBRATE_X _UxGT("Calibrar X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Calibrar Y") @@ -307,6 +349,7 @@ #define MSG_DELTA_SETTINGS _UxGT("Configuração Delta") #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Auto-Calibração") #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Calibrar Altura") +#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Desloc. Sonda Z") #define MSG_DELTA_DIAG_ROD _UxGT("Haste Diagonal") #define MSG_DELTA_HEIGHT _UxGT("Altura") #define MSG_DELTA_RADIUS _UxGT("Raio") @@ -319,65 +362,86 @@ #define MSG_MESH_LEVELING _UxGT("Nivelamento da Malha") #define MSG_INFO_STATS_MENU _UxGT("Estatísticas") #define MSG_INFO_BOARD_MENU _UxGT("Info. da Placa") -#define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistors") +#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistores") #define MSG_INFO_EXTRUDERS _UxGT("Extrusoras") -#define MSG_INFO_BAUDRATE _UxGT("Frequência Baud") +#define MSG_INFO_BAUDRATE _UxGT("Taxa de Transmissão") #define MSG_INFO_PROTOCOL _UxGT("Protocolo") -#define MSG_CASE_LIGHT _UxGT("Luz da Estrutura") +#define MSG_CASE_LIGHT _UxGT("Luz da Impressora") #define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Intensidade Brilho") -#define MSG_INFO_PRINT_COUNT _UxGT("Qtd de Impressões") -#define MSG_INFO_COMPLETED_PRINTS _UxGT("Fim") -#define MSG_INFO_PRINT_TIME _UxGT("Tempo de Impressão") -#define MSG_INFO_PRINT_LONGEST _UxGT("Trabalho Mais longo") -#define MSG_INFO_PRINT_FILAMENT _UxGT("Total Depositado") -#define MSG_INFO_MIN_TEMP _UxGT("Temp Min") -#define MSG_INFO_MAX_TEMP _UxGT("Temp Max") + +#if LCD_WIDTH >= 20 + #define MSG_INFO_PRINT_COUNT _UxGT("Total de Impressões") + #define MSG_INFO_COMPLETED_PRINTS _UxGT("Realizadas") + #define MSG_INFO_PRINT_TIME _UxGT("Tempo de Impressão") + #define MSG_INFO_PRINT_LONGEST _UxGT("Trabalho Mais longo") + #define MSG_INFO_PRINT_FILAMENT _UxGT("Total de Extrusão") +#else + #define MSG_INFO_PRINT_COUNT _UxGT("Qtd de Impressões") + #define MSG_INFO_COMPLETED_PRINTS _UxGT("Realizadas") + #define MSG_INFO_PRINT_TIME _UxGT("Tempo de Impressão") + #define MSG_INFO_PRINT_LONGEST _UxGT("Maior trabalho") + #define MSG_INFO_PRINT_FILAMENT _UxGT("T. Extrusão") +#endif + +#define MSG_INFO_MIN_TEMP _UxGT("Temp Mín") +#define MSG_INFO_MAX_TEMP _UxGT("Temp Máx") #define MSG_INFO_PSU _UxGT("PSU") #define MSG_DRIVE_STRENGTH _UxGT("Força do Motor") #define MSG_DAC_PERCENT _UxGT("Driver %") -#define MSG_DAC_EEPROM_WRITE _UxGT("Escrever Eeprom DAC") +#define MSG_DAC_EEPROM_WRITE _UxGT("Escrever EEPROM DAC") -#define MSG_FILAMENT_CHANGE_HEADER _UxGT("Troca de Filamento") +#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("IMPRESSÃO PAUSADA") +#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("CARREGAR FILAMENTO") +#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("DESCARREG. FILAMENTO") #define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("Config. de Retomada") -#define MSG_FILAMENT_CHANGE_OPTION_EXTRUDE _UxGT("Extrusar Mais") +#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Purgar mais") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Continuar Impressão") -#define MSG_FILAMENT_CHANGE_MINTEMP _UxGT("Temp. Mínima é ") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Bocal: ") +#define MSG_RUNOUT_SENSOR_ENABLE _UxGT("Sensor filamento") #define MSG_ERR_HOMING_FAILED _UxGT("Falha ao ir à origem") #define MSG_ERR_PROBING_FAILED _UxGT("Falha ao sondar") +#define MSG_M600_TOO_COLD _UxGT("M600: Muito frio") #if LCD_HEIGHT >= 4 + #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Aperte o botão para") + #define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("continuar impressão") + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Esperando o") #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("inicio da") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("troca de Filamento") + #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("troca de filamento") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperando") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("remoção de filamento") - - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Coloque Filamento") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Coloque filamento") #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("pressione o botão") #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("para continuar...") #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Pressione o botão") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("p/ Aquecer o Bocal") + #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("p/ aquecer o bocal") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo o Bocal") + #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo o bocal") #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Aguarde...") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Esperando") + #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("remoção de filamento") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Esperando") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filamento") - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Esperando extrusão") - #define MSG_FILAMENT_CHANGE_EXTRUDE_2 _UxGT("de filamento") + #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Espere pela") + #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("purga de filamento") + + #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Clique para finaliz.") + #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("purga de filamento") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Esperando impressão") #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("continuar") #else // LCD_HEIGHT < 4 + #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Clique p. continuar") #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Aguarde...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejetando...") #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Insira e Clique") #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Aquecendo...") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Ejetando...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Carregando...") - #define MSG_FILAMENT_CHANGE_EXTRUDE_1 _UxGT("Extrusando...") + #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Purgando...") + #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Clique p. finalizar") #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Continuando...") #endif diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index 36f5ebc2a8..954e6eb458 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -85,8 +85,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fact") #define MSG_AUTOTEMP _UxGT("Temp. Automática") -#define MSG_ON _UxGT("On ") -#define MSG_OFF _UxGT("Off") +#define MSG_LCD_ON _UxGT("On") +#define MSG_LCD_OFF _UxGT("Off") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 11772ac02e..9a3761b0cb 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -184,8 +184,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Макс") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Фактор") #define MSG_AUTOTEMP _UxGT("Автотемпература") -#define MSG_ON _UxGT("Вкл.") -#define MSG_OFF _UxGT("Выкл.") +#define MSG_LCD_ON _UxGT("Вкл.") +#define MSG_LCD_OFF _UxGT("Выкл.") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 2610d7b180..a30eec9bff 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -33,15 +33,12 @@ * */ -// Put characters here that should be displayed with M117 -//_UxGT("aäAÄaáAÁeéEÉiíIÍlĺLĹ") -//_UxGT("oóOÓoôOÔrŕRŔuúUÚyýYÝ") -//_UxGT("cčCČdďDĎlľLĽnňNŇsšSŠ") -//_UxGT("tťTŤzžZŽ") - #define DISPLAY_CHARSET_ISO10646_SK #define CHARSIZE 2 +// Characters that can be displayed with M117 +#define THIS_LANGUAGES_SPECIAL_SYMBOLS _UxGT("äÄáÁčČďĎéÉíÍĺĹľĽňŇóÓôÔŕŔšŠťŤúÚýÝžŽ³") + #define WELCOME_MSG MACHINE_NAME _UxGT(" pripravená.") #define MSG_BACK _UxGT("Naspäť") #define MSG_SD_INSERTED _UxGT("Karta vložená") @@ -211,14 +208,14 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Fakt") #define MSG_AUTOTEMP _UxGT("Auto-teplota") -#define MSG_ON _UxGT("Zap") -#define MSG_OFF _UxGT("Vyp") +#define MSG_LCD_ON _UxGT("Zap") +#define MSG_LCD_OFF _UxGT("Vyp") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") #define MSG_PID_C _UxGT("PID-C") #define MSG_SELECT _UxGT("Vybrať") -#define MSG_ACC _UxGT("Zrýchl") +#define MSG_ACC _UxGT("Zrýchlenie") #define MSG_JERK _UxGT("Skok") #if IS_KINEMATIC #define MSG_VA_JERK _UxGT("Va-skok") @@ -259,7 +256,7 @@ #define MSG_TEMPERATURE _UxGT("Teplota") #define MSG_MOTION _UxGT("Pohyb") #define MSG_FILAMENT _UxGT("Filament") -#define MSG_VOLUMETRIC_ENABLED _UxGT("E na mm3") +#define MSG_VOLUMETRIC_ENABLED _UxGT("E na mm³") #define MSG_FILAMENT_DIAM _UxGT("Priem. fil.") #define MSG_FILAMENT_UNLOAD _UxGT("Vysunúť mm") #define MSG_FILAMENT_LOAD _UxGT("Zaviesť mm") @@ -278,7 +275,7 @@ #define MSG_PAUSE_PRINT _UxGT("Pozastaviť tlač") #define MSG_RESUME_PRINT _UxGT("Obnoviť tlač") #define MSG_STOP_PRINT _UxGT("Zastaviť tlač") -#define MSG_POWER_LOSS_RECOVERY _UxGT("Obnova po výp. nap.") +#define MSG_OUTAGE_RECOVERY _UxGT("Obnova po výp. nap.") #define MSG_CARD_MENU _UxGT("Tlačiť z SD") #define MSG_NO_CARD _UxGT("Žiadna SD karta") #define MSG_DWELL _UxGT("Spím...") @@ -343,8 +340,8 @@ #define MSG_SHORT_MINUTE _UxGT("m") #define MSG_HEATING _UxGT("Ohrev...") #define MSG_COOLING _UxGT("Ochladzovanie...") -#define MSG_BED_HEATING _UxGT("Ohrev podl...") -#define MSG_BED_COOLING _UxGT("Ochladzovanie podl..") +#define MSG_BED_HEATING _UxGT("Ohrev podložky...") +#define MSG_BED_COOLING _UxGT("Ochladz. podložky...") #define MSG_DELTA_CALIBRATE _UxGT("Delta kalibrácia") #define MSG_DELTA_CALIBRATE_X _UxGT("Kalibrovať X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibrovať Y") @@ -411,41 +408,41 @@ // ...or up to 2 lines on a 3-line display // #if LCD_HEIGHT >= 4 - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Stlačte tlačidlo") - #define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("pre obnovu tlače") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čakajte prosím") - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("na spustenie") - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("výmeny filamentu") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte filament") - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("a stlačte tlačidlo") - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("pre pokračovanie") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Stlačte tlačidlo") - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("pre ohrev trysky") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Ohrev trysky") - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Čakajte prosím...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Čakajte prosím") - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("na vysunutie") - #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Čakajte prosím") - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("na zavedenie") - #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Čakajte prosím") - #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("na vytlačenie") - #define MSG_FILAMENT_CHANGE_PURGE_3 _UxGT("filamentu") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Stlačte tlačidlo") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("pre dokončenie") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_3 _UxGT("vytláčania filam.") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Čakajte prosím na") - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("obnovenie tlače...") + #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Stlačte tlačidlo") + #define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("pre obnovu tlače") + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čakajte prosím") + #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("na spustenie") + #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("výmeny filamentu") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte filament") + #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("a stlačte tlačidlo") + #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("pre pokračovanie") + #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Stlačte tlačidlo") + #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("pre ohrev trysky") + #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Ohrev trysky") + #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Čakajte prosím...") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Čakajte prosím") + #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("na vysunutie") + #define MSG_FILAMENT_CHANGE_UNLOAD_3 _UxGT("filamentu") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Čakajte prosím") + #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("na zavedenie") + #define MSG_FILAMENT_CHANGE_LOAD_3 _UxGT("filamentu") + #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Čakajte prosím") + #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("na vytlačenie") + #define MSG_FILAMENT_CHANGE_PURGE_3 _UxGT("filamentu") + #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Stlačte tlačidlo") + #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("pre dokončenie") + #define MSG_FILAMENT_CHANGE_CONT_PURGE_3 _UxGT("vytláčania filam.") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Čakajte prosím na") + #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("obnovenie tlače...") #else // LCD_HEIGHT < 4 - #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Kliknite pre pokr.") - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čakajte prosím...") - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte a kliknite") - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Kliknite pre ohrev") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Ohrev...") - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Vysúvanie...") - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Zavádzanie...") - #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vytlačovanie...") - #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Klik. pre dokonč.") - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Pokračovanie...") + #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Kliknite pre pokr.") + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Čakajte prosím...") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Vložte a kliknite") + #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Kliknite pre ohrev") + #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Ohrev...") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Vysúvanie...") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Zavádzanie...") + #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Vytlačovanie...") + #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Klik. pre dokonč.") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Pokračovanie...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/src/lcd/language/language_test.h b/Marlin/src/lcd/language/language_test.h index dfc31953fb..7b25e6f3fe 100644 --- a/Marlin/src/lcd/language/language_test.h +++ b/Marlin/src/lcd/language/language_test.h @@ -66,7 +66,7 @@ #define STRG_ASCII_2 _UxGT(" !\"#$%&'()*+,-./") #define STRG_ASCII_3 _UxGT("0123456789:;<=>?") #define STRG_ASCII_4 _UxGT("@ABCDEFGHIJKLMNO") -#define STRG_ASCII_5 _UxGT("PQRSTUVWXYZ[\]^_") +#define STRG_ASCII_5 _UxGT("PQRSTUVWXYZ[\\]^_") #define STRG_ASCII_6 _UxGT("`abcdefghijklmno") #define STRG_ASCII_7 _UxGT("pqrstuvwxyz{|}~") diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index 46e0805754..16e6da2dcd 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -27,241 +27,409 @@ * LCD Menu Messages * See also http://marlinfw.org/docs/development/lcd_language.html * + * Bu çeviri dosyasındaki sorunlar ve düzeltmeler için iletişim; + * Contact for issues and corrections in this translation file; + * Yücel Temel - (info@elektromanyetix.com) - https://elektromanyetix.com/ + * */ #define DISPLAY_CHARSET_ISO10646_TR #define CHARSIZE 2 +#define THIS_LANGUAGES_SPECIAL_SYMBOLS _UxGT("İÖÇğüşöç³") -#define WELCOME_MSG MACHINE_NAME _UxGT(" hazır.") // hazır. -#define MSG_SD_INSERTED _UxGT("SD Yerleşti.") // SD Yerleşti. -#define MSG_SD_REMOVED _UxGT("SD Çıkarıldı.") // SD Çıkarıldı. -#define MSG_LCD_ENDSTOPS _UxGT("Endstops") // Max length 8 characters // Endstops -#define MSG_MAIN _UxGT("Ana") // Ana -#define MSG_BACK _UxGT("Geri") // Geri -#define MSG_AUTOSTART _UxGT("Otobaşlat") // Otobaşlat -#define MSG_DISABLE_STEPPERS _UxGT("Motorları Durdur") // Motorları Durdur -#define MSG_DEBUG_MENU _UxGT("Hata Ayıklama") // Hata Ayıklama -#define MSG_PROGRESS_BAR_TEST _UxGT("Durum Çubuğu Testi") // Durum Çubuğu Testi -#define MSG_AUTO_HOME _UxGT("Eksenleri Sıfırla") // Eksenleri Sıfırla -#define MSG_AUTO_HOME_X _UxGT("X Sıfırla") // X Sıfırla -#define MSG_AUTO_HOME_Y _UxGT("Y Sıfırla") // Y Sıfırla -#define MSG_AUTO_HOME_Z _UxGT("Z Sıfırla") // Z Sıfırla -#define MSG_TMC_Z_CALIBRATION _UxGT("Ayarla Z") -#define MSG_LEVEL_BED_HOMING _UxGT("XYZ Sıfırlanıyor") // XYZ Sıfırlanıyor -#define MSG_LEVEL_BED_WAITING _UxGT("Başlatmak için tıkla") // Başlatmak için tıkla -#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Sıradaki Nokta") // Sıradaki Nokta -#define MSG_LEVEL_BED_DONE _UxGT("Seviyeleme Tamam!") // Seviyeleme Tamam! -#define MSG_SET_HOME_OFFSETS _UxGT("Offset Ayarla") // Offset Ayarla -#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offset Tamam") // Offset Tamam -#define MSG_SET_ORIGIN _UxGT("Sıfır Belirle") // Sıfır Belirle -#define MSG_PREHEAT_1 _UxGT("Ön Isınma " PREHEAT_1_LABEL) // Ön Isınma PREHEAT_1_LABEL -#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") // -#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Tüm") // Tüm -#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Nozül") // Nozül -#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Tabla") // Tabla -#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Ayar") // Ayar -#define MSG_PREHEAT_2 _UxGT("Ön Isınma " PREHEAT_2_LABEL) // Ön Isınma PREHEAT_2_LABEL -#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") // -#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Tüm") // Tüm -#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Nozül") // Nozül -#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Tabla") // Tabla -#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Ayar") // Ayar -#define MSG_COOLDOWN _UxGT("Soğut") // Soğut -#define MSG_SWITCH_PS_ON _UxGT("Gücü Aç") // Gücü Aç -#define MSG_SWITCH_PS_OFF _UxGT("Gücü Kapat") // Gücü Kapat -#define MSG_EXTRUDE _UxGT("Extrude") // Extrude -#define MSG_RETRACT _UxGT("Geri Çek") // Geri Çek -#define MSG_MOVE_AXIS _UxGT("Eksen Yönet") // Eksenleri Yönet -#define MSG_BED_LEVELING _UxGT("Tabla Seviyele") // Tabla Seviyele -#define MSG_LEVEL_BED _UxGT("Tabla Seviyele") // Tabla Seviyele - -#define MSG_MOVING _UxGT("Konumlanıyor...") // Konumlanıyor... -#define MSG_FREE_XY _UxGT("Durdur XY") // Durdur XY -#define MSG_MOVE_X _UxGT("X") // X -#define MSG_MOVE_Y _UxGT("Y") // Y -#define MSG_MOVE_Z _UxGT("Z") // Z -#define MSG_MOVE_E _UxGT("Ekstruder") // Ekstruder -#define MSG_MOVE_01MM _UxGT("0.1mm") // 0.1mm -#define MSG_MOVE_1MM _UxGT("1mm") // 1mm -#define MSG_MOVE_10MM _UxGT("10mm") // 10mm -#define MSG_SPEED _UxGT("Hız") // Hız -#define MSG_BED_Z _UxGT("Z Mesafesi") // Z Mesafesi -#define MSG_NOZZLE _UxGT("Nozül") // Nozül -#define MSG_BED _UxGT("Tabla") // Tabla -#define MSG_FAN_SPEED _UxGT("Fan Hızı") // Fan Hızı -#define MSG_FLOW _UxGT("Akış") // Akış -#define MSG_CONTROL _UxGT("Kontrol") // Kontrol -#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") // Min -#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") // Max -#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Çarpan") // Çarpan -#define MSG_AUTOTEMP _UxGT("Autotemp") // Autotemp -#define MSG_ON _UxGT("On ") // On -#define MSG_OFF _UxGT("Off") // Off -#define MSG_PID_P _UxGT("PID-P") // PID-P -#define MSG_PID_I _UxGT("PID-I") // PID-I -#define MSG_PID_D _UxGT("PID-D") // PID-D -#define MSG_PID_C _UxGT("PID-C") // PID-C -#define MSG_SELECT _UxGT("Seç") // Seç -#define MSG_ACC _UxGT("İvme") // İvme -#define MSG_JERK _UxGT("Jerk") +#define WELCOME_MSG MACHINE_NAME _UxGT(" hazır.") +#define MSG_BACK _UxGT("Geri") +#define MSG_SD_INSERTED _UxGT("SD K. Yerleştirildi.") +#define MSG_SD_REMOVED _UxGT("SD Kart Çıkarıldı.") +#define MSG_LCD_ENDSTOPS _UxGT("Enstops") // Max length 8 characters +#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Yazılımsal Endstops") +#define MSG_MAIN _UxGT("Ana") +#define MSG_ADVANCED_SETTINGS _UxGT("Gelişmiş Ayarlar") +#define MSG_CONFIGURATION _UxGT("Yapılandırma") +#define MSG_AUTOSTART _UxGT("Oto. Başlat") +#define MSG_DISABLE_STEPPERS _UxGT("Motorları Durdur") +#define MSG_DEBUG_MENU _UxGT("Hata Ayıklama") +#define MSG_PROGRESS_BAR_TEST _UxGT("Durum Çubuğu Testi") +#define MSG_AUTO_HOME _UxGT("Eksenleri Sıfırla") +#define MSG_AUTO_HOME_X _UxGT("X Sıfırla") +#define MSG_AUTO_HOME_Y _UxGT("Y Sıfırla") +#define MSG_AUTO_HOME_Z _UxGT("Z Sıfırla") +#define MSG_AUTO_Z_ALIGN _UxGT("Oto. Z-Hizalama") +#define MSG_TMC_Z_CALIBRATION _UxGT("Z Ayarla") +#define MSG_LEVEL_BED_HOMING _UxGT("XYZ Sıfırlanıyor") +#define MSG_LEVEL_BED_WAITING _UxGT("Başlatmak için tıkla") +#define MSG_LEVEL_BED_NEXT_POINT _UxGT("Sonraki Nokta") +#define MSG_LEVEL_BED_DONE _UxGT("Hizalama Tamam!") +#define MSG_Z_FADE_HEIGHT _UxGT("Kaçınma Yüksekliği") +#define MSG_SET_HOME_OFFSETS _UxGT("Offset Ayarla") +#define MSG_HOME_OFFSETS_APPLIED _UxGT("Offset Tamam") +#define MSG_SET_ORIGIN _UxGT("Sıfır Belirle") +#define MSG_PREHEAT_1 _UxGT("Ön Isınma " PREHEAT_1_LABEL) +#define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") +#define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Tüm") +#define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Nozul") +#define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Tabla") +#define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Ayarlar") +#define MSG_PREHEAT_2 _UxGT("Ön Isınma " PREHEAT_2_LABEL) +#define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") +#define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Tüm") +#define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Nozul") +#define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Tabla") +#define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT(" Ayarlar") +#define MSG_PREHEAT_CUSTOM _UxGT("Özel Ön Isınma") +#define MSG_COOLDOWN _UxGT("Soğut") +#define MSG_SWITCH_PS_ON _UxGT("Gücü Aç") +#define MSG_SWITCH_PS_OFF _UxGT("Gücü Kapat") +#define MSG_EXTRUDE _UxGT("Ekstrüzyon") +#define MSG_RETRACT _UxGT("Geri Çek") +#define MSG_MOVE_AXIS _UxGT("Eksen Hareketleri") +#define MSG_BED_LEVELING _UxGT("Tabla Hizalama") +#define MSG_LEVEL_BED _UxGT("Tabla Hizası") +#define MSG_LEVEL_CORNERS _UxGT("Hizalama Köşeleri") +#define MSG_NEXT_CORNER _UxGT("Sonraki Köşe") +#define MSG_EDITING_STOPPED _UxGT("Mesh Düzenleme Durdu") +#define MSG_MESH_X _UxGT("İndeks X") +#define MSG_MESH_Y _UxGT("İndeks Y") +#define MSG_MESH_EDIT_Z _UxGT("Z Değeri") +#define MSG_USER_MENU _UxGT("Özel Komutlar") +#define MSG_UBL_DOING_G29 _UxGT("G29 Çalışıyor") +#define MSG_UBL_UNHOMED _UxGT("Ilk XYZ Sıfırla") +#define MSG_UBL_TOOLS _UxGT("UBL Araçları") +#define MSG_UBL_LEVEL_BED _UxGT("UBL Yatak Hizalama") +#define MSG_IDEX_MENU _UxGT("IDEX Modu") +#define MSG_IDEX_MODE_AUTOPARK _UxGT("Oto-Park") +#define MSG_IDEX_MODE_DUPLICATE _UxGT("Kopyala") +#define MSG_IDEX_MODE_SCALED_COPY _UxGT("Ölçeklenmiş Kopya") +#define MSG_IDEX_MODE_FULL_CTRL _UxGT("Tam Kontrol") +#define MSG_IDEX_X_OFFSET _UxGT("2. nozul X") +#define MSG_IDEX_Y_OFFSET _UxGT("2. nozul Y") +#define MSG_IDEX_Z_OFFSET _UxGT("2. nozul Z") +#define MSG_IDEX_SAVE_OFFSETS _UxGT("Ofsetleri Kaydet") +#define MSG_UBL_MANUAL_MESH _UxGT("Elle Mesh Oluştur") +#define MSG_UBL_BC_INSERT _UxGT("Altlık & Ölçü Ver") +#define MSG_UBL_BC_INSERT2 _UxGT("Ölçü") +#define MSG_UBL_BC_REMOVE _UxGT("Yataktan Ölçü Kaldır") +#define MSG_UBL_MOVING_TO_NEXT _UxGT("Sonrakine Git") +#define MSG_UBL_ACTIVATE_MESH _UxGT("UBL'yi Etkinleştir") +#define MSG_UBL_DEACTIVATE_MESH _UxGT("UBL'yi Etkisizleştir") +#define MSG_UBL_SET_TEMP_BED _UxGT("Yatak Sıcaklığı") +#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED +#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Nozul Sıcaklığı") +#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND +#define MSG_UBL_MESH_EDIT _UxGT("Mesh Düzenleme") +#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Özel Mesh Düzenleme") +#define MSG_UBL_FINE_TUNE_MESH _UxGT("İnce Ayar Mesh") +#define MSG_UBL_DONE_EDITING_MESH _UxGT("Mesh Düzenleme Tamam") +#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Özel Mesh Oluştur") +#define MSG_UBL_BUILD_MESH_MENU _UxGT("Mesh Oluştur") +#define MSG_UBL_BUILD_MESH_M1 _UxGT("Mesh Oluştur (" PREHEAT_1_LABEL ")") +#define MSG_UBL_BUILD_MESH_M2 _UxGT("Mesh Oluştur (" PREHEAT_2_LABEL ")") +#define MSG_UBL_BUILD_COLD_MESH _UxGT("Soğuk Mesh Oluştur") +#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Mesh Yükseklik Ayarı") +#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Yükseklik miktarı") +#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Doğrulama Mesh") +#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Doğrulama Mesh (" PREHEAT_1_LABEL ")") +#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Doğrulama Mesh (" PREHEAT_2_LABEL ")") +#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Özel Mesh Doğrulama") +#define MSG_UBL_CONTINUE_MESH _UxGT("Tabla Mesh Devam et") +#define MSG_UBL_MESH_LEVELING _UxGT("Mesh Hizalama") +#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-Nokta Hizalama") +#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Kafes Mesh Hizalama") +#define MSG_UBL_MESH_LEVEL _UxGT("Mesh Seviyesi") +#define MSG_UBL_SIDE_POINTS _UxGT("Yan Noktalar") +#define MSG_UBL_MAP_TYPE _UxGT("Haritalama Türü") +#define MSG_UBL_OUTPUT_MAP _UxGT("Mesh Çıkış Haritası") +#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Host için Çıktı") +#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("CSV için Çıktı") +#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Yazıcıda Yedek Kpalı") +#define MSG_UBL_INFO_UBL _UxGT("UBL Çıkış Bilgisi") +#define MSG_EDIT_MESH _UxGT("Mesh Düzenle") +#define MSG_UBL_FILLIN_AMOUNT _UxGT("Dolgu Miktarı") +#define MSG_UBL_MANUAL_FILLIN _UxGT("Manuel Dolgu") +#define MSG_UBL_SMART_FILLIN _UxGT("Akıllı Dogu") +#define MSG_UBL_FILLIN_MESH _UxGT("Mesh Dolgu") +#define MSG_UBL_INVALIDATE_ALL _UxGT("Tümünü Geçersiz Kıl") +#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Yakını Geçersiz Kıl") +#define MSG_UBL_FINE_TUNE_ALL _UxGT("Tümünü İnce Ayarla") +#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Yakını İnce Ayarla") +#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Mesh Depolama") +#define MSG_UBL_STORAGE_SLOT _UxGT("Bellek Yuvası") +#define MSG_UBL_LOAD_MESH _UxGT("Yatak Mesh Yükle") +#define MSG_UBL_SAVE_MESH _UxGT("Yatak Mesh Kayıt Et") +#define MSG_MESH_LOADED _UxGT("Mesh %i yüklendi") +#define MSG_MESH_SAVED _UxGT("Mesh %i kayıtlandı") +#define MSG_NO_STORAGE _UxGT("Depolama Yok") +#define MSG_UBL_SAVE_ERROR _UxGT("Hata: UBL Kayıt") +#define MSG_UBL_RESTORE_ERROR _UxGT("Hata: UBL Yenileme") +#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Ofset Durduruldu") +#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Adım Adım UBL") +#define MSG_LED_CONTROL _UxGT("LED Kontrolü") +#define MSG_LEDS _UxGT("Işıklar") +#define MSG_LED_PRESETS _UxGT("Işık Hazır Ayarları") +#define MSG_SET_LEDS_RED _UxGT("Kırmızı") +#define MSG_SET_LEDS_ORANGE _UxGT("Turuncu") +#define MSG_SET_LEDS_YELLOW _UxGT("Sarı") +#define MSG_SET_LEDS_GREEN _UxGT("Yeşil") +#define MSG_SET_LEDS_BLUE _UxGT("Mavi") +#define MSG_SET_LEDS_INDIGO _UxGT("Lacivert") +#define MSG_SET_LEDS_VIOLET _UxGT("Menekşe") +#define MSG_SET_LEDS_WHITE _UxGT("Beyaz") +#define MSG_SET_LEDS_DEFAULT _UxGT("Varsayılan") +#define MSG_CUSTOM_LEDS _UxGT("Özel Işıklar") +#define MSG_INTENSITY_R _UxGT("Kırmızı Şiddeti") +#define MSG_INTENSITY_G _UxGT("Yeşil Şiddeti") +#define MSG_INTENSITY_B _UxGT("Mavi Şiddeti") +#define MSG_INTENSITY_W _UxGT("Beyaz Şiddeti") +#define MSG_LED_BRIGHTNESS _UxGT("Parlaklık") +#define MSG_MOVING _UxGT("Hareket Ediyor..") +#define MSG_FREE_XY _UxGT("Durdur XY") +#define MSG_MOVE_X _UxGT("X Hareketi") +#define MSG_MOVE_Y _UxGT("Y Hareketi") +#define MSG_MOVE_Z _UxGT("Z Hareketi") +#define MSG_MOVE_E _UxGT("Ekstruder") +#define MSG_HOTEND_TOO_COLD _UxGT("Nozul Çok Soğuk") +#define MSG_MOVE_01MM _UxGT("0.1mm") +#define MSG_MOVE_1MM _UxGT("1mm") +#define MSG_MOVE_10MM _UxGT("10mm") +#define MSG_SPEED _UxGT("Hız") +#define MSG_BED_Z _UxGT("Z Mesafesi") +#define MSG_NOZZLE _UxGT("Nozul") +#define MSG_BED _UxGT("Tabla") +#define MSG_FAN_SPEED _UxGT("Fan Hızı") +#define MSG_EXTRA_FAN_SPEED _UxGT("Ekstra Fan Hızı") +#define MSG_FLOW _UxGT("Akış") +#define MSG_CONTROL _UxGT("Kontrol") +#define MSG_MIN _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Min") +#define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Max") +#define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Çarpan") +#define MSG_AUTOTEMP _UxGT("Oto. Sıcaklık") +#define MSG_LCD_ON _UxGT("Açık") +#define MSG_LCD_OFF _UxGT("Kapalı") +#define MSG_PID_P _UxGT("PID-P") +#define MSG_PID_I _UxGT("PID-I") +#define MSG_PID_D _UxGT("PID-D") +#define MSG_PID_C _UxGT("PID-C") +#define MSG_SELECT _UxGT("Seç") +#define MSG_ACC _UxGT("İvme") +#define MSG_JERK _UxGT("Sarsım") #if IS_KINEMATIC - #define MSG_VA_JERK _UxGT("Va-jerk") - #define MSG_VB_JERK _UxGT("Vb-jerk") - #define MSG_VC_JERK _UxGT("Vc-jerk") + #define MSG_VA_JERK _UxGT("Va-Sarsım") + #define MSG_VB_JERK _UxGT("Vb-Sarsım") + #define MSG_VC_JERK _UxGT("Vc-Sarsım") #else - #define MSG_VA_JERK _UxGT("Vx-jerk") - #define MSG_VB_JERK _UxGT("Vy-jerk") - #define MSG_VC_JERK _UxGT("Vz-jerk") + #define MSG_VA_JERK _UxGT("Vx-Sarsım") + #define MSG_VB_JERK _UxGT("Vy-Sarsım") + #define MSG_VC_JERK _UxGT("Vz-Sarsım") #endif -#define MSG_VE_JERK _UxGT("Ve-jerk") // Ve-Jerk -#define MSG_VMAX _UxGT("Vmax ") // Vmax -#define MSG_VMIN _UxGT("Vmin") // Vmin -#define MSG_VTRAV_MIN _UxGT("VTrav min") // Vtrav min -#define MSG_AMAX _UxGT("Amax ") // Amax -#define MSG_A_RETRACT _UxGT("A-retract") // A-retract -#define MSG_A_TRAVEL _UxGT("A-travel") // A-travel -#define MSG_STEPS_PER_MM _UxGT("Steps/mm") // Steps/mm +#define MSG_VE_JERK _UxGT("Ve-Sarsım") +#define MSG_JUNCTION_DEVIATION _UxGT("Jonksiyon Sapması") +#define MSG_VELOCITY _UxGT("Hız Vektörü") +#define MSG_VMAX _UxGT("HızVektör.max ") +#define MSG_VMIN _UxGT("HızVektör.min") +#define MSG_VTRAV_MIN _UxGT("HV.gezinme min") +#define MSG_ACCELERATION _UxGT("Ivme") +#define MSG_AMAX _UxGT("Max. ivme ") +#define MSG_A_RETRACT _UxGT("Ivme-geri çekme") +#define MSG_A_TRAVEL _UxGT("Ivme-gezinme") +#define MSG_STEPS_PER_MM _UxGT("Adım/mm") #if IS_KINEMATIC - #define MSG_ASTEPS _UxGT("Asteps/mm") - #define MSG_BSTEPS _UxGT("Bsteps/mm") - #define MSG_CSTEPS _UxGT("Csteps/mm") + #define MSG_ASTEPS _UxGT("A adım/mm") + #define MSG_BSTEPS _UxGT("B adım/mm") + #define MSG_CSTEPS _UxGT("C adım/mm") #else - #define MSG_ASTEPS _UxGT("Xsteps/mm") - #define MSG_BSTEPS _UxGT("Ysteps/mm") - #define MSG_CSTEPS _UxGT("Zsteps/mm") + #define MSG_ASTEPS _UxGT("X adım/mm") + #define MSG_BSTEPS _UxGT("Y adım/mm") + #define MSG_CSTEPS _UxGT("Z adım/mm") #endif -#define MSG_ESTEPS _UxGT("Esteps/mm") // Esteps/mm -#define MSG_E1STEPS _UxGT("E1steps/mm") // E1steps/mm -#define MSG_E2STEPS _UxGT("E2steps/mm") // E2steps/mm -#define MSG_E3STEPS _UxGT("E3steps/mm") // E3steps/mm -#define MSG_E4STEPS _UxGT("E4steps/mm") // E4steps/mm -#define MSG_E5STEPS _UxGT("E5steps/mm") // E5steps/mm -#define MSG_E6STEPS _UxGT("E6steps/mm") // E6steps/mm -#define MSG_TEMPERATURE _UxGT("Sıcaklık") // Sıcaklık -#define MSG_MOTION _UxGT("Hareket") // Hareket -#define MSG_FILAMENT _UxGT("Filaman") // Filaman -#define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") // E in mm3 -#define MSG_FILAMENT_DIAM _UxGT("Fil. Çap") // Fil. Çap -#define MSG_ADVANCE_K _UxGT("K İlerlet") // K İlerlet -#define MSG_CONTRAST _UxGT("LCD Kontrast") // LCD Kontrast -#define MSG_STORE_EEPROM _UxGT("Hafızaya Al") // Hafızaya Al -#define MSG_LOAD_EEPROM _UxGT("Hafızadan Yükle") // Hafızadan Yükle -#define MSG_RESTORE_FAILSAFE _UxGT("Fabrika Ayarları") // Fabrika Ayarları -#define MSG_REFRESH _UxGT("Yenile") // Yenile -#define MSG_WATCH _UxGT("Bilgi Ekranı") // Bilgi Ekranı -#define MSG_PREPARE _UxGT("Hazırlık") // Hazırlık -#define MSG_TUNE _UxGT("Ayar") // Ayar -#define MSG_PAUSE_PRINT _UxGT("Duraklat") // Duraklat -#define MSG_RESUME_PRINT _UxGT("Sürdür") // Sürdür -#define MSG_STOP_PRINT _UxGT("Durdur") // Durdur -#define MSG_CARD_MENU _UxGT("SD den Yazdır") // SD den Yazdır -#define MSG_NO_CARD _UxGT("SD Kart Yok") // SD Kart Yok -#define MSG_DWELL _UxGT("Uyku...") // Uyku... -#define MSG_USERWAIT _UxGT("Operatör bekleniyor...") // Operatör bekleniyor... -#define MSG_PRINT_ABORTED _UxGT("Baskı Durduruldu") // Baskı Durduruldu -#define MSG_NO_MOVE _UxGT("İşlem yok.") // İşlem yok. -#define MSG_KILLED _UxGT("Kilitlendi. ") // Kilitlendi. -#define MSG_STOPPED _UxGT("Durdu. ") // Durdu. -#define MSG_CONTROL_RETRACT _UxGT("Geri Çek mm") // Geri Çek mm -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Re.mm") // Swap Re.mm -#define MSG_CONTROL_RETRACTF _UxGT("Geri Çekme V") // Geri Çekme V -#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") // Hop mm -#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") // UnRet mm -#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("S UnRet mm") // S UnRetmm -#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") // UnRet V -#define MSG_AUTORETRACT _UxGT("AutoRetr.") // AutoRetr. -#define MSG_FILAMENTCHANGE _UxGT("Filaman Değiştir") // Filaman Değiştir -#define MSG_INIT_SDCARD _UxGT("Init. SD") // Init. SD -#define MSG_CHANGE_SDCARD _UxGT("SD Değiştir") // SD Değiştir -#define MSG_ZPROBE_OUT _UxGT("Z Prob Açık. Tabla") // Z Prob Açık. Tabla -#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") // BLTouch Self-Test -#define MSG_BLTOUCH_RESET _UxGT("Sıfırla BLTouch") // Sıfırla BLTouch -#define MSG_HOME _UxGT("Sıfırla") // Sıfırla -#define MSG_FIRST _UxGT("önce") // Önce -#define MSG_ZPROBE_ZOFFSET _UxGT("Z Offset") // Z Offset -#define MSG_BABYSTEP_X _UxGT("Miniadım X") // Miniadım X -#define MSG_BABYSTEP_Y _UxGT("Miniadım Y") // Miniadım Y -#define MSG_BABYSTEP_Z _UxGT("Miniadım Z") // Miniadım Z -#define MSG_ENDSTOP_ABORT _UxGT("Endstop iptal") // Endstop iptal -#define MSG_HEATING_FAILED_LCD _UxGT("Isınma başarısız") // Isınma başarısız -#define MSG_ERR_REDUNDANT_TEMP _UxGT("Hata: Geçersiz Sıcaklık") // Hata: Geçersiz Sıcaklık -#define MSG_THERMAL_RUNAWAY _UxGT("TERMAL PROBLEM") // TERMAL PROBLEM -#define MSG_ERR_MAXTEMP _UxGT("Hata: MAXSICAKLIK") // Hata: MAXSICAKLIK -#define MSG_ERR_MINTEMP _UxGT("Hata: MINSICAKLIK") // Hata: MINSICAKLIK -#define MSG_ERR_MAXTEMP_BED _UxGT("Hata: MAXSIC. TABLA") // Hata: MAXSIC. TABLA -#define MSG_ERR_MINTEMP_BED _UxGT("Hata: MINSIC. TABLA") // Hata: MINSIC. TABLA -#define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST -#define MSG_HALTED _UxGT("YAZICI DURDURULDU") // YAZICI DURDURULDU -#define MSG_PLEASE_RESET _UxGT("Lütfen resetleyin") // Lütfen resetleyin -#define MSG_SHORT_DAY _UxGT("G") // One character only // G -#define MSG_SHORT_HOUR _UxGT("S") // One character only // S -#define MSG_SHORT_MINUTE _UxGT("D") // One character only // D -#define MSG_HEATING _UxGT("Isınıyor...") // Isınıyor... -#define MSG_BED_HEATING _UxGT("Tabla Isınıyor...") // Tabla Isınıyor... -#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrasyonu") // Delta Kalibrasyonu -#define MSG_DELTA_CALIBRATE_X _UxGT("Ayarla X") // Ayarla X -#define MSG_DELTA_CALIBRATE_Y _UxGT("Ayarla Y") // Ayarla Y -#define MSG_DELTA_CALIBRATE_Z _UxGT("Ayarla Z") // Ayarla Z -#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Ayarla Merkez") // Ayarla Merkez -#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Oto Kalibrasyon") // Oto Kalibrasyon -#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Delta Yük. Ayarla") // Delta Yük. Ayarla -#define MSG_INFO_MENU _UxGT("Yazıcı Hakkında") // Yazıcı Hakkında -#define MSG_INFO_PRINTER_MENU _UxGT("Yazıcı Bilgisi") // Yazıcı Bilgisi -#define MSG_INFO_STATS_MENU _UxGT("İstatistikler") // İstatistikler -#define MSG_INFO_BOARD_MENU _UxGT("Kontrolör Bilgisi") // Kontrol Bilgisi -#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistörler") // Termistörler -#define MSG_INFO_EXTRUDERS _UxGT("Ekstruderler") // Ekstruderler -#define MSG_INFO_BAUDRATE _UxGT("İletişim Hızı") // İletişim Hızı -#define MSG_INFO_PROTOCOL _UxGT("Protokol") // Protokol -#define MSG_CASE_LIGHT _UxGT("Aydınlatmayı") // Aydınlatmayı Aç - +#define MSG_ESTEPS _UxGT("E adım/mm") +#define MSG_E1STEPS _UxGT("E1 adım/mm") +#define MSG_E2STEPS _UxGT("E2 adım/mm") +#define MSG_E3STEPS _UxGT("E3 adım/mm") +#define MSG_E4STEPS _UxGT("E4 adım/mm") +#define MSG_E5STEPS _UxGT("E5 adım/mm") +#define MSG_E6STEPS _UxGT("E6 adım/mm") +#define MSG_TEMPERATURE _UxGT("Sıcaklık") +#define MSG_MOTION _UxGT("Hareket") +#define MSG_FILAMENT _UxGT("Filaman") +#define MSG_VOLUMETRIC_ENABLED _UxGT("Ekstrüzyon/mm³") +#define MSG_FILAMENT_DIAM _UxGT("Filaman Çapı") +#define MSG_FILAMENT_UNLOAD _UxGT("Çıkart mm") +#define MSG_FILAMENT_LOAD _UxGT("Yükle mm") +#define MSG_ADVANCE_K _UxGT("K İlerlet") +#define MSG_CONTRAST _UxGT("LCD Kontrast") +#define MSG_STORE_EEPROM _UxGT("Hafızaya Al") +#define MSG_LOAD_EEPROM _UxGT("Hafızadan Yükle") +#define MSG_RESTORE_FAILSAFE _UxGT("Fabrika Ayarları") +#define MSG_INIT_EEPROM _UxGT("EEPROM'u başlat") +#define MSG_SD_UPDATE _UxGT("SD Güncellemesi") +#define MSG_RESET_PRINTER _UxGT("Yazıcıyı Resetle") +#define MSG_REFRESH _UxGT("Yenile") +#define MSG_WATCH _UxGT("Bilgi Ekranı") +#define MSG_PREPARE _UxGT("Hazırlık") +#define MSG_TUNE _UxGT("Ayar") +#define MSG_PAUSE_PRINT _UxGT("Duraklat") +#define MSG_RESUME_PRINT _UxGT("Sürdür") +#define MSG_STOP_PRINT _UxGT("Durdur") +#define MSG_OUTAGE_RECOVERY _UxGT("Kesinti Kurtarma") +#define MSG_CARD_MENU _UxGT("SD Karttan Yazdır") +#define MSG_NO_CARD _UxGT("SD Kart Yok!") +#define MSG_DWELL _UxGT("Uyku...") +#define MSG_USERWAIT _UxGT("Operatör bekleniyor.") +#define MSG_PRINT_PAUSED _UxGT("Baskı Duraklatıldı") +#define MSG_PRINTING _UxGT("Baskı Yapılıyor...") +#define MSG_PRINT_ABORTED _UxGT("Baskı Durduruldu!") +#define MSG_NO_MOVE _UxGT("İşlem yok.") +#define MSG_KILLED _UxGT("Kilitlendi. ") +#define MSG_STOPPED _UxGT("Durdu. ") +#define MSG_CONTROL_RETRACT _UxGT("Geri Çek mm") +#define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Re.mm") +#define MSG_CONTROL_RETRACTF _UxGT("Geri Çekme V") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Atlama mm") +#define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") +#define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("S UnRet mm") +#define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") +#define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") +#define MSG_AUTORETRACT _UxGT("Oto. Geri Çekme") +#define MSG_FILAMENT_SWAP_LENGTH _UxGT("G.Çekme Boyu") +#define MSG_TOOL_CHANGE _UxGT("Takım Değişimi") +#define MSG_TOOL_CHANGE_ZLIFT _UxGT("Z Yükselt") +#define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Birincil Hız") +#define MSG_SINGLENOZZLE_RETRACT_SPD _UxGT("Geri Çekme Hızı") +#define MSG_FILAMENTCHANGE _UxGT("Filaman Değiştir") +#define MSG_FILAMENTLOAD _UxGT("Filaman Yükle") +#define MSG_FILAMENTUNLOAD _UxGT("Filaman Çıkart") +#define MSG_FILAMENTUNLOAD_ALL _UxGT("Tümünü Çıkart") +#define MSG_INIT_SDCARD _UxGT("SD Kart Başlatılıyor") +#define MSG_CHANGE_SDCARD _UxGT("SD Kart Değiştir") +#define MSG_ZPROBE_OUT _UxGT("Z Prob Açık. Tabla") +#define MSG_SKEW_FACTOR _UxGT("Çarpıklık Faktörü") +#define MSG_BLTOUCH _UxGT("BLTouch") +#define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") +#define MSG_BLTOUCH_RESET _UxGT("Sıfırla BLTouch") +#define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch Aç") +#define MSG_BLTOUCH_STOW _UxGT("BLTouch Kapat") +#define MSG_MANUAL_DEPLOY _UxGT("Z-Prob Aç") +#define MSG_MANUAL_STOW _UxGT("Z-Sensör Kapat") +#define MSG_HOME _UxGT("Sıfırla") +#define MSG_FIRST _UxGT("Önce") +#define MSG_ZPROBE_ZOFFSET _UxGT("Z Offset") +#define MSG_BABYSTEP_X _UxGT("Miniadım X") +#define MSG_BABYSTEP_Y _UxGT("Miniadım Y") +#define MSG_BABYSTEP_Z _UxGT("Miniadım Z") +#define MSG_ENDSTOP_ABORT _UxGT("Endstop iptal") +#define MSG_HEATING_FAILED_LCD _UxGT("Isınma başarısız") +#define MSG_HEATING_FAILED_LCD_BED _UxGT("Yatak Isınma Başrsız") +#define MSG_ERR_REDUNDANT_TEMP _UxGT("Hata: Sıcaklık Aşımı") +#define MSG_THERMAL_RUNAWAY _UxGT("TERMAL PROBLEM") +#define MSG_THERMAL_RUNAWAY_BED _UxGT("TABLA TERMAL PROBLEM") +#define MSG_ERR_MAXTEMP _UxGT("Hata: MAX.SICAKLIK") +#define MSG_ERR_MINTEMP _UxGT("Hata: MIN.SICAKLIK") +#define MSG_ERR_MAXTEMP_BED _UxGT("Hata: MAX.SIC. TABLA") +#define MSG_ERR_MINTEMP_BED _UxGT("Hata: MIN.SIC. TABLA") +#define MSG_ERR_Z_HOMING _UxGT("Önce XY Sıfırla") +#define MSG_HALTED _UxGT("YAZICI DURDURULDU") +#define MSG_PLEASE_RESET _UxGT("Lütfen Resetleyin") +#define MSG_SHORT_DAY _UxGT("G") // One character only +#define MSG_SHORT_HOUR _UxGT("S") // One character only +#define MSG_SHORT_MINUTE _UxGT("D") // One character only +#define MSG_HEATING _UxGT("Isınıyor...") +#define MSG_COOLING _UxGT("Soğuyor...") +#define MSG_BED_HEATING _UxGT("Tabla Isınıyor...") +#define MSG_BED_COOLING _UxGT("Tabla Soğuyor...") +#define MSG_DELTA_CALIBRATE _UxGT("Delta Kalibrasyonu") +#define MSG_DELTA_CALIBRATE_X _UxGT("Ayarla X") +#define MSG_DELTA_CALIBRATE_Y _UxGT("Ayarla Y") +#define MSG_DELTA_CALIBRATE_Z _UxGT("Ayarla Z") +#define MSG_DELTA_CALIBRATE_CENTER _UxGT("Ayarla Merkez") +#define MSG_DELTA_SETTINGS _UxGT("Delta Ayarları") +#define MSG_DELTA_AUTO_CALIBRATE _UxGT("Oto Kalibrasyon") +#define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Delta Yük. Ayarla") +#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Z Prob Ofseti") +#define MSG_DELTA_DIAG_ROD _UxGT("Çapral Mil") +#define MSG_DELTA_HEIGHT _UxGT("Yükseklik") +#define MSG_DELTA_RADIUS _UxGT("Yarıçap") +#define MSG_INFO_MENU _UxGT("Yazıcı Hakkında") +#define MSG_INFO_PRINTER_MENU _UxGT("Yazıcı Bilgisi") +#define MSG_3POINT_LEVELING _UxGT("3-Nokta Hizalama") +#define MSG_LINEAR_LEVELING _UxGT("Doğrusal Hizalama") +#define MSG_BILINEAR_LEVELING _UxGT("İki Yönlü Doğ. Hiza.") +#define MSG_UBL_LEVELING _UxGT("Birleşik Tabla Hiza.") +#define MSG_MESH_LEVELING _UxGT("Mesh Hizalama") +#define MSG_INFO_STATS_MENU _UxGT("İstatistikler") +#define MSG_INFO_BOARD_MENU _UxGT("Kontrolcü Bilgisi") +#define MSG_INFO_THERMISTOR_MENU _UxGT("Termistörler") +#define MSG_INFO_EXTRUDERS _UxGT("Ekstruderler") +#define MSG_INFO_BAUDRATE _UxGT("İletişim Hızı") +#define MSG_INFO_PROTOCOL _UxGT("Protokol") +#define MSG_CASE_LIGHT _UxGT("Aydınlatmayı Aç") +#define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Aydınlatma Parlaklğı") #if LCD_WIDTH >= 20 - #define MSG_INFO_PRINT_COUNT _UxGT("Baskı Sayısı") // Baskı Sayısı - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Tamamlanan") // Tamamlanan - #define MSG_INFO_PRINT_TIME _UxGT("Toplam Baskı Süresi") // Toplam Baskı Süresi - #define MSG_INFO_PRINT_LONGEST _UxGT("En Uzun Baskı Süresi") // En Uzun Baskı Süresi - #define MSG_INFO_PRINT_FILAMENT _UxGT("Toplam Filaman") // Toplam Filaman + #define MSG_INFO_PRINT_COUNT _UxGT("Baskı Sayısı") + #define MSG_INFO_COMPLETED_PRINTS _UxGT("Tamamlanan") + #define MSG_INFO_PRINT_TIME _UxGT("Toplam Baskı Süresi") + #define MSG_INFO_PRINT_LONGEST _UxGT("En Uzun Baskı Süresi") + #define MSG_INFO_PRINT_FILAMENT _UxGT("Toplam Filaman") #else - #define MSG_INFO_PRINT_COUNT _UxGT("Baskı") // Baskı - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Tamamlanan") // Tamamlanan - #define MSG_INFO_PRINT_TIME _UxGT("Süre") // Süre - #define MSG_INFO_PRINT_LONGEST _UxGT("En Uzun") // En Uzun - #define MSG_INFO_PRINT_FILAMENT _UxGT("Filaman") // Filaman + #define MSG_INFO_PRINT_COUNT _UxGT("Baskı") + #define MSG_INFO_COMPLETED_PRINTS _UxGT("Tamamlanan") + #define MSG_INFO_PRINT_TIME _UxGT("Süre") + #define MSG_INFO_PRINT_LONGEST _UxGT("En Uzun") + #define MSG_INFO_PRINT_FILAMENT _UxGT("Filaman") #endif - -#define MSG_INFO_MIN_TEMP _UxGT("Min Sıc.") // Min Sıcak. -#define MSG_INFO_MAX_TEMP _UxGT("Max Sıc.") // Max Sıcak. -#define MSG_INFO_PSU _UxGT("Güç Kaynağı") // Güç Kaynağı - -#define MSG_DRIVE_STRENGTH _UxGT("Sürücü Gücü") // Sürücü Gücü -#define MSG_DAC_PERCENT _UxGT("Sürücü %") // Sürücü % -#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("Seçenekler:") // Seçenekler: -#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Baskıyı sürdür") // Baskıyı sürdür -#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozül: ") // Nozül: - +#define MSG_INFO_MIN_TEMP _UxGT("Min Sıc.") +#define MSG_INFO_MAX_TEMP _UxGT("Max Sıc.") +#define MSG_INFO_PSU _UxGT("Güç Kaynağı") +#define MSG_DRIVE_STRENGTH _UxGT("Sürücü Gücü") +#define MSG_DAC_PERCENT _UxGT("Sürücü %") +#define MSG_DAC_EEPROM_WRITE _UxGT("DAC EEPROM Yaz") +#define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("BASKI DURAKLATILDI") +#define MSG_FILAMENT_CHANGE_HEADER_LOAD _UxGT("FILAMAN YüKLE") +#define MSG_FILAMENT_CHANGE_HEADER_UNLOAD _UxGT("FILAMAN ÇIKART") +#define MSG_FILAMENT_CHANGE_OPTION_HEADER _UxGT("Seçenekler:") +#define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Daha Fazla Tasviye") +#define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Baskıyı sürdür") +#define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Nozul: ") +#define MSG_RUNOUT_SENSOR_ENABLE _UxGT("Runout Sensörü") +#define MSG_ERR_HOMING_FAILED _UxGT("Sıfırlama Başarısız") +#define MSG_ERR_PROBING_FAILED _UxGT("Probing Başarısız") +#define MSG_M600_TOO_COLD _UxGT("M600: Çok Soğuk") +// +// Filament Değiştirme ekranları, 4 satırlı bir ekranda 3 satıra kadar gösterilir +// ...veya 3 satırlı ekranda 2 satıra kadar #if LCD_HEIGHT >= 4 // Up to 3 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Başlama bekleniyor") // Başlama bekleniyor - #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("filamanın") // filamanın - #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("değişimi") // değişimi - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Bekleniyor") // Bekleniyor - #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("filamanın çıkması") // filamanın çıkması - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Filamanı yükle") // Filamanı yükle - #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("ve devam için") // ve devam için - #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("tuşa bas...") // tuşa bas... - #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Nozülü Isıtmak için") // Nozülü Isıtmak için - #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("Butona Bas.") // Butona Bas. - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nozül Isınıyor") // Nozül Isınıyor - #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Lütfen Bekleyin...") // Lütfen Bekleyin... - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Bekleniyor") // Bekleniyor - #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("filamanın yüklenmesi") // filamanın yüklenmesi - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Baskının sürdürülmesini") // Baskının sürdürülmesini - #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("bekle") // bekle + #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Baskıya devam etmek") + #define MSG_ADVANCED_PAUSE_WAITING_2 _UxGT("için Butona bas") + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Filaman değişimi") + #define MSG_FILAMENT_CHANGE_INIT_2 _UxGT("için başlama") + #define MSG_FILAMENT_CHANGE_INIT_3 _UxGT("bekleniyor") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Filamanı yükle") + #define MSG_FILAMENT_CHANGE_INSERT_2 _UxGT("ve devam için") + #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("tuşa bas...") + #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Nozulü Isıtmak için") + #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("Butona Bas.") + #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Nozul Isınıyor") + #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Lütfen Bekleyin...") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Filamanın çıkması") + #define MSG_FILAMENT_CHANGE_UNLOAD_2 _UxGT("bekleniyor") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Filamanın yüklenmesi") + #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("bekleniyor..") + #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Filaman Temizlemesi") + #define MSG_FILAMENT_CHANGE_PURGE_2 _UxGT("için bekle") + #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Filaman Temizlemesi") + #define MSG_FILAMENT_CHANGE_CONT_PURGE_2 _UxGT("bitirmek için tıkla") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Baskının devam ") + #define MSG_FILAMENT_CHANGE_RESUME_2 _UxGT("etmesi için bekle") #else // LCD_HEIGHT < 4 // Up to 2 lines allowed - #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Lütfen bekleyiniz...") // Lütfen bekleyiniz... - #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Çıkartılıyor...") // Çıkartılıyor... - #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Yükle ve bas") // Yükle ve bas - #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Yüklüyor...") // Yüklüyor... - #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Sürdürülüyor...") // Sürdürülüyor... + #define MSG_ADVANCED_PAUSE_WAITING_1 _UxGT("Sürdürmek İçin Tıkla") + #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Lütfen bekleyiniz...") + #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Yükle ve bas") + #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Isıtmak için Tıkla") + #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Isınıyor...") + #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Çıkartılıyor...") + #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Yüklüyor...") + #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Temizleniyor...") + #define MSG_FILAMENT_CHANGE_CONT_PURGE_1 _UxGT("Bitirmek için Tıkla") + #define MSG_FILAMENT_CHANGE_RESUME_1 _UxGT("Sürdürülüyor...") #endif // LCD_HEIGHT < 4 diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 8030f3da44..38d7642420 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -87,8 +87,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Макс") #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" Факт") #define MSG_AUTOTEMP _UxGT("Автотемпер.") -#define MSG_ON _UxGT("Увімк.") -#define MSG_OFF _UxGT("Вимк. ") +#define MSG_LCD_ON _UxGT("Увімк.") +#define MSG_LCD_OFF _UxGT("Вимк.") #define MSG_PID_P _UxGT("PID-P") #define MSG_PID_I _UxGT("PID-I") #define MSG_PID_D _UxGT("PID-D") diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index adee5d5bdb..7eb9fa008f 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -180,8 +180,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 最大") //" " LCD_STR_THERMOMETER " Max" #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 因数") //" " LCD_STR_THERMOMETER " Fact" #define MSG_AUTOTEMP _UxGT("自动控温") //"Autotemp" -#define MSG_ON _UxGT("开 ") //"On " -#define MSG_OFF _UxGT("关 ") //"Off" +#define MSG_LCD_ON _UxGT("开") //"On" +#define MSG_LCD_OFF _UxGT("关") //"Off" #define MSG_PID_P _UxGT("PID-P") //"PID-P" #define MSG_PID_I _UxGT("PID-I") //"PID-I" #define MSG_PID_D _UxGT("PID-D") //"PID-D" @@ -324,7 +324,7 @@ #define MSG_CASE_LIGHT _UxGT("外壳灯") // "Case light" #define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("灯亮度") // "Light BRIGHTNESS" -#if LCD_WIDTH > 19 +#if LCD_WIDTH >= 20 #define MSG_INFO_PRINT_COUNT _UxGT("打印计数") //"Print Count" #define MSG_INFO_COMPLETED_PRINTS _UxGT("完成了") //"Completed" #define MSG_INFO_PRINT_TIME _UxGT("总打印时间") //"Total print time" diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index c64ac2f2b6..d823ad4d6f 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -180,8 +180,8 @@ #define MSG_MAX _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 最大") //" " LCD_STR_THERMOMETER " Max" #define MSG_FACTOR _UxGT(" ") LCD_STR_THERMOMETER _UxGT(" 系數") //" " LCD_STR_THERMOMETER " Fact" #define MSG_AUTOTEMP _UxGT("自動控溫") //"Autotemp" -#define MSG_ON _UxGT("開 ") //"On " -#define MSG_OFF _UxGT("關 ") //"Off" +#define MSG_LCD_ON _UxGT("開") //"On" +#define MSG_LCD_OFF _UxGT("關") //"Off" #define MSG_PID_P _UxGT("PID-P") //"PID-P" #define MSG_PID_I _UxGT("PID-I") //"PID-I" #define MSG_PID_D _UxGT("PID-D") //"PID-D" @@ -324,7 +324,7 @@ #define MSG_CASE_LIGHT _UxGT("外殼燈") // "Case light" #define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("燈亮度") // "Light BRIGHTNESS" -#if LCD_WIDTH > 19 +#if LCD_WIDTH >= 20 #define MSG_INFO_PRINT_COUNT _UxGT("列印計數") //"Print Count" #define MSG_INFO_COMPLETED_PRINTS _UxGT("已完成") //"Completed" #define MSG_INFO_PRINT_TIME _UxGT("總列印時間") //"Total print time" diff --git a/Marlin/src/lcd/lcdprint.h b/Marlin/src/lcd/lcdprint.h index b7366aff89..59cd546855 100644 --- a/Marlin/src/lcd/lcdprint.h +++ b/Marlin/src/lcd/lcdprint.h @@ -48,10 +48,12 @@ int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length); */ int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length); -void lcd_moveto(int col, int row); +void lcd_moveto(const uint8_t col, const uint8_t row); + +void lcd_put_int(const int i); inline int lcd_put_u8str_P(PGM_P str) { return lcd_put_u8str_max_P(str, PIXEL_LEN_NOLIMIT); } inline int lcd_put_u8str(const char* str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); } -inline int lcd_put_wchar(wchar_t c) { return lcd_put_wchar_max(c, PIXEL_LEN_NOLIMIT); } +inline int lcd_put_wchar(const wchar_t c) { return lcd_put_wchar_max(c, PIXEL_LEN_NOLIMIT); } diff --git a/Marlin/src/lcd/malyanlcd.cpp b/Marlin/src/lcd/malyanlcd.cpp index 1e90cea24a..0df6a8937a 100644 --- a/Marlin/src/lcd/malyanlcd.cpp +++ b/Marlin/src/lcd/malyanlcd.cpp @@ -45,6 +45,7 @@ #if ENABLED(MALYAN_LCD) +#include "ultralcd.h" #include "../module/temperature.h" #include "../module/planner.h" #include "../module/stepper.h" @@ -277,7 +278,7 @@ void process_lcd_p_command(const char* command) { // There may be a difference in how V1 and V2 LCDs handle subdirectory // prints. Investigate more. This matches the V1 motion controller actions // but the V2 LCD switches to "print" mode on {SYS:DIR} response. - if (card.filenameIsDir) { + if (card.flag.filenameIsDir) { card.chdir(card.filename); write_to_lcd_P(PSTR("{SYS:DIR}")); } @@ -329,7 +330,7 @@ void process_lcd_s_command(const char* command) { case 'L': { #if ENABLED(SDSUPPORT) - if (!card.cardOK) card.initsd(); + if (!card.flag.cardOK) card.initsd(); // A more efficient way to do this would be to // implement a callback in the ls_SerialPrint code, but @@ -341,7 +342,7 @@ void process_lcd_s_command(const char* command) { uint16_t file_count = card.get_num_Files(); for (uint16_t i = 0; i < file_count; i++) { card.getfilename(i); - sprintf_P(message_buffer, card.filenameIsDir ? PSTR("{DIR:%s}") : PSTR("{FILE:%s}"), card.longest_filename()); + sprintf_P(message_buffer, card.flag.filenameIsDir ? PSTR("{DIR:%s}") : PSTR("{FILE:%s}"), card.longest_filename()); write_to_lcd(message_buffer); } @@ -417,7 +418,7 @@ void update_usb_status(const bool forceUpdate) { * The optimize attribute fixes a register Compile * error for amtel. */ -void lcd_update() { +void MarlinUI::update() { static char inbound_buffer[MAX_CURLY_COMMAND]; // First report USB status. @@ -461,7 +462,7 @@ void lcd_update() { * it and translate into gcode, which then gets injected into * the command queue where possible. */ -void lcd_init() { +void MarlinUI::init() { inbound_count = 0; LCD_SERIAL.begin(500000); @@ -479,10 +480,10 @@ void lcd_init() { /** * Set an alert. */ -void lcd_setalertstatusPGM(PGM_P message) { - char message_buffer[MAX_CURLY_COMMAND]; - sprintf_P(message_buffer, PSTR("{E:%s}"), message); - write_to_lcd(message_buffer); +void MarlinUI::set_alert_status_P(PGM_P const message) { + write_to_lcd_P(PSTR("{E:")); + write_to_lcd_P(message); + write_to_lcd_P("}"); } #endif // MALYAN_LCD diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index 346a81729d..8046a5d811 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -30,12 +30,13 @@ #include "../../module/motion.h" #include "../../gcode/queue.h" #include "../../sd/cardreader.h" +#include "../../libs/buzzer.h" #if ENABLED(EEPROM_SETTINGS) #include "../../module/configuration_store.h" #endif -#if WATCH_HOTENDS || WATCH_THE_BED +#if WATCH_HOTENDS || WATCH_THE_BED || ENABLED(BABYSTEP_ZPROBE_OFFSET) #include "../../module/temperature.h" #endif @@ -61,10 +62,6 @@ menuPosition screen_history[6]; uint8_t screen_history_depth = 0; bool screen_changed; -#if LCD_TIMEOUT_TO_STATUS - bool defer_return_to_status; -#endif - // Value Editing PGM_P editLabel; void *editValue; @@ -79,9 +76,9 @@ bool no_reentry = false; //////// Menu Navigation & History ///////// //////////////////////////////////////////// -void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); } +void MarlinUI::return_to_status() { goto_screen(status_screen); } -void lcd_save_previous_screen() { +void MarlinUI::save_previous_screen() { if (screen_history_depth < COUNT(screen_history)) { screen_history[screen_history_depth].menu_function = currentScreen; screen_history[screen_history_depth].encoder_position = encoderPosition; @@ -89,30 +86,23 @@ void lcd_save_previous_screen() { } } -void lcd_goto_previous_menu() { +void MarlinUI::goto_previous_screen() { if (screen_history_depth > 0) { --screen_history_depth; - lcd_goto_screen( + goto_screen( screen_history[screen_history_depth].menu_function, screen_history[screen_history_depth].encoder_position ); } else - lcd_return_to_status(); + return_to_status(); } -#if LCD_TIMEOUT_TO_STATUS - void lcd_goto_previous_menu_no_defer() { - set_defer_return_to_status(false); - lcd_goto_previous_menu(); - } -#endif - //////////////////////////////////////////// /////////// Common Menu Actions //////////// //////////////////////////////////////////// -void menu_item_gcode::action(PGM_P pgcode) { enqueue_and_echo_commands_P(pgcode); } +void MenuItem_gcode::action(PGM_P pgcode) { enqueue_and_echo_commands_P(pgcode); } //////////////////////////////////////////// /////////// Menu Editing Actions /////////// @@ -129,47 +119,46 @@ void menu_item_gcode::action(PGM_P pgcode) { enqueue_and_echo_commands_P(pgcode) * * For example, DEFINE_MENU_EDIT_ITEM(int3) expands into these functions: * - * bool menu_item_int3::_edit(); - * void menu_item_int3::edit(); // edit int16_t (interactively) - * void menu_item_int3::action_setting_edit(PGM_P const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue, const screenFunc_t callback = null, const bool live = false); + * bool MenuItem_int3::_edit(); + * void MenuItem_int3::edit(); // edit int16_t (interactively) + * void MenuItem_int3::action_edit(PGM_P const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue, const screenFunc_t callback = null, const bool live = false); * * You can then use one of the menu macros to present the edit interface: * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999) * * This expands into a more primitive menu item: - * MENU_ITEM_VARIANT(int3, _setting_edit, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) + * MENU_ITEM_VARIANT(int3, _edit, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) * * ...which calls: - * menu_item_int3::action_setting_edit(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) + * MenuItem_int3::action_edit(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) */ -void menu_item_invariants::edit(strfunc_t strfunc, loadfunc_t loadfunc) { - ENCODER_DIRECTION_NORMAL(); - if ((int32_t)encoderPosition < 0) encoderPosition = 0; - if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; - if (lcdDrawUpdate) - lcd_implementation_drawedit(editLabel, strfunc(encoderPosition + minEditValue)); - if (lcd_clicked || (liveEdit && lcdDrawUpdate)) { - if (editValue != NULL) loadfunc(editValue, encoderPosition + minEditValue); - if (callbackFunc && (liveEdit || lcd_clicked)) (*callbackFunc)(); - if (lcd_clicked) lcd_goto_previous_menu(); - lcd_clicked = false; +void MenuItemBase::edit(strfunc_t strfunc, loadfunc_t loadfunc) { + ui.encoder_direction_normal(); + if ((int32_t)ui.encoderPosition < 0) ui.encoderPosition = 0; + if ((int32_t)ui.encoderPosition > maxEditValue) ui.encoderPosition = maxEditValue; + if (ui.should_draw()) + draw_edit_screen(editLabel, strfunc(ui.encoderPosition + minEditValue)); + if (ui.lcd_clicked || (liveEdit && ui.should_draw())) { + if (editValue != NULL) loadfunc(editValue, ui.encoderPosition + minEditValue); + if (callbackFunc && (liveEdit || ui.lcd_clicked)) (*callbackFunc)(); + if (ui.use_click()) ui.goto_previous_screen(); } } -void menu_item_invariants::init(PGM_P const el, void * const ev, const int32_t minv, const int32_t maxv, const uint32_t ep, const screenFunc_t cs, const screenFunc_t cb, const bool le) { - lcd_save_previous_screen(); - lcd_refresh(); +void MenuItemBase::init(PGM_P const el, void * const ev, const int32_t minv, const int32_t maxv, const uint32_t ep, const screenFunc_t cs, const screenFunc_t cb, const bool le) { + ui.save_previous_screen(); + ui.refresh(); editLabel = el; editValue = ev; minEditValue = minv; maxEditValue = maxv; - encoderPosition = ep; - currentScreen = cs; + ui.encoderPosition = ep; + ui.currentScreen = cs; callbackFunc = cb; liveEdit = le; } -#define DEFINE_MENU_EDIT_ITEM(NAME) template class menu_item_template; +#define DEFINE_MENU_EDIT_ITEM(NAME) template class TMenuItem; DEFINE_MENU_EDIT_ITEM(int3); DEFINE_MENU_EDIT_ITEM(int4); @@ -183,8 +172,8 @@ DEFINE_MENU_EDIT_ITEM(float52sign); DEFINE_MENU_EDIT_ITEM(float62); DEFINE_MENU_EDIT_ITEM(long5); -void menu_item_bool::action_setting_edit(PGM_P pstr, bool *ptr, screenFunc_t callback) { - UNUSED(pstr); *ptr ^= true; lcd_refresh(); +void MenuItem_bool::action_edit(PGM_P pstr, bool *ptr, screenFunc_t callback) { + UNUSED(pstr); *ptr ^= true; ui.refresh(); if (callback) (*callback)(); } @@ -202,7 +191,7 @@ bool printer_busy() { return planner.movesplanned() || IS_SD_PRINTING(); } /** * General function to go directly to a screen */ -void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) { +void MarlinUI::goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) { if (currentScreen != screen) { #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) @@ -215,10 +204,10 @@ void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) { // Going to menu_main from status screen? Remember first click time. // Going back to status screen within a very short time? Go to Z babystepping. if (screen == menu_main) { - if (currentScreen == lcd_status_screen) + if (on_status_screen()) doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL; } - else if (screen == lcd_status_screen && currentScreen == menu_main && PENDING(millis(), doubleclick_expire_ms)) { + else if (screen == status_screen && currentScreen == menu_main && PENDING(millis(), doubleclick_expire_ms)) { if (printer_busy()) { screen = #if ENABLED(BABYSTEP_ZPROBE_OFFSET) @@ -239,25 +228,25 @@ void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) { currentScreen = screen; encoderPosition = encoder; - if (screen == lcd_status_screen) { - set_defer_return_to_status(false); + if (screen == status_screen) { + ui.defer_status_screen(false); #if ENABLED(AUTO_BED_LEVELING_UBL) ubl.lcd_map_control = false; #endif screen_history_depth = 0; } - lcd_implementation_clear(); + clear_lcd(); // Re-initialize custom characters that may be re-used #if HAS_CHARACTER_LCD #if ENABLED(AUTO_BED_LEVELING_UBL) if (!ubl.lcd_map_control) #endif - LCD_SET_CHARSET(screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU); + set_custom_characters(screen == status_screen ? CHARSET_INFO : CHARSET_MENU); #endif - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; + refresh(LCDVIEW_CALL_REDRAW_NEXT); screen_changed = true; #if HAS_GRAPHICAL_LCD drawing_screen = false; @@ -276,24 +265,24 @@ void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) { // static PGM_P sync_message; -void _lcd_synchronize() { - if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, sync_message); +void MarlinUI::_synchronize() { + if (should_draw()) draw_menu_item_static(LCD_HEIGHT >= 4 ? 1 : 0, sync_message); if (no_reentry) return; // Make this the current handler till all moves are done no_reentry = true; const screenFunc_t old_screen = currentScreen; - lcd_goto_screen(_lcd_synchronize); + goto_screen(_synchronize); planner.synchronize(); // idle() is called until moves complete no_reentry = false; - lcd_goto_screen(old_screen); + goto_screen(old_screen); } // Display the synchronize screen with a custom message // ** This blocks the command queue! ** -void lcd_synchronize(PGM_P const msg/*=NULL*/) { +void MarlinUI::synchronize(PGM_P const msg/*=NULL*/) { static const char moving[] PROGMEM = MSG_MOVING; sync_message = msg ? msg : moving; - _lcd_synchronize(); + _synchronize(); } /** @@ -308,16 +297,16 @@ void lcd_synchronize(PGM_P const msg/*=NULL*/) { */ int8_t encoderLine, screen_items; void scroll_screen(const uint8_t limit, const bool is_menu) { - ENCODER_DIRECTION_MENUS(); + ui.encoder_direction_menus(); ENCODER_RATE_MULTIPLY(false); - if (encoderPosition > 0x8000) encoderPosition = 0; - if (first_page) { - encoderLine = encoderPosition / (ENCODER_STEPS_PER_MENU_ITEM); + if (ui.encoderPosition > 0x8000) ui.encoderPosition = 0; + if (ui.first_page) { + encoderLine = ui.encoderPosition / (ENCODER_STEPS_PER_MENU_ITEM); screen_changed = false; } if (screen_items > 0 && encoderLine >= screen_items - limit) { encoderLine = MAX(0, screen_items - limit); - encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); + ui.encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); } if (is_menu) { NOMORE(encoderTopLine, encoderLine); @@ -328,12 +317,12 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { encoderTopLine = encoderLine; } -void lcd_completion_feedback(const bool good/*=true*/) { +void MarlinUI::completion_feedback(const bool good/*=true*/) { if (good) { - lcd_buzz(100, 659); - lcd_buzz(100, 698); + BUZZ(100, 659); + BUZZ(100, 698); } - else lcd_buzz(20, 440); + else BUZZ(20, 440); } #if HAS_LINE_TO_Z @@ -348,17 +337,17 @@ void lcd_completion_feedback(const bool good/*=true*/) { #if ENABLED(BABYSTEP_ZPROBE_OFFSET) void lcd_babystep_zoffset() { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } - set_defer_return_to_status(true); + if (ui.use_click()) return ui.goto_previous_screen_no_defer(); + ui.defer_status_screen(true); #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) const bool do_probe = (active_extruder == 0); #else constexpr bool do_probe = true; #endif - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition) { - const int16_t babystep_increment = (int32_t)encoderPosition * (BABYSTEP_MULTIPLICATOR); - encoderPosition = 0; + ui.encoder_direction_normal(); + if (ui.encoderPosition) { + const int16_t babystep_increment = (int32_t)ui.encoderPosition * (BABYSTEP_MULTIPLICATOR); + ui.encoderPosition = 0; const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment, new_probe_offset = zprobe_zoffset + diff, @@ -378,16 +367,16 @@ void lcd_completion_feedback(const bool good/*=true*/) { else hotend_offset[Z_AXIS][active_extruder] = new_offs; #endif - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; + ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); } } - if (lcdDrawUpdate) { + if (ui.should_draw()) { #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) if (!do_probe) - lcd_implementation_drawedit(PSTR(MSG_IDEX_Z_OFFSET), ftostr43sign(hotend_offset[Z_AXIS][active_extruder])); + draw_edit_screen(PSTR(MSG_IDEX_Z_OFFSET), ftostr43sign(hotend_offset[Z_AXIS][active_extruder])); else #endif - lcd_implementation_drawedit(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset)); + draw_edit_screen(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset)); #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) if (do_probe) _lcd_zoffset_overlay_gfx(zprobe_zoffset); @@ -447,14 +436,14 @@ void watch_temp_callback_bed() { #endif #if ENABLED(EEPROM_SETTINGS) - void lcd_store_settings() { lcd_completion_feedback(settings.save()); } - void lcd_load_settings() { lcd_completion_feedback(settings.load()); } + void lcd_store_settings() { ui.completion_feedback(settings.save()); } + void lcd_load_settings() { ui.completion_feedback(settings.load()); } #endif void _lcd_draw_homing() { constexpr uint8_t line = (LCD_HEIGHT - 1) / 2; - if (lcdDrawUpdate) lcd_implementation_drawmenu_static(line, PSTR(MSG_LEVEL_BED_HOMING)); - lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW; + if (ui.should_draw()) draw_menu_item_static(line, PSTR(MSG_LEVEL_BED_HOMING)); + ui.refresh(LCDVIEW_CALL_NO_REDRAW); } #if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)) diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 8ff59b8b9c..7044bd22ca 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -30,139 +30,110 @@ extern bool screen_changed; constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP); void scroll_screen(const uint8_t limit, const bool is_menu); -bool use_click(); bool printer_busy(); -void lcd_completion_feedback(const bool good=true); -void lcd_save_previous_screen(); -void lcd_goto_previous_menu(); -#if LCD_TIMEOUT_TO_STATUS - void lcd_goto_previous_menu_no_defer(); -#else - #define lcd_goto_previous_menu_no_defer() lcd_goto_previous_menu() -#endif //////////////////////////////////////////// ////////// Menu Item Numeric Types ///////// //////////////////////////////////////////// #define DECLARE_MENU_EDIT_TYPE(TYPE, NAME, STRFUNC, SCALE) \ - struct NAME ## _item_info { \ + struct MenuItemInfo_##NAME { \ typedef TYPE type_t; \ static constexpr float scale = SCALE; \ static inline char* strfunc(const float value) { return STRFUNC((TYPE) value); } \ }; -DECLARE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1); -DECLARE_MENU_EDIT_TYPE(int16_t, int4, itostr4sign, 1); -DECLARE_MENU_EDIT_TYPE(uint8_t, int8, i8tostr3, 1); -DECLARE_MENU_EDIT_TYPE(float, float3, ftostr3, 1); -DECLARE_MENU_EDIT_TYPE(float, float52, ftostr52, 100); -DECLARE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000); -DECLARE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 0.01f); -DECLARE_MENU_EDIT_TYPE(float, float51, ftostr51sign, 10); -DECLARE_MENU_EDIT_TYPE(float, float52sign, ftostr52sign, 100); -DECLARE_MENU_EDIT_TYPE(float, float62, ftostr62rj, 100); -DECLARE_MENU_EDIT_TYPE(uint32_t, long5, ftostr5rj, 0.01f); +DECLARE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1 ); +DECLARE_MENU_EDIT_TYPE(int16_t, int4, itostr4sign, 1 ); +DECLARE_MENU_EDIT_TYPE(uint8_t, int8, i8tostr3, 1 ); +DECLARE_MENU_EDIT_TYPE(float, float3, ftostr3, 1 ); +DECLARE_MENU_EDIT_TYPE(float, float52, ftostr52, 100 ); +DECLARE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000 ); +DECLARE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 0.01f ); +DECLARE_MENU_EDIT_TYPE(float, float51, ftostr51sign, 10 ); +DECLARE_MENU_EDIT_TYPE(float, float52sign, ftostr52sign, 100 ); +DECLARE_MENU_EDIT_TYPE(float, float62, ftostr62rj, 100 ); +DECLARE_MENU_EDIT_TYPE(uint32_t, long5, ftostr5rj, 0.01f ); //////////////////////////////////////////// ///////// Menu Item Draw Functions ///////// //////////////////////////////////////////// +void draw_edit_screen(PGM_P const pstr, const char* const value=NULL); +void draw_menu_item(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char); +void draw_menu_item_static(const uint8_t row, PGM_P const pstr, const bool center=true, const bool invert=false, const char *valstr=NULL); +void _draw_menu_item_edit(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm); +FORCE_INLINE void draw_menu_item_back(const bool sel, const uint8_t row, PGM_P const pstr) { draw_menu_item(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]); } +FORCE_INLINE void draw_menu_item_edit(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data) { _draw_menu_item_edit(sel, row, pstr, data, false); } +FORCE_INLINE void draw_menu_item_edit_P(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data) { _draw_menu_item_edit(sel, row, pstr, data, true); } +#define draw_menu_item_submenu(sel, row, pstr, data) draw_menu_item(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]) +#define draw_menu_item_gcode(sel, row, pstr, gcode) draw_menu_item(sel, row, pstr, '>', ' ') +#define draw_menu_item_function(sel, row, pstr, data) draw_menu_item(sel, row, pstr, '>', ' ') +#define DRAW_MENU_ITEM_SETTING_EDIT_GENERIC(VAL) draw_menu_item_edit(sel, row, pstr, VAL) +#define DRAW_BOOL_SETTING(sel, row, pstr, data) draw_menu_item_edit_P(sel, row, pstr, (*(data))?PSTR(MSG_LCD_ON):PSTR(MSG_LCD_OFF)) + #if ENABLED(SDSUPPORT) class CardReader; + void draw_sd_menu_item(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir); + FORCE_INLINE void draw_menu_item_sdfile(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) { draw_sd_menu_item(sel, row, pstr, theCard, false); } + FORCE_INLINE void draw_menu_item_sdfolder(const bool sel, const uint8_t row, PGM_P const pstr, CardReader &theCard) { draw_sd_menu_item(sel, row, pstr, theCard, true); } #endif -void lcd_implementation_drawmenu_generic(const bool isSelected, const uint8_t row, const char* pstr, const char pre_char, const char post_char); -void lcd_implementation_drawmenu_static(const uint8_t row, const char* pstr, const bool center=true, const bool invert=false, const char *valstr=NULL); -void lcd_implementation_drawedit(const char* const pstr, const char* const value=NULL); -#if ENABLED(ADVANCED_PAUSE_FEATURE) - void lcd_implementation_hotend_status(const uint8_t row, const uint8_t extruder); -#endif -#if HAS_GRAPHICAL_LCD - void _drawmenu_setting_edit_generic(const bool isSelected, const uint8_t row, const char* pstr, const char* const data, const bool pgm); - #define lcd_implementation_drawmenu_back(sel, row, pstr) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]) - #define lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, false) - #define lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, true) - #define DRAWMENU_SETTING_EDIT_GENERIC(SRC) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, SRC) - #define DRAW_BOOL_SETTING(sel, row, pstr, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF)) - #if ENABLED(SDSUPPORT) - void _drawmenu_sd(const bool isSelected, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir); - #define lcd_implementation_drawmenu_sdfile(sel, row, pstr, theCard) _drawmenu_sd(sel, row, pstr, theCard, false) - #define lcd_implementation_drawmenu_sddirectory(sel, row, pstr, theCard) _drawmenu_sd(sel, row, pstr, theCard, true) - #endif - #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) || ENABLED(MESH_EDIT_GFX_OVERLAY) - void _lcd_zoffset_overlay_gfx(const float zvalue); - #endif -#else - #define lcd_implementation_drawmenu_back(sel, row, pstr) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_UPLEVEL_CHAR, LCD_UPLEVEL_CHAR) - void lcd_implementation_drawmenu_setting_edit_generic(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char* const data); - void lcd_implementation_drawmenu_setting_edit_generic_P(const bool sel, const uint8_t row, const char* pstr, const char pre_char, const char* const data); - #define DRAWMENU_SETTING_EDIT_GENERIC(SRC) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', SRC) - #define DRAW_BOOL_SETTING(sel, row, pstr, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF)) - #if ENABLED(SDSUPPORT) - void lcd_implementation_drawmenu_sdfile(const bool sel, const uint8_t row, PGM_P pstr, CardReader &theCard); - void lcd_implementation_drawmenu_sddirectory(const bool sel, const uint8_t row, PGM_P pstr, CardReader &theCard); - #endif -#endif -#define lcd_implementation_drawmenu_submenu(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]) -#define lcd_implementation_drawmenu_gcode(sel, row, pstr, gcode) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') -#define lcd_implementation_drawmenu_function(sel, row, pstr, data) lcd_implementation_drawmenu_generic(sel, row, pstr, '>', ' ') - -#if ENABLED(AUTO_BED_LEVELING_UBL) - void lcd_implementation_ubl_plot(const uint8_t x, const uint8_t inverted_y); +#if HAS_GRAPHICAL_LCD && (ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) || ENABLED(MESH_EDIT_GFX_OVERLAY)) + void _lcd_zoffset_overlay_gfx(const float zvalue); #endif //////////////////////////////////////////// /////// Edit Setting Draw Functions //////// //////////////////////////////////////////// -#define _DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(TYPE, NAME, STRFUNC) \ - FORCE_INLINE void lcd_implementation_drawmenu_setting_edit_ ## NAME (const bool sel, const uint8_t row, PGM_P pstr, PGM_P pstr2, TYPE * const data, ...) { \ +#define _DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(TYPE, NAME, STRFUNC) \ + FORCE_INLINE void draw_menu_item_edit_##NAME (const bool sel, const uint8_t row, PGM_P const pstr, PGM_P const pstr2, TYPE * const data, ...) { \ UNUSED(pstr2); \ - DRAWMENU_SETTING_EDIT_GENERIC(STRFUNC(*(data))); \ + DRAW_MENU_ITEM_SETTING_EDIT_GENERIC(STRFUNC(*(data))); \ } \ - FORCE_INLINE void lcd_implementation_drawmenu_setting_edit_accessor_ ## NAME (const bool sel, const uint8_t row, PGM_P pstr, PGM_P pstr2, TYPE (*pget)(), void (*pset)(TYPE), ...) { \ + FORCE_INLINE void draw_menu_item_edit_accessor_##NAME (const bool sel, const uint8_t row, PGM_P const pstr, PGM_P const pstr2, TYPE (*pget)(), void (*pset)(TYPE), ...) { \ UNUSED(pstr2); UNUSED(pset); \ - DRAWMENU_SETTING_EDIT_GENERIC(STRFUNC(pget())); \ + DRAW_MENU_ITEM_SETTING_EDIT_GENERIC(STRFUNC(pget())); \ } \ typedef void NAME##_void -#define DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(NAME) _DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(NAME ## _item_info::type_t, NAME, NAME ## _item_info::strfunc) +#define DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(NAME) _DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(MenuItemInfo_##NAME::type_t, NAME, MenuItemInfo_##NAME::strfunc) -DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(int3); -DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(int4); -DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(int8); -DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float3); -DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float52); -DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float43); -DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float5); -DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float51); -DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float52sign); -DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float62); -DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(long5); +DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int3); +DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int4); +DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int8); +DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float3); +DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float52); +DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float43); +DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float5); +DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float51); +DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float52sign); +DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float62); +DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(long5); -#define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data, ...) DRAW_BOOL_SETTING(sel, row, pstr, data) -#define lcd_implementation_drawmenu_setting_edit_accessor_bool(sel, row, pstr, pstr2, pget, pset) DRAW_BOOL_SETTING(sel, row, pstr, data) +#define draw_menu_item_edit_bool(sel, row, pstr, pstr2, data, ...) DRAW_BOOL_SETTING(sel, row, pstr, data) +#define draw_menu_item_edit_accessor_bool(sel, row, pstr, pstr2, pget, pset) DRAW_BOOL_SETTING(sel, row, pstr, data) //////////////////////////////////////////// /////////////// Menu Actions /////////////// //////////////////////////////////////////// -class menu_item_back { +class MenuItem_back { public: - static inline void action() { lcd_goto_previous_menu(); } + static inline void action() { ui.goto_previous_screen(); } }; -class menu_item_submenu { +class MenuItem_submenu { public: - static inline void action(const screenFunc_t func) { lcd_save_previous_screen(); lcd_goto_screen(func); } + static inline void action(const screenFunc_t func) { ui.save_previous_screen(); ui.goto_screen(func); } }; -class menu_item_gcode { +class MenuItem_gcode { public: static void action(const char * const pgcode); }; -class menu_item_function { +class MenuItem_function { public: static inline void action(const menuAction_t func) { (*func)(); }; }; @@ -171,7 +142,7 @@ class menu_item_function { /////////// Menu Editing Actions /////////// //////////////////////////////////////////// -class menu_item_invariants { +class MenuItemBase { protected: typedef char* (*strfunc_t)(const int32_t); typedef void (*loadfunc_t)(void *, const int32_t); @@ -180,22 +151,22 @@ class menu_item_invariants { }; template -class menu_item_template : menu_item_invariants { +class TMenuItem : MenuItemBase { private: typedef typename NAME::type_t type_t; - inline static float unscale(const float value) {return value * (1.0f / NAME::scale);} - inline static float scale(const float value) {return value * NAME::scale;} - static void load(void *ptr, const int32_t value) {*((type_t*)ptr) = unscale(value);} - static char* to_string(const int32_t value) {return NAME::strfunc(unscale(value));} + inline static float unscale(const float value) { return value * (1.0f / NAME::scale); } + inline static float scale(const float value) { return value * NAME::scale; } + static void load(void *ptr, const int32_t value) { *((type_t*)ptr) = unscale(value); } + static char* to_string(const int32_t value) { return NAME::strfunc(unscale(value)); } public: - static void action_setting_edit(PGM_P const pstr, type_t * const ptr, const type_t minValue, const type_t maxValue, const screenFunc_t callback=NULL, const bool live=false) { + static void action_edit(PGM_P const pstr, type_t * const ptr, const type_t minValue, const type_t maxValue, const screenFunc_t callback=NULL, const bool live=false) { const int32_t minv = scale(minValue); init(pstr, ptr, minv, int32_t(scale(maxValue)) - minv, int32_t(scale(*ptr)) - minv, edit, callback, live); } - static void edit() {menu_item_invariants::edit(to_string, load);} + static void edit() { MenuItemBase::edit(to_string, load); } }; -#define DECLARE_MENU_EDIT_ITEM(NAME) typedef menu_item_template menu_item_ ## NAME; +#define DECLARE_MENU_EDIT_ITEM(NAME) typedef TMenuItem MenuItem_##NAME; DECLARE_MENU_EDIT_ITEM(int3); DECLARE_MENU_EDIT_ITEM(int4); @@ -209,9 +180,9 @@ DECLARE_MENU_EDIT_ITEM(float52sign); DECLARE_MENU_EDIT_ITEM(float62); DECLARE_MENU_EDIT_ITEM(long5); -class menu_item_bool { +class MenuItem_bool { public: - static void action_setting_edit(PGM_P pstr, bool* ptr, const screenFunc_t callbackFunc=NULL); + static void action_edit(PGM_P const pstr, bool* ptr, const screenFunc_t callbackFunc=NULL); }; //////////////////////////////////////////// @@ -257,69 +228,47 @@ class menu_item_bool { screen_items = _thisItemNr; \ UNUSED(_skipStatic) -/** - * REVERSE_MENU_DIRECTION - * - * To reverse the menu direction we need a general way to reverse - * the direction of the encoder everywhere. So encoderDirection is - * added to allow the encoder to go the other way. - * - * This behavior is limited to scrolling Menus and SD card listings, - * and is disabled in other contexts. - */ -#if ENABLED(REVERSE_MENU_DIRECTION) - extern int8_t encoderDirection; - #define ENCODER_DIRECTION_NORMAL() (encoderDirection = 1) - #define ENCODER_DIRECTION_MENUS() (encoderDirection = -1) -#else - #define ENCODER_DIRECTION_NORMAL() NOOP - #define ENCODER_DIRECTION_MENUS() NOOP -#endif - #if ENABLED(ENCODER_RATE_MULTIPLIER) - extern millis_t lastEncoderMovementMillis; - extern bool encoderRateMultiplierEnabled; - #define ENCODER_RATE_MULTIPLY(F) (encoderRateMultiplierEnabled = F) - #define _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER) if (USE_MULTIPLIER) { encoderRateMultiplierEnabled = true; lastEncoderMovementMillis = 0; } + #define ENCODER_RATE_MULTIPLY(F) (ui.encoderRateMultiplierEnabled = F) + #define _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER) do{ if (USE_MULTIPLIER) ui.enable_encoder_multiplier(true); }while(0) //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value -#else // !ENCODER_RATE_MULTIPLIER +#else #define ENCODER_RATE_MULTIPLY(F) NOOP #define _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER) -#endif // !ENCODER_RATE_MULTIPLIER +#endif /** * MENU_ITEM generates draw & handler code for a menu item, potentially calling: * - * lcd_implementation_drawmenu_[_variant](sel, row, label, arg3...) - * menu_item_::action[_variant](arg3...) + * draw_menu_item_[_variant](sel, row, label, arg3...) + * MenuItem_::action[_variant](arg3...) * * Examples: * MENU_ITEM(back, MSG_WATCH, 0 [dummy parameter] ) * or * MENU_BACK(MSG_WATCH) - * lcd_implementation_drawmenu_back(sel, row, PSTR(MSG_WATCH)) - * menu_item_back::action() + * draw_menu_item_back(sel, row, PSTR(MSG_WATCH)) + * MenuItem_back::action() * * MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause) - * lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause) - * menu_item_function::action(lcd_sdcard_pause) + * draw_menu_item_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause) + * MenuItem_function::action(lcd_sdcard_pause) * * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999) - * lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - * menu_item_int3::action_setting_edit(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) + * draw_menu_item_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) + * MenuItem_int3::action_edit(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) * */ #define _MENU_ITEM_VARIANT_P(TYPE, VARIANT, USE_MULTIPLIER, PLABEL, ...) do { \ _skipStatic = false; \ if (_menuLineNr == _thisItemNr) { \ - if (encoderLine == _thisItemNr && lcd_clicked) { \ - lcd_clicked = false; \ + if (encoderLine == _thisItemNr && ui.use_click()) { \ _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \ - menu_item_ ## TYPE ::action ## VARIANT(__VA_ARGS__); \ + MenuItem_##TYPE ::action ## VARIANT(__VA_ARGS__); \ if (screen_changed) return; \ } \ - if (lcdDrawUpdate) \ - lcd_implementation_drawmenu ## VARIANT ## _ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ## __VA_ARGS__); \ + if (ui.should_draw()) \ + draw_menu_item ## VARIANT ## _ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ## __VA_ARGS__); \ } \ ++_thisItemNr; \ }while(0) @@ -329,17 +278,17 @@ class menu_item_bool { #define STATIC_ITEM_P(PLABEL, ...) do{ \ if (_menuLineNr == _thisItemNr) { \ if (_skipStatic && encoderLine <= _thisItemNr) { \ - encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ + ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ ++encoderLine; \ } \ - if (lcdDrawUpdate) \ - lcd_implementation_drawmenu_static(_lcdLineNr, PLABEL, ## __VA_ARGS__); \ + if (ui.should_draw()) \ + draw_menu_item_static(_lcdLineNr, PLABEL, ## __VA_ARGS__); \ } \ ++_thisItemNr; \ } while(0) #define MENU_ITEM_ADDON_START(X) \ - if (lcdDrawUpdate && _menuLineNr == _thisItemNr - 1) { \ + if (ui.should_draw() && _menuLineNr == _thisItemNr - 1) { \ SETCURSOR(X, _lcdLineNr) #define MENU_ITEM_ADDON_END() } (0) @@ -348,12 +297,12 @@ class menu_item_bool { #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL) #define MENU_ITEM_DUMMY() do { _thisItemNr++; }while(0) -#define MENU_ITEM_P(TYPE, PLABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, , 0, PLABEL, ## __VA_ARGS__) -#define MENU_ITEM(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, , 0, PSTR(LABEL), ## __VA_ARGS__) -#define MENU_ITEM_EDIT(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _setting_edit, 0, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) -#define MENU_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _setting_edit, 0, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) -#define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _setting_edit, 1, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) -#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _setting_edit, 1, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) +#define MENU_ITEM_P(TYPE, PLABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, , false, PLABEL, ## __VA_ARGS__) +#define MENU_ITEM(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, , false, PSTR(LABEL), ## __VA_ARGS__) +#define MENU_ITEM_EDIT(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _edit, false, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) +#define MENU_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _edit, false, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) +#define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _edit, true, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) +#define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) _MENU_ITEM_VARIANT_P(TYPE, _edit, true, PSTR(LABEL), PSTR(LABEL), ## __VA_ARGS__) //////////////////////////////////////////// /////////////// Menu Screens /////////////// @@ -380,7 +329,6 @@ void menu_move(); //////////////////////////////////////////// void lcd_move_z(); -void lcd_synchronize(PGM_P const msg=NULL); void _lcd_draw_homing(); void watch_temp_callback_E0(); @@ -427,3 +375,7 @@ void watch_temp_callback_bed(); void lcd_store_settings(); void lcd_load_settings(); #endif + +#if ENABLED(POWER_LOSS_RECOVERY) + void menu_job_recovery(); +#endif diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index a6174d5a70..bebf749214 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -52,7 +52,7 @@ // void _lcd_set_home_offsets() { enqueue_and_echo_commands_P(PSTR("M428")); - lcd_return_to_status(); + ui.return_to_status(); } #endif @@ -65,9 +65,9 @@ // static void _lcd_toggle_sd_update() { const bool new_state = !settings.sd_update_status(); - lcd_completion_feedback(settings.set_sd_update_status(new_state)); - lcd_return_to_status(); - if (new_state) LCD_MESSAGEPGM(MSG_RESET_PRINTER); else lcd_reset_status(); + ui.completion_feedback(settings.set_sd_update_status(new_state)); + ui.return_to_status(); + if (new_state) LCD_MESSAGEPGM(MSG_RESET_PRINTER); else ui.reset_status(); } #endif @@ -539,8 +539,8 @@ void menu_advanced_temperature() { #include "../../module/configuration_store.h" static void lcd_init_eeprom() { - lcd_completion_feedback(settings.init_eeprom()); - lcd_goto_previous_menu(); + ui.completion_feedback(settings.init_eeprom()); + ui.goto_previous_screen(); } static void lcd_init_eeprom_confirm() { diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_corners.cpp index 0d51ef346d..037d6be03a 100644 --- a/Marlin/src/lcd/menu/menu_bed_corners.cpp +++ b/Marlin/src/lcd/menu/menu_bed_corners.cpp @@ -77,7 +77,7 @@ void menu_level_bed_corners() { MSG_NEXT_CORNER #endif , _lcd_goto_next_corner); - MENU_ITEM(function, MSG_BACK, lcd_goto_previous_menu_no_defer); + MENU_ITEM(function, MSG_BACK, ui.goto_previous_screen_no_defer); END_MENU(); } @@ -85,18 +85,18 @@ void _lcd_level_bed_corners_homing() { _lcd_draw_homing(); if (all_axes_homed()) { bed_corner = 0; - lcd_goto_screen(menu_level_bed_corners); + ui.goto_screen(menu_level_bed_corners); _lcd_goto_next_corner(); } } void _lcd_level_bed_corners() { - set_defer_return_to_status(true); + ui.defer_status_screen(true); if (!all_axes_known()) { set_all_unhomed(); enqueue_and_echo_commands_P(PSTR("G28")); } - lcd_goto_screen(_lcd_level_bed_corners_homing); + ui.goto_screen(_lcd_level_bed_corners_homing); } #endif // HAS_LCD_MENU && LEVEL_BED_CORNERS diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index ae43ca12b4..40c51b5726 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -26,7 +26,7 @@ #include "../../inc/MarlinConfigPre.h" -#if HAS_LCD_MENU && ENABLED(LCD_BED_LEVELING) +#if ENABLED(LCD_BED_LEVELING) #include "menu.h" #include "../../module/planner.h" @@ -56,7 +56,7 @@ #endif ); - bool lcd_wait_for_move; + bool MarlinUI::wait_for_bl_move; // = false // // Bed leveling is done. Wait for G29 to complete. @@ -70,17 +70,17 @@ // ** This blocks the command queue! ** // void _lcd_level_bed_done() { - if (!lcd_wait_for_move) { + if (!ui.wait_for_bl_move) { #if MANUAL_PROBE_HEIGHT > 0 && DISABLED(MESH_BED_LEVELING) // Display "Done" screen and wait for moves to complete line_to_z(MANUAL_PROBE_HEIGHT); - lcd_synchronize(PSTR(MSG_LEVEL_BED_DONE)); + ui.synchronize(PSTR(MSG_LEVEL_BED_DONE)); #endif - lcd_goto_previous_menu_no_defer(); - lcd_completion_feedback(); + ui.goto_previous_screen_no_defer(); + ui.completion_feedback(); } - if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_DONE)); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; + if (ui.should_draw()) draw_menu_item_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_DONE)); + ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); } void _lcd_level_goto_next_point(); @@ -89,9 +89,9 @@ // Step 7: Get the Z coordinate, click goes to the next point or exits // void _lcd_level_bed_get_z() { - ENCODER_DIRECTION_NORMAL(); + ui.encoder_direction_normal(); - if (use_click()) { + if (ui.use_click()) { // // Save the current Z position and move @@ -102,8 +102,8 @@ // // The last G29 records the point and enables bed leveling // - lcd_wait_for_move = true; - lcd_goto_screen(_lcd_level_bed_done); + ui.wait_for_bl_move = true; + ui.goto_screen(_lcd_level_bed_done); #if ENABLED(MESH_BED_LEVELING) enqueue_and_echo_commands_P(PSTR("G29 S2")); #elif ENABLED(PROBE_MANUALLY) @@ -119,19 +119,19 @@ // // Encoder knob or keypad buttons adjust the Z position // - if (encoderPosition) { - const float z = current_position[Z_AXIS] + float((int32_t)encoderPosition) * (MESH_EDIT_Z_STEP); + if (ui.encoderPosition) { + const float z = current_position[Z_AXIS] + float((int32_t)ui.encoderPosition) * (MESH_EDIT_Z_STEP); line_to_z(constrain(z, -(LCD_PROBE_Z_RANGE) * 0.5f, (LCD_PROBE_Z_RANGE) * 0.5f)); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - encoderPosition = 0; + ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); + ui.encoderPosition = 0; } // // Draw on first display, then only on Z change // - if (lcdDrawUpdate) { + if (ui.should_draw()) { const float v = current_position[Z_AXIS]; - lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); + draw_edit_screen(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); } } @@ -139,23 +139,23 @@ // Step 6: Display "Next point: 1 / 9" while waiting for move to finish // void _lcd_level_bed_moving() { - if (lcdDrawUpdate) { + if (ui.should_draw()) { char msg[10]; sprintf_P(msg, PSTR("%i / %u"), (int)(manual_probe_index + 1), total_probe_points); - lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_NEXT_POINT), msg); + draw_edit_screen(PSTR(MSG_LEVEL_BED_NEXT_POINT), msg); } - lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW; - if (!lcd_wait_for_move) lcd_goto_screen(_lcd_level_bed_get_z); + ui.refresh(LCDVIEW_CALL_NO_REDRAW); + if (!ui.wait_for_bl_move) ui.goto_screen(_lcd_level_bed_get_z); } // // Step 5: Initiate a move to the next point // void _lcd_level_goto_next_point() { - lcd_goto_screen(_lcd_level_bed_moving); + ui.goto_screen(_lcd_level_bed_moving); // G29 Records Z, moves, and signals when it pauses - lcd_wait_for_move = true; + ui.wait_for_bl_move = true; #if ENABLED(MESH_BED_LEVELING) enqueue_and_echo_commands_P(manual_probe_index ? PSTR("G29 S2") : PSTR("G29 S1")); #elif ENABLED(PROBE_MANUALLY) @@ -168,8 +168,8 @@ // Move to the first probe position // void _lcd_level_bed_homing_done() { - if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_WAITING)); - if (use_click()) { + if (ui.should_draw()) draw_edit_screen(PSTR(MSG_LEVEL_BED_WAITING)); + if (ui.use_click()) { manual_probe_index = 0; _lcd_level_goto_next_point(); } @@ -180,7 +180,7 @@ // void _lcd_level_bed_homing() { _lcd_draw_homing(); - if (all_axes_homed()) lcd_goto_screen(_lcd_level_bed_homing_done); + if (all_axes_homed()) ui.goto_screen(_lcd_level_bed_homing_done); } #if ENABLED(PROBE_MANUALLY) @@ -191,9 +191,9 @@ // Step 2: Continue Bed Leveling... // void _lcd_level_bed_continue() { - set_defer_return_to_status(true); + ui.defer_status_screen(true); set_all_unhomed(); - lcd_goto_screen(_lcd_level_bed_homing); + ui.goto_screen(_lcd_level_bed_homing); enqueue_and_echo_commands_P(PSTR("G28")); } @@ -292,4 +292,4 @@ void menu_bed_leveling() { END_MENU(); } -#endif // HAS_LCD_MENU && LCD_BED_LEVELING +#endif // LCD_BED_LEVELING diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index f8fcd5c9c0..3e67a83672 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -36,41 +36,44 @@ #include "../../feature/runout.h" #endif +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../feature/power_loss_recovery.h" +#endif + #define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST) void menu_advanced_settings(); void menu_delta_calibrate(); -#if HAS_LCD_CONTRAST - void lcd_callback_set_contrast() { set_lcd_contrast(lcd_contrast); } -#endif - static void lcd_factory_settings() { settings.reset(); - lcd_completion_feedback(); + ui.completion_feedback(); } #if ENABLED(LCD_PROGRESS_BAR_TEST) + #include "../lcdprint.h" + static void progress_bar_test() { + ui.encoder_direction_normal(); static int8_t bar_percent = 0; - if (use_click()) { - lcd_goto_previous_menu(); - LCD_SET_CHARSET(CHARSET_MENU); + if (ui.use_click()) { + ui.goto_previous_screen(); + ui.set_custom_characters(CHARSET_MENU); return; } - bar_percent += (int8_t)encoderPosition; + bar_percent += (int8_t)ui.encoderPosition; bar_percent = constrain(bar_percent, 0, 100); - encoderPosition = 0; - lcd_implementation_drawmenu_static(0, PSTR(MSG_PROGRESS_BAR_TEST), true, true); + ui.encoderPosition = 0; + draw_menu_item_static(0, PSTR(MSG_PROGRESS_BAR_TEST), true, true); lcd_moveto((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2); - lcd_put_u8str(int(bar_percent)); lcd_put_wchar('%'); - lcd_moveto(0, LCD_HEIGHT - 1); lcd_draw_progress_bar(bar_percent); + lcd_put_int(bar_percent); lcd_put_wchar('%'); + lcd_moveto(0, LCD_HEIGHT - 1); ui.draw_progress_bar(bar_percent); } void _progress_bar_test() { - lcd_goto_screen(progress_bar_test); - LCD_SET_CHARSET(CHARSET_INFO); + ui.goto_screen(progress_bar_test); + ui.set_custom_characters(CHARSET_INFO); } #endif // LCD_PROGRESS_BAR_TEST @@ -271,12 +274,12 @@ static void lcd_factory_settings() { #endif START_MENU(); MENU_BACK(MSG_CONFIGURATION); - MENU_ITEM_EDIT(int8, MSG_FAN_SPEED, &lcd_preheat_fan_speed[material], 0, 255); + MENU_ITEM_EDIT(int8, MSG_FAN_SPEED, &ui.preheat_fan_speed[material], 0, 255); #if HAS_TEMP_HOTEND - MENU_ITEM_EDIT(int3, MSG_NOZZLE, &lcd_preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15); + MENU_ITEM_EDIT(int3, MSG_NOZZLE, &ui.preheat_hotend_temp[material], MINTEMP_ALL, MAXTEMP_ALL - 15); #endif #if HAS_HEATED_BED - MENU_ITEM_EDIT(int3, MSG_BED, &lcd_preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 15); + MENU_ITEM_EDIT(int3, MSG_BED, &ui.preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 15); #endif #if ENABLED(EEPROM_SETTINGS) MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); @@ -338,7 +341,7 @@ void menu_configuration() { #endif #if HAS_LCD_CONTRAST - MENU_ITEM_EDIT_CALLBACK(int3, MSG_CONTRAST, &lcd_contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, lcd_callback_set_contrast, true); + MENU_ITEM_EDIT_CALLBACK(int3, MSG_CONTRAST, &ui.contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, ui.refresh_contrast, true); #endif #if ENABLED(FWRETRACT) MENU_ITEM(submenu, MSG_RETRACT, menu_config_retract); @@ -351,7 +354,11 @@ void menu_configuration() { #endif #if ENABLED(FILAMENT_RUNOUT_SENSOR) - MENU_ITEM_EDIT(bool, MSG_RUNOUT_SENSOR_ENABLE, &runout.enabled); + MENU_ITEM_EDIT_CALLBACK(bool, MSG_RUNOUT_SENSOR_ENABLE, &runout.enabled, runout.reset); + #endif + + #if ENABLED(POWER_LOSS_RECOVERY) + MENU_ITEM_EDIT_CALLBACK(bool, MSG_OUTAGE_RECOVERY, &recovery.enabled, recovery.changed); #endif #if DISABLED(SLIM_LCD_MENUS) diff --git a/Marlin/src/lcd/menu/menu_custom.cpp b/Marlin/src/lcd/menu/menu_custom.cpp index f823a1049f..6b16bbc792 100644 --- a/Marlin/src/lcd/menu/menu_custom.cpp +++ b/Marlin/src/lcd/menu/menu_custom.cpp @@ -40,10 +40,10 @@ void _lcd_user_gcode(PGM_P const cmd) { enqueue_and_echo_commands_P(cmd); #if ENABLED(USER_SCRIPT_AUDIBLE_FEEDBACK) - lcd_completion_feedback(); + ui.completion_feedback(); #endif #if ENABLED(USER_SCRIPT_RETURN) - lcd_return_to_status(); + ui.return_to_status(); #endif } diff --git a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp index 231a044f44..f83057b658 100644 --- a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp +++ b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp @@ -38,9 +38,9 @@ void _man_probe_pt(const float &rx, const float &ry) { do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); - lcd_synchronize(); + ui.synchronize(); move_menu_scale = MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT)); - lcd_goto_screen(lcd_move_z); + ui.goto_screen(lcd_move_z); } #if ENABLED(DELTA_AUTO_CALIBRATION) @@ -50,11 +50,11 @@ void _man_probe_pt(const float &rx, const float &ry) { float lcd_probe_pt(const float &rx, const float &ry) { _man_probe_pt(rx, ry); KEEPALIVE_STATE(PAUSED_FOR_USER); - set_defer_return_to_status(true); + ui.defer_status_screen(true); wait_for_user = true; while (wait_for_user) idle(); KEEPALIVE_STATE(IN_HANDLER); - lcd_goto_previous_menu_no_defer(); + ui.goto_previous_screen_no_defer(); return current_position[Z_AXIS]; } @@ -66,12 +66,12 @@ void _man_probe_pt(const float &rx, const float &ry) { void _lcd_calibrate_homing() { _lcd_draw_homing(); - if (all_axes_homed()) lcd_goto_previous_menu(); + if (all_axes_homed()) ui.goto_previous_screen(); } void _lcd_delta_calibrate_home() { enqueue_and_echo_commands_P(PSTR("G28")); - lcd_goto_screen(_lcd_calibrate_homing); + ui.goto_screen(_lcd_calibrate_homing); } void _goto_tower_x() { _man_probe_pt(cos(RADIANS(210)) * delta_calibration_radius, sin(RADIANS(210)) * delta_calibration_radius); } diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp index 7eb5241797..b5938d0a98 100644 --- a/Marlin/src/lcd/menu/menu_filament.cpp +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -323,15 +323,15 @@ static PGM_P advanced_pause_header() { // Portions from STATIC_ITEM... #define HOTEND_STATUS_ITEM() do { \ if (_menuLineNr == _thisItemNr) { \ - if (lcdDrawUpdate) { \ - lcd_implementation_drawmenu_static(_lcdLineNr, PSTR(MSG_FILAMENT_CHANGE_NOZZLE), false, true); \ - lcd_implementation_hotend_status(_lcdLineNr, hotend_status_extruder); \ + if (ui.should_draw()) { \ + draw_menu_item_static(_lcdLineNr, PSTR(MSG_FILAMENT_CHANGE_NOZZLE), false, true); \ + ui.draw_hotend_status(_lcdLineNr, hotend_status_extruder); \ } \ if (_skipStatic && encoderLine <= _thisItemNr) { \ - encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ + ui.encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ ++encoderLine; \ } \ - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ + ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); \ } \ ++_thisItemNr; \ }while(0) @@ -507,11 +507,11 @@ void lcd_advanced_pause_show_message( hotend_status_extruder = extruder; const screenFunc_t next_screen = ap_message_screen(message); if (next_screen) { - set_defer_return_to_status(true); - lcd_goto_screen(next_screen); + ui.defer_status_screen(true); + ui.goto_screen(next_screen); } else - lcd_return_to_status(); + ui.return_to_status(); } #endif // HAS_LCD_MENU && ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp index a4860093eb..3bd7054cdc 100644 --- a/Marlin/src/lcd/menu/menu_info.cpp +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -47,7 +47,7 @@ // About Printer > Printer Stats // void menu_info_stats() { - if (use_click()) { return lcd_goto_previous_menu(); } + if (ui.use_click()) return ui.goto_previous_screen(); char buffer[21]; printStatistics stats = print_job_timer.getStats(); @@ -80,7 +80,7 @@ // About Printer > Thermistors // void menu_info_thermistors() { - if (use_click()) { return lcd_goto_previous_menu(); } + if (ui.use_click()) return ui.goto_previous_screen(); START_SCREEN(); #define THERMISTOR_ID TEMP_SENSOR_0 #include "../thermistornames.h" @@ -139,7 +139,7 @@ void menu_info_thermistors() { // About Printer > Board Info // void menu_info_board() { - if (use_click()) { return lcd_goto_previous_menu(); } + if (ui.use_click()) return ui.goto_previous_screen(); START_SCREEN(); STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000 @@ -158,7 +158,7 @@ void menu_info_board() { // About Printer > Printer Info // void menu_info_printer() { - if (use_click()) { return lcd_goto_previous_menu(); } + if (ui.use_click()) return ui.goto_previous_screen(); START_SCREEN(); STATIC_ITEM(MSG_MARLIN, true, true); // Marlin STATIC_ITEM(SHORT_BUILD_VERSION, true); // x.x.x-Branch diff --git a/Marlin/src/lcd/menu/menu_job_recovery.cpp b/Marlin/src/lcd/menu/menu_job_recovery.cpp index 31b375d0de..18063b224a 100644 --- a/Marlin/src/lcd/menu/menu_job_recovery.cpp +++ b/Marlin/src/lcd/menu/menu_job_recovery.cpp @@ -34,70 +34,20 @@ #include "../../feature/power_loss_recovery.h" static void lcd_power_loss_recovery_resume() { - char cmd[20]; - - // Return to status now - lcd_return_to_status(); - - // Turn leveling off and home - enqueue_and_echo_commands_P(PSTR("M420 S0\nG28 R0" - #if ENABLED(MARLIN_DEV_MODE) - " S" - #elif !IS_KINEMATIC - " X Y" - #endif - )); - - #if HAS_HEATED_BED - const int16_t bt = job_recovery_info.target_temperature_bed; - if (bt) { - // Restore the bed temperature - sprintf_P(cmd, PSTR("M190 S%i"), bt); - enqueue_and_echo_command(cmd); - } - #endif - - // Restore all hotend temperatures - HOTEND_LOOP() { - const int16_t et = job_recovery_info.target_temperature[e]; - if (et) { - #if HOTENDS > 1 - sprintf_P(cmd, PSTR("T%i"), e); - enqueue_and_echo_command(cmd); - #endif - sprintf_P(cmd, PSTR("M109 S%i"), et); - enqueue_and_echo_command(cmd); - } - } - - #if HOTENDS > 1 - sprintf_P(cmd, PSTR("T%i"), job_recovery_info.active_hotend); - enqueue_and_echo_command(cmd); - #endif - - // Restore print cooling fan speeds - for (uint8_t i = 0; i < FAN_COUNT; i++) { - uint8_t f = job_recovery_info.fan_speed[i]; - if (f) { - sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f); - enqueue_and_echo_command(cmd); - } - } - - // Start draining the job recovery command queue - job_recovery_phase = JOB_RECOVERY_YES; + ui.return_to_status(); + enqueue_and_echo_commands_P(PSTR("M1000")); } static void lcd_power_loss_recovery_cancel() { card.removeJobRecoveryFile(); card.autostart_index = 0; - lcd_return_to_status(); + ui.return_to_status(); } void menu_job_recovery() { - set_defer_return_to_status(true); + ui.defer_status_screen(true); START_MENU(); - STATIC_ITEM(MSG_POWER_LOSS_RECOVERY); + STATIC_ITEM(MSG_OUTAGE_RECOVERY); MENU_ITEM(function, MSG_RESUME_PRINT, lcd_power_loss_recovery_resume); MENU_ITEM(function, MSG_STOP_PRINT, lcd_power_loss_recovery_cancel); END_MENU(); diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index ae661a3b54..6217576858 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -37,13 +37,15 @@ #include "../../gcode/queue.h" #include "../../module/printcounter.h" + #if ENABLED(POWER_LOSS_RECOVERY) + #include "../../feature/power_loss_recovery.h" + #endif + void lcd_sdcard_pause() { - card.pauseSDPrint(); - print_job_timer.pause(); - #if ENABLED(PARK_HEAD_ON_PAUSE) - enqueue_and_echo_commands_P(PSTR("M125")); + #if ENABLED(POWER_LOSS_RECOVERY) + if (recovery.enabled) recovery.save(true, false); #endif - lcd_reset_status(); + enqueue_and_echo_commands_P(PSTR("M25")); } void lcd_sdcard_resume() { @@ -52,23 +54,17 @@ #else card.startFileprint(); print_job_timer.start(); + ui.reset_status(); #endif - lcd_reset_status(); } void lcd_sdcard_stop() { wait_for_heatup = wait_for_user = false; - card.abort_sd_printing = true; - lcd_setstatusPGM(PSTR(MSG_PRINT_ABORTED), -1); - lcd_return_to_status(); + card.flag.abort_sd_printing = true; + ui.set_status_P(PSTR(MSG_PRINT_ABORTED), -1); + ui.return_to_status(); } - #if ENABLED(MENU_ADDAUTOSTART) - - void lcd_autostart_sd() { card.beginautostart(); } - - #endif - #endif // SDSUPPORT void menu_tune(); @@ -86,7 +82,7 @@ void menu_main() { MENU_BACK(MSG_WATCH); #if ENABLED(SDSUPPORT) - if (card.cardOK) { + if (card.flag.cardOK) { if (card.isFileOpen()) { if (IS_SD_PRINTING()) MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause); @@ -102,7 +98,7 @@ void menu_main() { } } else { - MENU_ITEM(submenu, MSG_NO_CARD, menu_sdcard); + MENU_ITEM(function, MSG_NO_CARD, NULL); #if !PIN_EXISTS(SD_DETECT) MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface #endif @@ -157,7 +153,7 @@ void menu_main() { // #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) if (!busy) - MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd); + MENU_ITEM(function, MSG_AUTOSTART, card.beginautostart); #endif END_MENU(); diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index e4d6f50944..e4c29ad18c 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -46,9 +46,6 @@ extern millis_t manual_move_start_time; extern int8_t manual_move_axis; -#if ENABLED(DUAL_X_CARRIAGE) || E_MANUAL > 1 - extern int8_t manual_move_e_index; -#endif #if ENABLED(MANUAL_E_MOVES_RELATIVE) float manual_move_e_origin = 0; #endif @@ -57,18 +54,15 @@ extern int8_t manual_move_axis; #endif // -// Tell lcd_update() to start a move to current_position" after a short delay. +// Tell ui.update() to start a move to current_position" after a short delay. // inline void manual_move_to_current(AxisEnum axis #if E_MANUAL > 1 , const int8_t eindex=-1 #endif ) { - #if ENABLED(DUAL_X_CARRIAGE) || E_MANUAL > 1 - #if E_MANUAL > 1 - if (axis == E_AXIS) - #endif - manual_move_e_index = eindex >= 0 ? eindex : active_extruder; + #if E_MANUAL > 1 + if (axis == E_AXIS) ui.manual_move_e_index = eindex >= 0 ? eindex : active_extruder; #endif manual_move_start_time = millis() + (move_menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves manual_move_axis = (int8_t)axis; @@ -79,9 +73,9 @@ inline void manual_move_to_current(AxisEnum axis // static void _lcd_move_xyz(PGM_P name, AxisEnum axis) { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition && !processing_manual_move) { + if (ui.use_click()) return ui.goto_previous_screen_no_defer(); + ui.encoder_direction_normal(); + if (ui.encoderPosition && !ui.processing_manual_move) { // Start with no limits to movement float min = current_position[axis] - 1000, @@ -127,32 +121,32 @@ static void _lcd_move_xyz(PGM_P name, AxisEnum axis) { #endif // Get the new position - const float diff = float((int32_t)encoderPosition) * move_menu_scale; + const float diff = float((int32_t)ui.encoderPosition) * move_menu_scale; #if IS_KINEMATIC manual_move_offset += diff; - if ((int32_t)encoderPosition < 0) + if ((int32_t)ui.encoderPosition < 0) NOLESS(manual_move_offset, min - current_position[axis]); else NOMORE(manual_move_offset, max - current_position[axis]); #else current_position[axis] += diff; - if ((int32_t)encoderPosition < 0) + if ((int32_t)ui.encoderPosition < 0) NOLESS(current_position[axis], min); else NOMORE(current_position[axis], max); #endif manual_move_to_current(axis); - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + ui.refresh(LCDVIEW_REDRAW_NOW); } - encoderPosition = 0; - if (lcdDrawUpdate) { - const float pos = NATIVE_TO_LOGICAL(processing_manual_move ? destination[axis] : current_position[axis] + ui.encoderPosition = 0; + if (ui.should_draw()) { + const float pos = NATIVE_TO_LOGICAL(ui.processing_manual_move ? destination[axis] : current_position[axis] #if IS_KINEMATIC + manual_move_offset #endif , axis); - lcd_implementation_drawedit(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos)); + draw_edit_screen(name, move_menu_scale >= 0.1f ? ftostr41sign(pos) : ftostr43sign(pos)); } } void lcd_move_x() { _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS); } @@ -163,11 +157,11 @@ static void _lcd_move_e( const int8_t eindex=-1 #endif ) { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition) { - if (!processing_manual_move) { - const float diff = float((int32_t)encoderPosition) * move_menu_scale; + if (ui.use_click()) return ui.goto_previous_screen_no_defer(); + ui.encoder_direction_normal(); + if (ui.encoderPosition) { + if (!ui.processing_manual_move) { + const float diff = float((int32_t)ui.encoderPosition) * move_menu_scale; #if IS_KINEMATIC manual_move_offset += diff; #else @@ -178,11 +172,11 @@ static void _lcd_move_e( , eindex #endif ); - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + ui.refresh(LCDVIEW_REDRAW_NOW); } - encoderPosition = 0; + ui.encoderPosition = 0; } - if (lcdDrawUpdate) { + if (ui.should_draw()) { PGM_P pos_label; #if E_MANUAL == 1 pos_label = PSTR(MSG_MOVE_E); @@ -205,7 +199,7 @@ static void _lcd_move_e( } #endif // E_MANUAL > 1 - lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS] + draw_edit_screen(pos_label, ftostr41sign(current_position[E_AXIS] #if IS_KINEMATIC + manual_move_offset #endif @@ -241,9 +235,9 @@ inline void lcd_move_e() { _lcd_move_e(); } screenFunc_t _manual_move_func_ptr; void _goto_manual_move(const float scale) { - set_defer_return_to_status(true); + ui.defer_status_screen(true); move_menu_scale = scale; - lcd_goto_screen(_manual_move_func_ptr); + ui.goto_screen(_manual_move_func_ptr); } void menu_move_10mm() { _goto_manual_move(10); } void menu_move_1mm() { _goto_manual_move( 1); } @@ -305,7 +299,7 @@ void lcd_move_get_e_amount() { _menu_move_distance(E_AXIS, lcd_move_e, -1); } #if ENABLED(DELTA) void lcd_lower_z_to_clip_height() { line_to_z(delta_clip_start_height); - lcd_synchronize(); + ui.synchronize(); } #endif diff --git a/Marlin/src/lcd/menu/menu_sdcard.cpp b/Marlin/src/lcd/menu/menu_sdcard.cpp index 7677025207..f5fffb91e2 100644 --- a/Marlin/src/lcd/menu/menu_sdcard.cpp +++ b/Marlin/src/lcd/menu/menu_sdcard.cpp @@ -39,66 +39,67 @@ #endif void lcd_sd_updir() { - encoderPosition = card.updir() ? ENCODER_STEPS_PER_MENU_ITEM : 0; + ui.encoderPosition = card.updir() ? ENCODER_STEPS_PER_MENU_ITEM : 0; encoderTopLine = 0; screen_changed = true; - lcd_refresh(); + ui.refresh(); } #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) + uint32_t last_sdfile_encoderPosition = 0xFFFF; - void lcd_reselect_last_file() { + void MarlinUI::reselect_last_file() { if (last_sdfile_encoderPosition == 0xFFFF) return; - #if HAS_GRAPHICAL_LCD - // Some of this is a hack to force the screen update to work. - // TODO: Fix the real issue that causes this! - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - lcd_synchronize(); - safe_delay(50); - lcd_synchronize(); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - drawing_screen = screen_changed = true; - #endif + //#if HAS_GRAPHICAL_LCD + // // This is a hack to force a screen update. + // ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); + // ui.synchronize(); + // safe_delay(50); + // ui.synchronize(); + // ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); + // ui.drawing_screen = screen_changed = true; + //#endif - lcd_goto_screen(menu_sdcard, last_sdfile_encoderPosition); - set_defer_return_to_status(true); + goto_screen(menu_sdcard, last_sdfile_encoderPosition); last_sdfile_encoderPosition = 0xFFFF; - #if HAS_GRAPHICAL_LCD - lcd_update(); - #endif + defer_status_screen(true); + + //#if HAS_GRAPHICAL_LCD + // update(); + //#endif } #endif -class menu_item_sdfile { +class MenuItem_sdfile { public: static void action(CardReader &theCard) { #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - last_sdfile_encoderPosition = encoderPosition; // Save which file was selected for later use + last_sdfile_encoderPosition = ui.encoderPosition; // Save which file was selected for later use #endif card.openAndPrintFile(theCard.filename); - lcd_return_to_status(); - lcd_reset_status(); + ui.return_to_status(); + ui.reset_status(); } }; -class menu_item_sddirectory { +class MenuItem_sdfolder { public: static void action(CardReader &theCard) { card.chdir(theCard.filename); encoderTopLine = 0; - encoderPosition = 2 * ENCODER_STEPS_PER_MENU_ITEM; + ui.encoderPosition = 2 * ENCODER_STEPS_PER_MENU_ITEM; screen_changed = true; #if HAS_GRAPHICAL_LCD - drawing_screen = false; + ui.drawing_screen = false; #endif - lcd_refresh(); + ui.refresh(); } }; void menu_sdcard() { - ENCODER_DIRECTION_MENUS(); + ui.encoder_direction_menus(); const uint16_t fileCnt = card.get_num_Files(); @@ -110,9 +111,8 @@ void menu_sdcard() { MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh); #endif } - else { + else if (card.flag.cardOK) MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir); - } for (uint16_t i = 0; i < fileCnt; i++) { if (_menuLineNr == _thisItemNr) { @@ -124,8 +124,8 @@ void menu_sdcard() { card.getfilename_sorted(nr); - if (card.filenameIsDir) - MENU_ITEM(sddirectory, MSG_CARD_MENU, card); + if (card.flag.filenameIsDir) + MENU_ITEM(sdfolder, MSG_CARD_MENU, card); else MENU_ITEM(sdfile, MSG_CARD_MENU, card); } diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index 2f0434dc69..2883fe752e 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -36,8 +36,8 @@ #endif // Initialized by settings.load() -int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2]; -uint8_t lcd_preheat_fan_speed[2]; +int16_t MarlinUI::preheat_hotend_temp[2], MarlinUI::preheat_bed_temp[2]; +uint8_t MarlinUI::preheat_fan_speed[2]; // // "Temperature" submenu items @@ -59,44 +59,44 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb #else UNUSED(fan); #endif - lcd_return_to_status(); + ui.return_to_status(); } #if HOTENDS > 1 - void lcd_preheat_m1_e1_only() { _lcd_preheat(1, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e1_only() { _lcd_preheat(1, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } + void lcd_preheat_m1_e1_only() { _lcd_preheat(1, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_e1_only() { _lcd_preheat(1, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); } #if HAS_HEATED_BED - void lcd_preheat_m1_e1() { _lcd_preheat(1, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e1() { _lcd_preheat(1, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } + void lcd_preheat_m1_e1() { _lcd_preheat(1, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_e1() { _lcd_preheat(1, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } #endif #if HOTENDS > 2 - void lcd_preheat_m1_e2_only() { _lcd_preheat(2, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e2_only() { _lcd_preheat(2, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } + void lcd_preheat_m1_e2_only() { _lcd_preheat(2, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_e2_only() { _lcd_preheat(2, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); } #if HAS_HEATED_BED - void lcd_preheat_m1_e2() { _lcd_preheat(2, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e2() { _lcd_preheat(2, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } + void lcd_preheat_m1_e2() { _lcd_preheat(2, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_e2() { _lcd_preheat(2, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } #endif #if HOTENDS > 3 - void lcd_preheat_m1_e3_only() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e3_only() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } + void lcd_preheat_m1_e3_only() { _lcd_preheat(3, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_e3_only() { _lcd_preheat(3, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); } #if HAS_HEATED_BED - void lcd_preheat_m1_e3() { _lcd_preheat(3, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e3() { _lcd_preheat(3, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } + void lcd_preheat_m1_e3() { _lcd_preheat(3, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_e3() { _lcd_preheat(3, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } #endif #if HOTENDS > 4 - void lcd_preheat_m1_e4_only() { _lcd_preheat(4, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e4_only() { _lcd_preheat(4, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } + void lcd_preheat_m1_e4_only() { _lcd_preheat(4, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_e4_only() { _lcd_preheat(4, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); } #if HAS_HEATED_BED - void lcd_preheat_m1_e4() { _lcd_preheat(4, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e4() { _lcd_preheat(4, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } + void lcd_preheat_m1_e4() { _lcd_preheat(4, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_e4() { _lcd_preheat(4, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } #endif #if HOTENDS > 5 - void lcd_preheat_m1_e5_only() { _lcd_preheat(5, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e5_only() { _lcd_preheat(5, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } + void lcd_preheat_m1_e5_only() { _lcd_preheat(5, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_e5_only() { _lcd_preheat(5, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); } #if HAS_HEATED_BED - void lcd_preheat_m1_e5() { _lcd_preheat(5, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e5() { _lcd_preheat(5, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } + void lcd_preheat_m1_e5() { _lcd_preheat(5, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_e5() { _lcd_preheat(5, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } #endif #endif // HOTENDS > 5 #endif // HOTENDS > 4 @@ -113,15 +113,15 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb void lcd_preheat_m1_all() { #if HOTENDS > 1 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 1); + thermalManager.setTargetHotend(ui.preheat_hotend_temp[0], 1); #if HOTENDS > 2 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 2); + thermalManager.setTargetHotend(ui.preheat_hotend_temp[0], 2); #if HOTENDS > 3 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 3); + thermalManager.setTargetHotend(ui.preheat_hotend_temp[0], 3); #if HOTENDS > 4 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 4); + thermalManager.setTargetHotend(ui.preheat_hotend_temp[0], 4); #if HOTENDS > 5 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 5); + thermalManager.setTargetHotend(ui.preheat_hotend_temp[0], 5); #endif // HOTENDS > 5 #endif // HOTENDS > 4 #endif // HOTENDS > 3 @@ -136,15 +136,15 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb void lcd_preheat_m2_all() { #if HOTENDS > 1 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 1); + thermalManager.setTargetHotend(ui.preheat_hotend_temp[1], 1); #if HOTENDS > 2 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 2); + thermalManager.setTargetHotend(ui.preheat_hotend_temp[1], 2); #if HOTENDS > 3 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 3); + thermalManager.setTargetHotend(ui.preheat_hotend_temp[1], 3); #if HOTENDS > 4 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 4); + thermalManager.setTargetHotend(ui.preheat_hotend_temp[1], 4); #if HOTENDS > 5 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 5); + thermalManager.setTargetHotend(ui.preheat_hotend_temp[1], 5); #endif // HOTENDS > 5 #endif // HOTENDS > 4 #endif // HOTENDS > 3 @@ -161,14 +161,14 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb #if HAS_TEMP_HOTEND || HAS_HEATED_BED - void lcd_preheat_m1_e0_only() { _lcd_preheat(0, lcd_preheat_hotend_temp[0], -1, lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e0_only() { _lcd_preheat(0, lcd_preheat_hotend_temp[1], -1, lcd_preheat_fan_speed[1]); } + void lcd_preheat_m1_e0_only() { _lcd_preheat(0, ui.preheat_hotend_temp[0], -1, ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_e0_only() { _lcd_preheat(0, ui.preheat_hotend_temp[1], -1, ui.preheat_fan_speed[1]); } #if HAS_HEATED_BED - void lcd_preheat_m1_e0() { _lcd_preheat(0, lcd_preheat_hotend_temp[0], lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_e0() { _lcd_preheat(0, lcd_preheat_hotend_temp[1], lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } - void lcd_preheat_m1_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[0], lcd_preheat_fan_speed[0]); } - void lcd_preheat_m2_bedonly() { _lcd_preheat(0, 0, lcd_preheat_bed_temp[1], lcd_preheat_fan_speed[1]); } + void lcd_preheat_m1_e0() { _lcd_preheat(0, ui.preheat_hotend_temp[0], ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_e0() { _lcd_preheat(0, ui.preheat_hotend_temp[1], ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } + void lcd_preheat_m1_bedonly() { _lcd_preheat(0, 0, ui.preheat_bed_temp[0], ui.preheat_fan_speed[0]); } + void lcd_preheat_m2_bedonly() { _lcd_preheat(0, 0, ui.preheat_bed_temp[1], ui.preheat_fan_speed[1]); } #endif void menu_preheat_m1() { @@ -294,7 +294,7 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb void lcd_cooldown() { zero_fan_speeds(); thermalManager.disable_all_heaters(); - lcd_return_to_status(); + ui.return_to_status(); } #endif // HAS_TEMP_HOTEND || HAS_HEATED_BED diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index b4f3476585..b3e41fa5d0 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -62,29 +62,29 @@ void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); } long babysteps_done = 0; void _lcd_babystep(const AxisEnum axis, PGM_P msg) { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } - ENCODER_DIRECTION_NORMAL(); - if (encoderPosition) { - const int16_t babystep_increment = (int32_t)encoderPosition * (BABYSTEP_MULTIPLICATOR); - encoderPosition = 0; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + if (ui.use_click()) return ui.goto_previous_screen_no_defer(); + ui.encoder_direction_normal(); + if (ui.encoderPosition) { + const int16_t babystep_increment = (int32_t)ui.encoderPosition * (BABYSTEP_MULTIPLICATOR); + ui.encoderPosition = 0; + ui.refresh(LCDVIEW_REDRAW_NOW); thermalManager.babystep_axis(axis, babystep_increment); babysteps_done += babystep_increment; } - if (lcdDrawUpdate) - lcd_implementation_drawedit(msg, ftostr43sign(planner.steps_to_mm[axis] * babysteps_done)); + if (ui.should_draw()) + draw_edit_screen(msg, ftostr43sign(planner.steps_to_mm[axis] * babysteps_done)); } #if ENABLED(BABYSTEP_XY) void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEP_X)); } void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEP_Y)); } - void lcd_babystep_x() { lcd_goto_screen(_lcd_babystep_x); babysteps_done = 0; set_defer_return_to_status(true); } - void lcd_babystep_y() { lcd_goto_screen(_lcd_babystep_y); babysteps_done = 0; set_defer_return_to_status(true); } + void lcd_babystep_x() { ui.goto_screen(_lcd_babystep_x); babysteps_done = 0; ui.defer_status_screen(true); } + void lcd_babystep_y() { ui.goto_screen(_lcd_babystep_y); babysteps_done = 0; ui.defer_status_screen(true); } #endif #if DISABLED(BABYSTEP_ZPROBE_OFFSET) void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEP_Z)); } - void lcd_babystep_z() { lcd_goto_screen(_lcd_babystep_z); babysteps_done = 0; set_defer_return_to_status(true); } + void lcd_babystep_z() { ui.goto_screen(_lcd_babystep_z); babysteps_done = 0; ui.defer_status_screen(true); } #endif #endif // BABYSTEPPING diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp index 2686e6b0c3..f14ac555fb 100644 --- a/Marlin/src/lcd/menu/menu_ubl.cpp +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -51,22 +51,22 @@ float mesh_edit_value, mesh_edit_accumulator; // We round mesh_edit_value to 2.5 static int16_t ubl_encoderPosition = 0; static void _lcd_mesh_fine_tune(PGM_P msg) { - set_defer_return_to_status(true); + ui.defer_status_screen(true); if (ubl.encoder_diff) { ubl_encoderPosition = (ubl.encoder_diff > 0) ? 1 : -1; ubl.encoder_diff = 0; mesh_edit_accumulator += float(ubl_encoderPosition) * 0.005f * 0.5f; mesh_edit_value = mesh_edit_accumulator; - encoderPosition = 0; - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; + ui.encoderPosition = 0; + ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); const int32_t rounded = (int32_t)(mesh_edit_value * 1000); mesh_edit_value = float(rounded - (rounded % 5L)) / 1000; } - if (lcdDrawUpdate) { - lcd_implementation_drawedit(msg, ftostr43sign(mesh_edit_value)); + if (ui.should_draw()) { + draw_edit_screen(msg, ftostr43sign(mesh_edit_value)); #if ENABLED(MESH_EDIT_GFX_OVERLAY) _lcd_zoffset_overlay_gfx(mesh_edit_value); #endif @@ -74,19 +74,19 @@ static void _lcd_mesh_fine_tune(PGM_P msg) { } void _lcd_mesh_edit_NOP() { - set_defer_return_to_status(true); + ui.defer_status_screen(true); } float lcd_mesh_edit() { - lcd_goto_screen(_lcd_mesh_edit_NOP); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; + ui.goto_screen(_lcd_mesh_edit_NOP); + ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); _lcd_mesh_fine_tune(PSTR("Mesh Editor")); return mesh_edit_value; } void lcd_mesh_edit_setup(const float &initial) { mesh_edit_value = mesh_edit_accumulator = initial; - lcd_goto_screen(_lcd_mesh_edit_NOP); + ui.goto_screen(_lcd_mesh_edit_NOP); } void _lcd_z_offset_edit() { @@ -94,13 +94,13 @@ void _lcd_z_offset_edit() { } float lcd_z_offset_edit() { - lcd_goto_screen(_lcd_z_offset_edit); + ui.goto_screen(_lcd_z_offset_edit); return mesh_edit_value; } void lcd_z_offset_edit_setup(const float &initial) { mesh_edit_value = mesh_edit_accumulator = initial; - lcd_goto_screen(_lcd_z_offset_edit); + ui.goto_screen(_lcd_z_offset_edit); } /** @@ -160,7 +160,7 @@ void _menu_ubl_height_adjust() { START_MENU(); MENU_BACK(MSG_EDIT_MESH); MENU_ITEM_EDIT_CALLBACK(int3, MSG_UBL_MESH_HEIGHT_AMOUNT, &ubl_height_amount, -9, 9, _lcd_ubl_adjust_height_cmd); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); + MENU_ITEM(function, MSG_WATCH, ui.return_to_status); END_MENU(); } @@ -179,7 +179,7 @@ void _lcd_ubl_edit_mesh() { MENU_ITEM(gcode, MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); MENU_ITEM(gcode, MSG_UBL_FINE_TUNE_CLOSEST, PSTR("G29 P4 T")); MENU_ITEM(submenu, MSG_UBL_MESH_HEIGHT_ADJUST, _menu_ubl_height_adjust); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); + MENU_ITEM(function, MSG_WATCH, ui.return_to_status); END_MENU(); } @@ -220,7 +220,7 @@ void _lcd_ubl_validate_mesh() { MENU_ITEM(gcode, MSG_UBL_VALIDATE_MESH_M2, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); #endif MENU_ITEM(function, MSG_UBL_VALIDATE_CUSTOM_MESH, _lcd_ubl_validate_custom_mesh); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); + MENU_ITEM(function, MSG_WATCH, ui.return_to_status); END_MENU(); } @@ -261,7 +261,7 @@ void _lcd_ubl_mesh_leveling() { MENU_BACK(MSG_UBL_TOOLS); MENU_ITEM(gcode, MSG_UBL_3POINT_MESH_LEVELING, PSTR("G29 J0")); MENU_ITEM(submenu, MSG_UBL_GRID_MESH_LEVELING, _lcd_ubl_grid_level); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); + MENU_ITEM(function, MSG_WATCH, ui.return_to_status); END_MENU(); } @@ -290,13 +290,13 @@ void _menu_ubl_fillin() { MENU_ITEM_EDIT_CALLBACK(int3, MSG_UBL_FILLIN_AMOUNT, &ubl_fillin_amount, 0, 9, _lcd_ubl_fillin_amount_cmd); MENU_ITEM(gcode, MSG_UBL_SMART_FILLIN, PSTR("G29 P3 T0")); MENU_ITEM(gcode, MSG_UBL_MANUAL_FILLIN, PSTR("G29 P2 B T0")); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); + MENU_ITEM(function, MSG_WATCH, ui.return_to_status); END_MENU(); } void _lcd_ubl_invalidate() { ubl.invalidate(); - SERIAL_PROTOCOLLNPGM("Mesh invalidated."); + SERIAL_ECHOLNPGM("Mesh invalidated."); } /** @@ -353,7 +353,7 @@ void _lcd_ubl_build_mesh() { MENU_ITEM(gcode, MSG_UBL_CONTINUE_MESH, PSTR("G29 P1 C")); MENU_ITEM(function, MSG_UBL_INVALIDATE_ALL, _lcd_ubl_invalidate); MENU_ITEM(gcode, MSG_UBL_INVALIDATE_CLOSEST, PSTR("G29 I")); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); + MENU_ITEM(function, MSG_WATCH, ui.return_to_status); END_MENU(); } @@ -408,11 +408,11 @@ void _lcd_ubl_storage_mesh() { void _lcd_ubl_output_map_lcd(); void _lcd_ubl_map_homing() { - set_defer_return_to_status(true); + ui.defer_status_screen(true); _lcd_draw_homing(); if (all_axes_homed()) { ubl.lcd_map_control = true; // Return to the map screen - lcd_goto_screen(_lcd_ubl_output_map_lcd); + ui.goto_screen(_lcd_ubl_output_map_lcd); } } @@ -444,10 +444,10 @@ void sync_plan_position(); void _lcd_do_nothing() {} void _lcd_hard_stop() { - const screenFunc_t old_screen = currentScreen; - currentScreen = _lcd_do_nothing; + const screenFunc_t old_screen = ui.currentScreen; + ui.currentScreen = _lcd_do_nothing; planner.quick_stop(); - currentScreen = old_screen; + ui.currentScreen = old_screen; set_current_from_steppers_for_axis(ALL_AXES); sync_plan_position(); } @@ -455,15 +455,15 @@ void _lcd_hard_stop() { void _lcd_ubl_output_map_lcd() { static int16_t step_scaler = 0; - if (use_click()) return _lcd_ubl_map_lcd_edit_cmd(); - ENCODER_DIRECTION_NORMAL(); + if (ui.use_click()) return _lcd_ubl_map_lcd_edit_cmd(); + ui.encoder_direction_normal(); - if (encoderPosition) { - step_scaler += (int32_t)encoderPosition; + if (ui.encoderPosition) { + step_scaler += (int32_t)ui.encoderPosition; x_plot += step_scaler / (ENCODER_STEPS_PER_MENU_ITEM); if (ABS(step_scaler) >= ENCODER_STEPS_PER_MENU_ITEM) step_scaler = 0; - encoderPosition = 0; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + ui.encoderPosition = 0; + ui.refresh(LCDVIEW_REDRAW_NOW); } // Encoder to the right (++) @@ -487,8 +487,8 @@ void _lcd_ubl_output_map_lcd() { n_edit_pts = yc ? (xc ? 9 : 6) : (xc ? 6 : 4); // Corners #endif - if (lcdDrawUpdate) { - lcd_implementation_ubl_plot(x_plot, y_plot); + if (ui.should_draw()) { + ui.ubl_plot(x_plot, y_plot); if (planner.movesplanned()) // If the nozzle is already moving, cancel the move. _lcd_hard_stop(); @@ -505,7 +505,7 @@ void _lcd_ubl_output_map_lcd_cmd() { set_all_unhomed(); enqueue_and_echo_commands_P(PSTR("G28")); } - lcd_goto_screen(_lcd_ubl_map_homing); + ui.goto_screen(_lcd_ubl_map_homing); } /** diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 7cb7eaec9a..f5ba174df0 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -22,139 +22,180 @@ #include "../inc/MarlinConfigPre.h" -#if ENABLED(ULTRA_LCD) +// These displays all share the MarlinUI class +#if HAS_SPI_LCD || ENABLED(MALYAN_LCD) || ENABLED(EXTENSIBLE_UI) + #include "ultralcd.h" + MarlinUI ui; + #include "../sd/cardreader.h" + #if ENABLED(EXTENSIBLE_UI) + #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u) + #endif +#endif -#include +#if HAS_SPI_LCD + #if ENABLED(STATUS_MESSAGE_SCROLLING) + uint8_t MarlinUI::status_scroll_offset; // = 0 + #if LONG_FILENAME_LENGTH > CHARSIZE * 2 * (LCD_WIDTH) + #define MAX_MESSAGE_LENGTH LONG_FILENAME_LENGTH + #else + #define MAX_MESSAGE_LENGTH CHARSIZE * 2 * (LCD_WIDTH) + #endif + #else + #define MAX_MESSAGE_LENGTH CHARSIZE * (LCD_WIDTH) + #endif +#elif ENABLED(EXTENSIBLE_UI) + #define MAX_MESSAGE_LENGTH 63 +#endif + +#ifdef MAX_MESSAGE_LENGTH + uint8_t MarlinUI::status_message_level; // = 0 + char MarlinUI::status_message[MAX_MESSAGE_LENGTH + 1]; +#endif + +#if HAS_SPI_LCD + +#if HAS_GRAPHICAL_LCD + #include "dogm/ultralcd_DOGM.h" +#endif -#include "ultralcd.h" #include "lcdprint.h" #include "../sd/cardreader.h" #include "../module/temperature.h" #include "../module/planner.h" -#include "../module/stepper.h" -#include "../module/motion.h" -#include "../module/probe.h" #include "../module/printcounter.h" -#include "../gcode/gcode.h" +#include "../module/motion.h" #include "../gcode/queue.h" -#include "../module/configuration_store.h" -#include "../module/tool_change.h" #include "../Marlin.h" -#if ENABLED(ADVANCED_PAUSE_FEATURE) - #include "../feature/pause.h" -#endif - #if ENABLED(POWER_LOSS_RECOVERY) - #include "../feature/power_loss_recovery.h" - #if HAS_LCD_MENU - void menu_job_recovery(); - #endif + #include "../feature/power_loss_recovery.h" #endif -#if ENABLED(PRINTCOUNTER) && ENABLED(LCD_INFO_MENU) - #include "../libs/duration_t.h" +#if ENABLED(AUTO_BED_LEVELING_UBL) + #include "../feature/bedlevel/bedlevel.h" #endif -#if ENABLED(FILAMENT_LCD_DISPLAY) - #include "../feature/filwidth.h" -#endif - -#if ENABLED(BLTOUCH) - #include "../module/endstops.h" -#endif - -#if HAS_LEVELING - #include "../feature/bedlevel/bedlevel.h" -#endif - -#if DISABLED(LCD_USE_I2C_BUZZER) +#if HAS_BUZZER #include "../libs/buzzer.h" #endif -// Buttons -volatile uint8_t buttons; +#if HAS_ENCODER_ACTION + volatile uint8_t MarlinUI::buttons; + #if HAS_SLOW_BUTTONS + volatile uint8_t MarlinUI::slow_buttons; + #endif +#endif #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) uint8_t lcd_sd_status; #endif -#if ENABLED(STATUS_MESSAGE_SCROLLING) - uint8_t status_scroll_offset = 0; - #if LONG_FILENAME_LENGTH > CHARSIZE * 2 * (LCD_WIDTH) - #define MAX_MESSAGE_LENGTH LONG_FILENAME_LENGTH - #else - #define MAX_MESSAGE_LENGTH CHARSIZE * 2 * (LCD_WIDTH) - #endif -#else - #define MAX_MESSAGE_LENGTH CHARSIZE * (LCD_WIDTH) +#if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS + bool MarlinUI::defer_return_to_status; #endif -char lcd_status_message[MAX_MESSAGE_LENGTH + 1]; -uint8_t lcd_status_update_delay = 1, // First update one loop delayed - lcd_status_message_level; // Higher level blocks lower level +uint8_t MarlinUI::lcd_status_update_delay = 1; // First update one loop delayed #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - millis_t previous_lcd_status_ms = 0; -#endif - -#if HAS_LCD_MENU && ENABLED(SDSUPPORT) && ENABLED(SCROLL_LONG_FILENAMES) - uint8_t filename_scroll_pos, filename_scroll_max; + millis_t MarlinUI::next_filament_display; // = 0 #endif #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - uint8_t progress_bar_percent; + uint8_t MarlinUI::progress_bar_percent; // = 0 #endif millis_t next_button_update_ms; #if HAS_GRAPHICAL_LCD - bool drawing_screen, first_page; // = false + bool MarlinUI::drawing_screen, MarlinUI::first_page; // = false #endif // Encoder Handling #if HAS_ENCODER_ACTION - uint32_t encoderPosition; - volatile int8_t encoderDiff; // Updated in lcd_buttons_update, added to encoderPosition every LCD update - #if ENABLED(ENCODER_RATE_MULTIPLIER) - bool encoderRateMultiplierEnabled; - #endif - #if ENABLED(REVERSE_MENU_DIRECTION) - int8_t encoderDirection = 1; - #endif + uint32_t MarlinUI::encoderPosition; + volatile int8_t encoderDiff; // Updated in update_buttons, added to encoderPosition every LCD update #endif #if HAS_LCD_MENU #include "menu/menu.h" + #include "../sd/cardreader.h" - screenFunc_t currentScreen = lcd_status_screen; + #if ENABLED(SDSUPPORT) + + #if ENABLED(SCROLL_LONG_FILENAMES) + uint8_t MarlinUI::filename_scroll_pos, MarlinUI::filename_scroll_max; + #endif + + const char * MarlinUI::scrolled_filename(CardReader &theCard, const uint8_t maxlen, uint8_t hash, const bool doScroll) { + const char *outstr = theCard.longest_filename(); + if (theCard.longFilename[0]) { + #if ENABLED(SCROLL_LONG_FILENAMES) + if (doScroll) { + for (uint8_t l = FILENAME_LENGTH; l--;) + hash = ((hash << 1) | (hash >> 7)) ^ theCard.filename[l]; // rotate, xor + static uint8_t filename_scroll_hash; + if (filename_scroll_hash != hash) { // If the hash changed... + filename_scroll_hash = hash; // Save the new hash + filename_scroll_max = MAX(0, utf8_strlen(theCard.longFilename) - maxlen); // Update the scroll limit + filename_scroll_pos = 0; // Reset scroll to the start + lcd_status_update_delay = 8; // Don't scroll right away + } + outstr += filename_scroll_pos; + } + #else + theCard.longFilename[maxlen] = '\0'; // cutoff at screen edge + #endif + } + return outstr; + } - #if ENABLED(ENCODER_RATE_MULTIPLIER) - millis_t lastEncoderMovementMillis = 0; #endif - bool lcd_clicked, wait_for_unclick; + screenFunc_t MarlinUI::currentScreen; // Initialized in CTOR + + #if ENABLED(ENCODER_RATE_MULTIPLIER) + bool MarlinUI::encoderRateMultiplierEnabled; + millis_t MarlinUI::lastEncoderMovementMillis = 0; + void MarlinUI::enable_encoder_multiplier(const bool onoff) { + encoderRateMultiplierEnabled = onoff; + lastEncoderMovementMillis = 0; + } + #endif + + #if ENABLED(REVERSE_MENU_DIRECTION) + int8_t MarlinUI::encoderDirection = 1; + #endif + + bool MarlinUI::lcd_clicked; float move_menu_scale; - bool use_click() { + bool MarlinUI::use_click() { const bool click = lcd_clicked; lcd_clicked = false; return click; } -#else + #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - constexpr bool lcd_clicked = false; + bool MarlinUI::external_control; // = false + + void MarlinUI::wait_for_release() { + while (button_pressed()) safe_delay(50); + safe_delay(50); + } + + #endif #endif -void lcd_init() { +void MarlinUI::init() { - lcd_implementation_init(); + init_lcd(); + + #if HAS_DIGITAL_BUTTONS - #if ENABLED(NEWPANEL) #if BUTTON_EXISTS(EN1) SET_INPUT_PULLUP(BTN_EN1); #endif @@ -165,12 +206,6 @@ void lcd_init() { SET_INPUT_PULLUP(BTN_ENC); #endif - #if ENABLED(REPRAPWORLD_KEYPAD) && DISABLED(ADC_KEYPAD) - SET_OUTPUT(SHIFT_CLK); - OUT_WRITE(SHIFT_LD, HIGH); - SET_INPUT_PULLUP(SHIFT_OUT); - #endif - #if BUTTON_EXISTS(UP) SET_INPUT(BTN_UP); #endif @@ -184,37 +219,45 @@ void lcd_init() { SET_INPUT(BTN_RT); #endif - #else // !NEWPANEL + #endif // !HAS_DIGITAL_BUTTONS + + #if HAS_SHIFT_ENCODER #if ENABLED(SR_LCD_2W_NL) // Non latching 2 wire shift register + SET_OUTPUT(SR_DATA_PIN); SET_OUTPUT(SR_CLK_PIN); + #elif defined(SHIFT_CLK) + SET_OUTPUT(SHIFT_CLK); OUT_WRITE(SHIFT_LD, HIGH); - OUT_WRITE(SHIFT_EN, LOW); + #if defined(SHIFT_EN) && SHIFT_EN >= 0 + OUT_WRITE(SHIFT_EN, LOW); + #endif SET_INPUT_PULLUP(SHIFT_OUT); - #endif // SR_LCD_2W_NL - #endif // !NEWPANEL + #endif + + #endif // HAS_SHIFT_ENCODER #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) SET_INPUT_PULLUP(SD_DETECT_PIN); lcd_sd_status = 2; // UNKNOWN #endif - #if ENABLED(LCD_HAS_SLOW_BUTTONS) + #if HAS_ENCODER_ACTION && HAS_SLOW_BUTTONS slow_buttons = 0; #endif - lcd_buttons_update(); + update_buttons(); #if HAS_ENCODER_ACTION encoderDiff = 0; #endif } -bool lcd_blink() { +bool MarlinUI::get_blink() { static uint8_t blink = 0; static millis_t next_blink_ms = 0; millis_t ms = millis(); @@ -229,39 +272,11 @@ bool lcd_blink() { ///////////// Keypad Handling ////////////// //////////////////////////////////////////// -#if ENABLED(REPRAPWORLD_KEYPAD) - volatile uint8_t buttons_reprapworld_keypad; -#endif +#if ENABLED(REPRAPWORLD_KEYPAD) && HAS_ENCODER_ACTION -#if ENABLED(ADC_KEYPAD) + volatile uint8_t MarlinUI::keypad_buttons; - inline bool handle_adc_keypad() { - #define ADC_MIN_KEY_DELAY 100 - if (buttons_reprapworld_keypad) { - #if HAS_ENCODER_ACTION - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - if (encoderDirection == -1) { // side effect which signals we are inside a menu - #if HAS_LCD_MENU - if (RRK(EN_REPRAPWORLD_KEYPAD_DOWN)) encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM; - else if (RRK(EN_REPRAPWORLD_KEYPAD_UP)) encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; - else if (RRK(EN_REPRAPWORLD_KEYPAD_LEFT)) { menu_item_back::action(); lcd_quick_feedback(true); } - else if (RRK(EN_REPRAPWORLD_KEYPAD_RIGHT)) { lcd_return_to_status(); lcd_quick_feedback(true); } - #endif - } - else if (RRK(EN_REPRAPWORLD_KEYPAD_DOWN)) encoderPosition += ENCODER_PULSES_PER_STEP; - else if (RRK(EN_REPRAPWORLD_KEYPAD_UP)) encoderPosition -= ENCODER_PULSES_PER_STEP; - else if (RRK(EN_REPRAPWORLD_KEYPAD_RIGHT)) encoderPosition = 0; - #endif - next_button_update_ms = millis() + ADC_MIN_KEY_DELAY; - return true; - } - - return false; - } - -#elif ENABLED(REPRAPWORLD_KEYPAD) - - #if HAS_LCD_MENU + #if HAS_LCD_MENU && !HAS_ADC_BUTTONS void lcd_move_x(); void lcd_move_y(); @@ -280,45 +295,83 @@ bool lcd_blink() { #endif - inline void handle_reprapworld_keypad() { + bool MarlinUI::handle_keypad() { - static uint8_t keypad_debounce = 0; + #if HAS_ADC_BUTTONS - if (!RRK( EN_REPRAPWORLD_KEYPAD_F1 | EN_REPRAPWORLD_KEYPAD_F2 - | EN_REPRAPWORLD_KEYPAD_F3 | EN_REPRAPWORLD_KEYPAD_DOWN - | EN_REPRAPWORLD_KEYPAD_RIGHT | EN_REPRAPWORLD_KEYPAD_MIDDLE - | EN_REPRAPWORLD_KEYPAD_UP | EN_REPRAPWORLD_KEYPAD_LEFT ) - ) { - if (keypad_debounce > 0) keypad_debounce--; - } - else if (!keypad_debounce) { - keypad_debounce = 2; - - const bool homed = all_axes_homed(); - - #if HAS_LCD_MENU - - if (RRK(EN_REPRAPWORLD_KEYPAD_MIDDLE)) lcd_goto_screen(menu_move); - - #if DISABLED(DELTA) && Z_HOME_DIR == -1 - if (RRK(EN_REPRAPWORLD_KEYPAD_F2)) _reprapworld_keypad_move(Z_AXIS, 1); - #endif - - if (homed) { - #if ENABLED(DELTA) || Z_HOME_DIR != -1 - if (RRK(EN_REPRAPWORLD_KEYPAD_F2)) _reprapworld_keypad_move(Z_AXIS, 1); + #define ADC_MIN_KEY_DELAY 100 + if (keypad_buttons) { + #if HAS_ENCODER_ACTION + refresh(LCDVIEW_REDRAW_NOW); + #if HAS_LCD_MENU + if (encoderDirection == -1) { // ADC_KEYPAD forces REVERSE_MENU_DIRECTION, so this indicates menu navigation + if (RRK(EN_KEYPAD_UP)) encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; + else if (RRK(EN_KEYPAD_DOWN)) encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM; + else if (RRK(EN_KEYPAD_LEFT)) { MenuItem_back::action(); quick_feedback(); } + else if (RRK(EN_KEYPAD_RIGHT)) { return_to_status(); quick_feedback(); } + } + else #endif - if (RRK(EN_REPRAPWORLD_KEYPAD_F3)) _reprapworld_keypad_move(Z_AXIS, -1); - if (RRK(EN_REPRAPWORLD_KEYPAD_LEFT)) _reprapworld_keypad_move(X_AXIS, -1); - if (RRK(EN_REPRAPWORLD_KEYPAD_RIGHT)) _reprapworld_keypad_move(X_AXIS, 1); - if (RRK(EN_REPRAPWORLD_KEYPAD_DOWN)) _reprapworld_keypad_move(Y_AXIS, 1); - if (RRK(EN_REPRAPWORLD_KEYPAD_UP)) _reprapworld_keypad_move(Y_AXIS, -1); - } + { + #if HAS_LCD_MENU + if (RRK(EN_KEYPAD_UP)) encoderPosition -= ENCODER_PULSES_PER_STEP; + else if (RRK(EN_KEYPAD_DOWN)) encoderPosition += ENCODER_PULSES_PER_STEP; + else if (RRK(EN_KEYPAD_LEFT)) { MenuItem_back::action(); quick_feedback(); } + else if (RRK(EN_KEYPAD_RIGHT)) encoderPosition = 0; + #else + if (RRK(EN_KEYPAD_UP) || RRK(EN_KEYPAD_LEFT)) encoderPosition -= ENCODER_PULSES_PER_STEP; + else if (RRK(EN_KEYPAD_DOWN) || RRK(EN_KEYPAD_RIGHT)) encoderPosition += ENCODER_PULSES_PER_STEP; + #endif + } + #endif + next_button_update_ms = millis() + ADC_MIN_KEY_DELAY; + return true; + } - #endif // HAS_LCD_MENU + #else // !HAS_ADC_BUTTONS - if (!homed && RRK(EN_REPRAPWORLD_KEYPAD_F1)) enqueue_and_echo_commands_P(PSTR("G28")); - } + static uint8_t keypad_debounce = 0; + + if (!RRK( EN_KEYPAD_F1 | EN_KEYPAD_F2 + | EN_KEYPAD_F3 | EN_KEYPAD_DOWN + | EN_KEYPAD_RIGHT | EN_KEYPAD_MIDDLE + | EN_KEYPAD_UP | EN_KEYPAD_LEFT ) + ) { + if (keypad_debounce > 0) keypad_debounce--; + } + else if (!keypad_debounce) { + keypad_debounce = 2; + + const bool homed = all_axes_homed(); + + #if HAS_LCD_MENU + + if (RRK(EN_KEYPAD_MIDDLE)) goto_screen(menu_move); + + #if DISABLED(DELTA) && Z_HOME_DIR == -1 + if (RRK(EN_KEYPAD_F2)) _reprapworld_keypad_move(Z_AXIS, 1); + #endif + + if (homed) { + #if ENABLED(DELTA) || Z_HOME_DIR != -1 + if (RRK(EN_KEYPAD_F2)) _reprapworld_keypad_move(Z_AXIS, 1); + #endif + if (RRK(EN_KEYPAD_F3)) _reprapworld_keypad_move(Z_AXIS, -1); + if (RRK(EN_KEYPAD_LEFT)) _reprapworld_keypad_move(X_AXIS, -1); + if (RRK(EN_KEYPAD_RIGHT)) _reprapworld_keypad_move(X_AXIS, 1); + if (RRK(EN_KEYPAD_DOWN)) _reprapworld_keypad_move(Y_AXIS, 1); + if (RRK(EN_KEYPAD_UP)) _reprapworld_keypad_move(Y_AXIS, -1); + } + + #endif // HAS_LCD_MENU + + if (!homed && RRK(EN_KEYPAD_F1)) enqueue_and_echo_commands_P(PSTR("G28")); + return true; + } + + #endif // !ADC_KEYPAD + + return false; } #endif // REPRAPWORLD_KEYPAD @@ -330,32 +383,33 @@ bool lcd_blink() { */ #if ENABLED(LCD_PROGRESS_BAR) - millis_t progress_bar_ms = 0; // Start millis of the current progress bar cycle + millis_t MarlinUI::progress_bar_ms; // = 0 #if PROGRESS_MSG_EXPIRE > 0 - static millis_t expire_status_ms = 0; - void dontExpireStatus() { expire_status_ms = 0; } + millis_t MarlinUI::expire_status_ms; // = 0 #endif #endif -#if LCD_INFO_SCREEN_STYLE == 0 - void lcd_impl_status_screen_0(); -#elif LCD_INFO_SCREEN_STYLE == 1 - void lcd_impl_status_screen_1(); +#if HAS_PRINT_PROGRESS + uint8_t MarlinUI::get_progress() { + #if ENABLED(LCD_SET_PROGRESS_MANUALLY) + uint8_t &progress = progress_bar_percent; + #else + uint8_t progress = 0; + #endif + #if ENABLED(SDSUPPORT) + if (IS_SD_PRINTING()) progress = card.percentDone(); + #endif + return progress; + } #endif -void lcd_status_screen() { +void MarlinUI::status_screen() { #if HAS_LCD_MENU - ENCODER_DIRECTION_NORMAL(); + encoder_direction_normal(); ENCODER_RATE_MULTIPLY(false); #endif - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) && ENABLED(SDSUPPORT) && (ENABLED(LCD_PROGRESS_BAR) || HAS_GRAPHICAL_LCD) - // Progress bar % comes from SD when actively printing - if (IS_SD_PRINTING()) - progress_bar_percent = card.percentDone(); - #endif - #if ENABLED(LCD_PROGRESS_BAR) // @@ -364,7 +418,9 @@ void lcd_status_screen() { // share the same line on the display. // - millis_t ms = millis(); + #if DISABLED(PROGRESS_MSG_ONCE) || (PROGRESS_MSG_EXPIRE > 0) + millis_t ms = millis(); + #endif // If the message will blink rather than expire... #if DISABLED(PROGRESS_MSG_ONCE) @@ -377,14 +433,10 @@ void lcd_status_screen() { // Handle message expire if (expire_status_ms > 0) { - #if DISABLED(LCD_SET_PROGRESS_MANUALLY) - const uint8_t progress_bar_percent = card.percentDone(); - #endif - // Expire the message if a job is active and the bar has ticks - if (progress_bar_percent > 2 && !print_job_timer.isPaused()) { + if (get_progress() > 2 && !print_job_timer.isPaused()) { if (ELAPSED(ms, expire_status_ms)) { - lcd_status_message[0] = '\0'; + status_message[0] = '\0'; expire_status_ms = 0; } } @@ -403,16 +455,16 @@ void lcd_status_screen() { if (use_click()) { #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - previous_lcd_status_ms = millis(); // get status message to show up for a while + next_filament_display = millis() + 5000UL; // Show status message for 5s #endif - lcd_goto_screen(menu_main); - lcd_implementation_init(); // May revive the LCD if static electricity killed it + goto_screen(menu_main); + init_lcd(); // May revive the LCD if static electricity killed it return; } #endif // HAS_LCD_MENU - #if ENABLED(ULTIPANEL_FEEDMULTIPLY) + #if ENABLED(ULTIPANEL_FEEDMULTIPLY) && HAS_ENCODER_ACTION const int16_t new_frm = feedrate_percentage + (int32_t)encoderPosition; // Dead zone at 100% feedrate @@ -439,55 +491,22 @@ void lcd_status_screen() { #endif // ULTIPANEL_FEEDMULTIPLY - #if LCD_INFO_SCREEN_STYLE == 0 - lcd_impl_status_screen_0(); - #elif LCD_INFO_SCREEN_STYLE == 1 - lcd_impl_status_screen_1(); - #endif + draw_status_screen(); } -/** - * Reset the status message - */ -void lcd_reset_status() { - static const char paused[] PROGMEM = MSG_PRINT_PAUSED; - static const char printing[] PROGMEM = MSG_PRINTING; - static const char welcome[] PROGMEM = WELCOME_MSG; - PGM_P msg; - if (print_job_timer.isPaused()) - msg = paused; - #if ENABLED(SDSUPPORT) - else if (IS_SD_PRINTING()) - return lcd_setstatus(card.longest_filename(), true); - #endif - else if (print_job_timer.isRunning()) - msg = printing; - else - msg = welcome; - - lcd_setstatusPGM(msg, -1); +void MarlinUI::kill_screen(PGM_P lcd_msg) { + init(); + set_alert_status_P(lcd_msg); + draw_kill_screen(); } -void kill_screen(PGM_P lcd_msg) { - lcd_init(); - lcd_setalertstatusPGM(lcd_msg); - lcd_kill_screen(); -} - -#if HAS_BUZZER - void lcd_buzz(const long duration, const uint16_t freq) { - #if ENABLED(LCD_USE_I2C_BUZZER) - lcd.buzz(duration, freq); - #elif PIN_EXISTS(BEEPER) - buzzer.tone(duration, freq); - #endif - } -#endif - -void lcd_quick_feedback(const bool clear_buttons) { +void MarlinUI::quick_feedback(const bool clear_buttons/*=true*/) { #if HAS_LCD_MENU - lcd_refresh(); + refresh(); + #endif + + #if HAS_ENCODER_ACTION if (clear_buttons) buttons = 0; next_button_update_ms = millis() + 500; #else @@ -495,7 +514,7 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif // Buzz and wait. The delay is needed for buttons to settle! - lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); + buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); #if HAS_LCD_MENU #if ENABLED(LCD_USE_I2C_BUZZER) @@ -506,6 +525,10 @@ void lcd_quick_feedback(const bool clear_buttons) { #endif } +//////////////////////////////////////////// +/////////////// Manual Move //////////////// +//////////////////////////////////////////// + #if HAS_LCD_MENU extern bool no_reentry; // Flag to prevent recursion into menu handlers @@ -514,21 +537,19 @@ void lcd_quick_feedback(const bool clear_buttons) { millis_t manual_move_start_time = 0; #if IS_KINEMATIC - bool processing_manual_move = false; + bool MarlinUI::processing_manual_move = false; float manual_move_offset = 0; #endif - #if !IS_KINEMATIC || (IS_KINEMATIC && EXTRUDERS > 1) - int8_t manual_move_e_index = 0; - #else - constexpr int8_t manual_move_e_index = 0; + #if E_MANUAL > 1 + int8_t MarlinUI::manual_move_e_index = 0; #endif /** * If the most recent manual move hasn't been fed to the planner yet, * and the planner can accept one, send a move immediately. */ - void manage_manual_move() { + void MarlinUI::manage_manual_move() { if (processing_manual_move) return; @@ -583,7 +604,7 @@ void lcd_quick_feedback(const bool clear_buttons) { * - Act on RepRap World keypad input * - Update the encoder position * - Apply acceleration to the encoder position - * - Set lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NOW on controller events + * - Do refresh(LCDVIEW_CALL_REDRAW_NOW) on controller events * - Reset the Info Screen timeout if there's any input * - Update status indicators, if any * @@ -593,7 +614,7 @@ void lcd_quick_feedback(const bool clear_buttons) { * - Call the menu handler. Menu handlers should do the following: * - If a value changes, set lcdDrawUpdate to LCDVIEW_REDRAW_NOW and draw the value * (Encoder events automatically set lcdDrawUpdate for you.) - * - if (lcdDrawUpdate) { redraw } + * - if (should_draw()) { redraw } * - Before exiting the handler set lcdDrawUpdate to: * - LCDVIEW_CLEAR_CALL_REDRAW to clear screen and set LCDVIEW_CALL_REDRAW_NEXT. * - LCDVIEW_REDRAW_NOW to draw now (including remaining stripes). @@ -609,17 +630,9 @@ void lcd_quick_feedback(const bool clear_buttons) { * This function is only called from the main thread. */ -LCDViewAction lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; +LCDViewAction MarlinUI::lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; -#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - bool lcd_external_control; // = false -#endif - -#if ENABLED(LCD_HAS_SLOW_BUTTONS) - volatile uint8_t slow_buttons; -#endif - -bool lcd_detected() { +bool MarlinUI::detected() { return #if (ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008)) && defined(DETECT_DEVICE) lcd.LcdDetected() == 1 @@ -629,7 +642,7 @@ bool lcd_detected() { ; } -void lcd_update() { +void MarlinUI::update() { static uint16_t max_display_update_time = 0; static millis_t next_lcd_update_ms; @@ -643,33 +656,26 @@ void lcd_update() { // Handle any queued Move Axis motion manage_manual_move(); - // Update button states for LCD_CLICKED(), etc. - // After state changes the next button update - // may be delayed 300-500ms. - lcd_buttons_update(); - - #if ENABLED(AUTO_BED_LEVELING_UBL) - // Don't run the debouncer if UBL owns the display - #define UBL_CONDITION !lcd_external_control - #else - #define UBL_CONDITION true - #endif + // Update button states for button_pressed(), etc. + // If the state changes the next update may be delayed 300-500ms. + update_buttons(); // 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 && !no_reentry; // Keep the click if not waiting for a user-click - wait_for_user = false; // Any click clears wait for user - lcd_quick_feedback(true); // Always make a click sound + static bool wait_for_unclick; // = 0 + if (!external_control && button_pressed()) { + 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 && !no_reentry; // - Keep the click if not waiting for a user-click + wait_for_user = false; // - Any click clears wait for user + quick_feedback(); // - Always make a click sound } } else wait_for_unclick = false; - #if BUTTON_EXISTS(BACK) - if (LCD_BACK_CLICKED) { - lcd_quick_feedback(true); - lcd_goto_previous_menu(); + #if HAS_DIGITAL_BUTTONS && BUTTON_EXISTS(BACK) + if (LCD_BACK_CLICKED()) { + quick_feedback(); + goto_previous_screen(); } #endif @@ -678,7 +684,7 @@ void lcd_update() { #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) const uint8_t sd_status = (uint8_t)IS_SD_INSERTED(); - if (sd_status != lcd_sd_status && lcd_detected()) { + if (sd_status != lcd_sd_status && detected()) { uint8_t old_sd_status = lcd_sd_status; // prevent re-entry to this block! lcd_sd_status = sd_status; @@ -689,26 +695,19 @@ void lcd_update() { if (old_sd_status == 2) card.beginautostart(); // Initial boot else - LCD_MESSAGEPGM(MSG_SD_INSERTED); + set_status_P(PSTR(MSG_SD_INSERTED)); } else { card.release(); - if (old_sd_status != 2) LCD_MESSAGEPGM(MSG_SD_REMOVED); + if (old_sd_status != 2) set_status_P(PSTR(MSG_SD_REMOVED)); } - lcd_refresh(); - lcd_implementation_init(); // May revive the LCD if static electricity killed it + refresh(); + init_lcd(); // May revive the LCD if static electricity killed it } #endif // SDSUPPORT && SD_DETECT_PIN - #if ENABLED(POWER_LOSS_RECOVERY) - if (job_recovery_commands_count && job_recovery_phase == JOB_RECOVERY_IDLE) { - lcd_goto_screen(menu_job_recovery); - job_recovery_phase = JOB_RECOVERY_MAYBE; // Waiting for a response - } - #endif - const millis_t ms = millis(); if (ELAPSED(ms, next_lcd_update_ms) #if HAS_GRAPHICAL_LCD @@ -719,34 +718,27 @@ void lcd_update() { next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL; #if ENABLED(LCD_HAS_STATUS_INDICATORS) - lcd_implementation_update_indicators(); + update_indicators(); #endif - #if HAS_LCD_MENU - - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context - #endif - - #endif // HAS_LCD_MENU - #if HAS_ENCODER_ACTION - #if ENABLED(ADC_KEYPAD) + #if HAS_SLOW_BUTTONS + slow_buttons = read_slow_buttons(); // Buttons that take too long to read in interrupt context + #endif - if (handle_adc_keypad()) { + #if ENABLED(REPRAPWORLD_KEYPAD) + + if (handle_keypad()) { #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; #endif } - #elif ENABLED(REPRAPWORLD_KEYPAD) - - handle_reprapworld_keypad(); - #endif - const bool encoderPastThreshold = (ABS(encoderDiff) >= ENCODER_PULSES_PER_STEP); + const float abs_diff = ABS(encoderDiff); + const bool encoderPastThreshold = (abs_diff >= (ENCODER_PULSES_PER_STEP)); if (encoderPastThreshold || lcd_clicked) { if (encoderPastThreshold) { @@ -755,12 +747,12 @@ void lcd_update() { int32_t encoderMultiplier = 1; if (encoderRateMultiplierEnabled) { - int32_t encoderMovementSteps = ABS(encoderDiff) / ENCODER_PULSES_PER_STEP; + const float encoderMovementSteps = abs_diff / (ENCODER_PULSES_PER_STEP); 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; + const float encoderStepRate = encoderMovementSteps / float(ms - lastEncoderMovementMillis) * 1000; if (encoderStepRate >= ENCODER_100X_STEPS_PER_SEC) encoderMultiplier = 100; else if (encoderStepRate >= ENCODER_10X_STEPS_PER_SEC) encoderMultiplier = 10; @@ -784,32 +776,27 @@ void lcd_update() { #endif // ENCODER_RATE_MULTIPLIER - encoderPosition += (encoderDiff * encoderMultiplier) / ENCODER_PULSES_PER_STEP; + encoderPosition += (encoderDiff * encoderMultiplier) / (ENCODER_PULSES_PER_STEP); encoderDiff = 0; } #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; #endif - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + refresh(LCDVIEW_REDRAW_NOW); } #endif // This runs every ~100ms when idling often enough. // Instead of tracking changes just redraw the Status Screen once per second. - if ( - #if HAS_LCD_MENU - currentScreen == lcd_status_screen && - #endif - !lcd_status_update_delay-- - ) { + if (on_status_screen() && !lcd_status_update_delay--) { lcd_status_update_delay = 9 #if HAS_GRAPHICAL_LCD + 3 #endif ; max_display_update_time--; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + refresh(LCDVIEW_REDRAW_NOW); } #if HAS_LCD_MENU && ENABLED(SCROLL_LONG_FILENAMES) @@ -817,7 +804,7 @@ void lcd_update() { // cause a refresh to occur until all the text has scrolled into view. if (currentScreen == menu_sdcard && filename_scroll_pos < filename_scroll_max && !lcd_status_update_delay--) { lcd_status_update_delay = 6; - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + refresh(LCDVIEW_REDRAW_NOW); filename_scroll_pos++; #if LCD_TIMEOUT_TO_STATUS return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; @@ -828,58 +815,44 @@ void lcd_update() { // then we want to use 1/2 of the time only. uint16_t bbr2 = planner.block_buffer_runtime() >> 1; - #if HAS_GRAPHICAL_LCD - const bool &is_drawing = drawing_screen; - #else - constexpr bool is_drawing = false; - #endif - - if ((lcdDrawUpdate || is_drawing) && (!bbr2 || bbr2 > max_display_update_time)) { + if ((should_draw() || drawing_screen) && (!bbr2 || bbr2 > max_display_update_time)) { // Change state of drawing flag between screen updates - if (!is_drawing) switch (lcdDrawUpdate) { + if (!drawing_screen) switch (lcdDrawUpdate) { case LCDVIEW_CALL_NO_REDRAW: - lcdDrawUpdate = LCDVIEW_NONE; + refresh(LCDVIEW_NONE); break; case LCDVIEW_CLEAR_CALL_REDRAW: case LCDVIEW_CALL_REDRAW_NEXT: - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + refresh(LCDVIEW_REDRAW_NOW); case LCDVIEW_REDRAW_NOW: // set above, or by a handler through LCDVIEW_CALL_REDRAW_NEXT case LCDVIEW_NONE: break; } // switch - #if ENABLED(ADC_KEYPAD) - buttons_reprapworld_keypad = 0; - #endif - - #if HAS_LCD_MENU - #define CURRENTSCREEN() (*currentScreen)() - #else - #define CURRENTSCREEN() lcd_status_screen() + #if HAS_ADC_BUTTONS + keypad_buttons = 0; #endif #if HAS_GRAPHICAL_LCD + #if ENABLED(LIGHTWEIGHT_UI) - #if HAS_LCD_MENU - const bool in_status = currentScreen == lcd_status_screen; - #else - constexpr bool in_status = true; - #endif - const bool do_u8g_loop = !in_status; + const bool in_status = on_status_screen(), + do_u8g_loop = !in_status; lcd_in_status(in_status); - if (in_status) lcd_status_screen(); + if (in_status) status_screen(); #else constexpr bool do_u8g_loop = true; #endif + if (do_u8g_loop) { - if (!drawing_screen) { // If not already drawing pages - u8g.firstPage(); // Start the first page - drawing_screen = first_page = true; // Flag as drawing pages + if (!drawing_screen) { // If not already drawing pages + u8g.firstPage(); // Start the first page + drawing_screen = first_page = true; // Flag as drawing pages } - lcd_setFont(FONT_MENU); // Setup font for every page draw - u8g.setColorIndex(1); // And reset the color - CURRENTSCREEN(); // Draw and process the current screen + set_font(FONT_MENU); // Setup font for every page draw + u8g.setColorIndex(1); // And reset the color + run_current_screen(); // Draw and process the current screen first_page = false; // The screen handler can clear drawing_screen for an action that changes the screen. @@ -890,8 +863,11 @@ void lcd_update() { return; } } + #else - CURRENTSCREEN(); + + run_current_screen(); + #endif #if HAS_LCD_MENU @@ -905,18 +881,18 @@ void lcd_update() { #if HAS_LCD_MENU && LCD_TIMEOUT_TO_STATUS // Return to Status Screen after a timeout - if (currentScreen == lcd_status_screen || defer_return_to_status) + if (on_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(); + return_to_status(); #endif // Change state of drawing flag between screen updates - if (!is_drawing) switch (lcdDrawUpdate) { + if (!drawing_screen) switch (lcdDrawUpdate) { case LCDVIEW_CLEAR_CALL_REDRAW: - lcd_implementation_clear(); break; + clear_lcd(); break; case LCDVIEW_REDRAW_NOW: - lcdDrawUpdate = LCDVIEW_NONE; + refresh(LCDVIEW_NONE); case LCDVIEW_NONE: case LCDVIEW_CALL_REDRAW_NEXT: case LCDVIEW_CALL_NO_REDRAW: @@ -926,104 +902,7 @@ void lcd_update() { } // ELAPSED(ms, next_lcd_update_ms) } -void lcd_finishstatus(const bool persist=false) { - - #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0)) - UNUSED(persist); - #endif - - #if ENABLED(LCD_PROGRESS_BAR) - progress_bar_ms = millis(); - #if PROGRESS_MSG_EXPIRE > 0 - expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE; - #endif - #endif - - lcd_refresh(); - - #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - previous_lcd_status_ms = millis(); //get status message to show up for a while - #endif - - #if ENABLED(STATUS_MESSAGE_SCROLLING) - status_scroll_offset = 0; - #endif -} - -bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); } - -void lcd_setstatus(const char * const message, const bool persist) { - if (lcd_status_message_level > 0) return; - - // Here we have a problem. The message is encoded in UTF8, so - // arbitrarily cutting it will be a problem. We MUST be sure - // that there is no cutting in the middle of a multibyte character! - - // Get a pointer to the null terminator - const char* pend = message + strlen(message); - - // If length of supplied UTF8 string is greater than - // our buffer size, start cutting whole UTF8 chars - while ((pend - message) > MAX_MESSAGE_LENGTH) { - --pend; - while (!START_OF_UTF8_CHAR(*pend)) --pend; - }; - - // At this point, we have the proper cut point. Use it - uint8_t maxLen = pend - message; - strncpy(lcd_status_message, message, maxLen); - lcd_status_message[maxLen] = '\0'; - - lcd_finishstatus(persist); -} - -void lcd_setstatusPGM(PGM_P const message, int8_t level) { - if (level < 0) level = lcd_status_message_level = 0; - if (level < lcd_status_message_level) return; - lcd_status_message_level = level; - - // Here we have a problem. The message is encoded in UTF8, so - // arbitrarily cutting it will be a problem. We MUST be sure - // that there is no cutting in the middle of a multibyte character! - - // Get a pointer to the null terminator - PGM_P pend = message + strlen_P(message); - - // If length of supplied UTF8 string is greater than - // our buffer size, start cutting whole UTF8 chars - while ((pend - message) > MAX_MESSAGE_LENGTH) { - --pend; - while (!START_OF_UTF8_CHAR(pgm_read_byte(pend))) --pend; - }; - - // At this point, we have the proper cut point. Use it - uint8_t maxLen = pend - message; - strncpy_P(lcd_status_message, message, maxLen); - lcd_status_message[maxLen] = '\0'; - - lcd_finishstatus(level > 0); -} - -void lcd_status_printf_P(const uint8_t level, PGM_P const fmt, ...) { - if (level < lcd_status_message_level) return; - lcd_status_message_level = level; - va_list args; - va_start(args, fmt); - vsnprintf_P(lcd_status_message, MAX_MESSAGE_LENGTH, fmt, args); - va_end(args); - lcd_finishstatus(level > 0); -} - -void lcd_setalertstatusPGM(PGM_P const message) { - lcd_setstatusPGM(message, 1); - #if HAS_LCD_MENU - lcd_return_to_status(); - #endif -} - -void lcd_reset_alert_level() { lcd_status_message_level = 0; } - -#if ENABLED(ADC_KEYPAD) +#if HAS_ADC_BUTTONS typedef struct { uint16_t ADCKeyValueMin, ADCKeyValueMax; @@ -1032,14 +911,14 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = { // VALUE_MIN, VALUE_MAX, KEY - { 4000, 4096, 1 + BLEN_REPRAPWORLD_KEYPAD_F1 }, // F1 - { 4000, 4096, 1 + BLEN_REPRAPWORLD_KEYPAD_F2 }, // F2 - { 4000, 4096, 1 + BLEN_REPRAPWORLD_KEYPAD_F3 }, // F3 - { 300, 500, 1 + BLEN_REPRAPWORLD_KEYPAD_LEFT }, // LEFT - { 1900, 2200, 1 + BLEN_REPRAPWORLD_KEYPAD_RIGHT }, // RIGHT - { 570, 870, 1 + BLEN_REPRAPWORLD_KEYPAD_UP }, // UP - { 2670, 2870, 1 + BLEN_REPRAPWORLD_KEYPAD_DOWN }, // DOWN - { 1150, 1450, 1 + BLEN_REPRAPWORLD_KEYPAD_MIDDLE }, // ENTER + { 4000, 4096, 1 + BLEN_KEYPAD_F1 }, // F1 + { 4000, 4096, 1 + BLEN_KEYPAD_F2 }, // F2 + { 4000, 4096, 1 + BLEN_KEYPAD_F3 }, // F3 + { 300, 500, 1 + BLEN_KEYPAD_LEFT }, // LEFT + { 1900, 2200, 1 + BLEN_KEYPAD_RIGHT }, // RIGHT + { 570, 870, 1 + BLEN_KEYPAD_UP }, // UP + { 2670, 2870, 1 + BLEN_KEYPAD_DOWN }, // DOWN + { 1150, 1450, 1 + BLEN_KEYPAD_MIDDLE }, // ENTER }; uint8_t get_ADC_keyValue(void) { @@ -1058,184 +937,316 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } } #endif -#if HAS_LCD_MENU +#if HAS_ENCODER_ACTION - /** - * Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement) - * These values are independent of which pins are used for EN_A and EN_B indications - * The rotary encoder part is also independent to the chipset used for the LCD - */ - #if defined(EN_A) && defined(EN_B) - #define encrot0 0 - #define encrot1 2 - #define encrot2 3 - #define encrot3 1 - #endif + #if DISABLED(ADC_KEYPAD) && (ENABLED(REPRAPWORLD_KEYPAD) || !HAS_DIGITAL_BUTTONS) - #define GET_SHIFT_BUTTON_STATES(DST) \ - uint8_t new_##DST = 0; \ - WRITE(SHIFT_LD, LOW); \ - WRITE(SHIFT_LD, HIGH); \ - for (int8_t i = 0; i < 8; i++) { \ - new_##DST >>= 1; \ - if (READ(SHIFT_OUT)) SBI(new_##DST, 7); \ - WRITE(SHIFT_CLK, HIGH); \ - WRITE(SHIFT_CLK, LOW); \ - } \ - DST = ~new_##DST; //invert it, because a pressed switch produces a logical 0 + /** + * Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement) + * These values are independent of which pins are used for EN_A and EN_B indications + * The rotary encoder part is also independent to the chipset used for the LCD + */ + #define GET_SHIFT_BUTTON_STATES(DST) \ + uint8_t new_##DST = 0; \ + WRITE(SHIFT_LD, LOW); \ + WRITE(SHIFT_LD, HIGH); \ + for (int8_t i = 0; i < 8; i++) { \ + new_##DST >>= 1; \ + if (READ(SHIFT_OUT)) SBI(new_##DST, 7); \ + WRITE(SHIFT_CLK, HIGH); \ + WRITE(SHIFT_CLK, LOW); \ + } \ + DST = ~new_##DST; //invert it, because a pressed switch produces a logical 0 - #if ENABLED(G26_MESH_VALIDATION) - void lcd_chirp() { - lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - } - #endif - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - bool is_lcd_clicked() { return LCD_CLICKED(); } - void wait_for_release() { - while (is_lcd_clicked()) safe_delay(50); - safe_delay(50); - } #endif /** * Read encoder buttons from the hardware registers * Warning: This function is called from interrupt context! */ - void lcd_buttons_update() { - static uint8_t lastEncoderBits; + void MarlinUI::update_buttons() { const millis_t now = millis(); if (ELAPSED(now, next_button_update_ms)) { - #if ENABLED(NEWPANEL) - uint8_t newbutton = 0; + #if HAS_DIGITAL_BUTTONS + + #if BUTTON_EXISTS(EN1) || BUTTON_EXISTS(EN2) || BUTTON_EXISTS(ENC) || BUTTON_EXISTS(BACK) + + uint8_t newbutton = 0; + + #if BUTTON_EXISTS(EN1) + if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; + #endif + #if BUTTON_EXISTS(EN2) + if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; + #endif + #if BUTTON_EXISTS(ENC) + if (BUTTON_PRESSED(ENC)) newbutton |= EN_C; + #endif + #if BUTTON_EXISTS(BACK) + if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; + #endif + + #else + + constexpr uint8_t newbutton = 0; - #if BUTTON_EXISTS(EN1) - if (BUTTON_PRESSED(EN1)) newbutton |= EN_A; - #endif - #if BUTTON_EXISTS(EN2) - if (BUTTON_PRESSED(EN2)) newbutton |= EN_B; - #endif - #if BUTTON_EXISTS(ENC) - if (BUTTON_PRESSED(ENC)) newbutton |= EN_C; - #endif - #if BUTTON_EXISTS(BACK) - if (BUTTON_PRESSED(BACK)) newbutton |= EN_D; #endif // // Directional buttons // - #if LCD_HAS_DIRECTIONAL_BUTTONS + #if BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT) - #if ENABLED(REVERSE_MENU_DIRECTION) - #define _ENCODER_UD_STEPS (ENCODER_STEPS_PER_MENU_ITEM * encoderDirection) - #else - #define _ENCODER_UD_STEPS ENCODER_STEPS_PER_MENU_ITEM - #endif - #if ENABLED(REVERSE_ENCODER_DIRECTION) - #define ENCODER_UD_STEPS _ENCODER_UD_STEPS - #define ENCODER_LR_PULSES ENCODER_PULSES_PER_STEP - #else - #define ENCODER_UD_STEPS -(_ENCODER_UD_STEPS) - #define ENCODER_LR_PULSES -(ENCODER_PULSES_PER_STEP) - #endif + const int8_t pulses = (ENCODER_PULSES_PER_STEP) * encoderDirection; if (false) { // for the else-ifs below } #if BUTTON_EXISTS(UP) else if (BUTTON_PRESSED(UP)) { - encoderDiff = -(ENCODER_UD_STEPS); + encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * pulses; next_button_update_ms = now + 300; } #endif #if BUTTON_EXISTS(DWN) else if (BUTTON_PRESSED(DWN)) { - encoderDiff = ENCODER_UD_STEPS; + encoderDiff = -(ENCODER_STEPS_PER_MENU_ITEM) * pulses; next_button_update_ms = now + 300; } #endif #if BUTTON_EXISTS(LFT) else if (BUTTON_PRESSED(LFT)) { - encoderDiff = -(ENCODER_LR_PULSES); + encoderDiff = -pulses; next_button_update_ms = now + 300; } #endif #if BUTTON_EXISTS(RT) else if (BUTTON_PRESSED(RT)) { - encoderDiff = ENCODER_LR_PULSES; + encoderDiff = pulses; next_button_update_ms = now + 300; } #endif - #endif // LCD_HAS_DIRECTIONAL_BUTTONS + #endif // UP || DWN || LFT || RT - buttons = newbutton; - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - buttons |= slow_buttons; - #endif + buttons = newbutton + #if HAS_SLOW_BUTTONS + | slow_buttons + #endif + ; - #if ENABLED(ADC_KEYPAD) + #elif HAS_ADC_BUTTONS - uint8_t newbutton_reprapworld_keypad = 0; - buttons = 0; - if (buttons_reprapworld_keypad == 0) { - newbutton_reprapworld_keypad = get_ADC_keyValue(); - if (WITHIN(newbutton_reprapworld_keypad, 1, 8)) - buttons_reprapworld_keypad = _BV(newbutton_reprapworld_keypad - 1); - } + buttons = 0; + if (keypad_buttons == 0) { + const uint8_t b = get_ADC_keyValue(); + if (WITHIN(b, 1, 8)) keypad_buttons = _BV(b - 1); + } - #elif ENABLED(REPRAPWORLD_KEYPAD) + #endif - GET_SHIFT_BUTTON_STATES(buttons_reprapworld_keypad); + #if HAS_SHIFT_ENCODER - #endif - - #else // !NEWPANEL - - GET_SHIFT_BUTTON_STATES(buttons); + GET_SHIFT_BUTTON_STATES( + #if ENABLED(REPRAPWORLD_KEYPAD) + keypad_buttons + #else + buttons + #endif + ); #endif } // next_button_update_ms - // Manage encoder rotation - #if ENABLED(REVERSE_MENU_DIRECTION) && ENABLED(REVERSE_ENCODER_DIRECTION) - #define ENCODER_DIFF_CW (encoderDiff -= encoderDirection) - #define ENCODER_DIFF_CCW (encoderDiff += encoderDirection) - #elif ENABLED(REVERSE_MENU_DIRECTION) - #define ENCODER_DIFF_CW (encoderDiff += encoderDirection) - #define ENCODER_DIFF_CCW (encoderDiff -= encoderDirection) - #elif ENABLED(REVERSE_ENCODER_DIRECTION) - #define ENCODER_DIFF_CW (encoderDiff--) - #define ENCODER_DIFF_CCW (encoderDiff++) - #else - #define ENCODER_DIFF_CW (encoderDiff++) - #define ENCODER_DIFF_CCW (encoderDiff--) - #endif - #define ENCODER_SPIN(_E1, _E2) switch (lastEncoderBits) { case _E1: ENCODER_DIFF_CW; break; case _E2: ENCODER_DIFF_CCW; } + #if HAS_ENCODER_WHEEL + static uint8_t lastEncoderBits; - uint8_t enc = 0; - if (buttons & EN_A) enc |= B01; - if (buttons & EN_B) enc |= B10; - if (enc != lastEncoderBits) { - switch (enc) { - case encrot0: ENCODER_SPIN(encrot3, encrot1); break; - case encrot1: ENCODER_SPIN(encrot0, encrot2); break; - case encrot2: ENCODER_SPIN(encrot1, encrot3); break; - case encrot3: ENCODER_SPIN(encrot2, encrot0); break; - } - #if ENABLED(AUTO_BED_LEVELING_UBL) - if (lcd_external_control) { - ubl.encoder_diff = encoderDiff; // Make encoder rotation available to UBL G29 mesh editing. - encoderDiff = 0; // Hide the encoder event from the current screen handler. + #define encrot0 0 + #define encrot1 2 + #define encrot2 3 + #define encrot3 1 + + // Manage encoder rotation + #define ENCODER_SPIN(_E1, _E2) switch (lastEncoderBits) { case _E1: encoderDiff += encoderDirection; break; case _E2: encoderDiff -= encoderDirection; } + + uint8_t enc = 0; + if (buttons & EN_A) enc |= B01; + if (buttons & EN_B) enc |= B10; + if (enc != lastEncoderBits) { + switch (enc) { + case encrot0: ENCODER_SPIN(encrot3, encrot1); break; + case encrot1: ENCODER_SPIN(encrot0, encrot2); break; + case encrot2: ENCODER_SPIN(encrot1, encrot3); break; + case encrot3: ENCODER_SPIN(encrot2, encrot0); break; } - #endif - lastEncoderBits = enc; - } + if (external_control) { + #if ENABLED(AUTO_BED_LEVELING_UBL) + ubl.encoder_diff = encoderDiff; // Make encoder rotation available to UBL G29 mesh editing. + #endif + encoderDiff = 0; // Hide the encoder event from the current screen handler. + } + lastEncoderBits = enc; + } + + #endif // HAS_ENCODER_WHEEL } -#endif // HAS_LCD_MENU + #if HAS_SLOW_BUTTONS -#endif // ULTRA_LCD + uint8_t MarlinUI::read_slow_buttons() { + #if ENABLED(LCD_I2C_TYPE_MCP23017) + // Reading these buttons this is likely to be too slow to call inside interrupt context + // so they are called during normal lcd_update + uint8_t slow_bits = lcd.readButtons() << B_I2C_BTN_OFFSET; + #if ENABLED(LCD_I2C_VIKI) + if ((slow_bits & (B_MI | B_RI)) && PENDING(millis(), next_button_update_ms)) // LCD clicked + slow_bits &= ~(B_MI | B_RI); // Disable LCD clicked buttons if screen is updated + #endif // LCD_I2C_VIKI + return slow_bits; + #endif // LCD_I2C_TYPE_MCP23017 + } + + #endif + +#endif // HAS_ENCODER_ACTION + +#endif // HAS_SPI_LCD + +#if HAS_SPI_LCD || ENABLED(EXTENSIBLE_UI) + + #if ENABLED(EXTENSIBLE_UI) + #include "extensible_ui/ui_api.h" + #endif + + //////////////////////////////////////////// + /////////////// Status Line //////////////// + //////////////////////////////////////////// + + void MarlinUI::finishstatus(const bool persist) { + + #if !(ENABLED(LCD_PROGRESS_BAR) && (PROGRESS_MSG_EXPIRE > 0)) + UNUSED(persist); + #endif + + #if ENABLED(LCD_PROGRESS_BAR) + progress_bar_ms = millis(); + #if PROGRESS_MSG_EXPIRE > 0 + expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE; + #endif + #endif + + #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) + next_filament_display = millis() + 5000UL; // Show status message for 5s + #endif + + #if ENABLED(STATUS_MESSAGE_SCROLLING) + status_scroll_offset = 0; + #endif + + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onStatusChanged(status_message); + #endif + + refresh(); + } + + bool MarlinUI::has_status() { return (status_message[0] != '\0'); } + + void MarlinUI::set_status(const char * const message, const bool persist) { + if (status_message_level > 0) return; + + // Here we have a problem. The message is encoded in UTF8, so + // arbitrarily cutting it will be a problem. We MUST be sure + // that there is no cutting in the middle of a multibyte character! + + // Get a pointer to the null terminator + const char* pend = message + strlen(message); + + // If length of supplied UTF8 string is greater than + // our buffer size, start cutting whole UTF8 chars + while ((pend - message) > MAX_MESSAGE_LENGTH) { + --pend; + while (!START_OF_UTF8_CHAR(*pend)) --pend; + }; + + // At this point, we have the proper cut point. Use it + uint8_t maxLen = pend - message; + strncpy(status_message, message, maxLen); + status_message[maxLen] = '\0'; + + finishstatus(persist); + } + + #include + + void MarlinUI::status_printf_P(const uint8_t level, PGM_P const fmt, ...) { + if (level < status_message_level) return; + status_message_level = level; + va_list args; + va_start(args, fmt); + vsnprintf_P(status_message, MAX_MESSAGE_LENGTH, fmt, args); + va_end(args); + finishstatus(level > 0); + } + + void MarlinUI::set_status_P(PGM_P const message, int8_t level) { + if (level < 0) level = status_message_level = 0; + if (level < status_message_level) return; + status_message_level = level; + + // Here we have a problem. The message is encoded in UTF8, so + // arbitrarily cutting it will be a problem. We MUST be sure + // that there is no cutting in the middle of a multibyte character! + + // Get a pointer to the null terminator + PGM_P pend = message + strlen_P(message); + + // If length of supplied UTF8 string is greater than + // our buffer size, start cutting whole UTF8 chars + while ((pend - message) > MAX_MESSAGE_LENGTH) { + --pend; + while (!START_OF_UTF8_CHAR(pgm_read_byte(pend))) --pend; + }; + + // At this point, we have the proper cut point. Use it + uint8_t maxLen = pend - message; + strncpy_P(status_message, message, maxLen); + status_message[maxLen] = '\0'; + + finishstatus(level > 0); + } + + void MarlinUI::set_alert_status_P(PGM_P const message) { + set_status_P(message, 1); + #if HAS_LCD_MENU + return_to_status(); + #endif + } + + #include "../module/printcounter.h" + + /** + * Reset the status message + */ + void MarlinUI::reset_status() { + static const char paused[] PROGMEM = MSG_PRINT_PAUSED; + static const char printing[] PROGMEM = MSG_PRINTING; + static const char welcome[] PROGMEM = WELCOME_MSG; + PGM_P msg; + if (!IS_SD_PRINTING() && print_job_timer.isPaused()) + msg = paused; + #if ENABLED(SDSUPPORT) + else if (IS_SD_PRINTING()) + return set_status(card.longest_filename(), true); + #endif + else if (print_job_timer.isRunning()) + msg = printing; + else + msg = welcome; + + set_status_P(msg, -1); + } + +#endif // HAS_SPI_LCD || EXTENSIBLE_UI diff --git a/Marlin/src/lcd/ultralcd.h b/Marlin/src/lcd/ultralcd.h index a8b3826907..54eb239b9d 100644 --- a/Marlin/src/lcd/ultralcd.h +++ b/Marlin/src/lcd/ultralcd.h @@ -23,187 +23,12 @@ #include "../inc/MarlinConfig.h" -#if HAS_GRAPHICAL_LCD - - #ifndef LCD_PIXEL_WIDTH - #define LCD_PIXEL_WIDTH 128 - #endif - #ifndef LCD_PIXEL_HEIGHT - #define LCD_PIXEL_HEIGHT 64 - #endif - - // LCD selection - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define U8G_CLASS U8GLIB_ST7920_128X64_4X - #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN) - #define U8G_PARAM LCD_PINS_RS - #else - #define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS - #endif - - #elif ENABLED(U8GLIB_ST7920) - // RepRap Discount Full Graphics Smart Controller - #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN) - #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL - #define U8G_PARAM LCD_PINS_RS // 2 stripes, HW SPI (shared with SD card, on AVR does not use standard LCD adapter) - #else - //#define U8G_CLASS U8GLIB_ST7920_128X64_4X - //#define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS // Original u8glib device. 2 stripes, SW SPI - #define U8G_CLASS U8GLIB_ST7920_128X64_RRD - #define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS // Number of stripes can be adjusted in ultralcd_st7920_u8glib_rrd.h with PAGE_HEIGHT - // AVR version ignores these pin settings - // HAL version uses these pin settings - #endif - - #elif ENABLED(CARTESIO_UI) - // The CartesioUI display - //#define U8G_CLASS U8GLIB_DOGM128_2X - //#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes - #define U8G_CLASS U8GLIB_DOGM128_2X - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 4 stripes - - #elif ENABLED(U8GLIB_LM6059_AF) - // Based on the Adafruit ST7565 (http://www.adafruit.com/products/250) - //#define U8G_CLASS U8GLIB_LM6059 - //#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 8 stripes - #define U8G_CLASS U8GLIB_LM6059_2X - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 4 stripes - - #elif ENABLED(U8GLIB_ST7565_64128N) - // The MaKrPanel, Mini Viki, Viki 2.0 & AZSMZ 12864 ST7565 controller - #define SMART_RAMPS (MB(RAMPS_SMART_EFB) || MB(RAMPS_SMART_EEB) || MB(RAMPS_SMART_EFF) || MB(RAMPS_SMART_EEF) || MB(RAMPS_SMART_SF)) - #if DOGLCD_SCK == SCK_PIN && DOGLCD_MOSI == MOSI_PIN && !SMART_RAMPS - #define U8G_CLASS U8GLIB_64128N_2X_HAL - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // using HW-SPI - #else - #define U8G_CLASS U8GLIB_64128N_2X_HAL - #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // using SW-SPI - #endif - - #elif ENABLED(MKS_12864OLED_SSD1306) - // MKS 128x64 (SSD1306) OLED I2C LCD - #define U8G_CLASS U8GLIB_SSD1306_128X64 - #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 8 stripes - //#define U8G_CLASS U8GLIB_SSD1306_128X64_2X - //#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes - - #elif ENABLED(U8GLIB_SSD1306) - // Generic support for SSD1306 OLED I2C LCDs - //#define U8G_CLASS U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE - //#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes - #define U8G_CLASS U8GLIB_SSD1306_128X64_2X - #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes - - #elif ENABLED(MKS_12864OLED) - // MKS 128x64 (SH1106) OLED I2C LCD - #define U8G_CLASS U8GLIB_SH1106_128X64 - #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 8 stripes - //#define U8G_CLASS U8GLIB_SH1106_128X64_2X - //#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes - #elif ENABLED(U8GLIB_SH1106) - // Generic support for SH1106 OLED I2C LCDs - //#define U8G_CLASS U8GLIB_SH1106_128X64_2X_I2C_2_WIRE - //#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes - #define U8G_CLASS U8GLIB_SH1106_128X64_2X - #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes - #elif ENABLED(U8GLIB_SSD1309) - // Generic support for SSD1309 OLED I2C LCDs - #define U8G_CLASS U8GLIB_SSD1309_128X64 - #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) - #elif ENABLED(MINIPANEL) - // The MINIPanel display - //#define U8G_CLASS U8GLIB_MINI12864 - //#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 8 stripes - #define U8G_CLASS U8GLIB_MINI12864_2X - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // 4 stripes - #elif ENABLED(U8GLIB_SH1106_EINSTART) - // Connected via motherboard header - #define U8G_CLASS U8GLIB_SH1106_128X64 - #define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, LCD_PINS_DC, LCD_PINS_RS - #else - // for regular DOGM128 display with HW-SPI - //#define U8G_CLASS U8GLIB_DOGM128 - //#define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // HW-SPI Com: CS, A0 // 8 stripes - #define U8G_CLASS U8GLIB_DOGM128_2X - #define U8G_PARAM DOGLCD_CS, DOGLCD_A0 // HW-SPI Com: CS, A0 // 4 stripes - #endif - - #include - #include "dogm/HAL_LCD_class_defines.h" - extern U8G_CLASS u8g; - - // For selective rendering within a Y range - #define PAGE_UNDER(yb) (u8g.getU8g()->current_page.y0 <= (yb)) - #define PAGE_CONTAINS(ya, yb) (PAGE_UNDER(yb) && u8g.getU8g()->current_page.y1 >= (ya)) - - // Only Western languages support big / small fonts - #if DISABLED(DISPLAY_CHARSET_ISO10646_1) - #undef USE_BIG_EDIT_FONT - #undef USE_SMALL_INFOFONT - #endif - - #define MENU_FONT_NAME ISO10646_1_5x7 - #define MENU_FONT_WIDTH 6 - #define MENU_FONT_ASCENT 10 - #define MENU_FONT_DESCENT 2 - #define MENU_FONT_HEIGHT (MENU_FONT_ASCENT + MENU_FONT_DESCENT) - - #if ENABLED(USE_BIG_EDIT_FONT) - #define EDIT_FONT_NAME u8g_font_9x18 - #define EDIT_FONT_WIDTH 9 - #define EDIT_FONT_ASCENT 10 - #define EDIT_FONT_DESCENT 3 - #else - #define EDIT_FONT_NAME MENU_FONT_NAME - #define EDIT_FONT_WIDTH MENU_FONT_WIDTH - #define EDIT_FONT_ASCENT MENU_FONT_ASCENT - #define EDIT_FONT_DESCENT MENU_FONT_DESCENT - #endif - #define EDIT_FONT_HEIGHT (EDIT_FONT_ASCENT + EDIT_FONT_DESCENT) - - // Get the Ascent, Descent, and total Height for the Info Screen font - #if ENABLED(USE_SMALL_INFOFONT) - extern const u8g_fntpgm_uint8_t u8g_font_6x9[]; - #define INFO_FONT_ASCENT 7 - #else - #define INFO_FONT_ASCENT 8 - #endif - #define INFO_FONT_DESCENT 2 - #define INFO_FONT_HEIGHT (INFO_FONT_ASCENT + INFO_FONT_DESCENT) - - // Font IDs - enum MarlinFont : uint8_t { - FONT_STATUSMENU = 1, - FONT_EDIT, - FONT_MENU - }; - void lcd_setFont(const MarlinFont font_nr); - - #if ENABLED(LIGHTWEIGHT_UI) - void lcd_in_status(const bool inStatus); - #endif - -#endif // HAS_GRAPHICAL_LCD - -#if HAS_SPI_LCD || ENABLED(MALYAN_LCD) || ENABLED(EXTENSIBLE_UI) - void lcd_init(); - bool lcd_detected(); - void lcd_update(); - void lcd_setalertstatusPGM(PGM_P message); - void kill_screen(PGM_P lcd_msg); -#else - inline void lcd_init() {} - inline bool lcd_detected() { return true; } - inline void lcd_update() {} - inline void lcd_setalertstatusPGM(PGM_P message) { UNUSED(message); } +#if HAS_BUZZER + #include "../libs/buzzer.h" #endif #define HAS_ENCODER_ACTION (HAS_LCD_MENU || ENABLED(ULTIPANEL_FEEDMULTIPLY)) -#if HAS_ENCODER_ACTION - extern uint32_t encoderPosition; -#endif - #if HAS_SPI_LCD #include "../Marlin.h" @@ -213,18 +38,6 @@ #include "../module/motion.h" // for active_extruder #endif - void lcd_status_screen(); - void lcd_return_to_status(); - bool lcd_hasstatus(); - void lcd_setstatus(const char* message, const bool persist=false); - void lcd_setstatusPGM(PGM_P message, const int8_t level=0); - void lcd_setalertstatusPGM(PGM_P message); - void lcd_reset_alert_level(); - void lcd_reset_status(); - void lcd_status_printf_P(const uint8_t level, PGM_P const fmt, ...); - void lcd_kill_screen(); - void kill_screen(PGM_P lcd_msg); - enum LCDViewAction : uint8_t { LCDVIEW_NONE, LCDVIEW_REDRAW_NOW, @@ -233,37 +46,10 @@ LCDVIEW_CALL_NO_REDRAW }; - extern LCDViewAction lcdDrawUpdate; - inline void lcd_refresh() { lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; } - - #if HAS_BUZZER - void lcd_buzz(const long duration, const uint16_t freq); - #else - inline void lcd_buzz(const long duration, const uint16_t freq) { UNUSED(duration); UNUSED(freq); } - #endif - - void lcd_quick_feedback(const bool clear_buttons); // Audible feedback for a button click - could also be visual - - #if ENABLED(LCD_PROGRESS_BAR) - extern millis_t progress_bar_ms; // Start time for the current progress bar cycle - #if PROGRESS_MSG_EXPIRE > 0 - void dontExpireStatus(); - #endif - #endif - - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) - extern uint8_t progress_bar_percent; - #endif - - #if ENABLED(ADC_KEYPAD) + #if HAS_ADC_BUTTONS uint8_t get_ADC_keyValue(); #endif - #if HAS_LCD_CONTRAST - extern int16_t lcd_contrast; - void set_lcd_contrast(const int16_t value); - #endif - #if HAS_GRAPHICAL_LCD #define SETCURSOR(col, row) lcd_moveto(col * (MENU_FONT_WIDTH), (row + 1) * (MENU_FONT_HEIGHT)) #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_PIXEL_WIDTH - len * (MENU_FONT_WIDTH), (row + 1) * (MENU_FONT_HEIGHT)) @@ -272,53 +58,20 @@ #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_WIDTH - len, row) #endif - #if ENABLED(SHOW_BOOTSCREEN) - void lcd_bootscreen(); - #endif - #define LCD_UPDATE_INTERVAL 100 - #define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0) - #define BUTTON_PRESSED(BN) !READ(BTN_## BN) #if HAS_LCD_MENU + #if ENABLED(SDSUPPORT) + #include "../sd/cardreader.h" + #endif + typedef void (*screenFunc_t)(); typedef void (*menuAction_t)(); - extern screenFunc_t currentScreen; - void lcd_goto_screen(const screenFunc_t screen, const uint32_t encoder=0); - - extern bool lcd_clicked; - #if LCD_TIMEOUT_TO_STATUS - extern bool defer_return_to_status; - inline void set_defer_return_to_status(const bool defer) { defer_return_to_status = defer; } - #else - constexpr bool defer_return_to_status = false; - #define set_defer_return_to_status(D) NOOP - #endif - - extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2]; - extern uint8_t lcd_preheat_fan_speed[2]; - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - extern bool lcd_external_control; - #else - constexpr bool lcd_external_control = false; - #endif - - #if ENABLED(LCD_BED_LEVELING) - extern bool lcd_wait_for_move; - #else - constexpr bool lcd_wait_for_move = false; - #endif // Manual Movement constexpr float manual_feedrate_mm_m[XYZE] = MANUAL_FEEDRATE; extern float move_menu_scale; - #if IS_KINEMATIC - extern bool processing_manual_move; - #else - constexpr bool processing_manual_move = false; - #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) void lcd_advanced_pause_show_message(const AdvancedPauseMessage message, @@ -326,64 +79,48 @@ const uint8_t extruder=active_extruder); #endif - #if ENABLED(G26_MESH_VALIDATION) - void lcd_chirp(); - #endif - #if ENABLED(AUTO_BED_LEVELING_UBL) void lcd_mesh_edit_setup(const float &initial); float lcd_mesh_edit(); #endif - #if ENABLED(SCROLL_LONG_FILENAMES) - extern uint8_t filename_scroll_pos, filename_scroll_max; - #endif - #endif // HAS_LCD_MENU - #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - extern millis_t previous_lcd_status_ms; - #endif - - #if ENABLED(STATUS_MESSAGE_SCROLLING) - extern uint8_t status_scroll_offset; - #endif - - bool lcd_blink(); - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - bool is_lcd_clicked(); - void wait_for_release(); - #endif - -#elif ENABLED(EXTENSIBLE_UI) - - // These functions are defined elsewhere - void lcd_setstatus(const char* const message, const bool persist=false); - void lcd_setstatusPGM(const char* const message, const int8_t level=0); - void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...); - void lcd_reset_status(); - void lcd_refresh(); - void lcd_reset_alert_level(); - bool lcd_hasstatus(); - -#else // MALYAN_LCD or no LCD - - constexpr bool lcd_wait_for_move = false; - - inline void lcd_refresh() {} - inline bool lcd_hasstatus() { return false; } - inline void lcd_setstatus(const char* const message, const bool persist=false) { UNUSED(message); UNUSED(persist); } - inline void lcd_setstatusPGM(PGM_P const message, const int8_t level=0) { UNUSED(message); UNUSED(level); } - inline void lcd_status_printf_P(const uint8_t level, PGM_P const fmt, ...) { UNUSED(level); UNUSED(fmt); } - inline void lcd_reset_alert_level() {} - inline void lcd_reset_status() {} - #endif -#define HAS_DIGITAL_ENCODER (HAS_SPI_LCD && ENABLED(NEWPANEL)) +// REPRAPWORLD_KEYPAD (and ADC_KEYPAD) +#if ENABLED(REPRAPWORLD_KEYPAD) + #define BTN_OFFSET 0 // Bit offset into buttons for shift register values -#if HAS_DIGITAL_ENCODER + #define BLEN_KEYPAD_F3 0 + #define BLEN_KEYPAD_F2 1 + #define BLEN_KEYPAD_F1 2 + #define BLEN_KEYPAD_DOWN 3 + #define BLEN_KEYPAD_RIGHT 4 + #define BLEN_KEYPAD_MIDDLE 5 + #define BLEN_KEYPAD_UP 6 + #define BLEN_KEYPAD_LEFT 7 + + #define EN_KEYPAD_F1 _BV(BTN_OFFSET + BLEN_KEYPAD_F1) + #define EN_KEYPAD_F2 _BV(BTN_OFFSET + BLEN_KEYPAD_F2) + #define EN_KEYPAD_F3 _BV(BTN_OFFSET + BLEN_KEYPAD_F3) + #define EN_KEYPAD_DOWN _BV(BTN_OFFSET + BLEN_KEYPAD_DOWN) + #define EN_KEYPAD_RIGHT _BV(BTN_OFFSET + BLEN_KEYPAD_RIGHT) + #define EN_KEYPAD_MIDDLE _BV(BTN_OFFSET + BLEN_KEYPAD_MIDDLE) + #define EN_KEYPAD_UP _BV(BTN_OFFSET + BLEN_KEYPAD_UP) + #define EN_KEYPAD_LEFT _BV(BTN_OFFSET + BLEN_KEYPAD_LEFT) + + #define RRK(B) (keypad_buttons & (B)) + + #ifdef EN_C + #define BUTTON_CLICK() ((buttons & EN_C) || RRK(EN_KEYPAD_MIDDLE)) + #else + #define BUTTON_CLICK() RRK(EN_KEYPAD_MIDDLE) + #endif + +#endif + +#if HAS_DIGITAL_BUTTONS // Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes) #define BLEN_A 0 @@ -392,111 +129,403 @@ #define EN_A _BV(BLEN_A) #define EN_B _BV(BLEN_B) + #define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0) + #define BUTTON_PRESSED(BN) !READ(BTN_## BN) + #if BUTTON_EXISTS(ENC) #define BLEN_C 2 #define EN_C _BV(BLEN_C) #endif - #if BUTTON_EXISTS(BACK) - #define BLEN_D 3 - #define EN_D _BV(BLEN_D) - #define LCD_BACK_CLICKED (buttons & EN_D) + #if ENABLED(LCD_I2C_VIKI) + + #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) + + // button and encoder bit positions within 'buttons' + #define B_LE (BUTTON_LEFT << B_I2C_BTN_OFFSET) // The remaining normalized buttons are all read via I2C + #define B_UP (BUTTON_UP << B_I2C_BTN_OFFSET) + #define B_MI (BUTTON_SELECT << B_I2C_BTN_OFFSET) + #define B_DW (BUTTON_DOWN << B_I2C_BTN_OFFSET) + #define B_RI (BUTTON_RIGHT << B_I2C_BTN_OFFSET) + + #if BUTTON_EXISTS(ENC) // The pause/stop/restart button is connected to BTN_ENC when used + #define B_ST (EN_C) // Map the pause/stop/resume button into its normalized functional name + #define BUTTON_CLICK() (buttons & (B_MI|B_RI|B_ST)) // Pause/stop also acts as click until a proper pause/stop is implemented. + #else + #define BUTTON_CLICK() (buttons & (B_MI|B_RI)) + #endif + + // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update + + #elif ENABLED(LCD_I2C_PANELOLU2) + + #if !BUTTON_EXISTS(ENC) // Use I2C if not directly connected to a pin + + #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C) + + #define B_MI (PANELOLU2_ENCODER_C << B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later + + #define BUTTON_CLICK() (buttons & B_MI) + + #endif + #endif -#endif // HAS_DIGITAL_ENCODER - -#if HAS_LCD_MENU - - extern volatile uint8_t buttons; // The last-checked buttons in a bit array. - void lcd_buttons_update(); - #else - inline void lcd_buttons_update() {} + #define BUTTON_EXISTS(BN) false -#endif + // Shift register bits correspond to buttons: + #define BL_LE 7 // Left + #define BL_UP 6 // Up + #define BL_MI 5 // Middle + #define BL_DW 4 // Down + #define BL_RI 3 // Right + #define BL_ST 2 // Red Button + #define B_LE (_BV(BL_LE)) + #define B_UP (_BV(BL_UP)) + #define B_MI (_BV(BL_MI)) + #define B_DW (_BV(BL_DW)) + #define B_RI (_BV(BL_RI)) + #define B_ST (_BV(BL_ST)) -#if ENABLED(LCD_HAS_SLOW_BUTTONS) - extern volatile uint8_t slow_buttons; -#endif - -#if ENABLED(REPRAPWORLD_KEYPAD) - #define REPRAPWORLD_BTN_OFFSET 0 // Bit offset into buttons for shift register values - - #define BLEN_REPRAPWORLD_KEYPAD_F3 0 - #define BLEN_REPRAPWORLD_KEYPAD_F2 1 - #define BLEN_REPRAPWORLD_KEYPAD_F1 2 - #define BLEN_REPRAPWORLD_KEYPAD_DOWN 3 - #define BLEN_REPRAPWORLD_KEYPAD_RIGHT 4 - #define BLEN_REPRAPWORLD_KEYPAD_MIDDLE 5 - #define BLEN_REPRAPWORLD_KEYPAD_UP 6 - #define BLEN_REPRAPWORLD_KEYPAD_LEFT 7 - - #define EN_REPRAPWORLD_KEYPAD_F1 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F1)) - #define EN_REPRAPWORLD_KEYPAD_F2 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F2)) - #define EN_REPRAPWORLD_KEYPAD_F3 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F3)) - #define EN_REPRAPWORLD_KEYPAD_DOWN (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_DOWN)) - #define EN_REPRAPWORLD_KEYPAD_RIGHT (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_RIGHT)) - #define EN_REPRAPWORLD_KEYPAD_MIDDLE (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_MIDDLE)) - #define EN_REPRAPWORLD_KEYPAD_UP (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_UP)) - #define EN_REPRAPWORLD_KEYPAD_LEFT (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_LEFT)) - - #define RRK(B) (buttons_reprapworld_keypad & (B)) - - #ifdef EN_C - #define LCD_CLICKED() ((buttons & EN_C) || RRK(EN_REPRAPWORLD_KEYPAD_MIDDLE)) - #else - #define LCD_CLICKED() RRK(EN_REPRAPWORLD_KEYPAD_MIDDLE) + #ifndef BUTTON_CLICK + #define BUTTON_CLICK() (buttons & (B_MI|B_ST)) #endif -#endif // REPRAPWORLD_KEYPAD +#endif -#ifndef LCD_CLICKED +#if BUTTON_EXISTS(BACK) + #define BLEN_D 3 + #define EN_D _BV(BLEN_D) + #define LCD_BACK_CLICKED() (buttons & EN_D) +#else + #define LCD_BACK_CLICKED() false +#endif + +#ifndef BUTTON_CLICK #ifdef EN_C - #define LCD_CLICKED() (buttons & EN_C) + #define BUTTON_CLICK() (buttons & EN_C) #else - #define LCD_CLICKED() false + #define BUTTON_CLICK() false #endif #endif -extern uint8_t lcd_status_update_delay; -extern char lcd_status_message[]; - -#define LCD_MESSAGEPGM(x) lcd_setstatusPGM(PSTR(x)) -#define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatusPGM(PSTR(x)) - -// For i2c define BUZZ to use lcd_buzz -#if ENABLED(LCD_USE_I2C_BUZZER) - #define BUZZ(d,f) lcd_buzz(d, f) -#endif - -#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - void lcd_reselect_last_file(); -#endif - #if HAS_GRAPHICAL_LCD - extern bool drawing_screen, first_page; -#elif HAS_SPI_LCD - constexpr bool first_page = true; + enum MarlinFont : uint8_t { + FONT_STATUSMENU = 1, + FONT_EDIT, + FONT_MENU + }; +#else + enum HD44780CharSet : uint8_t { + CHARSET_MENU, + CHARSET_INFO, + CHARSET_BOOT + }; #endif -// LCD implementations -void lcd_implementation_clear(); -void lcd_implementation_init(); +//////////////////////////////////////////// +//////////// MarlinUI Singleton //////////// +//////////////////////////////////////////// -#if HAS_CHARACTER_LCD +class MarlinUI { +public: - enum HD44780CharSet : uint8_t { CHARSET_MENU, CHARSET_INFO, CHARSET_BOOT }; - - void lcd_set_custom_characters( - #if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN) - const HD44780CharSet screen_charset=CHARSET_INFO + MarlinUI() { + #if HAS_LCD_MENU + currentScreen = status_screen; #endif - ); - #if ENABLED(LCD_PROGRESS_BAR) - #define LCD_SET_CHARSET(C) lcd_set_custom_characters(C) - #else - #define LCD_SET_CHARSET(C) lcd_set_custom_characters() + } + + static inline void buzz(const long duration, const uint16_t freq) { + #if ENABLED(LCD_USE_I2C_BUZZER) + lcd.buzz(duration, freq); + #elif PIN_EXISTS(BEEPER) + buzzer.tone(duration, freq); + #else + UNUSED(duration); UNUSED(freq); + #endif + } + + // LCD implementations + static void clear_lcd(); + static void init_lcd(); + + #if HAS_SPI_LCD || ENABLED(MALYAN_LCD) || ENABLED(EXTENSIBLE_UI) + static void init(); + static void update(); + static void set_alert_status_P(PGM_P message); + #else // NO LCD + static inline void init() {} + static inline void update() {} + static inline void set_alert_status_P(PGM_P message) { UNUSED(message); } #endif -#endif + #if HAS_SPI_LCD || ENABLED(EXTENSIBLE_UI) + + static char status_message[]; + static bool has_status(); + + + static uint8_t status_message_level; // Higher levels block lower levels + static inline void reset_alert_level() { status_message_level = 0; } + + #if HAS_SPI_LCD + + static bool detected(); + + static LCDViewAction lcdDrawUpdate; + static inline bool should_draw() { return bool(lcdDrawUpdate); } + static inline void refresh(const LCDViewAction type) { lcdDrawUpdate = type; } + static inline void refresh() { refresh(LCDVIEW_CLEAR_CALL_REDRAW); } + + #if ENABLED(SHOW_BOOTSCREEN) + static void show_bootscreen(); + #endif + + #if HAS_GRAPHICAL_LCD + + static bool drawing_screen, first_page; + + static void set_font(const MarlinFont font_nr); + + #else + + static constexpr bool drawing_screen = false, first_page = true; + + static void set_custom_characters(const HD44780CharSet screen_charset=CHARSET_INFO); + + #if ENABLED(LCD_PROGRESS_BAR) + static millis_t progress_bar_ms; // Start time for the current progress bar cycle + static void draw_progress_bar(const uint8_t percent); + #if PROGRESS_MSG_EXPIRE > 0 + static millis_t MarlinUI::expire_status_ms; // = 0 + static inline void reset_progress_bar_timeout() { expire_status_ms = 0; } + #endif + #endif + + #endif + + #if ENABLED(STATUS_MESSAGE_SCROLLING) + static uint8_t status_scroll_offset; + #endif + static uint8_t lcd_status_update_delay; + + #if HAS_PRINT_PROGRESS + #if ENABLED(LCD_SET_PROGRESS_MANUALLY) + static uint8_t progress_bar_percent; + static void set_progress(const uint8_t progress) { progress_bar_percent = MIN(progress, 100); } + #endif + static uint8_t get_progress(); + #else + static constexpr uint8_t get_progress() { return 0; } + #endif + + #if HAS_LCD_CONTRAST + static int16_t contrast; + static void set_contrast(const int16_t value); + static inline void refresh_contrast() { set_contrast(contrast); } + #endif + + #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) + static millis_t next_filament_display; + #endif + + static void quick_feedback(const bool clear_buttons=true); + static void completion_feedback(const bool good=true); + + #if DISABLED(LIGHTWEIGHT_UI) + static void draw_status_message(const bool blink); + #endif + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + static void draw_hotend_status(const uint8_t row, const uint8_t extruder); + #endif + + static void status_screen(); + + #else + static void refresh() {} + #endif + + static bool get_blink(); + static void kill_screen(PGM_P const lcd_msg); + static void draw_kill_screen(); + static void set_status(const char* const message, const bool persist=false); + static void set_status_P(PGM_P const message, const int8_t level=0); + static void status_printf_P(const uint8_t level, PGM_P const fmt, ...); + static void reset_status(); + + #else // MALYAN_LCD or NO LCD + + static inline void refresh() {} + static inline void set_status(const char* const message, const bool persist=false) { UNUSED(message); UNUSED(persist); } + static inline void set_status_P(PGM_P const message, const int8_t level=0) { UNUSED(message); UNUSED(level); } + static inline void status_printf_P(const uint8_t level, PGM_P const fmt, ...) { UNUSED(level); UNUSED(fmt); } + static inline void reset_status() {} + static inline void reset_alert_level() {} + static constexpr bool has_status() { return false; } + + #endif + + #if HAS_LCD_MENU + + #if ENABLED(ENCODER_RATE_MULTIPLIER) + static bool encoderRateMultiplierEnabled; + static millis_t lastEncoderMovementMillis; + static void enable_encoder_multiplier(const bool onoff); + #endif + + #if ENABLED(SDSUPPORT) + #if ENABLED(SCROLL_LONG_FILENAMES) + static uint8_t filename_scroll_pos, filename_scroll_max; + #endif + static const char * scrolled_filename(CardReader &theCard, const uint8_t maxlen, uint8_t hash, const bool doScroll); + #endif + + #if IS_KINEMATIC + static bool processing_manual_move; + #else + static constexpr bool processing_manual_move = false; + #endif + + #if E_MANUAL > 1 + static int8_t manual_move_e_index; + #else + static constexpr int8_t manual_move_e_index = 0; + #endif + + static int16_t preheat_hotend_temp[2], preheat_bed_temp[2]; + static uint8_t preheat_fan_speed[2]; + + static void manage_manual_move(); + + static bool lcd_clicked; + static bool use_click(); + + static void synchronize(PGM_P const msg=NULL); + + static screenFunc_t currentScreen; + static void goto_screen(const screenFunc_t screen, const uint32_t encoder=0); + static void save_previous_screen(); + static void goto_previous_screen(); + static void return_to_status(); + static inline bool on_status_screen() { return currentScreen == status_screen; } + static inline void run_current_screen() { (*currentScreen)(); } + + #if ENABLED(LIGHTWEIGHT_UI) + static void lcd_in_status(const bool inStatus); + #endif + + static inline void defer_status_screen(const bool defer) { + #if LCD_TIMEOUT_TO_STATUS + defer_return_to_status = defer; + #else + UNUSED(defer); + #endif + } + + static inline void goto_previous_screen_no_defer() { + defer_status_screen(false); + goto_previous_screen(); + } + + #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) + static void reselect_last_file(); + #endif + + #if ENABLED(G26_MESH_VALIDATION) + static inline void chirp() { buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); } + #endif + + #if ENABLED(AUTO_BED_LEVELING_UBL) + static void ubl_plot(const uint8_t x, const uint8_t inverted_y); + #endif + + #elif HAS_SPI_LCD + + static constexpr bool lcd_clicked = false; + static constexpr bool on_status_screen() { return true; } + static inline void run_current_screen() { status_screen(); } + + #endif + + #if ENABLED(LCD_BED_LEVELING) && (ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING)) + static bool wait_for_bl_move; + #else + static constexpr bool wait_for_bl_move = false; + #endif + + #if HAS_LCD_MENU && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)) + static bool external_control; + FORCE_INLINE static void capture() { external_control = true; } + FORCE_INLINE static void release() { external_control = false; } + #else + static constexpr bool external_control = false; + #endif + + #if HAS_ENCODER_ACTION + + static volatile uint8_t buttons; + #if ENABLED(REPRAPWORLD_KEYPAD) + static volatile uint8_t keypad_buttons; + static bool handle_keypad(); + #endif + #if HAS_SLOW_BUTTONS + static volatile uint8_t slow_buttons; + static uint8_t read_slow_buttons(); + #endif + static void update_buttons(); + static inline bool button_pressed() { return BUTTON_CLICK(); } + #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) + static void wait_for_release(); + #endif + + static uint32_t encoderPosition; + + #if ENABLED(REVERSE_ENCODER_DIRECTION) + #define ENCODERBASE -1 + #else + #define ENCODERBASE +1 + #endif + #if ENABLED(REVERSE_MENU_DIRECTION) + static int8_t encoderDirection; + static inline void encoder_direction_normal() { encoderDirection = +(ENCODERBASE); } + static inline void encoder_direction_menus() { encoderDirection = -(ENCODERBASE); } + #else + static constexpr int8_t encoderDirection = ENCODERBASE; + static inline void encoder_direction_normal() {} + static inline void encoder_direction_menus() {} + #endif + + #else + + static inline void update_buttons() {} + + #endif + +private: + + static void _synchronize(); + + #if HAS_SPI_LCD || ENABLED(EXTENSIBLE_UI) + static void finishstatus(const bool persist); + #endif + + #if HAS_SPI_LCD + #if HAS_LCD_MENU + #if LCD_TIMEOUT_TO_STATUS + static bool defer_return_to_status; + #else + static constexpr bool defer_return_to_status = false; + #endif + #endif + static void draw_status_screen(); + #endif +}; + +extern MarlinUI ui; + +#define LCD_MESSAGEPGM(x) ui.set_status_P(PSTR(x)) +#define LCD_ALERTMESSAGEPGM(x) ui.set_alert_status_P(PSTR(x)) diff --git a/Marlin/src/libs/buzzer.cpp b/Marlin/src/libs/buzzer.cpp index 6fb4d51a03..997c226436 100644 --- a/Marlin/src/libs/buzzer.cpp +++ b/Marlin/src/libs/buzzer.cpp @@ -64,7 +64,7 @@ void Buzzer::tick() { if (state.tone.frequency > 0) { #if ENABLED(EXTENSIBLE_UI) CRITICAL_SECTION_START; - UI::onPlayTone(state.tone.frequency, state.tone.duration); + ExtUI::onPlayTone(state.tone.frequency, state.tone.duration); CRITICAL_SECTION_END; #elif ENABLED(SPEAKER) CRITICAL_SECTION_START; diff --git a/Marlin/src/libs/buzzer.h b/Marlin/src/libs/buzzer.h index 2a150e267c..c0ed8d9fa2 100644 --- a/Marlin/src/libs/buzzer.h +++ b/Marlin/src/libs/buzzer.h @@ -23,94 +23,95 @@ #include "../inc/MarlinConfig.h" -// Make a buzzer and macro #if ENABLED(LCD_USE_I2C_BUZZER) - // BUZZ() will be defined in ultralcd.h + + #define BUZZ(d,f) ui.buzz(d,f) + #elif PIN_EXISTS(BEEPER) -#include "circularqueue.h" + #include "circularqueue.h" -#define TONE_QUEUE_LENGTH 4 + #define TONE_QUEUE_LENGTH 4 -/** - * @brief Tone structure - * @details Simple abstraction of a tone based on a duration and a frequency. - */ -struct tone_t { - uint16_t duration; - uint16_t frequency; -}; + /** + * @brief Tone structure + * @details Simple abstraction of a tone based on a duration and a frequency. + */ + struct tone_t { + uint16_t duration; + uint16_t frequency; + }; -/** - * @brief Buzzer class - */ -class Buzzer { - public: + /** + * @brief Buzzer class + */ + class Buzzer { + public: - typedef struct { - tone_t tone; - uint32_t endtime; - } state_t; + typedef struct { + tone_t tone; + uint32_t endtime; + } state_t; - private: - static state_t state; + private: + static state_t state; - protected: - static CircularQueue buffer; + protected: + static CircularQueue buffer; - /** - * @brief Inverts the sate of a digital PIN - * @details This will invert the current state of an digital IO pin. - */ - FORCE_INLINE static void invert() { TOGGLE(BEEPER_PIN); } + /** + * @brief Inverts the sate of a digital PIN + * @details This will invert the current state of an digital IO pin. + */ + FORCE_INLINE static void invert() { TOGGLE(BEEPER_PIN); } - /** - * @brief Turn off a digital PIN - * @details Alias of digitalWrite(PIN, LOW) using FastIO - */ - FORCE_INLINE static void off() { WRITE(BEEPER_PIN, LOW); } + /** + * @brief Turn off a digital PIN + * @details Alias of digitalWrite(PIN, LOW) using FastIO + */ + FORCE_INLINE static void off() { WRITE(BEEPER_PIN, LOW); } - /** - * @brief Turn on a digital PIN - * @details Alias of digitalWrite(PIN, HIGH) using FastIO - */ - FORCE_INLINE static void on() { WRITE(BEEPER_PIN, HIGH); } + /** + * @brief Turn on a digital PIN + * @details Alias of digitalWrite(PIN, HIGH) using FastIO + */ + FORCE_INLINE static void on() { WRITE(BEEPER_PIN, HIGH); } - /** - * @brief Resets the state of the class - * @details Brings the class state to a known one. - */ - static inline void reset() { - off(); - state.endtime = 0; - } + /** + * @brief Resets the state of the class + * @details Brings the class state to a known one. + */ + static inline void reset() { + off(); + state.endtime = 0; + } - public: - /** - * @brief Class constructor - */ - Buzzer() { - SET_OUTPUT(BEEPER_PIN); - reset(); - } + public: + /** + * @brief Class constructor + */ + Buzzer() { + SET_OUTPUT(BEEPER_PIN); + reset(); + } - /** - * @brief Add a tone to the queue - * @details Adds a tone_t structure to the ring buffer, will block IO if the - * queue is full waiting for one slot to get available. - * - * @param duration Duration of the tone in milliseconds - * @param frequency Frequency of the tone in hertz - */ - static void tone(const uint16_t duration, const uint16_t frequency=0); + /** + * @brief Add a tone to the queue + * @details Adds a tone_t structure to the ring buffer, will block IO if the + * queue is full waiting for one slot to get available. + * + * @param duration Duration of the tone in milliseconds + * @param frequency Frequency of the tone in hertz + */ + static void tone(const uint16_t duration, const uint16_t frequency=0); - /** - * @brief Tick function - * @details This function should be called at loop, it will take care of - * playing the tones in the queue. - */ - static void tick(); -}; + /** + * @brief Tick function + * @details This function should be called at loop, it will take care of + * playing the tones in the queue. + */ + static void tick(); + }; // Provide a buzzer instance extern Buzzer buzzer; diff --git a/Marlin/src/libs/softspi.h b/Marlin/src/libs/softspi.h index ad4e4e7194..819567df81 100644 --- a/Marlin/src/libs/softspi.h +++ b/Marlin/src/libs/softspi.h @@ -1,653 +1,635 @@ -//https://github.com/niteris/ArduinoSoftSpi +// https://github.com/niteris/ArduinoSoftSpi #include + +#ifndef FORCE_INLINE + #define FORCE_INLINE inline __attribute__((always_inline)) +#endif + +#ifndef _BV + #define _BV(B) (1 << (B)) + #define SBI(A,B) (A |= (1 << (B))) + #define CBI(A,B) (A &= ~(1 << (B))) +#endif + +#define nop __asm__ volatile ("nop") // NOP for timing + #ifdef __arm__ -#ifdef CORE_TEENSY -//------------------------------------------------------------------------------ -/** read pin value - * @param[in] pin Arduino pin number - * @return value read - */ -static inline __attribute__((always_inline)) -bool fastDigitalRead(uint8_t pin) { - return *portInputRegister(pin); -} -//------------------------------------------------------------------------------ -/** Set pin value - * @param[in] pin Arduino pin number - * @param[in] level value to write - */ -static inline __attribute__((always_inline)) -void fastDigitalWrite(uint8_t pin, bool value) { - if (value) - *portSetRegister(pin) = 1; - else - *portClearRegister(pin) = 1; -} -#else // CORE_TEENSY -//------------------------------------------------------------------------------ -/** read pin value - * @param[in] pin Arduino pin number - * @return value read - */ -static inline __attribute__((always_inline)) -bool fastDigitalRead(uint8_t pin) { - return g_APinDescription[pin].pPort->PIO_PDSR & g_APinDescription[pin].ulPin; -} -//------------------------------------------------------------------------------ -/** Set pin value - * @param[in] pin Arduino pin number - * @param[in] level value to write - */ -static inline __attribute__((always_inline)) -void fastDigitalWrite(uint8_t pin, bool value) { - if (value) - g_APinDescription[pin].pPort->PIO_SODR = g_APinDescription[pin].ulPin; - else - g_APinDescription[pin].pPort->PIO_CODR = g_APinDescription[pin].ulPin; -} -#endif // CORE_TEENSY -//------------------------------------------------------------------------------ -inline void fastDigitalToggle(uint8_t pin) { - fastDigitalWrite(pin, !fastDigitalRead(pin)); -} -//------------------------------------------------------------------------------ -inline void fastPinMode(uint8_t pin, bool mode) {pinMode(pin, mode);} -#else // __arm__ -#include -#include -//------------------------------------------------------------------------------ -/** - * @class pin_map_t - * @brief struct for mapping digital pins - */ -struct pin_map_t { - volatile uint8_t* ddr; /**< address of DDR for this pin */ - volatile uint8_t* pin; /**< address of PIN for this pin */ - volatile uint8_t* port; /**< address of PORT for this pin */ - uint8_t bit; /**< bit number for this pin */ -}; -//------------------------------------------------------------------------------ -#if defined(__AVR_ATmega168__)\ -||defined(__AVR_ATmega168P__)\ -||defined(__AVR_ATmega328P__) -// 168 and 328 Arduinos -const static pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 0}, // D0 0 - {&DDRD, &PIND, &PORTD, 1}, // D1 1 - {&DDRD, &PIND, &PORTD, 2}, // D2 2 - {&DDRD, &PIND, &PORTD, 3}, // D3 3 - {&DDRD, &PIND, &PORTD, 4}, // D4 4 - {&DDRD, &PIND, &PORTD, 5}, // D5 5 - {&DDRD, &PIND, &PORTD, 6}, // D6 6 - {&DDRD, &PIND, &PORTD, 7}, // D7 7 - {&DDRB, &PINB, &PORTB, 0}, // B0 8 - {&DDRB, &PINB, &PORTB, 1}, // B1 9 - {&DDRB, &PINB, &PORTB, 2}, // B2 10 - {&DDRB, &PINB, &PORTB, 3}, // B3 11 - {&DDRB, &PINB, &PORTB, 4}, // B4 12 - {&DDRB, &PINB, &PORTB, 5}, // B5 13 - {&DDRC, &PINC, &PORTC, 0}, // C0 14 - {&DDRC, &PINC, &PORTC, 1}, // C1 15 - {&DDRC, &PINC, &PORTC, 2}, // C2 16 - {&DDRC, &PINC, &PORTC, 3}, // C3 17 - {&DDRC, &PINC, &PORTC, 4}, // C4 18 - {&DDRC, &PINC, &PORTC, 5} // C5 19 -}; -//------------------------------------------------------------------------------ -#elif defined(__AVR_ATmega1280__)\ -|| defined(__AVR_ATmega2560__) -// Mega -static const pin_map_t pinMap[] = { - {&DDRE, &PINE, &PORTE, 0}, // E0 0 - {&DDRE, &PINE, &PORTE, 1}, // E1 1 - {&DDRE, &PINE, &PORTE, 4}, // E4 2 - {&DDRE, &PINE, &PORTE, 5}, // E5 3 - {&DDRG, &PING, &PORTG, 5}, // G5 4 - {&DDRE, &PINE, &PORTE, 3}, // E3 5 - {&DDRH, &PINH, &PORTH, 3}, // H3 6 - {&DDRH, &PINH, &PORTH, 4}, // H4 7 - {&DDRH, &PINH, &PORTH, 5}, // H5 8 - {&DDRH, &PINH, &PORTH, 6}, // H6 9 - {&DDRB, &PINB, &PORTB, 4}, // B4 10 - {&DDRB, &PINB, &PORTB, 5}, // B5 11 - {&DDRB, &PINB, &PORTB, 6}, // B6 12 - {&DDRB, &PINB, &PORTB, 7}, // B7 13 - {&DDRJ, &PINJ, &PORTJ, 1}, // J1 14 - {&DDRJ, &PINJ, &PORTJ, 0}, // J0 15 - {&DDRH, &PINH, &PORTH, 1}, // H1 16 - {&DDRH, &PINH, &PORTH, 0}, // H0 17 - {&DDRD, &PIND, &PORTD, 3}, // D3 18 - {&DDRD, &PIND, &PORTD, 2}, // D2 19 - {&DDRD, &PIND, &PORTD, 1}, // D1 20 - {&DDRD, &PIND, &PORTD, 0}, // D0 21 - {&DDRA, &PINA, &PORTA, 0}, // A0 22 - {&DDRA, &PINA, &PORTA, 1}, // A1 23 - {&DDRA, &PINA, &PORTA, 2}, // A2 24 - {&DDRA, &PINA, &PORTA, 3}, // A3 25 - {&DDRA, &PINA, &PORTA, 4}, // A4 26 - {&DDRA, &PINA, &PORTA, 5}, // A5 27 - {&DDRA, &PINA, &PORTA, 6}, // A6 28 - {&DDRA, &PINA, &PORTA, 7}, // A7 29 - {&DDRC, &PINC, &PORTC, 7}, // C7 30 - {&DDRC, &PINC, &PORTC, 6}, // C6 31 - {&DDRC, &PINC, &PORTC, 5}, // C5 32 - {&DDRC, &PINC, &PORTC, 4}, // C4 33 - {&DDRC, &PINC, &PORTC, 3}, // C3 34 - {&DDRC, &PINC, &PORTC, 2}, // C2 35 - {&DDRC, &PINC, &PORTC, 1}, // C1 36 - {&DDRC, &PINC, &PORTC, 0}, // C0 37 - {&DDRD, &PIND, &PORTD, 7}, // D7 38 - {&DDRG, &PING, &PORTG, 2}, // G2 39 - {&DDRG, &PING, &PORTG, 1}, // G1 40 - {&DDRG, &PING, &PORTG, 0}, // G0 41 - {&DDRL, &PINL, &PORTL, 7}, // L7 42 - {&DDRL, &PINL, &PORTL, 6}, // L6 43 - {&DDRL, &PINL, &PORTL, 5}, // L5 44 - {&DDRL, &PINL, &PORTL, 4}, // L4 45 - {&DDRL, &PINL, &PORTL, 3}, // L3 46 - {&DDRL, &PINL, &PORTL, 2}, // L2 47 - {&DDRL, &PINL, &PORTL, 1}, // L1 48 - {&DDRL, &PINL, &PORTL, 0}, // L0 49 - {&DDRB, &PINB, &PORTB, 3}, // B3 50 - {&DDRB, &PINB, &PORTB, 2}, // B2 51 - {&DDRB, &PINB, &PORTB, 1}, // B1 52 - {&DDRB, &PINB, &PORTB, 0}, // B0 53 - {&DDRF, &PINF, &PORTF, 0}, // F0 54 - {&DDRF, &PINF, &PORTF, 1}, // F1 55 - {&DDRF, &PINF, &PORTF, 2}, // F2 56 - {&DDRF, &PINF, &PORTF, 3}, // F3 57 - {&DDRF, &PINF, &PORTF, 4}, // F4 58 - {&DDRF, &PINF, &PORTF, 5}, // F5 59 - {&DDRF, &PINF, &PORTF, 6}, // F6 60 - {&DDRF, &PINF, &PORTF, 7}, // F7 61 - {&DDRK, &PINK, &PORTK, 0}, // K0 62 - {&DDRK, &PINK, &PORTK, 1}, // K1 63 - {&DDRK, &PINK, &PORTK, 2}, // K2 64 - {&DDRK, &PINK, &PORTK, 3}, // K3 65 - {&DDRK, &PINK, &PORTK, 4}, // K4 66 - {&DDRK, &PINK, &PORTK, 5}, // K5 67 - {&DDRK, &PINK, &PORTK, 6}, // K6 68 - {&DDRK, &PINK, &PORTK, 7}, // K7 69 -//pins_MIGHTYBOARD_REVE.h - {&DDRG, &PING, &PORTG, 4}, // G4 70 - {&DDRG, &PING, &PORTG, 3}, // G3 71 - {&DDRJ, &PINJ, &PORTJ, 2}, // J2 72 - {&DDRJ, &PINJ, &PORTJ, 3}, // J3 73 - {&DDRJ, &PINJ, &PORTJ, 7}, // J7 74 - {&DDRJ, &PINJ, &PORTJ, 4}, // J4 75 - {&DDRJ, &PINJ, &PORTJ, 5}, // J5 76 - {&DDRJ, &PINJ, &PORTJ, 6}, // J6 77 - {&DDRE, &PINE, &PORTE, 2}, // E2 78 - {&DDRE, &PINE, &PORTE, 6} // E6 79 + #ifdef CORE_TEENSY -}; -//------------------------------------------------------------------------------ -#elif defined(__AVR_ATmega1284P__)\ -|| defined(__AVR_ATmega1284__)\ -|| defined(__AVR_ATmega644P__)\ -|| defined(__AVR_ATmega644__)\ -|| defined(__AVR_ATmega64__)\ -|| defined(__AVR_ATmega32__)\ -|| defined(__AVR_ATmega324__)\ -|| defined(__AVR_ATmega16__) - -#ifdef VARIANT_MIGHTY -// Mighty Layout -static const pin_map_t pinMap[] = { - {&DDRB, &PINB, &PORTB, 0}, // B0 0 - {&DDRB, &PINB, &PORTB, 1}, // B1 1 - {&DDRB, &PINB, &PORTB, 2}, // B2 2 - {&DDRB, &PINB, &PORTB, 3}, // B3 3 - {&DDRB, &PINB, &PORTB, 4}, // B4 4 - {&DDRB, &PINB, &PORTB, 5}, // B5 5 - {&DDRB, &PINB, &PORTB, 6}, // B6 6 - {&DDRB, &PINB, &PORTB, 7}, // B7 7 - {&DDRD, &PIND, &PORTD, 0}, // D0 8 - {&DDRD, &PIND, &PORTD, 1}, // D1 9 - {&DDRD, &PIND, &PORTD, 2}, // D2 10 - {&DDRD, &PIND, &PORTD, 3}, // D3 11 - {&DDRD, &PIND, &PORTD, 4}, // D4 12 - {&DDRD, &PIND, &PORTD, 5}, // D5 13 - {&DDRD, &PIND, &PORTD, 6}, // D6 14 - {&DDRD, &PIND, &PORTD, 7}, // D7 15 - {&DDRC, &PINC, &PORTC, 0}, // C0 16 - {&DDRC, &PINC, &PORTC, 1}, // C1 17 - {&DDRC, &PINC, &PORTC, 2}, // C2 18 - {&DDRC, &PINC, &PORTC, 3}, // C3 19 - {&DDRC, &PINC, &PORTC, 4}, // C4 20 - {&DDRC, &PINC, &PORTC, 5}, // C5 21 - {&DDRC, &PINC, &PORTC, 6}, // C6 22 - {&DDRC, &PINC, &PORTC, 7}, // C7 23 - {&DDRA, &PINA, &PORTA, 0}, // A0 24 - {&DDRA, &PINA, &PORTA, 1}, // A1 25 - {&DDRA, &PINA, &PORTA, 2}, // A2 26 - {&DDRA, &PINA, &PORTA, 3}, // A3 27 - {&DDRA, &PINA, &PORTA, 4}, // A4 28 - {&DDRA, &PINA, &PORTA, 5}, // A5 29 - {&DDRA, &PINA, &PORTA, 6}, // A6 30 - {&DDRA, &PINA, &PORTA, 7} // A7 31 -}; -#elif defined(VARIANT_BOBUINO) -// Bobuino Layout -static const pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 0}, // D0 0 - {&DDRD, &PIND, &PORTD, 1}, // D1 1 - {&DDRD, &PIND, &PORTD, 2}, // D2 2 - {&DDRD, &PIND, &PORTD, 3}, // D3 3 - {&DDRB, &PINB, &PORTB, 0}, // B0 4 - {&DDRB, &PINB, &PORTB, 1}, // B1 5 - {&DDRB, &PINB, &PORTB, 2}, // B2 6 - {&DDRB, &PINB, &PORTB, 3}, // B3 7 - {&DDRD, &PIND, &PORTD, 5}, // D5 8 - {&DDRD, &PIND, &PORTD, 6}, // D6 9 - {&DDRB, &PINB, &PORTB, 4}, // B4 10 - {&DDRB, &PINB, &PORTB, 5}, // B5 11 - {&DDRB, &PINB, &PORTB, 6}, // B6 12 - {&DDRB, &PINB, &PORTB, 7}, // B7 13 - {&DDRA, &PINA, &PORTA, 7}, // A7 14 - {&DDRA, &PINA, &PORTA, 6}, // A6 15 - {&DDRA, &PINA, &PORTA, 5}, // A5 16 - {&DDRA, &PINA, &PORTA, 4}, // A4 17 - {&DDRA, &PINA, &PORTA, 3}, // A3 18 - {&DDRA, &PINA, &PORTA, 2}, // A2 19 - {&DDRA, &PINA, &PORTA, 1}, // A1 20 - {&DDRA, &PINA, &PORTA, 0}, // A0 21 - {&DDRC, &PINC, &PORTC, 0}, // C0 22 - {&DDRC, &PINC, &PORTC, 1}, // C1 23 - {&DDRC, &PINC, &PORTC, 2}, // C2 24 - {&DDRC, &PINC, &PORTC, 3}, // C3 25 - {&DDRC, &PINC, &PORTC, 4}, // C4 26 - {&DDRC, &PINC, &PORTC, 5}, // C5 27 - {&DDRC, &PINC, &PORTC, 6}, // C6 28 - {&DDRC, &PINC, &PORTC, 7}, // C7 29 - {&DDRD, &PIND, &PORTD, 4}, // D4 30 - {&DDRD, &PIND, &PORTD, 7} // D7 31 -}; -#elif defined(VARIANT_STANDARD) -// Standard Layout -static const pin_map_t pinMap[] = { - {&DDRB, &PINB, &PORTB, 0}, // B0 0 - {&DDRB, &PINB, &PORTB, 1}, // B1 1 - {&DDRB, &PINB, &PORTB, 2}, // B2 2 - {&DDRB, &PINB, &PORTB, 3}, // B3 3 - {&DDRB, &PINB, &PORTB, 4}, // B4 4 - {&DDRB, &PINB, &PORTB, 5}, // B5 5 - {&DDRB, &PINB, &PORTB, 6}, // B6 6 - {&DDRB, &PINB, &PORTB, 7}, // B7 7 - {&DDRD, &PIND, &PORTD, 0}, // D0 8 - {&DDRD, &PIND, &PORTD, 1}, // D1 9 - {&DDRD, &PIND, &PORTD, 2}, // D2 10 - {&DDRD, &PIND, &PORTD, 3}, // D3 11 - {&DDRD, &PIND, &PORTD, 4}, // D4 12 - {&DDRD, &PIND, &PORTD, 5}, // D5 13 - {&DDRD, &PIND, &PORTD, 6}, // D6 14 - {&DDRD, &PIND, &PORTD, 7}, // D7 15 - {&DDRC, &PINC, &PORTC, 0}, // C0 16 - {&DDRC, &PINC, &PORTC, 1}, // C1 17 - {&DDRC, &PINC, &PORTC, 2}, // C2 18 - {&DDRC, &PINC, &PORTC, 3}, // C3 19 - {&DDRC, &PINC, &PORTC, 4}, // C4 20 - {&DDRC, &PINC, &PORTC, 5}, // C5 21 - {&DDRC, &PINC, &PORTC, 6}, // C6 22 - {&DDRC, &PINC, &PORTC, 7}, // C7 23 - {&DDRA, &PINA, &PORTA, 7}, // A7 24 - {&DDRA, &PINA, &PORTA, 6}, // A6 25 - {&DDRA, &PINA, &PORTA, 5}, // A5 26 - {&DDRA, &PINA, &PORTA, 4}, // A4 27 - {&DDRA, &PINA, &PORTA, 3}, // A3 28 - {&DDRA, &PINA, &PORTA, 2}, // A2 29 - {&DDRA, &PINA, &PORTA, 1}, // A1 30 - {&DDRA, &PINA, &PORTA, 0} // A0 31 -}; -#else // VARIANT_MIGHTY -#error Undefined variant 1284, 644, 324, 64, 32 -#endif // VARIANT_MIGHTY -//------------------------------------------------------------------------------ -#elif defined(__AVR_ATmega32U4__) -#ifdef CORE_TEENSY -// Teensy 2.0 -static const pin_map_t pinMap[] = { - {&DDRB, &PINB, &PORTB, 0}, // B0 0 - {&DDRB, &PINB, &PORTB, 1}, // B1 1 - {&DDRB, &PINB, &PORTB, 2}, // B2 2 - {&DDRB, &PINB, &PORTB, 3}, // B3 3 - {&DDRB, &PINB, &PORTB, 7}, // B7 4 - {&DDRD, &PIND, &PORTD, 0}, // D0 5 - {&DDRD, &PIND, &PORTD, 1}, // D1 6 - {&DDRD, &PIND, &PORTD, 2}, // D2 7 - {&DDRD, &PIND, &PORTD, 3}, // D3 8 - {&DDRC, &PINC, &PORTC, 6}, // C6 9 - {&DDRC, &PINC, &PORTC, 7}, // C7 10 - {&DDRD, &PIND, &PORTD, 6}, // D6 11 - {&DDRD, &PIND, &PORTD, 7}, // D7 12 - {&DDRB, &PINB, &PORTB, 4}, // B4 13 - {&DDRB, &PINB, &PORTB, 5}, // B5 14 - {&DDRB, &PINB, &PORTB, 6}, // B6 15 - {&DDRF, &PINF, &PORTF, 7}, // F7 16 - {&DDRF, &PINF, &PORTF, 6}, // F6 17 - {&DDRF, &PINF, &PORTF, 5}, // F5 18 - {&DDRF, &PINF, &PORTF, 4}, // F4 19 - {&DDRF, &PINF, &PORTF, 1}, // F1 20 - {&DDRF, &PINF, &PORTF, 0}, // F0 21 - {&DDRD, &PIND, &PORTD, 4}, // D4 22 - {&DDRD, &PIND, &PORTD, 5}, // D5 23 - {&DDRE, &PINE, &PORTE, 6} // E6 24 -}; -//------------------------------------------------------------------------------ -#else // CORE_TEENSY -// Leonardo -static const pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 2}, // D2 0 - {&DDRD, &PIND, &PORTD, 3}, // D3 1 - {&DDRD, &PIND, &PORTD, 1}, // D1 2 - {&DDRD, &PIND, &PORTD, 0}, // D0 3 - {&DDRD, &PIND, &PORTD, 4}, // D4 4 - {&DDRC, &PINC, &PORTC, 6}, // C6 5 - {&DDRD, &PIND, &PORTD, 7}, // D7 6 - {&DDRE, &PINE, &PORTE, 6}, // E6 7 - {&DDRB, &PINB, &PORTB, 4}, // B4 8 - {&DDRB, &PINB, &PORTB, 5}, // B5 9 - {&DDRB, &PINB, &PORTB, 6}, // B6 10 - {&DDRB, &PINB, &PORTB, 7}, // B7 11 - {&DDRD, &PIND, &PORTD, 6}, // D6 12 - {&DDRC, &PINC, &PORTC, 7}, // C7 13 - {&DDRB, &PINB, &PORTB, 3}, // B3 14 - {&DDRB, &PINB, &PORTB, 1}, // B1 15 - {&DDRB, &PINB, &PORTB, 2}, // B2 16 - {&DDRB, &PINB, &PORTB, 0}, // B0 17 - {&DDRF, &PINF, &PORTF, 7}, // F7 18 - {&DDRF, &PINF, &PORTF, 6}, // F6 19 - {&DDRF, &PINF, &PORTF, 5}, // F5 20 - {&DDRF, &PINF, &PORTF, 4}, // F4 21 - {&DDRF, &PINF, &PORTF, 1}, // F1 22 - {&DDRF, &PINF, &PORTF, 0}, // F0 23 - {&DDRD, &PIND, &PORTD, 4}, // D4 24 - {&DDRD, &PIND, &PORTD, 7}, // D7 25 - {&DDRB, &PINB, &PORTB, 4}, // B4 26 - {&DDRB, &PINB, &PORTB, 5}, // B5 27 - {&DDRB, &PINB, &PORTB, 6}, // B6 28 - {&DDRD, &PIND, &PORTD, 6} // D6 29 -}; -#endif // CORE_TEENSY -//------------------------------------------------------------------------------ -#elif defined(__AVR_AT90USB646__)\ -|| defined(__AVR_AT90USB1286__) -// Teensy++ 1.0 & 2.0 -static const pin_map_t pinMap[] = { - {&DDRD, &PIND, &PORTD, 0}, // D0 0 - {&DDRD, &PIND, &PORTD, 1}, // D1 1 - {&DDRD, &PIND, &PORTD, 2}, // D2 2 - {&DDRD, &PIND, &PORTD, 3}, // D3 3 - {&DDRD, &PIND, &PORTD, 4}, // D4 4 - {&DDRD, &PIND, &PORTD, 5}, // D5 5 - {&DDRD, &PIND, &PORTD, 6}, // D6 6 - {&DDRD, &PIND, &PORTD, 7}, // D7 7 - {&DDRE, &PINE, &PORTE, 0}, // E0 8 - {&DDRE, &PINE, &PORTE, 1}, // E1 9 - {&DDRC, &PINC, &PORTC, 0}, // C0 10 - {&DDRC, &PINC, &PORTC, 1}, // C1 11 - {&DDRC, &PINC, &PORTC, 2}, // C2 12 - {&DDRC, &PINC, &PORTC, 3}, // C3 13 - {&DDRC, &PINC, &PORTC, 4}, // C4 14 - {&DDRC, &PINC, &PORTC, 5}, // C5 15 - {&DDRC, &PINC, &PORTC, 6}, // C6 16 - {&DDRC, &PINC, &PORTC, 7}, // C7 17 - {&DDRE, &PINE, &PORTE, 6}, // E6 18 - {&DDRE, &PINE, &PORTE, 7}, // E7 19 - {&DDRB, &PINB, &PORTB, 0}, // B0 20 - {&DDRB, &PINB, &PORTB, 1}, // B1 21 - {&DDRB, &PINB, &PORTB, 2}, // B2 22 - {&DDRB, &PINB, &PORTB, 3}, // B3 23 - {&DDRB, &PINB, &PORTB, 4}, // B4 24 - {&DDRB, &PINB, &PORTB, 5}, // B5 25 - {&DDRB, &PINB, &PORTB, 6}, // B6 26 - {&DDRB, &PINB, &PORTB, 7}, // B7 27 - {&DDRA, &PINA, &PORTA, 0}, // A0 28 - {&DDRA, &PINA, &PORTA, 1}, // A1 29 - {&DDRA, &PINA, &PORTA, 2}, // A2 30 - {&DDRA, &PINA, &PORTA, 3}, // A3 31 - {&DDRA, &PINA, &PORTA, 4}, // A4 32 - {&DDRA, &PINA, &PORTA, 5}, // A5 33 - {&DDRA, &PINA, &PORTA, 6}, // A6 34 - {&DDRA, &PINA, &PORTA, 7}, // A7 35 - {&DDRE, &PINE, &PORTE, 4}, // E4 36 - {&DDRE, &PINE, &PORTE, 5}, // E5 37 - {&DDRF, &PINF, &PORTF, 0}, // F0 38 - {&DDRF, &PINF, &PORTF, 1}, // F1 39 - {&DDRF, &PINF, &PORTF, 2}, // F2 40 - {&DDRF, &PINF, &PORTF, 3}, // F3 41 - {&DDRF, &PINF, &PORTF, 4}, // F4 42 - {&DDRF, &PINF, &PORTF, 5}, // F5 43 - {&DDRF, &PINF, &PORTF, 6}, // F6 44 - {&DDRF, &PINF, &PORTF, 7} // F7 45 -}; -//------------------------------------------------------------------------------ -#else // CPU type -#error unknown CPU type -#endif // CPU type -//------------------------------------------------------------------------------ -/** count of pins */ -static const uint8_t digitalPinCount = sizeof(pinMap)/sizeof(pin_map_t); -//============================================================================== -/** generate bad pin number error */ -void badPinNumber(void) - __attribute__((error("Pin number is too large or not a constant"))); -//------------------------------------------------------------------------------ -/** Check for valid pin number - * @param[in] pin Number of pin to be checked. - */ -static inline __attribute__((always_inline)) -void badPinCheck(uint8_t pin) { - if (!__builtin_constant_p(pin) || pin >= digitalPinCount) { - badPinNumber(); - } -} -//------------------------------------------------------------------------------ -/** fast write helper - * @param[in] address I/O register address - * @param[in] bit bit number to write - * @param[in] level value for bit - */ -static inline __attribute__((always_inline)) -void fastBitWriteSafe(volatile uint8_t* address, uint8_t bit, bool level) { - uint8_t oldSREG; - if (address > (uint8_t*)0x5F) { - oldSREG = SREG; - cli(); - } - if (level) { - *address |= 1 << bit; - } else { - *address &= ~(1 << bit); - } - if (address > (uint8_t*)0x5F) { - SREG = oldSREG; - } -} -//------------------------------------------------------------------------------ -/** read pin value - * @param[in] pin Arduino pin number - * @return value read - */ -static inline __attribute__((always_inline)) -bool fastDigitalRead(uint8_t pin) { - badPinCheck(pin); - return (*pinMap[pin].pin >> pinMap[pin].bit) & 1; -} -//------------------------------------------------------------------------------ -/** toggle a pin - * @param[in] pin Arduino pin number - * - * If the pin is in output mode toggle the pin level. - * If the pin is in input mode toggle the state of the 20K pullup. - */ -static inline __attribute__((always_inline)) -void fastDigitalToggle(uint8_t pin) { - badPinCheck(pin); - if (pinMap[pin].pin > (uint8_t*)0x5F) { - // must write bit to high address port - *pinMap[pin].pin = 1 << pinMap[pin].bit; - } else { - // will compile to sbi and PIN register will not be read. - *pinMap[pin].pin |= 1 << pinMap[pin].bit; + /** + * Read pin value + * @param[in] pin Arduino pin number + * @return value read + */ + FORCE_INLINE static bool fastDigitalRead(uint8_t pin) { + return *portInputRegister(pin); } -} -//------------------------------------------------------------------------------ -/** Set pin value - * @param[in] pin Arduino pin number - * @param[in] level value to write - */ -static inline __attribute__((always_inline)) -void fastDigitalWrite(uint8_t pin, bool level) { - badPinCheck(pin); - fastBitWriteSafe(pinMap[pin].port, pinMap[pin].bit, level); -} -//------------------------------------------------------------------------------ -/** set pin mode - * @param[in] pin Arduino pin number - * @param[in] mode if true set output mode else input mode - * - * fastPinMode does not enable or disable the 20K pullup for input mode. - */ -static inline __attribute__((always_inline)) -void fastPinMode(uint8_t pin, bool mode) { - badPinCheck(pin); - fastBitWriteSafe(pinMap[pin].ddr, pinMap[pin].bit, mode); -} -#endif // __arm__ -//------------------------------------------------------------------------------ -/** set pin configuration + /** + * Set pin value + * @param[in] pin Arduino pin number + * @param[in] level value to write + */ + FORCE_INLINE static void fastDigitalWrite(uint8_t pin, bool value) { + if (value) + *portSetRegister(pin) = 1; + else + *portClearRegister(pin) = 1; + } + + #else // !CORE_TEENSY + + /** + * Read pin value + * @param[in] pin Arduino pin number + * @return value read + */ + FORCE_INLINE static bool fastDigitalRead(uint8_t pin) { + return g_APinDescription[pin].pPort->PIO_PDSR & g_APinDescription[pin].ulPin; + } + + /** + * Set pin value + * @param[in] pin Arduino pin number + * @param[in] level value to write + */ + FORCE_INLINE static void fastDigitalWrite(uint8_t pin, bool value) { + if (value) + g_APinDescription[pin].pPort->PIO_SODR = g_APinDescription[pin].ulPin; + else + g_APinDescription[pin].pPort->PIO_CODR = g_APinDescription[pin].ulPin; + } + + #endif // !CORE_TEENSY + + inline void fastDigitalToggle(uint8_t pin) { fastDigitalWrite(pin, !fastDigitalRead(pin)); } + + inline void fastPinMode(uint8_t pin, bool mode) { pinMode(pin, mode); } + +#else // !__arm__ + + #include + #include + + /** + * @class pin_map_t + * @brief struct for mapping digital pins + */ + struct pin_map_t { + volatile uint8_t* ddr; /**< address of DDR for this pin */ + volatile uint8_t* pin; /**< address of PIN for this pin */ + volatile uint8_t* port; /**< address of PORT for this pin */ + uint8_t bit; /**< bit number for this pin */ + }; + + #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328P__) + + // 168 and 328 Arduinos + const static pin_map_t pinMap[] = { + {&DDRD, &PIND, &PORTD, 0}, // D0 0 + {&DDRD, &PIND, &PORTD, 1}, // D1 1 + {&DDRD, &PIND, &PORTD, 2}, // D2 2 + {&DDRD, &PIND, &PORTD, 3}, // D3 3 + {&DDRD, &PIND, &PORTD, 4}, // D4 4 + {&DDRD, &PIND, &PORTD, 5}, // D5 5 + {&DDRD, &PIND, &PORTD, 6}, // D6 6 + {&DDRD, &PIND, &PORTD, 7}, // D7 7 + {&DDRB, &PINB, &PORTB, 0}, // B0 8 + {&DDRB, &PINB, &PORTB, 1}, // B1 9 + {&DDRB, &PINB, &PORTB, 2}, // B2 10 + {&DDRB, &PINB, &PORTB, 3}, // B3 11 + {&DDRB, &PINB, &PORTB, 4}, // B4 12 + {&DDRB, &PINB, &PORTB, 5}, // B5 13 + {&DDRC, &PINC, &PORTC, 0}, // C0 14 + {&DDRC, &PINC, &PORTC, 1}, // C1 15 + {&DDRC, &PINC, &PORTC, 2}, // C2 16 + {&DDRC, &PINC, &PORTC, 3}, // C3 17 + {&DDRC, &PINC, &PORTC, 4}, // C4 18 + {&DDRC, &PINC, &PORTC, 5} // C5 19 + }; + + #elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) + + // Mega + static const pin_map_t pinMap[] = { + {&DDRE, &PINE, &PORTE, 0}, // E0 0 + {&DDRE, &PINE, &PORTE, 1}, // E1 1 + {&DDRE, &PINE, &PORTE, 4}, // E4 2 + {&DDRE, &PINE, &PORTE, 5}, // E5 3 + {&DDRG, &PING, &PORTG, 5}, // G5 4 + {&DDRE, &PINE, &PORTE, 3}, // E3 5 + {&DDRH, &PINH, &PORTH, 3}, // H3 6 + {&DDRH, &PINH, &PORTH, 4}, // H4 7 + {&DDRH, &PINH, &PORTH, 5}, // H5 8 + {&DDRH, &PINH, &PORTH, 6}, // H6 9 + {&DDRB, &PINB, &PORTB, 4}, // B4 10 + {&DDRB, &PINB, &PORTB, 5}, // B5 11 + {&DDRB, &PINB, &PORTB, 6}, // B6 12 + {&DDRB, &PINB, &PORTB, 7}, // B7 13 + {&DDRJ, &PINJ, &PORTJ, 1}, // J1 14 + {&DDRJ, &PINJ, &PORTJ, 0}, // J0 15 + {&DDRH, &PINH, &PORTH, 1}, // H1 16 + {&DDRH, &PINH, &PORTH, 0}, // H0 17 + {&DDRD, &PIND, &PORTD, 3}, // D3 18 + {&DDRD, &PIND, &PORTD, 2}, // D2 19 + {&DDRD, &PIND, &PORTD, 1}, // D1 20 + {&DDRD, &PIND, &PORTD, 0}, // D0 21 + {&DDRA, &PINA, &PORTA, 0}, // A0 22 + {&DDRA, &PINA, &PORTA, 1}, // A1 23 + {&DDRA, &PINA, &PORTA, 2}, // A2 24 + {&DDRA, &PINA, &PORTA, 3}, // A3 25 + {&DDRA, &PINA, &PORTA, 4}, // A4 26 + {&DDRA, &PINA, &PORTA, 5}, // A5 27 + {&DDRA, &PINA, &PORTA, 6}, // A6 28 + {&DDRA, &PINA, &PORTA, 7}, // A7 29 + {&DDRC, &PINC, &PORTC, 7}, // C7 30 + {&DDRC, &PINC, &PORTC, 6}, // C6 31 + {&DDRC, &PINC, &PORTC, 5}, // C5 32 + {&DDRC, &PINC, &PORTC, 4}, // C4 33 + {&DDRC, &PINC, &PORTC, 3}, // C3 34 + {&DDRC, &PINC, &PORTC, 2}, // C2 35 + {&DDRC, &PINC, &PORTC, 1}, // C1 36 + {&DDRC, &PINC, &PORTC, 0}, // C0 37 + {&DDRD, &PIND, &PORTD, 7}, // D7 38 + {&DDRG, &PING, &PORTG, 2}, // G2 39 + {&DDRG, &PING, &PORTG, 1}, // G1 40 + {&DDRG, &PING, &PORTG, 0}, // G0 41 + {&DDRL, &PINL, &PORTL, 7}, // L7 42 + {&DDRL, &PINL, &PORTL, 6}, // L6 43 + {&DDRL, &PINL, &PORTL, 5}, // L5 44 + {&DDRL, &PINL, &PORTL, 4}, // L4 45 + {&DDRL, &PINL, &PORTL, 3}, // L3 46 + {&DDRL, &PINL, &PORTL, 2}, // L2 47 + {&DDRL, &PINL, &PORTL, 1}, // L1 48 + {&DDRL, &PINL, &PORTL, 0}, // L0 49 + {&DDRB, &PINB, &PORTB, 3}, // B3 50 + {&DDRB, &PINB, &PORTB, 2}, // B2 51 + {&DDRB, &PINB, &PORTB, 1}, // B1 52 + {&DDRB, &PINB, &PORTB, 0}, // B0 53 + {&DDRF, &PINF, &PORTF, 0}, // F0 54 + {&DDRF, &PINF, &PORTF, 1}, // F1 55 + {&DDRF, &PINF, &PORTF, 2}, // F2 56 + {&DDRF, &PINF, &PORTF, 3}, // F3 57 + {&DDRF, &PINF, &PORTF, 4}, // F4 58 + {&DDRF, &PINF, &PORTF, 5}, // F5 59 + {&DDRF, &PINF, &PORTF, 6}, // F6 60 + {&DDRF, &PINF, &PORTF, 7}, // F7 61 + {&DDRK, &PINK, &PORTK, 0}, // K0 62 + {&DDRK, &PINK, &PORTK, 1}, // K1 63 + {&DDRK, &PINK, &PORTK, 2}, // K2 64 + {&DDRK, &PINK, &PORTK, 3}, // K3 65 + {&DDRK, &PINK, &PORTK, 4}, // K4 66 + {&DDRK, &PINK, &PORTK, 5}, // K5 67 + {&DDRK, &PINK, &PORTK, 6}, // K6 68 + {&DDRK, &PINK, &PORTK, 7}, // K7 69 + + // pins_MIGHTYBOARD_REVE.h + {&DDRG, &PING, &PORTG, 4}, // G4 70 + {&DDRG, &PING, &PORTG, 3}, // G3 71 + {&DDRJ, &PINJ, &PORTJ, 2}, // J2 72 + {&DDRJ, &PINJ, &PORTJ, 3}, // J3 73 + {&DDRJ, &PINJ, &PORTJ, 7}, // J7 74 + {&DDRJ, &PINJ, &PORTJ, 4}, // J4 75 + {&DDRJ, &PINJ, &PORTJ, 5}, // J5 76 + {&DDRJ, &PINJ, &PORTJ, 6}, // J6 77 + {&DDRE, &PINE, &PORTE, 2}, // E2 78 + {&DDRE, &PINE, &PORTE, 6} // E6 79 + }; + + #elif defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega1284__) \ + || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__) \ + || defined(__AVR_ATmega64__) || defined(__AVR_ATmega32__) \ + || defined(__AVR_ATmega324__) || defined(__AVR_ATmega16__) + + #ifdef VARIANT_MIGHTY + + // Mighty Layout + static const pin_map_t pinMap[] = { + {&DDRB, &PINB, &PORTB, 0}, // B0 0 + {&DDRB, &PINB, &PORTB, 1}, // B1 1 + {&DDRB, &PINB, &PORTB, 2}, // B2 2 + {&DDRB, &PINB, &PORTB, 3}, // B3 3 + {&DDRB, &PINB, &PORTB, 4}, // B4 4 + {&DDRB, &PINB, &PORTB, 5}, // B5 5 + {&DDRB, &PINB, &PORTB, 6}, // B6 6 + {&DDRB, &PINB, &PORTB, 7}, // B7 7 + {&DDRD, &PIND, &PORTD, 0}, // D0 8 + {&DDRD, &PIND, &PORTD, 1}, // D1 9 + {&DDRD, &PIND, &PORTD, 2}, // D2 10 + {&DDRD, &PIND, &PORTD, 3}, // D3 11 + {&DDRD, &PIND, &PORTD, 4}, // D4 12 + {&DDRD, &PIND, &PORTD, 5}, // D5 13 + {&DDRD, &PIND, &PORTD, 6}, // D6 14 + {&DDRD, &PIND, &PORTD, 7}, // D7 15 + {&DDRC, &PINC, &PORTC, 0}, // C0 16 + {&DDRC, &PINC, &PORTC, 1}, // C1 17 + {&DDRC, &PINC, &PORTC, 2}, // C2 18 + {&DDRC, &PINC, &PORTC, 3}, // C3 19 + {&DDRC, &PINC, &PORTC, 4}, // C4 20 + {&DDRC, &PINC, &PORTC, 5}, // C5 21 + {&DDRC, &PINC, &PORTC, 6}, // C6 22 + {&DDRC, &PINC, &PORTC, 7}, // C7 23 + {&DDRA, &PINA, &PORTA, 0}, // A0 24 + {&DDRA, &PINA, &PORTA, 1}, // A1 25 + {&DDRA, &PINA, &PORTA, 2}, // A2 26 + {&DDRA, &PINA, &PORTA, 3}, // A3 27 + {&DDRA, &PINA, &PORTA, 4}, // A4 28 + {&DDRA, &PINA, &PORTA, 5}, // A5 29 + {&DDRA, &PINA, &PORTA, 6}, // A6 30 + {&DDRA, &PINA, &PORTA, 7} // A7 31 + }; + + #elif defined(VARIANT_BOBUINO) + + // Bobuino Layout + static const pin_map_t pinMap[] = { + {&DDRD, &PIND, &PORTD, 0}, // D0 0 + {&DDRD, &PIND, &PORTD, 1}, // D1 1 + {&DDRD, &PIND, &PORTD, 2}, // D2 2 + {&DDRD, &PIND, &PORTD, 3}, // D3 3 + {&DDRB, &PINB, &PORTB, 0}, // B0 4 + {&DDRB, &PINB, &PORTB, 1}, // B1 5 + {&DDRB, &PINB, &PORTB, 2}, // B2 6 + {&DDRB, &PINB, &PORTB, 3}, // B3 7 + {&DDRD, &PIND, &PORTD, 5}, // D5 8 + {&DDRD, &PIND, &PORTD, 6}, // D6 9 + {&DDRB, &PINB, &PORTB, 4}, // B4 10 + {&DDRB, &PINB, &PORTB, 5}, // B5 11 + {&DDRB, &PINB, &PORTB, 6}, // B6 12 + {&DDRB, &PINB, &PORTB, 7}, // B7 13 + {&DDRA, &PINA, &PORTA, 7}, // A7 14 + {&DDRA, &PINA, &PORTA, 6}, // A6 15 + {&DDRA, &PINA, &PORTA, 5}, // A5 16 + {&DDRA, &PINA, &PORTA, 4}, // A4 17 + {&DDRA, &PINA, &PORTA, 3}, // A3 18 + {&DDRA, &PINA, &PORTA, 2}, // A2 19 + {&DDRA, &PINA, &PORTA, 1}, // A1 20 + {&DDRA, &PINA, &PORTA, 0}, // A0 21 + {&DDRC, &PINC, &PORTC, 0}, // C0 22 + {&DDRC, &PINC, &PORTC, 1}, // C1 23 + {&DDRC, &PINC, &PORTC, 2}, // C2 24 + {&DDRC, &PINC, &PORTC, 3}, // C3 25 + {&DDRC, &PINC, &PORTC, 4}, // C4 26 + {&DDRC, &PINC, &PORTC, 5}, // C5 27 + {&DDRC, &PINC, &PORTC, 6}, // C6 28 + {&DDRC, &PINC, &PORTC, 7}, // C7 29 + {&DDRD, &PIND, &PORTD, 4}, // D4 30 + {&DDRD, &PIND, &PORTD, 7} // D7 31 + }; + + #elif defined(VARIANT_STANDARD) + + // Standard Layout + static const pin_map_t pinMap[] = { + {&DDRB, &PINB, &PORTB, 0}, // B0 0 + {&DDRB, &PINB, &PORTB, 1}, // B1 1 + {&DDRB, &PINB, &PORTB, 2}, // B2 2 + {&DDRB, &PINB, &PORTB, 3}, // B3 3 + {&DDRB, &PINB, &PORTB, 4}, // B4 4 + {&DDRB, &PINB, &PORTB, 5}, // B5 5 + {&DDRB, &PINB, &PORTB, 6}, // B6 6 + {&DDRB, &PINB, &PORTB, 7}, // B7 7 + {&DDRD, &PIND, &PORTD, 0}, // D0 8 + {&DDRD, &PIND, &PORTD, 1}, // D1 9 + {&DDRD, &PIND, &PORTD, 2}, // D2 10 + {&DDRD, &PIND, &PORTD, 3}, // D3 11 + {&DDRD, &PIND, &PORTD, 4}, // D4 12 + {&DDRD, &PIND, &PORTD, 5}, // D5 13 + {&DDRD, &PIND, &PORTD, 6}, // D6 14 + {&DDRD, &PIND, &PORTD, 7}, // D7 15 + {&DDRC, &PINC, &PORTC, 0}, // C0 16 + {&DDRC, &PINC, &PORTC, 1}, // C1 17 + {&DDRC, &PINC, &PORTC, 2}, // C2 18 + {&DDRC, &PINC, &PORTC, 3}, // C3 19 + {&DDRC, &PINC, &PORTC, 4}, // C4 20 + {&DDRC, &PINC, &PORTC, 5}, // C5 21 + {&DDRC, &PINC, &PORTC, 6}, // C6 22 + {&DDRC, &PINC, &PORTC, 7}, // C7 23 + {&DDRA, &PINA, &PORTA, 7}, // A7 24 + {&DDRA, &PINA, &PORTA, 6}, // A6 25 + {&DDRA, &PINA, &PORTA, 5}, // A5 26 + {&DDRA, &PINA, &PORTA, 4}, // A4 27 + {&DDRA, &PINA, &PORTA, 3}, // A3 28 + {&DDRA, &PINA, &PORTA, 2}, // A2 29 + {&DDRA, &PINA, &PORTA, 1}, // A1 30 + {&DDRA, &PINA, &PORTA, 0} // A0 31 + }; + + #else // !(VARIANT_MIGHTY || VARIANT_BOBUINO || VARIANT_STANDARD) + + #error Undefined variant 1284, 644, 324, 64, 32 + + #endif + + #elif defined(__AVR_ATmega32U4__) + + #ifdef CORE_TEENSY + + // Teensy 2.0 + static const pin_map_t pinMap[] = { + {&DDRB, &PINB, &PORTB, 0}, // B0 0 + {&DDRB, &PINB, &PORTB, 1}, // B1 1 + {&DDRB, &PINB, &PORTB, 2}, // B2 2 + {&DDRB, &PINB, &PORTB, 3}, // B3 3 + {&DDRB, &PINB, &PORTB, 7}, // B7 4 + {&DDRD, &PIND, &PORTD, 0}, // D0 5 + {&DDRD, &PIND, &PORTD, 1}, // D1 6 + {&DDRD, &PIND, &PORTD, 2}, // D2 7 + {&DDRD, &PIND, &PORTD, 3}, // D3 8 + {&DDRC, &PINC, &PORTC, 6}, // C6 9 + {&DDRC, &PINC, &PORTC, 7}, // C7 10 + {&DDRD, &PIND, &PORTD, 6}, // D6 11 + {&DDRD, &PIND, &PORTD, 7}, // D7 12 + {&DDRB, &PINB, &PORTB, 4}, // B4 13 + {&DDRB, &PINB, &PORTB, 5}, // B5 14 + {&DDRB, &PINB, &PORTB, 6}, // B6 15 + {&DDRF, &PINF, &PORTF, 7}, // F7 16 + {&DDRF, &PINF, &PORTF, 6}, // F6 17 + {&DDRF, &PINF, &PORTF, 5}, // F5 18 + {&DDRF, &PINF, &PORTF, 4}, // F4 19 + {&DDRF, &PINF, &PORTF, 1}, // F1 20 + {&DDRF, &PINF, &PORTF, 0}, // F0 21 + {&DDRD, &PIND, &PORTD, 4}, // D4 22 + {&DDRD, &PIND, &PORTD, 5}, // D5 23 + {&DDRE, &PINE, &PORTE, 6} // E6 24 + }; + + #else // !CORE_TEENSY + + // Leonardo + static const pin_map_t pinMap[] = { + {&DDRD, &PIND, &PORTD, 2}, // D2 0 + {&DDRD, &PIND, &PORTD, 3}, // D3 1 + {&DDRD, &PIND, &PORTD, 1}, // D1 2 + {&DDRD, &PIND, &PORTD, 0}, // D0 3 + {&DDRD, &PIND, &PORTD, 4}, // D4 4 + {&DDRC, &PINC, &PORTC, 6}, // C6 5 + {&DDRD, &PIND, &PORTD, 7}, // D7 6 + {&DDRE, &PINE, &PORTE, 6}, // E6 7 + {&DDRB, &PINB, &PORTB, 4}, // B4 8 + {&DDRB, &PINB, &PORTB, 5}, // B5 9 + {&DDRB, &PINB, &PORTB, 6}, // B6 10 + {&DDRB, &PINB, &PORTB, 7}, // B7 11 + {&DDRD, &PIND, &PORTD, 6}, // D6 12 + {&DDRC, &PINC, &PORTC, 7}, // C7 13 + {&DDRB, &PINB, &PORTB, 3}, // B3 14 + {&DDRB, &PINB, &PORTB, 1}, // B1 15 + {&DDRB, &PINB, &PORTB, 2}, // B2 16 + {&DDRB, &PINB, &PORTB, 0}, // B0 17 + {&DDRF, &PINF, &PORTF, 7}, // F7 18 + {&DDRF, &PINF, &PORTF, 6}, // F6 19 + {&DDRF, &PINF, &PORTF, 5}, // F5 20 + {&DDRF, &PINF, &PORTF, 4}, // F4 21 + {&DDRF, &PINF, &PORTF, 1}, // F1 22 + {&DDRF, &PINF, &PORTF, 0}, // F0 23 + {&DDRD, &PIND, &PORTD, 4}, // D4 24 + {&DDRD, &PIND, &PORTD, 7}, // D7 25 + {&DDRB, &PINB, &PORTB, 4}, // B4 26 + {&DDRB, &PINB, &PORTB, 5}, // B5 27 + {&DDRB, &PINB, &PORTB, 6}, // B6 28 + {&DDRD, &PIND, &PORTD, 6} // D6 29 + }; + + #endif // !CORE_TEENSY + + #elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) + + // Teensy++ 1.0 & 2.0 + static const pin_map_t pinMap[] = { + {&DDRD, &PIND, &PORTD, 0}, // D0 0 + {&DDRD, &PIND, &PORTD, 1}, // D1 1 + {&DDRD, &PIND, &PORTD, 2}, // D2 2 + {&DDRD, &PIND, &PORTD, 3}, // D3 3 + {&DDRD, &PIND, &PORTD, 4}, // D4 4 + {&DDRD, &PIND, &PORTD, 5}, // D5 5 + {&DDRD, &PIND, &PORTD, 6}, // D6 6 + {&DDRD, &PIND, &PORTD, 7}, // D7 7 + {&DDRE, &PINE, &PORTE, 0}, // E0 8 + {&DDRE, &PINE, &PORTE, 1}, // E1 9 + {&DDRC, &PINC, &PORTC, 0}, // C0 10 + {&DDRC, &PINC, &PORTC, 1}, // C1 11 + {&DDRC, &PINC, &PORTC, 2}, // C2 12 + {&DDRC, &PINC, &PORTC, 3}, // C3 13 + {&DDRC, &PINC, &PORTC, 4}, // C4 14 + {&DDRC, &PINC, &PORTC, 5}, // C5 15 + {&DDRC, &PINC, &PORTC, 6}, // C6 16 + {&DDRC, &PINC, &PORTC, 7}, // C7 17 + {&DDRE, &PINE, &PORTE, 6}, // E6 18 + {&DDRE, &PINE, &PORTE, 7}, // E7 19 + {&DDRB, &PINB, &PORTB, 0}, // B0 20 + {&DDRB, &PINB, &PORTB, 1}, // B1 21 + {&DDRB, &PINB, &PORTB, 2}, // B2 22 + {&DDRB, &PINB, &PORTB, 3}, // B3 23 + {&DDRB, &PINB, &PORTB, 4}, // B4 24 + {&DDRB, &PINB, &PORTB, 5}, // B5 25 + {&DDRB, &PINB, &PORTB, 6}, // B6 26 + {&DDRB, &PINB, &PORTB, 7}, // B7 27 + {&DDRA, &PINA, &PORTA, 0}, // A0 28 + {&DDRA, &PINA, &PORTA, 1}, // A1 29 + {&DDRA, &PINA, &PORTA, 2}, // A2 30 + {&DDRA, &PINA, &PORTA, 3}, // A3 31 + {&DDRA, &PINA, &PORTA, 4}, // A4 32 + {&DDRA, &PINA, &PORTA, 5}, // A5 33 + {&DDRA, &PINA, &PORTA, 6}, // A6 34 + {&DDRA, &PINA, &PORTA, 7}, // A7 35 + {&DDRE, &PINE, &PORTE, 4}, // E4 36 + {&DDRE, &PINE, &PORTE, 5}, // E5 37 + {&DDRF, &PINF, &PORTF, 0}, // F0 38 + {&DDRF, &PINF, &PORTF, 1}, // F1 39 + {&DDRF, &PINF, &PORTF, 2}, // F2 40 + {&DDRF, &PINF, &PORTF, 3}, // F3 41 + {&DDRF, &PINF, &PORTF, 4}, // F4 42 + {&DDRF, &PINF, &PORTF, 5}, // F5 43 + {&DDRF, &PINF, &PORTF, 6}, // F6 44 + {&DDRF, &PINF, &PORTF, 7} // F7 45 + }; + + #else // CPU type + + #error "Unknown CPU type for Software SPI" + + #endif // CPU type + + /** count of pins */ + static constexpr uint8_t digitalPinCount = sizeof(pinMap) / sizeof(pin_map_t); + + /** generate bad pin number error */ + void badPinNumber(void) + __attribute__((error("Pin number is too large or not a constant"))); + + /** + * Check for valid pin number + * @param[in] pin Number of pin to be checked. + */ + FORCE_INLINE static void badPinCheck(const uint8_t pin) { + if (!__builtin_constant_p(pin) || pin >= digitalPinCount) badPinNumber(); + } + + /** + * Fast write helper + * @param[in] address I/O register address + * @param[in] bit bit number to write + * @param[in] level value for bit + */ + FORCE_INLINE static void fastBitWriteSafe(volatile uint8_t* address, uint8_t bit, bool level) { + uint8_t oldSREG; + if (address > (uint8_t*)0x5F) { oldSREG = SREG; cli(); } + if (level) SBI(*address, bit); else CBI(*address, bit); + if (address > (uint8_t*)0x5F) SREG = oldSREG; + } + + /** + * Read pin value + * @param[in] pin Arduino pin number + * @return value read + */ + FORCE_INLINE static bool fastDigitalRead(uint8_t pin) { + badPinCheck(pin); + return (*pinMap[pin].pin >> pinMap[pin].bit) & 1; + } + + /** + * Toggle a pin + * @param[in] pin Arduino pin number + * + * If the pin is in output mode toggle the pin level. + * If the pin is in input mode toggle the state of the 20K pullup. + */ + FORCE_INLINE static void fastDigitalToggle(uint8_t pin) { + badPinCheck(pin); + if (pinMap[pin].pin > (uint8_t*)0x5F) + *pinMap[pin].pin = _BV(pinMap[pin].bit); // Must write bit to high address port + else + SBI(*pinMap[pin].pin, pinMap[pin].bit); // Compiles to sbi and PIN register will not be read + } + + /** + * Set pin value + * @param[in] pin Arduino pin number + * @param[in] level value to write + */ + FORCE_INLINE static void fastDigitalWrite(uint8_t pin, bool level) { + badPinCheck(pin); + fastBitWriteSafe(pinMap[pin].port, pinMap[pin].bit, level); + } + + /** + * Set pin mode + * @param[in] pin Arduino pin number + * @param[in] mode if true set output mode else input mode + * + * fastPinMode does not enable or disable the 20K pullup for input mode. + */ + FORCE_INLINE static void fastPinMode(uint8_t pin, bool mode) { + badPinCheck(pin); + fastBitWriteSafe(pinMap[pin].ddr, pinMap[pin].bit, mode); + } + +#endif // !__arm__ + +/** + * Set pin configuration * @param[in] pin Arduino pin number * @param[in] mode If true set output mode else input mode * @param[in] level If mode is output, set level high/low. * If mode is input, enable or disable the pin's 20K pullup. */ -static inline __attribute__((always_inline)) -void fastPinConfig(uint8_t pin, bool mode, bool level) { +FORCE_INLINE static void fastPinConfig(uint8_t pin, bool mode, bool level) { fastPinMode(pin, mode); fastDigitalWrite(pin, level); } -//============================================================================== + /** * @class DigitalPin * @brief Fast digital port I/O */ template class DigitalPin { - public: - //---------------------------------------------------------------------------- +public: + /** Constructor */ DigitalPin() {} - //---------------------------------------------------------------------------- - /** Constructor + + /** + * Constructor * @param[in] pinMode if true set output mode else input mode. */ - explicit DigitalPin(bool pinMode) { - mode(pinMode); - } - //---------------------------------------------------------------------------- - /** Constructor + explicit DigitalPin(bool pinMode) { mode(pinMode); } + + /** + * Constructor * @param[in] mode If true set output mode else input mode * @param[in] level If mode is output, set level high/low. * If mode is input, enable or disable the pin's 20K pullup. */ - DigitalPin(bool mode, bool level) { - config(mode, level); - } - //---------------------------------------------------------------------------- - /** Asignment operator + DigitalPin(bool mode, bool level) { config(mode, level); } + + /** + * Assignment operator * @param[in] value If true set the pin's level high else set the * pin's level low. * * @return This DigitalPin instance. */ - inline DigitalPin & operator = (bool value) __attribute__((always_inline)) { - write(value); - return *this; - } - //---------------------------------------------------------------------------- - /** Parenthesis operator + FORCE_INLINE DigitalPin & operator = (bool value) { write(value); return *this; } + + /** + * Parentheses operator * @return Pin's level */ - inline operator bool () const __attribute__((always_inline)) { - return read(); - } - //---------------------------------------------------------------------------- - /** set pin configuration + FORCE_INLINE operator bool () const { return read(); } + + /** + * Set pin configuration * @param[in] mode If true set output mode else input mode * @param[in] level If mode is output, set level high/low. * If mode is input, enable or disable the pin's 20K pullup. */ - inline __attribute__((always_inline)) - void config(bool mode, bool level) { - fastPinConfig(PinNumber, mode, level); - } - //---------------------------------------------------------------------------- + FORCE_INLINE void config(bool mode, bool level) { fastPinConfig(PinNumber, mode, level); } + /** * Set pin level high if output mode or enable 20K pullup if input mode. */ - inline __attribute__((always_inline)) - void high() {write(true);} - //---------------------------------------------------------------------------- + FORCE_INLINE void high() { write(true); } + /** * Set pin level low if output mode or disable 20K pullup if input mode. */ - inline __attribute__((always_inline)) - void low() {write(false);} - //---------------------------------------------------------------------------- + FORCE_INLINE void low() { write(false); } + /** * Set pin mode * @param[in] pinMode if true set output mode else input mode. * * mode() does not enable or disable the 20K pullup for input mode. */ - inline __attribute__((always_inline)) - void mode(bool pinMode) { - fastPinMode(PinNumber, pinMode); - } - //---------------------------------------------------------------------------- + FORCE_INLINE void mode(bool pinMode) { fastPinMode(PinNumber, pinMode); } + /** @return Pin's level */ - inline __attribute__((always_inline)) - bool read() const { - return fastDigitalRead(PinNumber); - } - //---------------------------------------------------------------------------- - /** toggle a pin - * + FORCE_INLINE bool read() const { return fastDigitalRead(PinNumber); } + + /** + * Toggle a pin * If the pin is in output mode toggle the pin's level. * If the pin is in input mode toggle the state of the 20K pullup. */ - inline __attribute__((always_inline)) - void toggle() { - fastDigitalToggle(PinNumber); - } - //---------------------------------------------------------------------------- - /** Write the pin's level. + FORCE_INLINE void toggle() { fastDigitalToggle(PinNumber); } + + /** + * Write the pin's level. * @param[in] value If true set the pin's level high else set the * pin's level low. */ - inline __attribute__((always_inline)) - void write(bool value) { - fastDigitalWrite(PinNumber, value); - } + FORCE_INLINE void write(bool value) { fastDigitalWrite(PinNumber, value); } }; -//------------------------------------------------------------------------------ -/** Nop for timing. */ -#define nop __asm__ volatile ("nop") -//------------------------------------------------------------------------------ -/** Pin Mode for MISO is input.*/ -const bool MISO_MODE = false; -/** Pullups disabled for MISO are disabled. */ -const bool MISO_LEVEL = false; -/** Pin Mode for MOSI is output.*/ -const bool MOSI_MODE = true; -/** Pin Mode for SCK is output. */ -const bool SCK_MODE = true; -//------------------------------------------------------------------------------ +const bool MISO_MODE = false, // Pin Mode for MISO is input. + MISO_LEVEL = false, // Pullups disabled for MISO are disabled. + MOSI_MODE = true, // Pin Mode for MOSI is output. + SCK_MODE = true; // Pin Mode for SCK is output. + /** * @class SoftSPI * @brief Fast software SPI. @@ -655,19 +637,19 @@ const bool SCK_MODE = true; template class SoftSPI { public: - //---------------------------------------------------------------------------- + /** Initialize SoftSPI pins. */ void begin() { fastPinConfig(MisoPin, MISO_MODE, MISO_LEVEL); fastPinConfig(MosiPin, MOSI_MODE, !MODE_CPHA(Mode)); fastPinConfig(SckPin, SCK_MODE, MODE_CPOL(Mode)); } - //---------------------------------------------------------------------------- - /** Soft SPI receive byte. + + /** + * Soft SPI receive byte. * @return Data byte received. */ - inline __attribute__((always_inline)) - uint8_t receive() { + FORCE_INLINE uint8_t receive() { uint8_t data = 0; receiveBit(7, &data); receiveBit(6, &data); @@ -679,12 +661,12 @@ class SoftSPI { receiveBit(0, &data); return data; } - //---------------------------------------------------------------------------- - /** Soft SPI send byte. + + /** + * Soft SPI send byte. * @param[in] data Data byte to send. */ - inline __attribute__((always_inline)) - void send(uint8_t data) { + FORCE_INLINE void send(uint8_t data) { sendBit(7, data); sendBit(6, data); sendBit(5, data); @@ -694,13 +676,13 @@ class SoftSPI { sendBit(1, data); sendBit(0, data); } - //---------------------------------------------------------------------------- - /** Soft SPI transfer byte. + + /** + * Soft SPI transfer byte. * @param[in] txData Data byte to send. * @return Data byte received. */ - inline __attribute__((always_inline)) - uint8_t transfer(uint8_t txData) { + FORCE_INLINE uint8_t transfer(uint8_t txData) { uint8_t rxData = 0; transferBit(7, &rxData, txData); transferBit(6, &rxData, txData); @@ -714,53 +696,35 @@ class SoftSPI { } private: - //---------------------------------------------------------------------------- - inline __attribute__((always_inline)) - bool MODE_CPHA(uint8_t mode) {return (mode & 1) != 0;} - inline __attribute__((always_inline)) - bool MODE_CPOL(uint8_t mode) {return (mode & 2) != 0;} - inline __attribute__((always_inline)) - void receiveBit(uint8_t bit, uint8_t* data) { - if (MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); - } + + FORCE_INLINE bool MODE_CPHA(uint8_t mode) { return bool(mode & 1); } + FORCE_INLINE bool MODE_CPOL(uint8_t mode) { return bool(mode & 2); } + FORCE_INLINE void receiveBit(uint8_t bit, uint8_t* data) { + if (MODE_CPHA(Mode)) fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); nop; nop; fastDigitalWrite(SckPin, MODE_CPHA(Mode) ? MODE_CPOL(Mode) : !MODE_CPOL(Mode)); - if (fastDigitalRead(MisoPin)) *data |= 1 << bit; - if (!MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, MODE_CPOL(Mode)); - } + if (fastDigitalRead(MisoPin)) SBI(*data, bit); + if (!MODE_CPHA(Mode)) fastDigitalWrite(SckPin, MODE_CPOL(Mode)); } - //---------------------------------------------------------------------------- - inline __attribute__((always_inline)) - void sendBit(uint8_t bit, uint8_t data) { - if (MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); - } - fastDigitalWrite(MosiPin, data & (1 << bit)); - fastDigitalWrite(SckPin, - MODE_CPHA(Mode) ? MODE_CPOL(Mode) : !MODE_CPOL(Mode)); + + FORCE_INLINE void sendBit(uint8_t bit, uint8_t data) { + if (MODE_CPHA(Mode)) fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); + fastDigitalWrite(MosiPin, data & _BV(bit)); + fastDigitalWrite(SckPin, MODE_CPHA(Mode) ? MODE_CPOL(Mode) : !MODE_CPOL(Mode)); nop; nop; - if (!MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, MODE_CPOL(Mode)); - } + if (!MODE_CPHA(Mode)) fastDigitalWrite(SckPin, MODE_CPOL(Mode)); } - //---------------------------------------------------------------------------- - inline __attribute__((always_inline)) - void transferBit(uint8_t bit, uint8_t* rxData, uint8_t txData) { - if (MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); - } - fastDigitalWrite(MosiPin, txData & (1 << bit)); + + FORCE_INLINE void transferBit(uint8_t bit, uint8_t* rxData, uint8_t txData) { + if (MODE_CPHA(Mode)) fastDigitalWrite(SckPin, !MODE_CPOL(Mode)); + fastDigitalWrite(MosiPin, txData & _BV(bit)); fastDigitalWrite(SckPin, MODE_CPHA(Mode) ? MODE_CPOL(Mode) : !MODE_CPOL(Mode)); - if (fastDigitalRead(MisoPin)) *rxData |= 1 << bit; - if (!MODE_CPHA(Mode)) { - fastDigitalWrite(SckPin, MODE_CPOL(Mode)); - } + if (fastDigitalRead(MisoPin)) SBI(*rxData, bit); + if (!MODE_CPHA(Mode)) fastDigitalWrite(SckPin, MODE_CPOL(Mode)); } - //---------------------------------------------------------------------------- + }; diff --git a/Marlin/src/libs/stopwatch.cpp b/Marlin/src/libs/stopwatch.cpp index 2817190aa6..3217fbc777 100644 --- a/Marlin/src/libs/stopwatch.cpp +++ b/Marlin/src/libs/stopwatch.cpp @@ -71,13 +71,13 @@ bool Stopwatch::start() { else return false; } -void Stopwatch::resume(const millis_t duration) { +void Stopwatch::resume(const millis_t with_time) { #if ENABLED(DEBUG_STOPWATCH) Stopwatch::debug(PSTR("resume")); #endif reset(); - if ((accumulator = duration)) state = RUNNING; + if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { diff --git a/Marlin/src/libs/stopwatch.h b/Marlin/src/libs/stopwatch.h index c1e9ea74f8..732c64f410 100644 --- a/Marlin/src/libs/stopwatch.h +++ b/Marlin/src/libs/stopwatch.h @@ -75,7 +75,7 @@ class Stopwatch { * @brief Resume the stopwatch * @details Resume a timer from a given duration */ - static void resume(const millis_t duration); + static void resume(const millis_t with_time); /** * @brief Reset the stopwatch diff --git a/Marlin/src/libs/vector_3.cpp b/Marlin/src/libs/vector_3.cpp index cb9f3272f1..5066f54b2d 100644 --- a/Marlin/src/libs/vector_3.cpp +++ b/Marlin/src/libs/vector_3.cpp @@ -84,13 +84,9 @@ void vector_3::apply_rotation(const matrix_3x3 &matrix) { void vector_3::debug(PGM_P const title) { serialprintPGM(title); - SERIAL_PROTOCOLPGM(" x: "); - SERIAL_PROTOCOL_F(x, 6); - SERIAL_PROTOCOLPGM(" y: "); - SERIAL_PROTOCOL_F(y, 6); - SERIAL_PROTOCOLPGM(" z: "); - SERIAL_PROTOCOL_F(z, 6); - SERIAL_EOL(); + SERIAL_ECHOPAIR_F(" x: ", x, 6); + SERIAL_ECHOPAIR_F(" y: ", y, 6); + SERIAL_ECHOLNPAIR_F(" z: ", z, 6); } void apply_rotation_xyz(const matrix_3x3 &matrix, float &x, float &y, float &z) { @@ -151,9 +147,9 @@ void matrix_3x3::debug(PGM_P const title) { uint8_t count = 0; for (uint8_t i = 0; i < 3; i++) { for (uint8_t j = 0; j < 3; j++) { - if (matrix[count] >= 0.0) SERIAL_PROTOCOLCHAR('+'); - SERIAL_PROTOCOL_F(matrix[count], 6); - SERIAL_PROTOCOLCHAR(' '); + if (matrix[count] >= 0.0) SERIAL_CHAR('+'); + SERIAL_ECHO_F(matrix[count], 6); + SERIAL_CHAR(' '); count++; } SERIAL_EOL(); diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index 9e8e9e3fc5..796f5477cb 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -37,7 +37,7 @@ */ // Change EEPROM version if the structure changes -#define EEPROM_VERSION "V62" +#define EEPROM_VERSION "V63" #define EEPROM_OFFSET 100 // Check the integrity of data offsets. @@ -66,15 +66,19 @@ #include "../gcode/gcode.h" #include "../Marlin.h" +#if ENABLED(EEPROM_SETTINGS) || ENABLED(SD_FIRMWARE_UPDATE) + #include "../HAL/shared/persistent_store_api.h" +#endif + #if HAS_LEVELING #include "../feature/bedlevel/bedlevel.h" #endif #if HAS_SERVOS #include "servo.h" + #define EEPROM_NUM_SERVOS NUM_SERVOS #else - #undef NUM_SERVOS - #define NUM_SERVOS NUM_SERVO_PLUGS + #define EEPROM_NUM_SERVOS NUM_SERVO_PLUGS #endif #if HAS_BED_PROBE @@ -82,6 +86,11 @@ #endif #include "../feature/fwretract.h" + +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../feature/power_loss_recovery.h" +#endif + #include "../feature/pause.h" #if EXTRUDERS > 1 @@ -178,7 +187,7 @@ typedef struct SettingsDataStruct { // // SERVO_ANGLES // - uint16_t servo_angles[NUM_SERVOS][2]; // M281 P L U + uint16_t servo_angles[EEPROM_NUM_SERVOS][2]; // M281 P L U // // DELTA / [XYZ]_DUAL_ENDSTOPS @@ -201,9 +210,9 @@ typedef struct SettingsDataStruct { // // ULTIPANEL // - int16_t lcd_preheat_hotend_temp[2], // M145 S0 H - lcd_preheat_bed_temp[2]; // M145 S0 B - uint8_t lcd_preheat_fan_speed[2]; // M145 S0 F + int16_t ui_preheat_hotend_temp[2], // M145 S0 H + ui_preheat_bed_temp[2]; // M145 S0 B + uint8_t ui_preheat_fan_speed[2]; // M145 S0 F // // PIDTEMP @@ -221,6 +230,11 @@ typedef struct SettingsDataStruct { // int16_t lcd_contrast; // M250 C + // + // POWER_LOSS_RECOVERY + // + bool recovery_enabled; // M413 S + // // FWRETRACT // @@ -269,7 +283,7 @@ typedef struct SettingsDataStruct { // Tool-change settings // #if EXTRUDERS > 1 - toolchange_settings_t toolchange_settings; // M217 S P R + toolchange_settings_t toolchange_settings; // M217 S P R #endif } SettingsData; @@ -370,8 +384,37 @@ void MarlinSettings::postprocess() { #endif // SD_FIRMWARE_UPDATE +#if ENABLED(EEPROM_CHITCHAT) + #define CHITCHAT_ECHO(V) SERIAL_ECHO(V) + #define CHITCHAT_ECHOLNPGM(STR) SERIAL_ECHOLNPGM(STR) + #define CHITCHAT_ECHOPAIR(STR,V) SERIAL_ECHOPAIR(STR,V) + #define CHITCHAT_ECHOLNPAIR(STR,V) SERIAL_ECHOLNPAIR(STR,V) + #define CHITCHAT_ECHO_START_P(port) SERIAL_ECHO_START_P(port) + #define CHITCHAT_ERROR_START_P(port) SERIAL_ERROR_START_P(port) + #define CHITCHAT_ERROR_MSG_P(port, STR) SERIAL_ERROR_MSG_P(port, STR) + #define CHITCHAT_ECHO_P(port, VAL) SERIAL_ECHO_P(port, VAL) + #define CHITCHAT_ECHOPGM_P(port, STR) SERIAL_ECHOPGM_P(port, STR) + #define CHITCHAT_ECHOLNPGM_P(port, STR) SERIAL_ECHOLNPGM_P(port, STR) + #define CHITCHAT_ECHOPAIR_P(port, STR, VAL) SERIAL_ECHOPAIR_P(port, STR, VAL) + #define CHITCHAT_ECHOLNPAIR_P(port, STR, VAL) SERIAL_ECHOLNPAIR_P(port, STR, VAL) + #define CHITCHAT_EOL() SERIAL_EOL() +#else + #define CHITCHAT_ECHO(V) NOOP + #define CHITCHAT_ECHOLNPGM(STR) NOOP + #define CHITCHAT_ECHOPAIR(STR,V) NOOP + #define CHITCHAT_ECHOLNPAIR(STR,V) NOOP + #define CHITCHAT_ECHO_START_P(port) NOOP + #define CHITCHAT_ERROR_START_P(port) NOOP + #define CHITCHAT_ERROR_MSG_P(port, STR) NOOP + #define CHITCHAT_ECHO_P(port, VAL) NOOP + #define CHITCHAT_ECHOPGM_P(port, STR) NOOP + #define CHITCHAT_ECHOLNPGM_P(port, STR) NOOP + #define CHITCHAT_ECHOPAIR_P(port, STR, VAL) NOOP + #define CHITCHAT_ECHOLNPAIR_P(port, STR, VAL) NOOP + #define CHITCHAT_EOL() NOOP +#endif + #if ENABLED(EEPROM_SETTINGS) - #include "../HAL/shared/persistent_store_api.h" #define EEPROM_START() int eeprom_index = EEPROM_OFFSET; persistentStore.access_start() #define EEPROM_FINISH() persistentStore.access_finish() @@ -379,7 +422,7 @@ void MarlinSettings::postprocess() { #define EEPROM_WRITE(VAR) persistentStore.write_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc) #define EEPROM_READ(VAR) persistentStore.read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc, !validating) #define EEPROM_READ_ALWAYS(VAR) persistentStore.read_data(eeprom_index, (uint8_t*)&VAR, sizeof(VAR), &working_crc) - #define EEPROM_ASSERT(TST,ERR) do{ if (!(TST)) { SERIAL_ERROR_START_P(port); SERIAL_ERRORLNPGM_P(port, ERR); eeprom_error = true; } }while(0) + #define EEPROM_ASSERT(TST,ERR) do{ if (!(TST)) { SERIAL_ERROR_MSG_P(port, ERR); eeprom_error = true; } }while(0) #if ENABLED(DEBUG_EEPROM_READWRITE) #define _FIELD_TEST(FIELD) \ @@ -397,10 +440,7 @@ void MarlinSettings::postprocess() { bool MarlinSettings::size_error(const uint16_t size PORTARG_AFTER) { if (size != datasize()) { - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ERROR_START_P(port); - SERIAL_ERRORLNPGM_P(port, "EEPROM datasize error."); - #endif + CHITCHAT_ERROR_MSG_P(port, "EEPROM datasize error."); return true; } return false; @@ -592,36 +632,11 @@ void MarlinSettings::postprocess() { // Servo Angles // { - #if !(HAS_SERVOS && ENABLED(EDITABLE_SERVO_ANGLES)) - - uint16_t servo_angles[NUM_SERVOS][2] = { { 0, 0 } }; - - #if ENABLED(SWITCHING_EXTRUDER) - - constexpr uint16_t sesa[][2] = SWITCHING_EXTRUDER_SERVO_ANGLES; - servo_angles[SWITCHING_EXTRUDER_SERVO_NR][0] = sesa[0][0]; - servo_angles[SWITCHING_EXTRUDER_SERVO_NR][1] = sesa[0][1]; - #if EXTRUDERS > 3 - servo_angles[SWITCHING_EXTRUDER_E23_SERVO_NR][0] = sesa[1][0]; - servo_angles[SWITCHING_EXTRUDER_E23_SERVO_NR][1] = sesa[1][1]; - #endif - - #elif ENABLED(SWITCHING_NOZZLE) - - constexpr uint16_t snsa[] = SWITCHING_NOZZLE_SERVO_ANGLES; - servo_angles[SWITCHING_NOZZLE_SERVO_NR][0] = snsa[0]; - servo_angles[SWITCHING_NOZZLE_SERVO_NR][1] = snsa[1]; - - #elif defined(Z_SERVO_ANGLES) && defined(Z_PROBE_SERVO_NR) - - constexpr uint16_t zsa[] = Z_SERVO_ANGLES; - servo_angles[Z_PROBE_SERVO_NR][0] = zsa[0]; - servo_angles[Z_PROBE_SERVO_NR][1] = zsa[1]; - - #endif - - #endif // !HAS_SERVOS || !EDITABLE_SERVO_ANGLES + _FIELD_TEST(servo_angles); + #if !HAS_SERVOS + uint16_t servo_angles[NUM_SERVO_PLUGS][2] = { { 0, 0 } }; + #endif EEPROM_WRITE(servo_angles); } @@ -680,15 +695,19 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(lcd_preheat_hotend_temp); - #if !HAS_LCD_MENU - constexpr int16_t lcd_preheat_hotend_temp[2] = { PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND }, - lcd_preheat_bed_temp[2] = { PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED }; - constexpr uint8_t lcd_preheat_fan_speed[2] = { PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED }; + #if HAS_LCD_MENU + const int16_t (&ui_preheat_hotend_temp)[2] = ui.preheat_hotend_temp, + (&ui_preheat_bed_temp)[2] = ui.preheat_bed_temp; + const uint8_t (&ui_preheat_fan_speed)[2] = ui.preheat_fan_speed; + #else + constexpr int16_t ui_preheat_hotend_temp[2] = { PREHEAT_1_TEMP_HOTEND, PREHEAT_2_TEMP_HOTEND }, + ui_preheat_bed_temp[2] = { PREHEAT_1_TEMP_BED, PREHEAT_2_TEMP_BED }; + constexpr uint8_t ui_preheat_fan_speed[2] = { PREHEAT_1_FAN_SPEED, PREHEAT_2_FAN_SPEED }; #endif - EEPROM_WRITE(lcd_preheat_hotend_temp); - EEPROM_WRITE(lcd_preheat_bed_temp); - EEPROM_WRITE(lcd_preheat_fan_speed); + EEPROM_WRITE(ui_preheat_hotend_temp); + EEPROM_WRITE(ui_preheat_bed_temp); + EEPROM_WRITE(ui_preheat_fan_speed); } // @@ -717,6 +736,7 @@ void MarlinSettings::postprocess() { // { _FIELD_TEST(bedPID); + #if DISABLED(PIDTEMPBED) const PID_t bed_pid = { DUMMY_PID_VALUE, DUMMY_PID_VALUE, DUMMY_PID_VALUE }; EEPROM_WRITE(bed_pid); @@ -731,12 +751,32 @@ void MarlinSettings::postprocess() { { _FIELD_TEST(lcd_contrast); - #if !HAS_LCD_CONTRAST - const int16_t lcd_contrast = 32; - #endif + const int16_t lcd_contrast = + #if HAS_LCD_CONTRAST + ui.contrast + #else + 32 + #endif + ; EEPROM_WRITE(lcd_contrast); } + // + // Power-Loss Recovery + // + { + _FIELD_TEST(recovery_enabled); + + const bool recovery_enabled = + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.enabled + #else + true + #endif + ; + EEPROM_WRITE(recovery_enabled); + } + // // Firmware Retraction // @@ -1012,12 +1052,10 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(final_crc); // Report storage size - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START_P(port); - SERIAL_ECHOPAIR_P(port, "Settings Stored (", eeprom_size); - SERIAL_ECHOPAIR_P(port, " bytes; crc ", (uint32_t)final_crc); - SERIAL_ECHOLNPGM_P(port, ")"); - #endif + CHITCHAT_ECHO_START_P(port); + CHITCHAT_ECHOPAIR_P(port, "Settings Stored (", eeprom_size); + CHITCHAT_ECHOPAIR_P(port, " bytes; crc ", (uint32_t)final_crc); + CHITCHAT_ECHOLNPGM_P(port, ")"); eeprom_error |= size_error(eeprom_size); } @@ -1054,12 +1092,10 @@ void MarlinSettings::postprocess() { stored_ver[0] = '?'; stored_ver[1] = '\0'; } - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START_P(port); - SERIAL_ECHOPGM_P(port, "EEPROM version mismatch "); - SERIAL_ECHOPAIR_P(port, "(EEPROM=", stored_ver); - SERIAL_ECHOLNPGM_P(port, " Marlin=" EEPROM_VERSION ")"); - #endif + CHITCHAT_ECHO_START_P(port); + CHITCHAT_ECHOPGM_P(port, "EEPROM version mismatch "); + CHITCHAT_ECHOPAIR_P(port, "(EEPROM=", stored_ver); + CHITCHAT_ECHOLNPGM_P(port, " Marlin=" EEPROM_VERSION ")"); eeprom_error = true; } else { @@ -1250,10 +1286,14 @@ void MarlinSettings::postprocess() { // SERVO_ANGLES // { - #if !(HAS_SERVOS && ENABLED(EDITABLE_SERVO_ANGLES)) - uint16_t servo_angles[NUM_SERVOS][2]; + _FIELD_TEST(servo_angles); + + #if ENABLED(EDITABLE_SERVO_ANGLES) + uint16_t (&servo_angles_arr)[EEPROM_NUM_SERVOS][2] = servo_angles; + #else + uint16_t servo_angles_arr[EEPROM_NUM_SERVOS][2]; #endif - EEPROM_READ(servo_angles); + EEPROM_READ(servo_angles_arr); } // @@ -1304,15 +1344,19 @@ void MarlinSettings::postprocess() { // LCD Preheat settings // { - _FIELD_TEST(lcd_preheat_hotend_temp); + _FIELD_TEST(ui_preheat_hotend_temp); - #if !HAS_LCD_MENU - int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2]; - uint8_t lcd_preheat_fan_speed[2]; + #if HAS_LCD_MENU + int16_t (&ui_preheat_hotend_temp)[2] = ui.preheat_hotend_temp, + (&ui_preheat_bed_temp)[2] = ui.preheat_bed_temp; + uint8_t (&ui_preheat_fan_speed)[2] = ui.preheat_fan_speed; + #else + int16_t ui_preheat_hotend_temp[2], ui_preheat_bed_temp[2]; + uint8_t ui_preheat_fan_speed[2]; #endif - EEPROM_READ(lcd_preheat_hotend_temp); // 2 floats - EEPROM_READ(lcd_preheat_bed_temp); // 2 floats - EEPROM_READ(lcd_preheat_fan_speed); // 2 floats + EEPROM_READ(ui_preheat_hotend_temp); // 2 floats + EEPROM_READ(ui_preheat_bed_temp); // 2 floats + EEPROM_READ(ui_preheat_fan_speed); // 2 floats } // @@ -1366,10 +1410,26 @@ void MarlinSettings::postprocess() { // { _FIELD_TEST(lcd_contrast); - #if !HAS_LCD_CONTRAST - int16_t lcd_contrast; - #endif + + int16_t lcd_contrast; EEPROM_READ(lcd_contrast); + #if HAS_LCD_CONTRAST + ui.set_contrast(lcd_contrast); + #endif + } + + // + // Power-Loss Recovery + // + { + _FIELD_TEST(recovery_enabled); + + #if ENABLED(POWER_LOSS_RECOVERY) + EEPROM_READ(recovery.enabled); + #else + bool recovery_enabled; + EEPROM_READ(recovery_enabled); + #endif } // @@ -1646,31 +1706,25 @@ void MarlinSettings::postprocess() { eeprom_error = size_error(eeprom_index - (EEPROM_OFFSET)); if (eeprom_error) { - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START_P(port); - SERIAL_ECHOPAIR_P(port, "Index: ", int(eeprom_index - (EEPROM_OFFSET))); - SERIAL_ECHOLNPAIR_P(port, " Size: ", datasize()); - #endif + CHITCHAT_ECHO_START_P(port); + CHITCHAT_ECHOPAIR_P(port, "Index: ", int(eeprom_index - (EEPROM_OFFSET))); + CHITCHAT_ECHOLNPAIR_P(port, " Size: ", datasize()); } else if (working_crc != stored_crc) { eeprom_error = true; - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ERROR_START_P(port); - SERIAL_ERRORPGM_P(port, "EEPROM CRC mismatch - (stored) "); - SERIAL_ERROR_P(port, stored_crc); - SERIAL_ERRORPGM_P(port, " != "); - SERIAL_ERROR_P(port, working_crc); - SERIAL_ERRORLNPGM_P(port, " (calculated)!"); - #endif + CHITCHAT_ERROR_START_P(port); + CHITCHAT_ECHOPGM_P(port, "EEPROM CRC mismatch - (stored) "); + CHITCHAT_ECHO_P(port, stored_crc); + CHITCHAT_ECHOPGM_P(port, " != "); + CHITCHAT_ECHO_P(port, working_crc); + CHITCHAT_ECHOLNPGM_P(port, " (calculated)!"); } else if (!validating) { - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START_P(port); - SERIAL_ECHO_P(port, version); - SERIAL_ECHOPAIR_P(port, " stored settings retrieved (", eeprom_index - (EEPROM_OFFSET)); - SERIAL_ECHOPAIR_P(port, " bytes; crc ", (uint32_t)working_crc); - SERIAL_ECHOLNPGM_P(port, ")"); - #endif + CHITCHAT_ECHO_START_P(port); + CHITCHAT_ECHO_P(port, version); + CHITCHAT_ECHOPAIR_P(port, " stored settings retrieved (", eeprom_index - (EEPROM_OFFSET)); + CHITCHAT_ECHOPAIR_P(port, " bytes; crc ", (uint32_t)working_crc); + CHITCHAT_ECHOLNPGM_P(port, ")"); } if (!validating && !eeprom_error) postprocess(); @@ -1683,31 +1737,27 @@ void MarlinSettings::postprocess() { SERIAL_EOL_P(port); #if ENABLED(EEPROM_CHITCHAT) ubl.echo_name(); - SERIAL_ECHOLNPGM_P(port, " initialized.\n"); + CHITCHAT_ECHOLNPGM_P(port, " initialized.\n"); #endif } else { eeprom_error = true; #if ENABLED(EEPROM_CHITCHAT) - SERIAL_PROTOCOLPGM_P(port, "?Can't enable "); + CHITCHAT_ECHOPGM_P(port, "?Can't enable "); ubl.echo_name(); - SERIAL_PROTOCOLLNPGM_P(port, "."); + CHITCHAT_ECHOLNPGM_P(port, "."); #endif ubl.reset(); } if (ubl.storage_slot >= 0) { load_mesh(ubl.storage_slot); - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHOPAIR_P(port, "Mesh ", ubl.storage_slot); - SERIAL_ECHOLNPGM_P(port, " loaded from storage."); - #endif + CHITCHAT_ECHOPAIR_P(port, "Mesh ", ubl.storage_slot); + CHITCHAT_ECHOLNPGM_P(port, " loaded from storage."); } else { ubl.reset(); - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHOLNPGM_P(port, "UBL System reset()"); - #endif + CHITCHAT_ECHOLNPGM_P(port, "UBL System reset()"); } } #endif @@ -1736,13 +1786,15 @@ void MarlinSettings::postprocess() { #if ENABLED(AUTO_BED_LEVELING_UBL) - #if ENABLED(EEPROM_CHITCHAT) - void ubl_invalid_slot(const int s) { - SERIAL_PROTOCOLLNPGM("?Invalid slot."); - SERIAL_PROTOCOL(s); - SERIAL_PROTOCOLLNPGM(" mesh slots available."); - } - #endif + inline void ubl_invalid_slot(const int s) { + #if ENABLED(EEPROM_CHITCHAT) + CHITCHAT_ECHOLNPGM("?Invalid slot."); + CHITCHAT_ECHO(s); + CHITCHAT_ECHOLNPGM(" mesh slots available."); + #else + UNUSED(s); + #endif + } const uint16_t MarlinSettings::meshes_end = persistentStore.capacity() - 129; // 128 (+1 because of the change to capacity rather than last valid address) // is a placeholder for the size of the MAT; the MAT will always @@ -1766,32 +1818,24 @@ void MarlinSettings::postprocess() { #if ENABLED(AUTO_BED_LEVELING_UBL) const int16_t a = calc_num_meshes(); if (!WITHIN(slot, 0, a - 1)) { - #if ENABLED(EEPROM_CHITCHAT) - ubl_invalid_slot(a); - SERIAL_PROTOCOLPAIR("E2END=", persistentStore.capacity() - 1); - SERIAL_PROTOCOLPAIR(" meshes_end=", meshes_end); - SERIAL_PROTOCOLLNPAIR(" slot=", slot); - SERIAL_EOL(); - #endif + ubl_invalid_slot(a); + CHITCHAT_ECHOPAIR("E2END=", persistentStore.capacity() - 1); + CHITCHAT_ECHOPAIR(" meshes_end=", meshes_end); + CHITCHAT_ECHOLNPAIR(" slot=", slot); + CHITCHAT_EOL(); return; } int pos = mesh_slot_offset(slot); uint16_t crc = 0; + // Write crc to MAT along with other data, or just tack on to the beginning or end persistentStore.access_start(); const bool status = persistentStore.write_data(pos, (uint8_t *)&ubl.z_values, sizeof(ubl.z_values), &crc); persistentStore.access_finish(); - if (status) - SERIAL_PROTOCOLPGM("?Unable to save mesh data.\n"); - - // Write crc to MAT along with other data, or just tack on to the beginning or end - - #if ENABLED(EEPROM_CHITCHAT) - if (!status) - SERIAL_PROTOCOLLNPAIR("Mesh saved in slot ", slot); - #endif + if (status) SERIAL_ECHOPGM("?Unable to save mesh data.\n"); + else CHITCHAT_ECHOLNPAIR("Mesh saved in slot ", slot); #else @@ -1807,9 +1851,7 @@ void MarlinSettings::postprocess() { const int16_t a = settings.calc_num_meshes(); if (!WITHIN(slot, 0, a - 1)) { - #if ENABLED(EEPROM_CHITCHAT) - ubl_invalid_slot(a); - #endif + ubl_invalid_slot(a); return; } @@ -1821,13 +1863,9 @@ void MarlinSettings::postprocess() { const uint16_t status = persistentStore.read_data(pos, dest, sizeof(ubl.z_values), &crc); persistentStore.access_finish(); - if (status) - SERIAL_PROTOCOLPGM("?Unable to load mesh data.\n"); + if (status) SERIAL_ECHOPGM("?Unable to load mesh data.\n"); + else CHITCHAT_ECHOLNPAIR("Mesh loaded from slot ", slot); - #if ENABLED(EEPROM_CHITCHAT) - else - SERIAL_PROTOCOLLNPAIR("Mesh loaded from slot ", slot); - #endif EEPROM_FINISH(); #else @@ -1845,10 +1883,7 @@ void MarlinSettings::postprocess() { #else // !EEPROM_SETTINGS bool MarlinSettings::save(PORTARG_SOLO) { - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ERROR_START_P(port); - SERIAL_ERRORLNPGM_P(port, "EEPROM disabled"); - #endif + CHITCHAT_ERROR_MSG_P(port, "EEPROM disabled"); return false; } @@ -1936,39 +1971,13 @@ void MarlinSettings::reset(PORTARG_SOLO) { // Servo Angles // - #if HAS_SERVOS && ENABLED(EDITABLE_SERVO_ANGLES) + #if ENABLED(EDITABLE_SERVO_ANGLES) + COPY(servo_angles, base_servo_angles); + #endif - #if ENABLED(SWITCHING_EXTRUDER) - - #if EXTRUDERS > 3 - #define REQ_ANGLES 4 - #else - #define REQ_ANGLES 2 - #endif - constexpr uint16_t sesa[] = SWITCHING_EXTRUDER_SERVO_ANGLES; - static_assert(COUNT(sesa) == REQ_ANGLES, "SWITCHING_EXTRUDER_SERVO_ANGLES needs " STRINGIFY(REQ_ANGLES) " angles."); - servo_angles[SWITCHING_EXTRUDER_SERVO_NR][0] = sesa[0]; - servo_angles[SWITCHING_EXTRUDER_SERVO_NR][1] = sesa[1]; - #if EXTRUDERS > 3 - servo_angles[SWITCHING_EXTRUDER_E23_SERVO_NR][0] = sesa[2]; - servo_angles[SWITCHING_EXTRUDER_E23_SERVO_NR][1] = sesa[3]; - #endif - - #elif ENABLED(SWITCHING_NOZZLE) - - constexpr uint16_t snsa[2] = SWITCHING_NOZZLE_SERVO_ANGLES; - servo_angles[SWITCHING_NOZZLE_SERVO_NR][0] = snsa[0]; - servo_angles[SWITCHING_NOZZLE_SERVO_NR][1] = snsa[1]; - - #elif defined(Z_SERVO_ANGLES) && defined(Z_PROBE_SERVO_NR) - - constexpr uint16_t zsa[2] = Z_SERVO_ANGLES; - servo_angles[Z_PROBE_SERVO_NR][0] = zsa[0]; - servo_angles[Z_PROBE_SERVO_NR][1] = zsa[1]; - - #endif - - #endif // HAS_SERVOS && EDITABLE_SERVO_ANGLES + // + // Endstop Adjustments + // #if ENABLED(DELTA) const float adj[ABC] = DELTA_ENDSTOP_ADJ, dta[ABC] = DELTA_TOWER_ANGLE_TRIM; @@ -2027,15 +2036,23 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif + // + // Preheat parameters + // + #if HAS_LCD_MENU - lcd_preheat_hotend_temp[0] = PREHEAT_1_TEMP_HOTEND; - lcd_preheat_hotend_temp[1] = PREHEAT_2_TEMP_HOTEND; - lcd_preheat_bed_temp[0] = PREHEAT_1_TEMP_BED; - lcd_preheat_bed_temp[1] = PREHEAT_2_TEMP_BED; - lcd_preheat_fan_speed[0] = PREHEAT_1_FAN_SPEED; - lcd_preheat_fan_speed[1] = PREHEAT_2_FAN_SPEED; + ui.preheat_hotend_temp[0] = PREHEAT_1_TEMP_HOTEND; + ui.preheat_hotend_temp[1] = PREHEAT_2_TEMP_HOTEND; + ui.preheat_bed_temp[0] = PREHEAT_1_TEMP_BED; + ui.preheat_bed_temp[1] = PREHEAT_2_TEMP_BED; + ui.preheat_fan_speed[0] = PREHEAT_1_FAN_SPEED; + ui.preheat_fan_speed[1] = PREHEAT_2_FAN_SPEED; #endif + // + // Hotend PID + // + #if ENABLED(PIDTEMP) HOTEND_LOOP() { PID_PARAM(Kp, e) = float(DEFAULT_Kp); @@ -2045,10 +2062,19 @@ void MarlinSettings::reset(PORTARG_SOLO) { PID_PARAM(Kc, e) = DEFAULT_Kc; #endif } - #if ENABLED(PID_EXTRUSION_SCALING) - thermalManager.lpq_len = 20; // default last-position-queue size - #endif - #endif // PIDTEMP + #endif + + // + // PID Extrusion Scaling + // + + #if ENABLED(PID_EXTRUSION_SCALING) + thermalManager.lpq_len = 20; // Default last-position-queue size + #endif + + // + // Heated Bed PID + // #if ENABLED(PIDTEMPBED) thermalManager.bed_pid.Kp = DEFAULT_bedKp; @@ -2056,14 +2082,34 @@ void MarlinSettings::reset(PORTARG_SOLO) { thermalManager.bed_pid.Kd = scalePID_d(DEFAULT_bedKd); #endif + // + // LCD Contrast + // + #if HAS_LCD_CONTRAST - lcd_contrast = DEFAULT_LCD_CONTRAST; + ui.set_contrast(DEFAULT_LCD_CONTRAST); #endif + // + // Power-Loss Recovery + // + + #if ENABLED(POWER_LOSS_RECOVERY) + recovery.enable(true); + #endif + + // + // Firmware Retraction + // + #if ENABLED(FWRETRACT) fwretract.reset(); #endif + // + // Volumetric & Filament Size + // + #if DISABLED(NO_VOLUMETRICS) parser.volumetric_enabled = @@ -2088,16 +2134,36 @@ void MarlinSettings::reset(PORTARG_SOLO) { reset_stepper_drivers(); + // + // Linear Advance + // + #if ENABLED(LIN_ADVANCE) LOOP_L_N(i, EXTRUDERS) planner.extruder_advance_K[i] = LIN_ADVANCE_K; #endif + // + // Motor Current PWM + // + #if HAS_MOTOR_CURRENT_PWM uint32_t tmp_motor_current_setting[3] = PWM_MOTOR_CURRENT; for (uint8_t q = 3; q--;) stepper.digipot_current(q, (stepper.motor_current_setting[q] = tmp_motor_current_setting[q])); #endif + // + // CNC Coordinate System + // + + #if ENABLED(CNC_COORDINATE_SYSTEMS) + (void)gcode.select_coordinate_system(-1); // Go back to machine space + #endif + + // + // Skew Correction + // + #if ENABLED(SKEW_CORRECTION_GCODE) planner.skew_factor.xy = XY_SKEW_FACTOR; #if ENABLED(SKEW_CORRECTION_FOR_Z) @@ -2106,6 +2172,10 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif #endif + // + // Advanced Pause filament load & unload lengths + // + #if ENABLED(ADVANCED_PAUSE_FEATURE) for (uint8_t e = 0; e < EXTRUDERS; e++) { fc_settings[e].unload_length = FILAMENT_CHANGE_UNLOAD_LENGTH; @@ -2115,15 +2185,15 @@ void MarlinSettings::reset(PORTARG_SOLO) { postprocess(); - #if ENABLED(EEPROM_CHITCHAT) - SERIAL_ECHO_START_P(port); - SERIAL_ECHOLNPGM_P(port, "Hardcoded Default Settings Loaded"); - #endif + CHITCHAT_ECHO_START_P(port); + CHITCHAT_ECHOLNPGM_P(port, "Hardcoded Default Settings Loaded"); } #if DISABLED(DISABLE_M503) - #define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START_P(port); }while(0) + #define CONFIG_ECHO_START() do{ if (!forReplay) SERIAL_ECHO_START_P(port); }while(0) + #define CONFIG_ECHO_MSG(STR) do{ CONFIG_ECHO_START(); SERIAL_ECHOLNPGM_P(port, STR); }while(0) + #define CONFIG_ECHO_HEADING(STR) do{ if (!forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOLNPGM_P(port, STR); } }while(0) #if HAS_TRINAMIC void say_M906(PORTARG_SOLO) { SERIAL_ECHOPGM_P(port, " M906"); } @@ -2172,7 +2242,7 @@ void MarlinSettings::reset(PORTARG_SOLO) { /** * Announce current units, in case inches are being displayed */ - CONFIG_ECHO_START; + CONFIG_ECHO_START(); #if ENABLED(INCH_MODE_SUPPORT) SERIAL_ECHOPGM_P(port, " G2"); SERIAL_CHAR_P(port, parser.linear_unit_factor == 1.0 ? '1' : '0'); @@ -2188,7 +2258,7 @@ void MarlinSettings::reset(PORTARG_SOLO) { // Temperature units - for Ultipanel temperature options - CONFIG_ECHO_START; + CONFIG_ECHO_START(); #if ENABLED(TEMPERATURE_UNITS_SUPPORT) SERIAL_ECHOPGM_P(port, " M149 "); SERIAL_CHAR_P(port, parser.temp_units_code()); @@ -2208,7 +2278,7 @@ void MarlinSettings::reset(PORTARG_SOLO) { * Volumetric extrusion M200 */ if (!forReplay) { - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPGM_P(port, "Filament settings:"); if (parser.volumetric_enabled) SERIAL_EOL_P(port); @@ -2216,27 +2286,27 @@ void MarlinSettings::reset(PORTARG_SOLO) { SERIAL_ECHOLNPGM_P(port, " Disabled"); } - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M200 D", LINEAR_UNIT(planner.filament_size[0])); SERIAL_EOL_P(port); #if EXTRUDERS > 1 - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M200 T1 D", LINEAR_UNIT(planner.filament_size[1])); SERIAL_EOL_P(port); #if EXTRUDERS > 2 - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M200 T2 D", LINEAR_UNIT(planner.filament_size[2])); SERIAL_EOL_P(port); #if EXTRUDERS > 3 - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M200 T3 D", LINEAR_UNIT(planner.filament_size[3])); SERIAL_EOL_P(port); #if EXTRUDERS > 4 - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M200 T4 D", LINEAR_UNIT(planner.filament_size[4])); SERIAL_EOL_P(port); #if EXTRUDERS > 5 - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M200 T5 D", LINEAR_UNIT(planner.filament_size[5])); SERIAL_EOL_P(port); #endif // EXTRUDERS > 5 @@ -2245,18 +2315,13 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif // EXTRUDERS > 2 #endif // EXTRUDERS > 1 - if (!parser.volumetric_enabled) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, " M200 D0"); - } + if (!parser.volumetric_enabled) + CONFIG_ECHO_MSG(" M200 D0"); #endif // !NO_VOLUMETRICS - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Steps per unit:"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Steps per unit:"); + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M92 X", LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS])); SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS])); SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(planner.settings.axis_steps_per_mm[Z_AXIS])); @@ -2265,18 +2330,15 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif SERIAL_EOL_P(port); #if ENABLED(DISTINCT_E_FACTORS) - CONFIG_ECHO_START; + CONFIG_ECHO_START(); for (uint8_t i = 0; i < E_STEPPERS; i++) { SERIAL_ECHOPAIR_P(port, " M92 T", (int)i); SERIAL_ECHOLNPAIR_P(port, " E", VOLUMETRIC_UNIT(planner.settings.axis_steps_per_mm[E_AXIS + i])); } #endif - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Maximum feedrates (units/s):"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Maximum feedrates (units/s):"); + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M203 X", LINEAR_UNIT(planner.settings.max_feedrate_mm_s[X_AXIS])); SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(planner.settings.max_feedrate_mm_s[Y_AXIS])); SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(planner.settings.max_feedrate_mm_s[Z_AXIS])); @@ -2285,18 +2347,15 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif SERIAL_EOL_P(port); #if ENABLED(DISTINCT_E_FACTORS) - CONFIG_ECHO_START; + CONFIG_ECHO_START(); for (uint8_t i = 0; i < E_STEPPERS; i++) { SERIAL_ECHOPAIR_P(port, " M203 T", (int)i); SERIAL_ECHOLNPAIR_P(port, " E", VOLUMETRIC_UNIT(planner.settings.max_feedrate_mm_s[E_AXIS + i])); } #endif - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Maximum Acceleration (units/s2):"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Maximum Acceleration (units/s2):"); + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M201 X", LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[X_AXIS])); SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[Y_AXIS])); SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[Z_AXIS])); @@ -2305,24 +2364,21 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif SERIAL_EOL_P(port); #if ENABLED(DISTINCT_E_FACTORS) - CONFIG_ECHO_START; + CONFIG_ECHO_START(); for (uint8_t i = 0; i < E_STEPPERS; i++) { SERIAL_ECHOPAIR_P(port, " M201 T", (int)i); SERIAL_ECHOLNPAIR_P(port, " E", VOLUMETRIC_UNIT(planner.settings.max_acceleration_mm_per_s2[E_AXIS + i])); } #endif - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Acceleration (units/s2): P R T"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Acceleration (units/s2): P R T"); + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M204 P", LINEAR_UNIT(planner.settings.acceleration)); SERIAL_ECHOPAIR_P(port, " R", LINEAR_UNIT(planner.settings.retract_acceleration)); SERIAL_ECHOLNPAIR_P(port, " T", LINEAR_UNIT(planner.settings.travel_acceleration)); if (!forReplay) { - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPGM_P(port, "Advanced: B S T"); #if ENABLED(JUNCTION_DEVIATION) SERIAL_ECHOPGM_P(port, " J"); @@ -2335,7 +2391,7 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif SERIAL_EOL_P(port); } - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M205 B", LINEAR_UNIT(planner.settings.min_segment_time_us)); SERIAL_ECHOPAIR_P(port, " S", LINEAR_UNIT(planner.settings.min_feedrate_mm_s)); SERIAL_ECHOPAIR_P(port, " T", LINEAR_UNIT(planner.settings.min_travel_feedrate_mm_s)); @@ -2355,29 +2411,21 @@ void MarlinSettings::reset(PORTARG_SOLO) { SERIAL_EOL_P(port); #if HAS_M206_COMMAND - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Home offset:"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Home offset:"); + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M206 X", LINEAR_UNIT(home_offset[X_AXIS])); SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(home_offset[Y_AXIS])); SERIAL_ECHOLNPAIR_P(port, " Z", LINEAR_UNIT(home_offset[Z_AXIS])); #endif #if HAS_HOTEND_OFFSET - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Hotend offsets:"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Hotend offsets:"); + CONFIG_ECHO_START(); for (uint8_t e = 1; e < HOTENDS; e++) { SERIAL_ECHOPAIR_P(port, " M218 T", (int)e); SERIAL_ECHOPAIR_P(port, " X", LINEAR_UNIT(hotend_offset[X_AXIS][e])); SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e])); - SERIAL_ECHO_P(port, " Z"); - SERIAL_ECHO_F_P(port, LINEAR_UNIT(hotend_offset[Z_AXIS][e]), 3); - SERIAL_EOL_P(port); + SERIAL_ECHOLNPAIR_F_P(port, " Z", LINEAR_UNIT(hotend_offset[Z_AXIS][e]), 3); } #endif @@ -2388,29 +2436,23 @@ void MarlinSettings::reset(PORTARG_SOLO) { #if ENABLED(MESH_BED_LEVELING) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Mesh Bed Leveling:"); - } + CONFIG_ECHO_HEADING("Mesh Bed Leveling:"); #elif ENABLED(AUTO_BED_LEVELING_UBL) if (!forReplay) { - CONFIG_ECHO_START; + CONFIG_ECHO_START(); ubl.echo_name(); SERIAL_ECHOLNPGM_P(port, ":"); } #elif HAS_ABL - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Auto Bed Leveling:"); - } + CONFIG_ECHO_HEADING("Auto Bed Leveling:"); #endif - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M420 S", planner.leveling_active ? 1 : 0); #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(planner.z_fade_height)); @@ -2422,12 +2464,10 @@ void MarlinSettings::reset(PORTARG_SOLO) { if (leveling_is_valid()) { for (uint8_t py = 0; py < GRID_MAX_POINTS_Y; py++) { for (uint8_t px = 0; px < GRID_MAX_POINTS_X; px++) { - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " G29 S3 X", (int)px + 1); SERIAL_ECHOPAIR_P(port, " Y", (int)py + 1); - SERIAL_ECHOPGM_P(port, " Z"); - SERIAL_ECHO_F_P(port, LINEAR_UNIT(mbl.z_values[px][py]), 5); - SERIAL_EOL_P(port); + SERIAL_ECHOLNPAIR_F_P(port, " Z", LINEAR_UNIT(mbl.z_values[px][py]), 5); } } } @@ -2442,19 +2482,17 @@ void MarlinSettings::reset(PORTARG_SOLO) { SERIAL_ECHOLNPGM_P(port, " meshes.\n"); } -// ubl.report_current_mesh(PORTVAR_SOLO); // This is too verbose for large mesh's. A better (more terse) - // solution needs to be found. + //ubl.report_current_mesh(PORTVAR_SOLO); // This is too verbose for large meshes. A better (more terse) + // solution needs to be found. #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) if (leveling_is_valid()) { for (uint8_t py = 0; py < GRID_MAX_POINTS_Y; py++) { for (uint8_t px = 0; px < GRID_MAX_POINTS_X; px++) { - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " G29 W I", (int)px); SERIAL_ECHOPAIR_P(port, " J", (int)py); - SERIAL_ECHOPGM_P(port, " Z"); - SERIAL_ECHO_F_P(port, LINEAR_UNIT(z_values[px][py]), 5); - SERIAL_EOL_P(port); + SERIAL_ECHOLNPAIR_F_P(port, " Z", LINEAR_UNIT(z_values[px][py]), 5); } } } @@ -2463,12 +2501,9 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif // HAS_LEVELING - #if HAS_SERVOS && ENABLED(EDITABLE_SERVO_ANGLES) + #if ENABLED(EDITABLE_SERVO_ANGLES) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Servo Angles:"); - } + CONFIG_ECHO_HEADING("Servo Angles:"); for (uint8_t i = 0; i < NUM_SERVOS; i++) { switch (i) { #if ENABLED(SWITCHING_EXTRUDER) @@ -2481,7 +2516,7 @@ void MarlinSettings::reset(PORTARG_SOLO) { #elif defined(Z_SERVO_ANGLES) && defined(Z_PROBE_SERVO_NR) case Z_PROBE_SERVO_NR: #endif - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M281 P", int(i)); SERIAL_ECHOPAIR_P(port, " L", servo_angles[i][0]); SERIAL_ECHOPAIR_P(port, " U", servo_angles[i][1]); @@ -2490,15 +2525,12 @@ void MarlinSettings::reset(PORTARG_SOLO) { } } - #endif // HAS_SERVOS && EDITABLE_SERVO_ANGLES + #endif // EDITABLE_SERVO_ANGLES #if HAS_SCARA_OFFSET - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "SCARA settings: S P T"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("SCARA settings: S P T"); + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M665 S", delta_segments_per_second); SERIAL_ECHOPAIR_P(port, " P", scara_home_offset[A_AXIS]); SERIAL_ECHOPAIR_P(port, " T", scara_home_offset[B_AXIS]); @@ -2507,19 +2539,14 @@ void MarlinSettings::reset(PORTARG_SOLO) { #elif ENABLED(DELTA) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Endstop adjustment:"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Endstop adjustment:"); + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M666 X", LINEAR_UNIT(delta_endstop_adj[X_AXIS])); SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(delta_endstop_adj[Y_AXIS])); SERIAL_ECHOLNPAIR_P(port, " Z", LINEAR_UNIT(delta_endstop_adj[Z_AXIS])); - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Delta settings: L R H S B XYZ"); - } - CONFIG_ECHO_START; + + CONFIG_ECHO_HEADING("Delta settings: L R H S B XYZ"); + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M665 L", LINEAR_UNIT(delta_diagonal_rod)); SERIAL_ECHOPAIR_P(port, " R", LINEAR_UNIT(delta_radius)); SERIAL_ECHOPAIR_P(port, " H", LINEAR_UNIT(delta_height)); @@ -2532,11 +2559,8 @@ void MarlinSettings::reset(PORTARG_SOLO) { #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Endstop adjustment:"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Endstop adjustment:"); + CONFIG_ECHO_START(); SERIAL_ECHOPGM_P(port, " M666"); #if ENABLED(X_DUAL_ENDSTOPS) SERIAL_ECHOPAIR_P(port, " X", LINEAR_UNIT(endstops.x2_endstop_adj)); @@ -2546,7 +2570,7 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif #if ENABLED(Z_TRIPLE_ENDSTOPS) SERIAL_ECHOLNPAIR_P(port, "S1 Z", LINEAR_UNIT(endstops.z2_endstop_adj)); - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M666 S2 Z", LINEAR_UNIT(endstops.z3_endstop_adj)); #elif ENABLED(Z_DUAL_ENDSTOPS) SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(endstops.z2_endstop_adj)); @@ -2557,31 +2581,25 @@ void MarlinSettings::reset(PORTARG_SOLO) { #if HAS_LCD_MENU - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Material heatup parameters:"); - } - for (uint8_t i = 0; i < COUNT(lcd_preheat_hotend_temp); i++) { - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Material heatup parameters:"); + for (uint8_t i = 0; i < COUNT(ui.preheat_hotend_temp); i++) { + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M145 S", (int)i); - SERIAL_ECHOPAIR_P(port, " H", TEMP_UNIT(lcd_preheat_hotend_temp[i])); - SERIAL_ECHOPAIR_P(port, " B", TEMP_UNIT(lcd_preheat_bed_temp[i])); - SERIAL_ECHOLNPAIR_P(port, " F", int(lcd_preheat_fan_speed[i])); + SERIAL_ECHOPAIR_P(port, " H", TEMP_UNIT(ui.preheat_hotend_temp[i])); + SERIAL_ECHOPAIR_P(port, " B", TEMP_UNIT(ui.preheat_bed_temp[i])); + SERIAL_ECHOLNPAIR_P(port, " F", int(ui.preheat_fan_speed[i])); } #endif #if HAS_PID_HEATING - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "PID settings:"); - } + CONFIG_ECHO_HEADING("PID settings:"); #if ENABLED(PIDTEMP) #if HOTENDS > 1 if (forReplay) { HOTEND_LOOP() { - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M301 E", e); SERIAL_ECHOPAIR_P(port, " P", PID_PARAM(Kp, e)); SERIAL_ECHOPAIR_P(port, " I", unscalePID_i(PID_PARAM(Ki, e))); @@ -2597,7 +2615,7 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif // HOTENDS > 1 // !forReplay || HOTENDS == 1 { - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echo values for E0 SERIAL_ECHOPAIR_P(port, " I", unscalePID_i(PID_PARAM(Ki, 0))); SERIAL_ECHOPAIR_P(port, " D", unscalePID_d(PID_PARAM(Kd, 0))); @@ -2610,7 +2628,7 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif // PIDTEMP #if ENABLED(PIDTEMPBED) - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M304 P", thermalManager.bed_pid.Kp); SERIAL_ECHOPAIR_P(port, " I", unscalePID_i(thermalManager.bed_pid.Ki)); SERIAL_ECHOPAIR_P(port, " D", unscalePID_d(thermalManager.bed_pid.Kd)); @@ -2620,42 +2638,36 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif // PIDTEMP || PIDTEMPBED #if HAS_LCD_CONTRAST - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "LCD Contrast:"); - } - CONFIG_ECHO_START; - SERIAL_ECHOLNPAIR_P(port, " M250 C", lcd_contrast); + CONFIG_ECHO_HEADING("LCD Contrast:"); + CONFIG_ECHO_START(); + SERIAL_ECHOLNPAIR_P(port, " M250 C", ui.contrast); + #endif + + #if ENABLED(POWER_LOSS_RECOVERY) + CONFIG_ECHO_HEADING("Power-Loss Recovery:"); + CONFIG_ECHO_START(); + SERIAL_ECHOLNPAIR_P(port, " M413 S", int(recovery.enabled)); #endif #if ENABLED(FWRETRACT) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Retract: S F Z"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Retract: S F Z"); + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M207 S", LINEAR_UNIT(fwretract.settings.retract_length)); SERIAL_ECHOPAIR_P(port, " W", LINEAR_UNIT(fwretract.settings.swap_retract_length)); SERIAL_ECHOPAIR_P(port, " F", MMS_TO_MMM(LINEAR_UNIT(fwretract.settings.retract_feedrate_mm_s))); SERIAL_ECHOLNPAIR_P(port, " Z", LINEAR_UNIT(fwretract.settings.retract_zraise)); - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Recover: S F"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Recover: S F"); + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M208 S", LINEAR_UNIT(fwretract.settings.retract_recover_length)); SERIAL_ECHOPAIR_P(port, " W", LINEAR_UNIT(fwretract.settings.swap_retract_recover_length)); SERIAL_ECHOLNPAIR_P(port, " F", MMS_TO_MMM(LINEAR_UNIT(fwretract.settings.retract_recover_feedrate_mm_s))); #if ENABLED(FWRETRACT_AUTORETRACT) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Auto-Retract: S=0 to disable, 1 to interpret E-only moves as retract/recover"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Auto-Retract: S=0 to disable, 1 to interpret E-only moves as retract/recover"); + CONFIG_ECHO_START(); SERIAL_ECHOLNPAIR_P(port, " M209 S", fwretract.autoretract_enabled ? 1 : 0); #endif // FWRETRACT_AUTORETRACT @@ -2667,11 +2679,11 @@ void MarlinSettings::reset(PORTARG_SOLO) { */ #if HAS_BED_PROBE if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOPGM_P(port, "Z-Probe Offset (mm):"); + CONFIG_ECHO_START(); + SERIAL_ECHOPGM_P(port, "Z-Probe Offset"); SAY_UNITS_P(port, true); } - CONFIG_ECHO_START; + CONFIG_ECHO_START(); SERIAL_ECHOLNPAIR_P(port, " M851 Z", LINEAR_UNIT(zprobe_zoffset)); #endif @@ -2679,23 +2691,14 @@ void MarlinSettings::reset(PORTARG_SOLO) { * Bed Skew Correction */ #if ENABLED(SKEW_CORRECTION_GCODE) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Skew Factor: "); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Skew Factor: "); + CONFIG_ECHO_START(); #if ENABLED(SKEW_CORRECTION_FOR_Z) - SERIAL_ECHOPGM_P(port, " M852 I"); - SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.skew_factor.xy), 6); - SERIAL_ECHOPGM_P(port, " J"); - SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.skew_factor.xz), 6); - SERIAL_ECHOPGM_P(port, " K"); - SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.skew_factor.yz), 6); - SERIAL_EOL_P(port); + SERIAL_ECHOPAIR_F_P(port, " M852 I", LINEAR_UNIT(planner.skew_factor.xy), 6); + SERIAL_ECHOPAIR_F_P(port, " J", LINEAR_UNIT(planner.skew_factor.xz), 6); + SERIAL_ECHOLNPAIR_F_P(port, " K", LINEAR_UNIT(planner.skew_factor.yz), 6); #else - SERIAL_ECHOPGM_P(port, " M852 S"); - SERIAL_ECHO_F_P(port, LINEAR_UNIT(planner.skew_factor.xy), 6); - SERIAL_EOL_P(port); + SERIAL_ECHOLNPAIR_F_P(port, " M852 S", LINEAR_UNIT(planner.skew_factor.xy), 6); #endif #endif @@ -2704,11 +2707,8 @@ void MarlinSettings::reset(PORTARG_SOLO) { /** * TMC stepper driver current */ - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Stepper driver current:"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Stepper driver current:"); + CONFIG_ECHO_START(); #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z) say_M906(PORTVAR_SOLO); #endif @@ -2777,11 +2777,8 @@ void MarlinSettings::reset(PORTARG_SOLO) { * TMC Hybrid Threshold */ #if ENABLED(HYBRID_THRESHOLD) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Hybrid Threshold:"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Hybrid Threshold:"); + CONFIG_ECHO_START(); #if AXIS_HAS_STEALTHCHOP(X) || AXIS_HAS_STEALTHCHOP(Y) || AXIS_HAS_STEALTHCHOP(Z) say_M913(PORTVAR_SOLO); #endif @@ -2852,11 +2849,8 @@ void MarlinSettings::reset(PORTARG_SOLO) { * TMC Sensorless homing thresholds */ #if USE_SENSORLESS - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "TMC2130 StallGuard threshold:"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("TMC2130 StallGuard threshold:"); + CONFIG_ECHO_START(); #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS say_M914(PORTVAR_SOLO); #if X_SENSORLESS @@ -2904,12 +2898,8 @@ void MarlinSettings::reset(PORTARG_SOLO) { * Linear Advance */ #if ENABLED(LIN_ADVANCE) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Linear Advance:"); - } - - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Linear Advance:"); + CONFIG_ECHO_START(); #if EXTRUDERS < 2 SERIAL_ECHOLNPAIR_P(port, " M900 K", planner.extruder_advance_K[0]); #else @@ -2921,11 +2911,8 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif #if HAS_MOTOR_CURRENT_PWM - CONFIG_ECHO_START; - if (!forReplay) { - SERIAL_ECHOLNPGM_P(port, "Stepper motor currents:"); - CONFIG_ECHO_START; - } + CONFIG_ECHO_HEADING("Stepper motor currents:"); + CONFIG_ECHO_START(); SERIAL_ECHOPAIR_P(port, " M907 X", stepper.motor_current_setting[0]); SERIAL_ECHOPAIR_P(port, " Z", stepper.motor_current_setting[1]); SERIAL_ECHOPAIR_P(port, " E", stepper.motor_current_setting[2]); @@ -2936,11 +2923,8 @@ void MarlinSettings::reset(PORTARG_SOLO) { * Advanced Pause filament load & unload lengths */ #if ENABLED(ADVANCED_PAUSE_FEATURE) - if (!forReplay) { - CONFIG_ECHO_START; - SERIAL_ECHOLNPGM_P(port, "Filament load/unload lengths:"); - } - CONFIG_ECHO_START; + CONFIG_ECHO_HEADING("Filament load/unload lengths:"); + CONFIG_ECHO_START(); #if EXTRUDERS == 1 say_M603(PORTVAR_SOLO); SERIAL_ECHOPAIR_P(port, "L", LINEAR_UNIT(fc_settings[0].load_length)); @@ -2949,27 +2933,27 @@ void MarlinSettings::reset(PORTARG_SOLO) { say_M603(PORTVAR_SOLO); SERIAL_ECHOPAIR_P(port, "T0 L", LINEAR_UNIT(fc_settings[0].load_length)); SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(fc_settings[0].unload_length)); - CONFIG_ECHO_START; + CONFIG_ECHO_START(); say_M603(PORTVAR_SOLO); SERIAL_ECHOPAIR_P(port, "T1 L", LINEAR_UNIT(fc_settings[1].load_length)); SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(fc_settings[1].unload_length)); #if EXTRUDERS > 2 - CONFIG_ECHO_START; + CONFIG_ECHO_START(); say_M603(PORTVAR_SOLO); SERIAL_ECHOPAIR_P(port, "T2 L", LINEAR_UNIT(fc_settings[2].load_length)); SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(fc_settings[2].unload_length)); #if EXTRUDERS > 3 - CONFIG_ECHO_START; + CONFIG_ECHO_START(); say_M603(PORTVAR_SOLO); SERIAL_ECHOPAIR_P(port, "T3 L", LINEAR_UNIT(fc_settings[3].load_length)); SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(fc_settings[3].unload_length)); #if EXTRUDERS > 4 - CONFIG_ECHO_START; + CONFIG_ECHO_START(); say_M603(PORTVAR_SOLO); SERIAL_ECHOPAIR_P(port, "T4 L", LINEAR_UNIT(fc_settings[4].load_length)); SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(fc_settings[4].unload_length)); #if EXTRUDERS > 5 - CONFIG_ECHO_START; + CONFIG_ECHO_START(); say_M603(PORTVAR_SOLO); SERIAL_ECHOPAIR_P(port, "T5 L", LINEAR_UNIT(fc_settings[5].load_length)); SERIAL_ECHOLNPAIR_P(port, " U", LINEAR_UNIT(fc_settings[5].unload_length)); @@ -2981,11 +2965,8 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif // ADVANCED_PAUSE_FEATURE #if EXTRUDERS > 1 - CONFIG_ECHO_START; - if (!forReplay) { - SERIAL_ECHOLNPGM_P(port, "Tool-changing:"); - CONFIG_ECHO_START; - } + CONFIG_ECHO_HEADING("Tool-changing:"); + CONFIG_ECHO_START(); M217_report(true); #endif } diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 28e0d92f69..41ac8a37d9 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -42,7 +42,7 @@ Endstops endstops; -// public: +// private: bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load() volatile uint8_t Endstops::hit_state; @@ -259,15 +259,13 @@ void Endstops::poll() { void Endstops::enable_globally(const bool onoff) { enabled_globally = enabled = onoff; - - update(); + resync(); } // Enable / disable endstop checking void Endstops::enable(const bool onoff) { enabled = onoff; - - update(); + resync(); } // Disable / Enable endstops based on ENSTOPS_ONLY_FOR_HOMING and global enable @@ -287,11 +285,24 @@ void Endstops::not_homing() { #if HAS_BED_PROBE void Endstops::enable_z_probe(const bool onoff) { z_probe_enabled = onoff; - - update(); + resync(); } #endif +// Get the stable endstop states when enabled +void Endstops::resync() { + if (!abort_enabled()) return; // If endstops/probes are disabled the loop below can hang + + #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) + update(); + #else + safe_delay(2); // Wait for Temperature ISR to run at least once (runs at 1KHz) + #endif + #if ENDSTOP_NOISE_THRESHOLD + while (endstop_poll_count) safe_delay(1); + #endif +} + #if ENABLED(PINS_DEBUGGING) void Endstops::run_monitor() { if (!monitor_flag) return; @@ -337,7 +348,7 @@ void Endstops::event_handler() { SERIAL_EOL(); #if ENABLED(ULTRA_LCD) - lcd_status_printf_P(0, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP); + ui.status_printf_P(0, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP); #endif #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) && ENABLED(SDSUPPORT) @@ -354,13 +365,13 @@ void Endstops::event_handler() { static void print_es_state(const bool is_hit, PGM_P const label=NULL) { if (label) serialprintPGM(label); - SERIAL_PROTOCOLPGM(": "); + SERIAL_ECHOPGM(": "); serialprintPGM(is_hit ? PSTR(MSG_ENDSTOP_HIT) : PSTR(MSG_ENDSTOP_OPEN)); SERIAL_EOL(); } void _O2 Endstops::M119() { - SERIAL_PROTOCOLLNPGM(MSG_M119_REPORT); + SERIAL_ECHOLNPGM(MSG_M119_REPORT); #define ES_REPORT(S) print_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING, PSTR(MSG_##S)) #if HAS_X_MIN ES_REPORT(X_MIN); @@ -430,7 +441,7 @@ void _O2 Endstops::M119() { #endif #endif } - SERIAL_PROTOCOLPGM(MSG_FILAMENT_RUNOUT_SENSOR); + SERIAL_ECHOPGM(MSG_FILAMENT_RUNOUT_SENSOR); if (i > 1) { SERIAL_CHAR(' '); SERIAL_CHAR('0' + i); } print_es_state(digitalRead(pin) != FIL_RUNOUT_INVERTING); } @@ -764,101 +775,104 @@ void Endstops::update() { static uint8_t local_LED_status = 0; uint16_t live_state_local = 0; + #define ES_GET_STATE(S) if (READ(S##_PIN)) SBI(live_state_local, S) + #if HAS_X_MIN - if (READ(X_MIN_PIN)) SBI(live_state_local, X_MIN); + ES_GET_STATE(X_MIN); #endif #if HAS_X_MAX - if (READ(X_MAX_PIN)) SBI(live_state_local, X_MAX); + ES_GET_STATE(X_MAX); #endif #if HAS_Y_MIN - if (READ(Y_MIN_PIN)) SBI(live_state_local, Y_MIN); + ES_GET_STATE(Y_MIN); #endif #if HAS_Y_MAX - if (READ(Y_MAX_PIN)) SBI(live_state_local, Y_MAX); + ES_GET_STATE(Y_MAX); #endif #if HAS_Z_MIN - if (READ(Z_MIN_PIN)) SBI(live_state_local, Z_MIN); + ES_GET_STATE(Z_MIN); #endif #if HAS_Z_MAX - if (READ(Z_MAX_PIN)) SBI(live_state_local, Z_MAX); + ES_GET_STATE(Z_MAX); #endif #if HAS_Z_MIN_PROBE_PIN - if (READ(Z_MIN_PROBE_PIN)) SBI(live_state_local, Z_MIN_PROBE); + ES_GET_STATE(Z_MIN_PROBE); #endif #if HAS_X2_MIN - if (READ(X2_MIN_PIN)) SBI(live_state_local, X2_MIN); + ES_GET_STATE(X2_MIN); #endif #if HAS_X2_MAX - if (READ(X2_MAX_PIN)) SBI(live_state_local, X2_MAX); + ES_GET_STATE(X2_MAX); #endif #if HAS_Y2_MIN - if (READ(Y2_MIN_PIN)) SBI(live_state_local, Y2_MIN); + ES_GET_STATE(Y2_MIN); #endif #if HAS_Y2_MAX - if (READ(Y2_MAX_PIN)) SBI(live_state_local, Y2_MAX); + ES_GET_STATE(Y2_MAX); #endif #if HAS_Z2_MIN - if (READ(Z2_MIN_PIN)) SBI(live_state_local, Z2_MIN); + ES_GET_STATE(Z2_MIN); #endif #if HAS_Z2_MAX - if (READ(Z2_MAX_PIN)) SBI(live_state_local, Z2_MAX); + ES_GET_STATE(Z2_MAX); #endif #if HAS_Z3_MIN - if (READ(Z3_MIN_PIN)) SBI(live_state_local, Z3_MIN); + ES_GET_STATE(Z3_MIN); #endif #if HAS_Z3_MAX - if (READ(Z3_MAX_PIN)) SBI(live_state_local, Z3_MAX); + ES_GET_STATE(Z3_MAX); #endif uint16_t endstop_change = live_state_local ^ old_live_state_local; + #define ES_REPORT_CHANGE(S) if (TEST(endstop_change, S)) SERIAL_ECHOPAIR(" " STRINGIFY(S) ":", TEST(live_state_local, S)) if (endstop_change) { #if HAS_X_MIN - if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR(" X_MIN:", TEST(live_state_local, X_MIN)); + ES_REPORT_CHANGE(X_MIN); #endif #if HAS_X_MAX - if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR(" X_MAX:", TEST(live_state_local, X_MAX)); + ES_REPORT_CHANGE(X_MAX); #endif #if HAS_Y_MIN - if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR(" Y_MIN:", TEST(live_state_local, Y_MIN)); + ES_REPORT_CHANGE(Y_MIN); #endif #if HAS_Y_MAX - if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR(" Y_MAX:", TEST(live_state_local, Y_MAX)); + ES_REPORT_CHANGE(Y_MAX); #endif #if HAS_Z_MIN - if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR(" Z_MIN:", TEST(live_state_local, Z_MIN)); + ES_REPORT_CHANGE(Z_MIN); #endif #if HAS_Z_MAX - if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR(" Z_MAX:", TEST(live_state_local, Z_MAX)); + ES_REPORT_CHANGE(Z_MAX); #endif #if HAS_Z_MIN_PROBE_PIN - if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR(" PROBE:", TEST(live_state_local, Z_MIN_PROBE)); + ES_REPORT_CHANGE(Z_MIN_PROBE); #endif #if HAS_X2_MIN - if (TEST(endstop_change, X2_MIN)) SERIAL_PROTOCOLPAIR(" X2_MIN:", TEST(live_state_local, X2_MIN)); + ES_REPORT_CHANGE(X2_MIN); #endif #if HAS_X2_MAX - if (TEST(endstop_change, X2_MAX)) SERIAL_PROTOCOLPAIR(" X2_MAX:", TEST(live_state_local, X2_MAX)); + ES_REPORT_CHANGE(X2_MAX); #endif #if HAS_Y2_MIN - if (TEST(endstop_change, Y2_MIN)) SERIAL_PROTOCOLPAIR(" Y2_MIN:", TEST(live_state_local, Y2_MIN)); + ES_REPORT_CHANGE(Y2_MIN); #endif #if HAS_Y2_MAX - if (TEST(endstop_change, Y2_MAX)) SERIAL_PROTOCOLPAIR(" Y2_MAX:", TEST(live_state_local, Y2_MAX)); + ES_REPORT_CHANGE(Y2_MAX); #endif #if HAS_Z2_MIN - if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR(" Z2_MIN:", TEST(live_state_local, Z2_MIN)); + ES_REPORT_CHANGE(Z2_MIN); #endif #if HAS_Z2_MAX - if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR(" Z2_MAX:", TEST(live_state_local, Z2_MAX)); + ES_REPORT_CHANGE(Z2_MAX); #endif #if HAS_Z3_MIN - if (TEST(endstop_change, Z3_MIN)) SERIAL_PROTOCOLPAIR(" Z3_MIN:", TEST(live_state_local, Z3_MIN)); + ES_REPORT_CHANGE(Z3_MIN); #endif #if HAS_Z3_MAX - if (TEST(endstop_change, Z3_MAX)) SERIAL_PROTOCOLPAIR(" Z3_MAX:", TEST(live_state_local, Z3_MAX)); + ES_REPORT_CHANGE(Z3_MAX); #endif - SERIAL_PROTOCOLPGM("\n\n"); + SERIAL_ECHOPGM("\n\n"); analogWrite(LED_PIN, local_LED_status); local_LED_status ^= 255; old_live_state_local = live_state_local; diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index f73c17946f..7892ea81da 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -162,6 +162,8 @@ class Endstops { static void enable_z_probe(const bool onoff=true); #endif + static void resync(); + // Debugging of endstops #if ENABLED(PINS_DEBUGGING) static bool monitor_flag; diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 9cd83907c1..532f73974c 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -163,14 +163,10 @@ float cartes[XYZ]; * Output the current position to serial */ void report_current_position() { - SERIAL_PROTOCOLPGM("X:"); - SERIAL_PROTOCOL(LOGICAL_X_POSITION(current_position[X_AXIS])); - SERIAL_PROTOCOLPGM(" Y:"); - SERIAL_PROTOCOL(LOGICAL_Y_POSITION(current_position[Y_AXIS])); - SERIAL_PROTOCOLPGM(" Z:"); - SERIAL_PROTOCOL(LOGICAL_Z_POSITION(current_position[Z_AXIS])); - SERIAL_PROTOCOLPGM(" E:"); - SERIAL_PROTOCOL(current_position[E_AXIS]); + SERIAL_ECHOPAIR("X:", LOGICAL_X_POSITION(current_position[X_AXIS])); + SERIAL_ECHOPAIR(" Y:", LOGICAL_Y_POSITION(current_position[Y_AXIS])); + SERIAL_ECHOPAIR(" Z:", LOGICAL_Z_POSITION(current_position[Z_AXIS])); + SERIAL_ECHOPAIR(" E:", current_position[E_AXIS]); stepper.report_positions(); @@ -967,15 +963,13 @@ void prepare_move_to_destination() { #if ENABLED(PREVENT_COLD_EXTRUSION) if (thermalManager.tooColdToExtrude(active_extruder)) { current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); + SERIAL_ECHO_MSG(MSG_ERR_COLD_EXTRUDE_STOP); } #endif // PREVENT_COLD_EXTRUSION #if ENABLED(PREVENT_LENGTHY_EXTRUDE) if (ABS(destination[E_AXIS] - current_position[E_AXIS]) * planner.e_factor[active_extruder] > (EXTRUDE_MAXLENGTH)) { current_position[E_AXIS] = destination[E_AXIS]; // Behave as if the move really took place, but ignore E part - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); + SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP); } #endif // PREVENT_LENGTHY_EXTRUDE } @@ -1026,7 +1020,7 @@ void prepare_move_to_destination() { SERIAL_ECHOLNPGM(" " MSG_FIRST); #if ENABLED(ULTRA_LCD) - lcd_status_printf_P(0, PSTR(MSG_HOME " %s%s%s " MSG_FIRST), xx ? MSG_X : "", yy ? MSG_Y : "", zz ? MSG_Z : ""); + ui.status_printf_P(0, PSTR(MSG_HOME " %s%s%s " MSG_FIRST), xx ? MSG_X : "", yy ? MSG_Y : "", zz ? MSG_Z : ""); #endif return true; } @@ -1046,8 +1040,7 @@ inline float get_homing_bump_feedrate(const AxisEnum axis) { uint8_t hbd = pgm_read_byte(&homing_bump_divisor[axis]); if (hbd < 1) { hbd = 10; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("Warning: Homing Bump Divisor < 1"); + SERIAL_ECHO_MSG("Warning: Homing Bump Divisor < 1"); } return homing_feedrate(axis) / hbd; } @@ -1120,8 +1113,8 @@ void do_homing_move(const AxisEnum axis, const float distance, const float fr_mm if (axis == Z_AXIS && distance < 0 && thermalManager.isHeatingBed()) { serialprintPGM(msg_wait_for_bed_heating); LCD_MESSAGEPGM(MSG_BED_HEATING); - while (thermalManager.isHeatingBed()) safe_delay(200); - lcd_reset_status(); + thermalManager.wait_for_bed(); + ui.reset_status(); } #endif @@ -1557,10 +1550,8 @@ void homeaxis(const AxisEnum axis) { do_homing_move(axis, delta_endstop_adj[axis] - (MIN_STEPS_PER_SEGMENT + 1) * planner.steps_to_mm[axis] * Z_HOME_DIR); } - #else + #else // CARTESIAN / CORE - // For cartesian/core machines, - // set the axis to its home position set_axis_is_at_home(axis); sync_plan_position(); diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index c185678ad0..dcbd688686 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1181,7 +1181,7 @@ void Planner::check_axes_activity() { if (has_blocks_queued()) { #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) + FANS_LOOP(i) tail_fan_speed[i] = block_buffer[block_buffer_tail].fan_speed[i]; #endif @@ -1204,7 +1204,7 @@ void Planner::check_axes_activity() { } else { #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) tail_fan_speed[i] = fan_speed[i]; + FANS_LOOP(i) tail_fan_speed[i] = fan_speed[i]; #endif #if ENABLED(BARICUDA) @@ -1661,8 +1661,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, position_float[E_AXIS] = target_float[E_AXIS]; #endif de = 0; // no difference - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP); + SERIAL_ECHO_MSG(MSG_ERR_COLD_EXTRUDE_STOP); } #endif // PREVENT_COLD_EXTRUSION #if ENABLED(PREVENT_LENGTHY_EXTRUDE) @@ -1672,8 +1671,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, position_float[E_AXIS] = target_float[E_AXIS]; #endif de = 0; // no difference - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP); + SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP); } #endif // PREVENT_LENGTHY_EXTRUDE } @@ -1751,7 +1749,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) block->fan_speed[i] = fan_speed[i]; + FANS_LOOP(i) block->fan_speed[i] = fan_speed[i]; #endif #if ENABLED(BARICUDA) diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 8cf37f0758..4fe90b9fa7 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -175,13 +175,9 @@ typedef struct { min_travel_feedrate_mm_s; // (mm/s) M205 T - Minimum travel feedrate } planner_settings_t; -#ifndef XY_SKEW_FACTOR +#if DISABLED(SKEW_CORRECTION) #define XY_SKEW_FACTOR 0 -#endif -#ifndef XZ_SKEW_FACTOR #define XZ_SKEW_FACTOR 0 -#endif -#ifndef YZ_SKEW_FACTOR #define YZ_SKEW_FACTOR 0 #endif diff --git a/Marlin/src/module/printcounter.cpp b/Marlin/src/module/printcounter.cpp index 0c6934807b..94b4253188 100644 --- a/Marlin/src/module/printcounter.cpp +++ b/Marlin/src/module/printcounter.cpp @@ -111,7 +111,7 @@ void PrintCounter::saveStats() { void PrintCounter::showStats() { char buffer[21]; - SERIAL_PROTOCOLPGM(MSG_STATS); + SERIAL_ECHOPGM(MSG_STATS); SERIAL_ECHOPGM("Prints: "); SERIAL_ECHO(data.totalPrints); @@ -124,7 +124,7 @@ void PrintCounter::showStats() { - ((isRunning() || isPaused()) ? 1 : 0)); SERIAL_EOL(); - SERIAL_PROTOCOLPGM(MSG_STATS); + SERIAL_ECHOPGM(MSG_STATS); duration_t elapsed = data.printTime; elapsed.toString(buffer); @@ -151,7 +151,7 @@ void PrintCounter::showStats() { #endif SERIAL_EOL(); - SERIAL_PROTOCOLPGM(MSG_STATS); + SERIAL_ECHOPGM(MSG_STATS); SERIAL_ECHOPGM("Filament used: "); SERIAL_ECHO(data.filamentUsed / 1000); diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index bec70918a6..596ebf0182 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -38,7 +38,9 @@ #include "../gcode/gcode.h" #include "../lcd/ultralcd.h" -#include "../Marlin.h" +#if ENABLED(BLTOUCH) || ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(PROBE_TRIGGERED_WHEN_STOWED_TEST) + #include "../Marlin.h" // for stop() +#endif #if HAS_LEVELING #include "../feature/bedlevel/bedlevel.h" @@ -63,6 +65,10 @@ float zprobe_zoffset; // Initialized by settings.load() #include "../feature/tmc_util.h" #endif +#if QUIET_PROBING + #include "stepper_indirection.h" +#endif + #if ENABLED(Z_PROBE_SLED) #ifndef SLED_DOCKING_OFFSET @@ -320,8 +326,7 @@ float zprobe_zoffset; // Initialized by settings.load() // (Measured completion time was 0.65 seconds // after reset, deploy, and stow sequence) if (TEST_BLTOUCH()) { // If it still claims to be triggered... - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_STOP_BLTOUCH); + SERIAL_ERROR_MSG(MSG_STOP_BLTOUCH); stop(); // punt! return true; } @@ -370,15 +375,15 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { BUZZ(100, 698); PGM_P const ds_str = deploy ? PSTR(MSG_MANUAL_DEPLOY) : PSTR(MSG_MANUAL_STOW); - lcd_return_to_status(); // To display the new status message - lcd_setstatusPGM(ds_str, 99); + ui.return_to_status(); // To display the new status message + ui.set_status_P(ds_str, 99); serialprintPGM(ds_str); SERIAL_EOL(); KEEPALIVE_STATE(PAUSED_FOR_USER); wait_for_user = true; while (wait_for_user) idle(); - lcd_reset_status(); + ui.reset_status(); KEEPALIVE_STATE(IN_HANDLER); #endif // PAUSE_BEFORE_DEPLOY_STOW @@ -405,6 +410,10 @@ FORCE_INLINE void probe_specific_action(const bool deploy) { do_blocking_move_to_x(deploy ? Z_PROBE_DEPLOY_X : Z_PROBE_RETRACT_X); + #elif DISABLED(PAUSE_BEFORE_DEPLOY_STOW) + + UNUSED(deploy); + #endif } @@ -446,8 +455,7 @@ bool set_probe_deployed(const bool deploy) { #define _AUE_ARGS #endif if (axis_unhomed_error(_AUE_ARGS)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_STOP_UNHOMED); + SERIAL_ERROR_MSG(MSG_STOP_UNHOMED); stop(); return true; } @@ -475,8 +483,7 @@ bool set_probe_deployed(const bool deploy) { if (PROBE_STOWED() == deploy) { // Unchanged after deploy/stow action? if (IsRunning()) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Z-Probe failed"); + SERIAL_ERROR_MSG("Z-Probe failed"); LCD_ALERTMESSAGEPGM("Err: ZPROBE"); } stop(); @@ -526,8 +533,8 @@ static bool do_probe_move(const float z, const float fr_mm_s) { if (thermalManager.isHeatingBed()) { serialprintPGM(msg_wait_for_bed_heating); LCD_MESSAGEPGM(MSG_BED_HEATING); - while (thermalManager.isHeatingBed()) safe_delay(200); - lcd_reset_status(); + thermalManager.wait_for_bed(); + ui.reset_status(); } #endif @@ -767,13 +774,9 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/ } if (verbose_level > 2) { - SERIAL_PROTOCOLPGM("Bed X: "); - SERIAL_PROTOCOL_F(LOGICAL_X_POSITION(rx), 3); - SERIAL_PROTOCOLPGM(" Y: "); - SERIAL_PROTOCOL_F(LOGICAL_Y_POSITION(ry), 3); - SERIAL_PROTOCOLPGM(" Z: "); - SERIAL_PROTOCOL_F(measured_z, 3); - SERIAL_EOL(); + SERIAL_ECHOPAIR_F("Bed X: ", LOGICAL_X_POSITION(rx), 3); + SERIAL_ECHOPAIR_F(" Y: ", LOGICAL_Y_POSITION(ry), 3); + SERIAL_ECHOLNPAIR_F(" Z: ", measured_z, 3); } feedrate_mm_s = old_feedrate_mm_s; @@ -781,8 +784,7 @@ float probe_pt(const float &rx, const float &ry, const ProbePtRaise raise_after/ if (isnan(measured_z)) { STOW_PROBE(); LCD_MESSAGEPGM(MSG_ERR_PROBING_FAILED); - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_PROBING_FAILED); + SERIAL_ERROR_MSG(MSG_ERR_PROBING_FAILED); } #if ENABLED(DEBUG_LEVELING_FEATURE) diff --git a/Marlin/src/module/scara.cpp b/Marlin/src/module/scara.cpp index 8063c44443..febdaaf641 100644 --- a/Marlin/src/module/scara.cpp +++ b/Marlin/src/module/scara.cpp @@ -142,8 +142,8 @@ void inverse_kinematics(const float (&raw)[XYZ]) { } void scara_report_positions() { - SERIAL_PROTOCOLPAIR("SCARA Theta:", planner.get_axis_position_degrees(A_AXIS)); - SERIAL_PROTOCOLLNPAIR(" Psi+Theta:", planner.get_axis_position_degrees(B_AXIS)); + SERIAL_ECHOPAIR("SCARA Theta:", planner.get_axis_position_degrees(A_AXIS)); + SERIAL_ECHOLNPAIR(" Psi+Theta:", planner.get_axis_position_degrees(B_AXIS)); SERIAL_EOL(); } diff --git a/Marlin/src/module/servo.cpp b/Marlin/src/module/servo.cpp index fbb3e6a764..fb17651b1c 100644 --- a/Marlin/src/module/servo.cpp +++ b/Marlin/src/module/servo.cpp @@ -31,7 +31,10 @@ #include "servo.h" HAL_SERVO_LIB servo[NUM_SERVOS]; -uint16_t servo_angles[NUM_SERVOS][2]; + +#if ENABLED(EDITABLE_SERVO_ANGLES) + uint16_t servo_angles[NUM_SERVOS][2]; +#endif void servo_init() { #if NUM_SERVOS >= 1 && HAS_SERVO_0 diff --git a/Marlin/src/module/servo.h b/Marlin/src/module/servo.h index 7dc70559c7..54a4f0af09 100644 --- a/Marlin/src/module/servo.h +++ b/Marlin/src/module/servo.h @@ -28,13 +28,60 @@ #include "../inc/MarlinConfig.h" #include "../HAL/shared/servo.h" -extern HAL_SERVO_LIB servo[NUM_SERVOS]; -extern uint16_t servo_angles[NUM_SERVOS][2]; -extern void servo_init(); +#if HAS_SERVO_ANGLES + + #if ENABLED(SWITCHING_EXTRUDER) + #ifndef SWITCHING_EXTRUDER_E23_SERVO_NR + #define SWITCHING_EXTRUDER_E23_SERVO_NR -1 + #endif + #if EXTRUDERS > 3 + #define REQ_ANGLES 4 + #else + #define REQ_ANGLES 2 + #endif + #define SADATA SWITCHING_EXTRUDER_SERVO_ANGLES + #define ASRC(N,E) (SWITCHING_EXTRUDER_SERVO_NR == N ? asrc[E] : SWITCHING_EXTRUDER_E23_SERVO_NR == N ? asrc[E+2] : 0) + #elif ENABLED(SWITCHING_NOZZLE) + #define SADATA SWITCHING_NOZZLE_SERVO_ANGLES + #define ASRC(N,E) (SWITCHING_NOZZLE_SERVO_NR == N ? asrc[E] : 0) + #elif defined(Z_SERVO_ANGLES) && defined(Z_PROBE_SERVO_NR) + #define SADATA Z_SERVO_ANGLES + #define ASRC(N,E) (Z_PROBE_SERVO_NR == N ? asrc[E] : 0) + #endif + + #if ENABLED(EDITABLE_SERVO_ANGLES) + extern uint16_t servo_angles[NUM_SERVOS][2]; + #define BASE_SERVO_ANGLES base_servo_angles + #else + #define BASE_SERVO_ANGLES servo_angles + #endif + + constexpr uint16_t asrc[] = SADATA; + #if REQ_ANGLES + static_assert(COUNT(asrc) == REQ_ANGLES, "SWITCHING_EXTRUDER_SERVO_ANGLES needs " STRINGIFY(REQ_ANGLES) " angles."); + #endif + + constexpr uint16_t BASE_SERVO_ANGLES [NUM_SERVOS][2] = { + { ASRC(0,0), ASRC(0,1) } + #if NUM_SERVOS > 1 + , { ASRC(1,0), ASRC(1,1) } + #if NUM_SERVOS > 2 + , { ASRC(2,0), ASRC(2,1) } + #if NUM_SERVOS > 3 + , { ASRC(3,0), ASRC(3,1) } + #endif + #endif + #endif + }; + + #if HAS_Z_SERVO_PROBE + #define DEPLOY_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][0]) + #define STOW_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][1]) + #endif + +#endif // HAS_SERVO_ANGLES #define MOVE_SERVO(I, P) servo[I].move(P) -#if HAS_Z_SERVO_PROBE - #define DEPLOY_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][0]) - #define STOW_Z_SERVO() MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][1]) -#endif +extern HAL_SERVO_LIB servo[NUM_SERVOS]; +extern void servo_init(); diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 4c560f52d3..e25b4e614d 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -590,29 +590,29 @@ void Stepper::set_directions() { * uint16_t t; * umul24x24to16hi(t, bezier_AV, curr_step); // t: Range 0 - 1^16 = 16 bits * uint16_t f = t; - * umul16x16to16hi(f, f, t); // Range 16 bits (unsigned) - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^3 (unsigned) - * uint24_t acc = bezier_F; // Range 20 bits (unsigned) + * umul16x16to16hi(f, f, t); // Range 16 bits (unsigned) + * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^3 (unsigned) + * uint24_t acc = bezier_F; // Range 20 bits (unsigned) * if (A_negative) { * uint24_t v; - * umul16x24to24hi(v, f, bezier_C); // Range 21bits + * umul16x24to24hi(v, f, bezier_C); // Range 21bits * acc -= v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^4 (unsigned) - * umul16x24to24hi(v, f, bezier_B); // Range 22bits + * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^4 (unsigned) + * umul16x24to24hi(v, f, bezier_B); // Range 22bits * acc += v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^5 (unsigned) - * umul16x24to24hi(v, f, bezier_A); // Range 21bits + 15 = 36bits (plus sign) + * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^5 (unsigned) + * umul16x24to24hi(v, f, bezier_A); // Range 21bits + 15 = 36bits (plus sign) * acc -= v; * } * else { * uint24_t v; - * umul16x24to24hi(v, f, bezier_C); // Range 21bits + * umul16x24to24hi(v, f, bezier_C); // Range 21bits * acc += v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^4 (unsigned) - * umul16x24to24hi(v, f, bezier_B); // Range 22bits + * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^4 (unsigned) + * umul16x24to24hi(v, f, bezier_B); // Range 22bits * acc -= v; - * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^5 (unsigned) - * umul16x24to24hi(v, f, bezier_A); // Range 21bits + 15 = 36bits (plus sign) + * umul16x16to16hi(f, f, t); // Range 16 bits : f = t^5 (unsigned) + * umul16x24to24hi(v, f, bezier_A); // Range 21bits + 15 = 36bits (plus sign) * acc += v; * } * return acc; @@ -1492,7 +1492,7 @@ uint32_t Stepper::stepper_block_phase_isr() { // If current block is finished, reset pointer if (step_events_completed >= step_event_count) { #if FILAMENT_RUNOUT_DISTANCE_MM > 0 - runout.block_complete(current_block); + runout.block_completed(current_block); #endif axis_did_move = 0; current_block = NULL; @@ -2218,25 +2218,25 @@ void Stepper::report_positions() { if (was_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT(); #if CORE_IS_XY || CORE_IS_XZ || ENABLED(DELTA) || IS_SCARA - SERIAL_PROTOCOLPGM(MSG_COUNT_A); + SERIAL_ECHOPGM(MSG_COUNT_A); #else - SERIAL_PROTOCOLPGM(MSG_COUNT_X); + SERIAL_ECHOPGM(MSG_COUNT_X); #endif - SERIAL_PROTOCOL(xpos); + SERIAL_ECHO(xpos); #if CORE_IS_XY || CORE_IS_YZ || ENABLED(DELTA) || IS_SCARA - SERIAL_PROTOCOLPGM(" B:"); + SERIAL_ECHOPGM(" B:"); #else - SERIAL_PROTOCOLPGM(" Y:"); + SERIAL_ECHOPGM(" Y:"); #endif - SERIAL_PROTOCOL(ypos); + SERIAL_ECHO(ypos); #if CORE_IS_XZ || CORE_IS_YZ || ENABLED(DELTA) - SERIAL_PROTOCOLPGM(" C:"); + SERIAL_ECHOPGM(" C:"); #else - SERIAL_PROTOCOLPGM(" Z:"); + SERIAL_ECHOPGM(" Z:"); #endif - SERIAL_PROTOCOL(zpos); + SERIAL_ECHO(zpos); SERIAL_EOL(); } @@ -2407,13 +2407,13 @@ void Stepper::report_positions() { void Stepper::refresh_motor_power() { LOOP_L_N(i, COUNT(motor_current_setting)) { switch (i) { - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) + #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_X) || PIN_EXISTS(MOTOR_CURRENT_PWM_Y) case 0: #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) case 1: #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) + #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) || PIN_EXISTS(MOTOR_CURRENT_PWM_E0) || PIN_EXISTS(MOTOR_CURRENT_PWM_E1) case 2: #endif digipot_current(i, motor_current_setting[i]); @@ -2426,7 +2426,7 @@ void Stepper::report_positions() { #if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM - void Stepper::digipot_current(const uint8_t driver, const int current) { + void Stepper::digipot_current(const uint8_t driver, const int16_t current) { #if HAS_DIGIPOTSS @@ -2440,15 +2440,33 @@ void Stepper::report_positions() { #define _WRITE_CURRENT_PWM(P) analogWrite(MOTOR_CURRENT_PWM_## P ##_PIN, 255L * current / (MOTOR_CURRENT_PWM_RANGE)) switch (driver) { - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - case 0: _WRITE_CURRENT_PWM(XY); break; - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - case 1: _WRITE_CURRENT_PWM(Z); break; - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - case 2: _WRITE_CURRENT_PWM(E); break; - #endif + case 0: + #if PIN_EXISTS(MOTOR_CURRENT_PWM_X) + _WRITE_CURRENT_PWM(X); + #endif + #if PIN_EXISTS(MOTOR_CURRENT_PWM_Y) + _WRITE_CURRENT_PWM(Y); + #endif + #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) + _WRITE_CURRENT_PWM(XY); + #endif + break; + case 1: + #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) + _WRITE_CURRENT_PWM(Z); + #endif + break; + case 2: + #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) + _WRITE_CURRENT_PWM(E); + #endif + #if PIN_EXISTS(MOTOR_CURRENT_PWM_E0) + _WRITE_CURRENT_PWM(E0); + #endif + #if PIN_EXISTS(MOTOR_CURRENT_PWM_E1) + _WRITE_CURRENT_PWM(E1); + #endif + break; } #endif } @@ -2469,6 +2487,12 @@ void Stepper::report_positions() { #elif HAS_MOTOR_CURRENT_PWM + #if PIN_EXISTS(MOTOR_CURRENT_PWM_X) + SET_OUTPUT(MOTOR_CURRENT_PWM_X_PIN); + #endif + #if PIN_EXISTS(MOTOR_CURRENT_PWM_Y) + SET_OUTPUT(MOTOR_CURRENT_PWM_Y_PIN); + #endif #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) SET_OUTPUT(MOTOR_CURRENT_PWM_XY_PIN); #endif @@ -2478,12 +2502,19 @@ void Stepper::report_positions() { #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) SET_OUTPUT(MOTOR_CURRENT_PWM_E_PIN); #endif + #if PIN_EXISTS(MOTOR_CURRENT_PWM_E0) + SET_OUTPUT(MOTOR_CURRENT_PWM_E0_PIN); + #endif + #if PIN_EXISTS(MOTOR_CURRENT_PWM_E1) + SET_OUTPUT(MOTOR_CURRENT_PWM_E1_PIN); + #endif refresh_motor_power(); // Set Timer5 to 31khz so the PWM of the motor power is as constant as possible. (removes a buzzing noise) - SET_CS5(PRESCALER_1); - + #ifdef __AVR__ + SET_CS5(PRESCALER_1); + #endif #endif } @@ -2587,6 +2618,7 @@ void Stepper::report_positions() { SET_OUTPUT(E5_MS3_PIN); #endif #endif + static const uint8_t microstep_modes[] = MICROSTEP_MODES; for (uint16_t i = 0; i < COUNT(microstep_modes); i++) microstep_mode(i, microstep_modes[i]); @@ -2781,82 +2813,81 @@ void Stepper::report_positions() { case 128: microstep_ms(driver, MICROSTEP128); break; #endif - default: SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("Microsteps unavailable"); break; + default: SERIAL_ERROR_MSG("Microsteps unavailable"); break; } } void Stepper::microstep_readings() { - SERIAL_PROTOCOLLNPGM("MS1,MS2,MS3 Pins"); - SERIAL_PROTOCOLPGM("X: "); + SERIAL_ECHOPGM("MS1,MS2,MS3 Pins\nX: "); #if HAS_X_MICROSTEPS - SERIAL_PROTOCOL(READ(X_MS1_PIN)); - SERIAL_PROTOCOL(READ(X_MS2_PIN)); + SERIAL_ECHO(READ(X_MS1_PIN)); + SERIAL_ECHO(READ(X_MS2_PIN)); #if PIN_EXISTS(X_MS3) - SERIAL_PROTOCOLLN(READ(X_MS3_PIN)); + SERIAL_ECHOLN(READ(X_MS3_PIN)); #endif #endif #if HAS_Y_MICROSTEPS - SERIAL_PROTOCOLPGM("Y: "); - SERIAL_PROTOCOL(READ(Y_MS1_PIN)); - SERIAL_PROTOCOL(READ(Y_MS2_PIN)); + SERIAL_ECHOPGM("Y: "); + SERIAL_ECHO(READ(Y_MS1_PIN)); + SERIAL_ECHO(READ(Y_MS2_PIN)); #if PIN_EXISTS(Y_MS3) - SERIAL_PROTOCOLLN(READ(Y_MS3_PIN)); + SERIAL_ECHOLN(READ(Y_MS3_PIN)); #endif #endif #if HAS_Z_MICROSTEPS - SERIAL_PROTOCOLPGM("Z: "); - SERIAL_PROTOCOL(READ(Z_MS1_PIN)); - SERIAL_PROTOCOL(READ(Z_MS2_PIN)); + SERIAL_ECHOPGM("Z: "); + SERIAL_ECHO(READ(Z_MS1_PIN)); + SERIAL_ECHO(READ(Z_MS2_PIN)); #if PIN_EXISTS(Z_MS3) - SERIAL_PROTOCOLLN(READ(Z_MS3_PIN)); + SERIAL_ECHOLN(READ(Z_MS3_PIN)); #endif #endif #if HAS_E0_MICROSTEPS - SERIAL_PROTOCOLPGM("E0: "); - SERIAL_PROTOCOL(READ(E0_MS1_PIN)); - SERIAL_PROTOCOL(READ(E0_MS2_PIN)); + SERIAL_ECHOPGM("E0: "); + SERIAL_ECHO(READ(E0_MS1_PIN)); + SERIAL_ECHO(READ(E0_MS2_PIN)); #if PIN_EXISTS(E0_MS3) - SERIAL_PROTOCOLLN(READ(E0_MS3_PIN)); + SERIAL_ECHOLN(READ(E0_MS3_PIN)); #endif #endif #if HAS_E1_MICROSTEPS - SERIAL_PROTOCOLPGM("E1: "); - SERIAL_PROTOCOL(READ(E1_MS1_PIN)); - SERIAL_PROTOCOL(READ(E1_MS2_PIN)); + SERIAL_ECHOPGM("E1: "); + SERIAL_ECHO(READ(E1_MS1_PIN)); + SERIAL_ECHO(READ(E1_MS2_PIN)); #if PIN_EXISTS(E1_MS3) - SERIAL_PROTOCOLLN(READ(E1_MS3_PIN)); + SERIAL_ECHOLN(READ(E1_MS3_PIN)); #endif #endif #if HAS_E2_MICROSTEPS - SERIAL_PROTOCOLPGM("E2: "); - SERIAL_PROTOCOL(READ(E2_MS1_PIN)); - SERIAL_PROTOCOL(READ(E2_MS2_PIN)); + SERIAL_ECHOPGM("E2: "); + SERIAL_ECHO(READ(E2_MS1_PIN)); + SERIAL_ECHO(READ(E2_MS2_PIN)); #if PIN_EXISTS(E2_MS3) - SERIAL_PROTOCOLLN(READ(E2_MS3_PIN)); + SERIAL_ECHOLN(READ(E2_MS3_PIN)); #endif #endif #if HAS_E3_MICROSTEPS - SERIAL_PROTOCOLPGM("E3: "); - SERIAL_PROTOCOL(READ(E3_MS1_PIN)); - SERIAL_PROTOCOL(READ(E3_MS2_PIN)); + SERIAL_ECHOPGM("E3: "); + SERIAL_ECHO(READ(E3_MS1_PIN)); + SERIAL_ECHO(READ(E3_MS2_PIN)); #if PIN_EXISTS(E3_MS3) - SERIAL_PROTOCOLLN(READ(E3_MS3_PIN)); + SERIAL_ECHOLN(READ(E3_MS3_PIN)); #endif #endif #if HAS_E4_MICROSTEPS - SERIAL_PROTOCOLPGM("E4: "); - SERIAL_PROTOCOL(READ(E4_MS1_PIN)); - SERIAL_PROTOCOL(READ(E4_MS2_PIN)); + SERIAL_ECHOPGM("E4: "); + SERIAL_ECHO(READ(E4_MS1_PIN)); + SERIAL_ECHO(READ(E4_MS2_PIN)); #if PIN_EXISTS(E4_MS3) - SERIAL_PROTOCOLLN(READ(E4_MS3_PIN)); + SERIAL_ECHOLN(READ(E4_MS3_PIN)); #endif #endif #if HAS_E5_MICROSTEPS - SERIAL_PROTOCOLPGM("E5: "); - SERIAL_PROTOCOL(READ(E5_MS1_PIN)); - SERIAL_PROTOCOLLN(READ(E5_MS2_PIN)); + SERIAL_ECHOPGM("E5: "); + SERIAL_ECHO(READ(E5_MS1_PIN)); + SERIAL_ECHOLN(READ(E5_MS2_PIN)); #if PIN_EXISTS(E5_MS3) - SERIAL_PROTOCOLLN(READ(E5_MS3_PIN)); + SERIAL_ECHOLN(READ(E5_MS3_PIN)); #endif #endif } diff --git a/Marlin/src/module/stepper_indirection.h b/Marlin/src/module/stepper_indirection.h index 1b0e6c883d..1dfb219af1 100644 --- a/Marlin/src/module/stepper_indirection.h +++ b/Marlin/src/module/stepper_indirection.h @@ -613,3 +613,126 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR) #define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR) #endif + +// +// Stepper enable / disable +// +#if HAS_X2_ENABLE + #define enable_X() do{ X_ENABLE_WRITE( X_ENABLE_ON); X2_ENABLE_WRITE( X_ENABLE_ON); }while(0) + #define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); X2_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0) +#elif HAS_X_ENABLE + #define enable_X() X_ENABLE_WRITE( X_ENABLE_ON) + #define disable_X() do{ X_ENABLE_WRITE(!X_ENABLE_ON); CBI(axis_known_position, X_AXIS); }while(0) +#else + #define enable_X() NOOP + #define disable_X() NOOP +#endif + +#if HAS_Y2_ENABLE + #define enable_Y() do{ Y_ENABLE_WRITE( Y_ENABLE_ON); Y2_ENABLE_WRITE(Y_ENABLE_ON); }while(0) + #define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); Y2_ENABLE_WRITE(!Y_ENABLE_ON); CBI(axis_known_position, Y_AXIS); }while(0) +#elif HAS_Y_ENABLE + #define enable_Y() Y_ENABLE_WRITE( Y_ENABLE_ON) + #define disable_Y() do{ Y_ENABLE_WRITE(!Y_ENABLE_ON); CBI(axis_known_position, Y_AXIS); }while(0) +#else + #define enable_Y() NOOP + #define disable_Y() NOOP +#endif + +#if HAS_Z3_ENABLE + #define enable_Z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); Z3_ENABLE_WRITE(Z_ENABLE_ON); }while(0) + #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); Z3_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0) +#elif HAS_Z2_ENABLE + #define enable_Z() do{ Z_ENABLE_WRITE( Z_ENABLE_ON); Z2_ENABLE_WRITE(Z_ENABLE_ON); }while(0) + #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); Z2_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0) +#elif HAS_Z_ENABLE + #define enable_Z() Z_ENABLE_WRITE( Z_ENABLE_ON) + #define disable_Z() do{ Z_ENABLE_WRITE(!Z_ENABLE_ON); CBI(axis_known_position, Z_AXIS); }while(0) +#else + #define enable_Z() NOOP + #define disable_Z() NOOP +#endif + +#if ENABLED(MIXING_EXTRUDER) + + /** + * Mixing steppers synchronize their enable (and direction) together + */ + #if MIXING_STEPPERS > 5 + #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); E4_ENABLE_WRITE( E_ENABLE_ON); E5_ENABLE_WRITE( E_ENABLE_ON); } + #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); E4_ENABLE_WRITE(!E_ENABLE_ON); E5_ENABLE_WRITE(!E_ENABLE_ON); } + #elif MIXING_STEPPERS > 4 + #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); E4_ENABLE_WRITE( E_ENABLE_ON); } + #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); E4_ENABLE_WRITE(!E_ENABLE_ON); } + #elif MIXING_STEPPERS > 3 + #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); E3_ENABLE_WRITE( E_ENABLE_ON); } + #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); E3_ENABLE_WRITE(!E_ENABLE_ON); } + #elif MIXING_STEPPERS > 2 + #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); E2_ENABLE_WRITE( E_ENABLE_ON); } + #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); E2_ENABLE_WRITE(!E_ENABLE_ON); } + #else + #define enable_E0() { E0_ENABLE_WRITE( E_ENABLE_ON); E1_ENABLE_WRITE( E_ENABLE_ON); } + #define disable_E0() { E0_ENABLE_WRITE(!E_ENABLE_ON); E1_ENABLE_WRITE(!E_ENABLE_ON); } + #endif + #define enable_E1() NOOP + #define disable_E1() NOOP + #define enable_E2() NOOP + #define disable_E2() NOOP + #define enable_E3() NOOP + #define disable_E3() NOOP + #define enable_E4() NOOP + #define disable_E4() NOOP + #define enable_E5() NOOP + #define disable_E5() NOOP + +#else // !MIXING_EXTRUDER + + #if HAS_E0_ENABLE + #define enable_E0() E0_ENABLE_WRITE( E_ENABLE_ON) + #define disable_E0() E0_ENABLE_WRITE(!E_ENABLE_ON) + #else + #define enable_E0() NOOP + #define disable_E0() NOOP + #endif + + #if E_STEPPERS > 1 && HAS_E1_ENABLE + #define enable_E1() E1_ENABLE_WRITE( E_ENABLE_ON) + #define disable_E1() E1_ENABLE_WRITE(!E_ENABLE_ON) + #else + #define enable_E1() NOOP + #define disable_E1() NOOP + #endif + + #if E_STEPPERS > 2 && HAS_E2_ENABLE + #define enable_E2() E2_ENABLE_WRITE( E_ENABLE_ON) + #define disable_E2() E2_ENABLE_WRITE(!E_ENABLE_ON) + #else + #define enable_E2() NOOP + #define disable_E2() NOOP + #endif + + #if E_STEPPERS > 3 && HAS_E3_ENABLE + #define enable_E3() E3_ENABLE_WRITE( E_ENABLE_ON) + #define disable_E3() E3_ENABLE_WRITE(!E_ENABLE_ON) + #else + #define enable_E3() NOOP + #define disable_E3() NOOP + #endif + + #if E_STEPPERS > 4 && HAS_E4_ENABLE + #define enable_E4() E4_ENABLE_WRITE( E_ENABLE_ON) + #define disable_E4() E4_ENABLE_WRITE(!E_ENABLE_ON) + #else + #define enable_E4() NOOP + #define disable_E4() NOOP + #endif + + #if E_STEPPERS > 5 && HAS_E5_ENABLE + #define enable_E5() E5_ENABLE_WRITE( E_ENABLE_ON) + #define disable_E5() E5_ENABLE_WRITE(!E_ENABLE_ON) + #else + #define enable_E5() NOOP + #define disable_E5() NOOP + #endif + +#endif // !MIXING_EXTRUDER diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 892379c536..c086d29e7a 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -217,7 +217,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; bool Temperature::heater_idle_timeout_exceeded[HOTENDS] = { false }; #endif -#if ENABLED(ADC_KEYPAD) +#if HAS_ADC_BUTTONS uint32_t Temperature::current_ADCKey_raw = 0; uint8_t Temperature::ADCKey_count = 0; #endif @@ -228,7 +228,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; #if HAS_PID_HEATING - inline void say_default_() { SERIAL_PROTOCOLPGM("#define DEFAULT_"); } + inline void say_default_() { SERIAL_ECHOPGM("#define DEFAULT_"); } /** * PID Autotuning (M303) @@ -236,7 +236,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; * Alternately heat and cool the nozzle, observing its behavior to * determine the best PID values to achieve a stable temperature. */ - void Temperature::PID_autotune(const float &target, const int8_t hotend, const int8_t ncycles, const bool set_result/*=false*/) { + void Temperature::PID_autotune(const float &target, const int8_t heater, const int8_t ncycles, const bool set_result/*=false*/) { float current = 0.0; int cycles = 0; bool heating = true; @@ -249,10 +249,10 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; float max = 0, min = 10000; #if HAS_PID_FOR_BOTH - #define GHV(B,H) (hotend < 0 ? (B) : (H)) - #define SHV(S,B,H) do{ if (hotend < 0) S##_bed = B; else S [hotend] = H; }while(0) - #define ONHEATINGSTART() (hotend < 0 ? printerEventLEDs.onBedHeatingStart() : printerEventLEDs.onHotendHeatingStart()) - #define ONHEATING(S,C,T) do{ if (hotend < 0) printerEventLEDs.onBedHeating(S,C,T); else printerEventLEDs.onHotendHeating(S,C,T); }while(0) + #define GHV(B,H) (heater < 0 ? (B) : (H)) + #define SHV(S,B,H) do{ if (heater < 0) S##_bed = B; else S [heater] = H; }while(0) + #define ONHEATINGSTART() (heater < 0 ? printerEventLEDs.onBedHeatingStart() : printerEventLEDs.onHotendHeatingStart()) + #define ONHEATING(S,C,T) do{ if (heater < 0) printerEventLEDs.onBedHeating(S,C,T); else printerEventLEDs.onHotendHeating(S,C,T); }while(0) #elif ENABLED(PIDTEMPBED) #define GHV(B,H) B #define SHV(S,B,H) (S##_bed = B) @@ -260,7 +260,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; #define ONHEATING(S,C,T) printerEventLEDs.onBedHeating(S,C,T) #else #define GHV(B,H) H - #define SHV(S,B,H) (S [hotend] = H) + #define SHV(S,B,H) (S [heater] = H) #define ONHEATINGSTART() printerEventLEDs.onHotendHeatingStart() #define ONHEATING(S,C,T) printerEventLEDs.onHotendHeating(S,C,T) #endif @@ -268,7 +268,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; #if WATCH_THE_BED || WATCH_HOTENDS #define HAS_TP_BED (ENABLED(THERMAL_PROTECTION_BED) && ENABLED(PIDTEMPBED)) #if HAS_TP_BED && ENABLED(THERMAL_PROTECTION_HOTENDS) && ENABLED(PIDTEMP) - #define GTV(B,H) (hotend < 0 ? (B) : (H)) + #define GTV(B,H) (heater < 0 ? (B) : (H)) #elif HAS_TP_BED #define GTV(B,H) (B) #else @@ -286,22 +286,6 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; next_auto_fan_check_ms = next_temp_ms + 2500UL; #endif - #if ENABLED(PIDTEMP) - #define _TOP_HOTEND HOTENDS - 1 - #else - #define _TOP_HOTEND -1 - #endif - #if ENABLED(PIDTEMPBED) - #define _BOT_HOTEND -1 - #else - #define _BOT_HOTEND 0 - #endif - - if (!WITHIN(hotend, _BOT_HOTEND, _TOP_HOTEND)) { - SERIAL_ECHOLNPGM(MSG_PID_BAD_EXTRUDER_NUM); - return; - } - SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_START); disable_all_heaters(); @@ -310,7 +294,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; wait_for_heatup = true; // Can be interrupted with M108 #if ENABLED(PRINTER_EVENT_LEDS) - const float start_temp = GHV(current_temperature_bed, current_temperature[hotend]); + const float start_temp = GHV(current_temperature_bed, current_temperature[heater]); LEDColor color = ONHEATINGSTART(); #endif @@ -323,7 +307,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; updateTemperaturesFromRawValues(); // Get the current temperature and constrain it - current = GHV(current_temperature_bed, current_temperature[hotend]); + current = GHV(current_temperature_bed, current_temperature[heater]); NOLESS(max, current); NOMORE(min, current); @@ -359,37 +343,37 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; bias = constrain(bias, 20, max_pow - 20); d = (bias > max_pow >> 1) ? max_pow - 1 - bias : bias; - SERIAL_PROTOCOLPAIR(MSG_BIAS, bias); - SERIAL_PROTOCOLPAIR(MSG_D, d); - SERIAL_PROTOCOLPAIR(MSG_T_MIN, min); - SERIAL_PROTOCOLPAIR(MSG_T_MAX, max); + SERIAL_ECHOPAIR(MSG_BIAS, bias); + SERIAL_ECHOPAIR(MSG_D, d); + SERIAL_ECHOPAIR(MSG_T_MIN, min); + SERIAL_ECHOPAIR(MSG_T_MAX, max); if (cycles > 2) { float Ku = (4.0f * d) / (float(M_PI) * (max - min) * 0.5f), Tu = ((float)(t_low + t_high) * 0.001f); - SERIAL_PROTOCOLPAIR(MSG_KU, Ku); - SERIAL_PROTOCOLPAIR(MSG_TU, Tu); + SERIAL_ECHOPAIR(MSG_KU, Ku); + SERIAL_ECHOPAIR(MSG_TU, Tu); tune_pid.Kp = 0.6f * Ku; tune_pid.Ki = 2 * tune_pid.Kp / Tu; tune_pid.Kd = tune_pid.Kp * Tu * 0.125f; - SERIAL_PROTOCOLLNPGM("\n" MSG_CLASSIC_PID); - SERIAL_PROTOCOLPAIR(MSG_KP, tune_pid.Kp); - SERIAL_PROTOCOLPAIR(MSG_KI, tune_pid.Ki); - SERIAL_PROTOCOLLNPAIR(MSG_KD, tune_pid.Kd); + SERIAL_ECHOLNPGM("\n" MSG_CLASSIC_PID); + SERIAL_ECHOPAIR(MSG_KP, tune_pid.Kp); + SERIAL_ECHOPAIR(MSG_KI, tune_pid.Ki); + SERIAL_ECHOLNPAIR(MSG_KD, tune_pid.Kd); /** tune_pid.Kp = 0.33*Ku; tune_pid.Ki = tune_pid.Kp/Tu; tune_pid.Kd = tune_pid.Kp*Tu/3; - SERIAL_PROTOCOLLNPGM(" Some overshoot"); - SERIAL_PROTOCOLPAIR(" Kp: ", tune_pid.Kp); - SERIAL_PROTOCOLPAIR(" Ki: ", tune_pid.Ki); - SERIAL_PROTOCOLPAIR(" Kd: ", tune_pid.Kd); + SERIAL_ECHOLNPGM(" Some overshoot"); + SERIAL_ECHOPAIR(" Kp: ", tune_pid.Kp); + SERIAL_ECHOPAIR(" Ki: ", tune_pid.Ki); + SERIAL_ECHOPAIR(" Kd: ", tune_pid.Kd); tune_pid.Kp = 0.2*Ku; tune_pid.Ki = 2*tune_pid.Kp/Tu; tune_pid.Kd = tune_pid.Kp*Tu/3; - SERIAL_PROTOCOLLNPGM(" No overshoot"); - SERIAL_PROTOCOLPAIR(" Kp: ", tune_pid.Kp); - SERIAL_PROTOCOLPAIR(" Ki: ", tune_pid.Ki); - SERIAL_PROTOCOLPAIR(" Kd: ", tune_pid.Kd); + SERIAL_ECHOLNPGM(" No overshoot"); + SERIAL_ECHOPAIR(" Kp: ", tune_pid.Kp); + SERIAL_ECHOPAIR(" Ki: ", tune_pid.Ki); + SERIAL_ECHOPAIR(" Kd: ", tune_pid.Kd); */ } } @@ -405,14 +389,14 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; #define MAX_OVERSHOOT_PID_AUTOTUNE 20 #endif if (current > target + MAX_OVERSHOOT_PID_AUTOTUNE) { - SERIAL_PROTOCOLLNPGM(MSG_PID_TEMP_TOO_HIGH); + SERIAL_ECHOLNPGM(MSG_PID_TEMP_TOO_HIGH); break; } // Report heater states every 2 seconds if (ELAPSED(ms, next_temp_ms)) { #if HAS_TEMP_SENSOR - print_heaterstates(); + print_heater_states(heater >= 0 ? heater : active_extruder); SERIAL_EOL(); #endif next_temp_ms = ms + 2000UL; @@ -423,9 +407,9 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; #if WATCH_THE_BED && WATCH_HOTENDS true #elif WATCH_HOTENDS - hotend >= 0 + heater >= 0 #else - hotend < 0 + heater < 0 #endif ) { if (!heated) { // If not yet reached target... @@ -435,10 +419,10 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; if (current > watch_temp_target) heated = true; // - Flag if target temperature reached } else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired - _temp_error(hotend, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, hotend)); + _temp_error(heater, PSTR(MSG_T_HEATING_FAILED), TEMP_ERR_PSTR(MSG_HEATING_FAILED_LCD, heater)); } else if (current < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far? - _temp_error(hotend, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, hotend)); + _temp_error(heater, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, heater)); } #endif } // every 2 seconds @@ -448,26 +432,26 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; #define MAX_CYCLE_TIME_PID_AUTOTUNE 20L #endif if (((ms - t1) + (ms - t2)) > (MAX_CYCLE_TIME_PID_AUTOTUNE * 60L * 1000L)) { - SERIAL_PROTOCOLLNPGM(MSG_PID_TIMEOUT); + SERIAL_ECHOLNPGM(MSG_PID_TIMEOUT); break; } if (cycles > ncycles) { - SERIAL_PROTOCOLLNPGM(MSG_PID_AUTOTUNE_FINISHED); + SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_FINISHED); #if HAS_PID_FOR_BOTH const char * const estring = GHV(PSTR("bed"), PSTR("")); - say_default_(); serialprintPGM(estring); SERIAL_PROTOCOLLNPAIR("Kp ", tune_pid.Kp); - say_default_(); serialprintPGM(estring); SERIAL_PROTOCOLLNPAIR("Ki ", tune_pid.Ki); - say_default_(); serialprintPGM(estring); SERIAL_PROTOCOLLNPAIR("Kd ", tune_pid.Kd); + say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Kp ", tune_pid.Kp); + say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Ki ", tune_pid.Ki); + say_default_(); serialprintPGM(estring); SERIAL_ECHOLNPAIR("Kd ", tune_pid.Kd); #elif ENABLED(PIDTEMP) - say_default_(); SERIAL_PROTOCOLLNPAIR("Kp ", tune_pid.Kp); - say_default_(); SERIAL_PROTOCOLLNPAIR("Ki ", tune_pid.Ki); - say_default_(); SERIAL_PROTOCOLLNPAIR("Kd ", tune_pid.Kd); + say_default_(); SERIAL_ECHOLNPAIR("Kp ", tune_pid.Kp); + say_default_(); SERIAL_ECHOLNPAIR("Ki ", tune_pid.Ki); + say_default_(); SERIAL_ECHOLNPAIR("Kd ", tune_pid.Kd); #else - say_default_(); SERIAL_PROTOCOLLNPAIR("bedKp ", tune_pid.Kp); - say_default_(); SERIAL_PROTOCOLLNPAIR("bedKi ", tune_pid.Ki); - say_default_(); SERIAL_PROTOCOLLNPAIR("bedKd ", tune_pid.Kd); + say_default_(); SERIAL_ECHOLNPAIR("bedKp ", tune_pid.Kp); + say_default_(); SERIAL_ECHOLNPAIR("bedKi ", tune_pid.Ki); + say_default_(); SERIAL_ECHOLNPAIR("bedKd ", tune_pid.Kd); #endif #define _SET_BED_PID() do { \ @@ -477,15 +461,15 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; }while(0) #define _SET_EXTRUDER_PID() do { \ - PID_PARAM(Kp, hotend) = tune_pid.Kp; \ - PID_PARAM(Ki, hotend) = scalePID_i(tune_pid.Ki); \ - PID_PARAM(Kd, hotend) = scalePID_d(tune_pid.Kd); \ + PID_PARAM(Kp, heater) = tune_pid.Kp; \ + PID_PARAM(Ki, heater) = scalePID_i(tune_pid.Ki); \ + PID_PARAM(Kd, heater) = scalePID_d(tune_pid.Kd); \ updatePID(); }while(0) // Use the result? (As with "M303 U1") if (set_result) { #if HAS_PID_FOR_BOTH - if (hotend < 0) _SET_BED_PID(); else _SET_EXTRUDER_PID(); + if (heater < 0) _SET_BED_PID(); else _SET_EXTRUDER_PID(); #elif ENABLED(PIDTEMP) _SET_EXTRUDER_PID(); #else @@ -498,7 +482,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; return; } - lcd_update(); + ui.update(); } disable_all_heaters(); #if ENABLED(PRINTER_EVENT_LEDS) @@ -575,13 +559,13 @@ int Temperature::getHeaterPower(const int heater) { // // Temperature Error Handlers // -void Temperature::_temp_error(const int8_t e, PGM_P const serial_msg, PGM_P const lcd_msg) { +void Temperature::_temp_error(const int8_t heater, PGM_P const serial_msg, PGM_P const lcd_msg) { static bool killed = false; 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); + SERIAL_ECHOPGM(MSG_STOPPED_HEATER); + if (heater >= 0) SERIAL_ECHOLN((int)heater); else SERIAL_ECHOLNPGM(MSG_HEATER_BED); } #if DISABLED(BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE) if (!killed) { @@ -594,12 +578,12 @@ void Temperature::_temp_error(const int8_t e, PGM_P const serial_msg, PGM_P cons #endif } -void Temperature::max_temp_error(const int8_t e) { - _temp_error(e, PSTR(MSG_T_MAXTEMP), TEMP_ERR_PSTR(MSG_ERR_MAXTEMP, e)); +void Temperature::max_temp_error(const int8_t heater) { + _temp_error(heater, PSTR(MSG_T_MAXTEMP), TEMP_ERR_PSTR(MSG_ERR_MAXTEMP, heater)); } -void Temperature::min_temp_error(const int8_t e) { - _temp_error(e, PSTR(MSG_T_MINTEMP), TEMP_ERR_PSTR(MSG_ERR_MINTEMP, e)); +void Temperature::min_temp_error(const int8_t heater) { + _temp_error(heater, PSTR(MSG_T_MINTEMP), TEMP_ERR_PSTR(MSG_ERR_MINTEMP, heater)); } float Temperature::get_pid_output(const int8_t e) { @@ -791,8 +775,13 @@ void Temperature::manage_heater() { updateTemperaturesFromRawValues(); // also resets the watchdog #if ENABLED(HEATER_0_USES_MAX6675) - if (current_temperature[0] > MIN(HEATER_0_MAXTEMP, MAX6675_TMAX - 1.0)) max_temp_error(0); - if (current_temperature[0] < MAX(HEATER_0_MINTEMP, MAX6675_TMIN + .01)) min_temp_error(0); + if (current_temperature[0] > MIN(HEATER_0_MAXTEMP, HEATER_0_MAX6675_TMAX - 1.0)) max_temp_error(0); + if (current_temperature[0] < MAX(HEATER_0_MINTEMP, HEATER_0_MAX6675_TMIN + .01)) min_temp_error(0); + #endif + + #if ENABLED(HEATER_1_USES_MAX6675) + if (current_temperature[1] > MIN(HEATER_1_MAXTEMP, HEATER_1_MAX6675_TMAX - 1.0)) max_temp_error(1); + if (current_temperature[1] < MAX(HEATER_1_MINTEMP, HEATER_1_MAX6675_TMIN + .01)) min_temp_error(1); #endif #if WATCH_HOTENDS || WATCH_THE_BED || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN || HEATER_IDLE_HANDLER @@ -943,7 +932,7 @@ void Temperature::manage_heater() { // Derived from RepRap FiveD extruder::getTemperature() // For hot end temperature measurement. -float Temperature::analog2temp(const int raw, const uint8_t e) { +float Temperature::analog_to_celsius_hotend(const int raw, const uint8_t e) { #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) if (e > HOTENDS) #else @@ -951,8 +940,8 @@ float Temperature::analog2temp(const int raw, const uint8_t e) { #endif { SERIAL_ERROR_START(); - SERIAL_ERROR((int)e); - SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER_NUM); + SERIAL_ECHO((int)e); + SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER_NUM); kill(); return 0.0; } @@ -969,7 +958,9 @@ float Temperature::analog2temp(const int raw, const uint8_t e) { break; #endif case 1: - #if ENABLED(HEATER_1_USES_AD595) + #if ENABLED(HEATER_1_USES_MAX6675) + return raw * 0.25; + #elif ENABLED(HEATER_1_USES_AD595) return TEMP_AD595(raw); #elif ENABLED(HEATER_1_USES_AD8495) return TEMP_AD8495(raw); @@ -1015,7 +1006,7 @@ float Temperature::analog2temp(const int raw, const uint8_t e) { #if HAS_HEATED_BED // Derived from RepRap FiveD extruder::getTemperature() // For bed temperature measurement. - float Temperature::analog2tempBed(const int raw) { + float Temperature::analog_to_celsius_bed(const int raw) { #if ENABLED(HEATER_BED_USES_THERMISTOR) SCAN_THERMISTOR_TABLE(BEDTEMPTABLE, BEDTEMPTABLE_LEN); #elif ENABLED(HEATER_BED_USES_AD595) @@ -1031,7 +1022,7 @@ float Temperature::analog2temp(const int raw, const uint8_t e) { #if HAS_TEMP_CHAMBER // Derived from RepRap FiveD extruder::getTemperature() // For chamber temperature measurement. - float Temperature::analog2tempChamber(const int raw) { + float Temperature::analog_to_celsiusChamber(const int raw) { #if ENABLED(HEATER_CHAMBER_USES_THERMISTOR) SCAN_THERMISTOR_TABLE(CHAMBERTEMPTABLE, CHAMBERTEMPTABLE_LEN); #elif ENABLED(HEATER_CHAMBER_USES_AD595) @@ -1052,20 +1043,23 @@ float Temperature::analog2temp(const int raw, const uint8_t e) { */ void Temperature::updateTemperaturesFromRawValues() { #if ENABLED(HEATER_0_USES_MAX6675) - current_temperature_raw[0] = read_max6675(); + current_temperature_raw[0] = READ_MAX6675(0); #endif - HOTEND_LOOP() current_temperature[e] = Temperature::analog2temp(current_temperature_raw[e], e); + #if ENABLED(HEATER_1_USES_MAX6675) + current_temperature_raw[1] = READ_MAX6675(1); + #endif + HOTEND_LOOP() current_temperature[e] = analog_to_celsius_hotend(current_temperature_raw[e], e); #if HAS_HEATED_BED - current_temperature_bed = Temperature::analog2tempBed(current_temperature_bed_raw); + current_temperature_bed = analog_to_celsius_bed(current_temperature_bed_raw); #endif #if HAS_TEMP_CHAMBER - current_temperature_chamber = Temperature::analog2tempChamber(current_temperature_chamber_raw); + current_temperature_chamber = analog_to_celsiusChamber(current_temperature_chamber_raw); #endif #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - redundant_temperature = Temperature::analog2temp(redundant_temperature_raw, 1); + redundant_temperature = analog_to_celsius_hotend(redundant_temperature_raw, 1); #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) - filament_width_meas = analog2widthFil(); + filament_width_meas = analog_to_mm_fil_width(); #endif #if ENABLED(USE_WATCHDOG) @@ -1080,7 +1074,7 @@ void Temperature::updateTemperaturesFromRawValues() { #if ENABLED(FILAMENT_WIDTH_SENSOR) // Convert raw Filament Width to millimeters - float Temperature::analog2widthFil() { + float Temperature::analog_to_mm_fil_width() { return current_raw_filwidth * 5.0f * (1.0f / 16383.0f); } @@ -1177,6 +1171,13 @@ void Temperature::init() { #endif #endif + #if ENABLED(USE_CONTROLLER_FAN) + SET_OUTPUT(CONTROLLER_FAN_PIN); + #if ENABLED(FAST_PWM_FAN) + setPwmFrequency(CONTROLLER_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8 + #endif + #endif + #if ENABLED(HEATER_0_USES_MAX6675) OUT_WRITE(SCK_PIN, LOW); @@ -1186,10 +1187,14 @@ void Temperature::init() { max6675_spi.init(); OUT_WRITE(SS_PIN, HIGH); - OUT_WRITE(MAX6675_SS, HIGH); + OUT_WRITE(MAX6675_SS_PIN, HIGH); #endif // HEATER_0_USES_MAX6675 + #if ENABLED(HEATER_1_USES_MAX6675) + OUT_WRITE(MAX6675_SS2_PIN, HIGH); + #endif + HAL_adc_init(); #if HAS_TEMP_ADC_0 @@ -1299,7 +1304,7 @@ void Temperature::init() { #define TEMP_MIN_ROUTINE(NR) \ minttemp[NR] = HEATER_ ##NR## _MINTEMP; \ - while (analog2temp(minttemp_raw[NR], NR) < HEATER_ ##NR## _MINTEMP) { \ + while (analog_to_celsius_hotend(minttemp_raw[NR], NR) < HEATER_ ##NR## _MINTEMP) { \ if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \ minttemp_raw[NR] += OVERSAMPLENR; \ else \ @@ -1307,7 +1312,7 @@ void Temperature::init() { } #define TEMP_MAX_ROUTINE(NR) \ maxttemp[NR] = HEATER_ ##NR## _MAXTEMP; \ - while (analog2temp(maxttemp_raw[NR], NR) > HEATER_ ##NR## _MAXTEMP) { \ + while (analog_to_celsius_hotend(maxttemp_raw[NR], NR) > HEATER_ ##NR## _MAXTEMP) { \ if (HEATER_ ##NR## _RAW_LO_TEMP < HEATER_ ##NR## _RAW_HI_TEMP) \ maxttemp_raw[NR] -= OVERSAMPLENR; \ else \ @@ -1363,7 +1368,7 @@ void Temperature::init() { #if HAS_HEATED_BED #ifdef BED_MINTEMP - while (analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { + while (analog_to_celsius_bed(bed_minttemp_raw) < BED_MINTEMP) { #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else @@ -1372,7 +1377,7 @@ void Temperature::init() { } #endif // BED_MINTEMP #ifdef BED_MAXTEMP - while (analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { + while (analog_to_celsius_bed(bed_maxttemp_raw) > BED_MAXTEMP) { #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else @@ -1438,7 +1443,7 @@ void Temperature::init() { #if HOTENDS == 1 UNUSED(e); #endif - if (degHotend(HOTEND_INDEX) < degTargetHotend(HOTEND_INDEX) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) { + if (degTargetHotend(HOTEND_INDEX) && degHotend(HOTEND_INDEX) < degTargetHotend(HOTEND_INDEX) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) { watch_target_temp[HOTEND_INDEX] = degHotend(HOTEND_INDEX) + WATCH_TEMP_INCREASE; watch_heater_next_ms[HOTEND_INDEX] = millis() + (WATCH_TEMP_PERIOD) * 1000UL; } @@ -1454,7 +1459,7 @@ void Temperature::init() { * This is called when the temperature is set. (M140, M190) */ void Temperature::start_watching_bed() { - if (degBed() < degTargetBed() - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) { + if (degTargetBed() && degBed() < degTargetBed() - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) { watch_target_bed_temp = degBed() + WATCH_BED_TEMP_INCREASE; watch_bed_next_ms = millis() + (WATCH_BED_TEMP_PERIOD) * 1000UL; } @@ -1611,63 +1616,97 @@ void Temperature::disable_all_heaters() { #endif // PROBING_HEATERS_OFF -#if ENABLED(HEATER_0_USES_MAX6675) +#if HAS_MAX6675 - #define MAX6675_HEAT_INTERVAL 250u + int Temperature::read_max6675( + #if COUNT_6675 > 1 + const uint8_t hindex + #endif + ) { + #if COUNT_6675 == 1 + constexpr uint8_t hindex = 0; + #endif - #if ENABLED(MAX6675_IS_MAX31855) - uint32_t max6675_temp = 2000; - #define MAX6675_ERROR_MASK 7 - #define MAX6675_DISCARD_BITS 18 - #define MAX6675_SPEED_BITS 3 // (_BV(SPR1)) // clock ÷ 64 - #else - uint16_t max6675_temp = 2000; - #define MAX6675_ERROR_MASK 4 - #define MAX6675_DISCARD_BITS 3 - #define MAX6675_SPEED_BITS 2 // (_BV(SPR0)) // clock ÷ 16 - #endif + #define MAX6675_HEAT_INTERVAL 250UL - int Temperature::read_max6675() { - - static millis_t next_max6675_ms = 0; + #if ENABLED(MAX6675_IS_MAX31855) + static uint32_t max6675_temp = 2000; + #define MAX6675_ERROR_MASK 7 + #define MAX6675_DISCARD_BITS 18 + #define MAX6675_SPEED_BITS 3 // (_BV(SPR1)) // clock ÷ 64 + #else + static uint16_t max6675_temp = 2000; + #define MAX6675_ERROR_MASK 4 + #define MAX6675_DISCARD_BITS 3 + #define MAX6675_SPEED_BITS 2 // (_BV(SPR0)) // clock ÷ 16 + #endif + // Return last-read value between readings + static millis_t next_max6675_ms[COUNT_6675] = { 0 }; millis_t ms = millis(); + if (PENDING(ms, next_max6675_ms[hindex])) return int(max6675_temp); + next_max6675_ms[hindex] = ms + MAX6675_HEAT_INTERVAL; - if (PENDING(ms, next_max6675_ms)) return (int)max6675_temp; + // + // TODO: spiBegin, spiRec and spiInit doesn't work when soft spi is used. + // + #if MB(MIGHTYBOARD_REVE) + spiBegin(); + spiInit(MAX6675_SPEED_BITS); + #endif - next_max6675_ms = ms + MAX6675_HEAT_INTERVAL; + #if COUNT_6675 > 1 + #define WRITE_MAX6675(V) do{ switch (hindex) { case 1: WRITE(MAX6675_SS2_PIN, V); break; default: WRITE(MAX6675_SS_PIN, V); } }while(0) + #elif ENABLED(HEATER_1_USES_MAX6675) + #define WRITE_MAX6675(V) WRITE(MAX6675_SS2_PIN, V) + #else + #define WRITE_MAX6675(V) WRITE(MAX6675_SS_PIN, V) + #endif - spiBegin(); - spiInit(MAX6675_SPEED_BITS); - - WRITE(MAX6675_SS, 0); // enable TT_MAX6675 + WRITE_MAX6675(LOW); // enable TT_MAX6675 DELAY_NS(100); // Ensure 100ns delay // Read a big-endian temperature value max6675_temp = 0; for (uint8_t i = sizeof(max6675_temp); i--;) { - max6675_temp |= spiRec(); + max6675_temp |= ( + #if MB(MIGHTYBOARD_REVE) + max6675_spi.receive() + #else + spiRec() + #endif + ); if (i > 0) max6675_temp <<= 8; // shift left if not the last byte } - WRITE(MAX6675_SS, 1); // disable TT_MAX6675 + WRITE_MAX6675(HIGH); // disable TT_MAX6675 if (max6675_temp & MAX6675_ERROR_MASK) { SERIAL_ERROR_START(); - SERIAL_ERRORPGM("Temp measurement error! "); + SERIAL_ECHOPGM("Temp measurement error! "); #if MAX6675_ERROR_MASK == 7 - SERIAL_ERRORPGM("MAX31855 "); + SERIAL_ECHOPGM("MAX31855 "); if (max6675_temp & 1) - SERIAL_ERRORLNPGM("Open Circuit"); + SERIAL_ECHOLNPGM("Open Circuit"); else if (max6675_temp & 2) - SERIAL_ERRORLNPGM("Short to GND"); + SERIAL_ECHOLNPGM("Short to GND"); else if (max6675_temp & 4) - SERIAL_ERRORLNPGM("Short to VCC"); + SERIAL_ECHOLNPGM("Short to VCC"); #else - SERIAL_ERRORLNPGM("MAX6675"); + SERIAL_ECHOLNPGM("MAX6675"); #endif - max6675_temp = MAX6675_TMAX * 4; // thermocouple open + + // Thermocouple open + max6675_temp = 4 * ( + #if COUNT_6675 > 1 + hindex ? HEATER_1_MAX6675_TMAX : HEATER_0_MAX6675_TMAX + #elif ENABLED(HEATER_1_USES_MAX6675) + HEATER_1_MAX6675_TMAX + #else + HEATER_0_MAX6675_TMAX + #endif + ); } else max6675_temp >>= MAX6675_DISCARD_BITS; @@ -1676,24 +1715,28 @@ void Temperature::disable_all_heaters() { if (max6675_temp & 0x00002000) max6675_temp |= 0xFFFFC000; #endif - return (int)max6675_temp; + return int(max6675_temp); } -#endif // HEATER_0_USES_MAX6675 +#endif // HAS_MAX6675 /** * Get raw temperatures */ void Temperature::set_current_temp_raw() { + #if HAS_TEMP_ADC_0 && DISABLED(HEATER_0_USES_MAX6675) current_temperature_raw[0] = raw_temp_value[0]; #endif + #if HAS_TEMP_ADC_1 + #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) redundant_temperature_raw = raw_temp_value[1]; - #else + #elif DISABLED(HEATER_1_USES_MAX6675) current_temperature_raw[1] = raw_temp_value[1]; #endif + #if HAS_TEMP_ADC_2 current_temperature_raw[2] = raw_temp_value[2]; #if HAS_TEMP_ADC_3 @@ -1706,6 +1749,7 @@ void Temperature::set_current_temp_raw() { #endif // HAS_TEMP_ADC_4 #endif // HAS_TEMP_ADC_3 #endif // HAS_TEMP_ADC_2 + #endif // HAS_TEMP_ADC_1 #if HAS_HEATED_BED @@ -1787,17 +1831,17 @@ void Temperature::readings_ready() { #if HAS_HEATED_BED #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP - #define GEBED <= + #define BEDCMP(A,B) ((A)<=(B)) #else - #define GEBED >= + #define BEDCMP(A,B) ((A)>=(B)) #endif const bool bed_on = (target_temperature_bed > 0) #if ENABLED(PIDTEMPBED) || (soft_pwm_amount_bed > 0) #endif ; - if (current_temperature_bed_raw GEBED bed_maxttemp_raw) max_temp_error(-1); - if (bed_minttemp_raw GEBED current_temperature_bed_raw && bed_on) min_temp_error(-1); + if (BEDCMP(current_temperature_bed_raw, bed_maxttemp_raw)) max_temp_error(-1); + if (BEDCMP(bed_minttemp_raw, current_temperature_bed_raw) && bed_on) min_temp_error(-1); #endif } @@ -1832,7 +1876,7 @@ void Temperature::isr() { // avoid multiple loads of pwm_count uint8_t pwm_count_tmp = pwm_count; - #if ENABLED(ADC_KEYPAD) + #if HAS_ADC_BUTTONS static unsigned int raw_ADCKey_value = 0; #endif @@ -1878,7 +1922,7 @@ void Temperature::isr() { ; /** - * Standard PWM modulation + * Standard heater PWM modulation */ if (pwm_count_tmp >= 127) { pwm_count_tmp -= 127; @@ -2123,7 +2167,7 @@ void Temperature::isr() { // Update lcd buttons 488 times per second // static bool do_buttons; - if ((do_buttons ^= true)) lcd_buttons_update(); + if ((do_buttons ^= true)) ui.update_buttons(); /** * One sensor is sampled on every other call of the ISR. @@ -2253,7 +2297,7 @@ void Temperature::isr() { break; #endif - #if ENABLED(ADC_KEYPAD) + #if HAS_ADC_BUTTONS case Prepare_ADC_KEY: HAL_START_ADC(ADC_KEYPAD_PIN); break; @@ -2321,8 +2365,8 @@ void Temperature::isr() { UNUSED(e); #endif - SERIAL_PROTOCOLCHAR_P(port, ' '); - SERIAL_PROTOCOLCHAR_P(port, + SERIAL_CHAR_P(port, ' '); + SERIAL_CHAR_P(port, #if HAS_TEMP_CHAMBER && HAS_HEATED_BED && HAS_TEMP_HOTEND e == -2 ? 'C' : e == -1 ? 'B' : 'T' #elif HAS_HEATED_BED && HAS_TEMP_HOTEND @@ -2334,27 +2378,27 @@ void Temperature::isr() { #endif ); #if HOTENDS > 1 - if (e >= 0) SERIAL_PROTOCOLCHAR_P(port, '0' + e); + if (e >= 0) SERIAL_CHAR_P(port, '0' + e); #endif - SERIAL_PROTOCOLCHAR_P(port, ':'); - SERIAL_PROTOCOL_P(port, c); - SERIAL_PROTOCOLPAIR_P(port, " /" , t); + SERIAL_CHAR_P(port, ':'); + SERIAL_ECHO_P(port, c); + SERIAL_ECHOPAIR_P(port, " /" , t); #if ENABLED(SHOW_TEMP_ADC_VALUES) - SERIAL_PROTOCOLPAIR_P(port, " (", r / OVERSAMPLENR); - SERIAL_PROTOCOLCHAR_P(port, ')'); + SERIAL_ECHOPAIR_P(port, " (", r / OVERSAMPLENR); + SERIAL_CHAR_P(port, ')'); #endif delay(2); } - void Temperature::print_heaterstates( + void Temperature::print_heater_states(const uint8_t target_extruder #if NUM_SERIAL > 1 - const int8_t port + , const int8_t port #endif ) { #if HAS_TEMP_HOTEND - print_heater_state(degHotend(gcode.target_extruder), degTargetHotend(gcode.target_extruder) + print_heater_state(degHotend(target_extruder), degTargetHotend(target_extruder) #if ENABLED(SHOW_TEMP_ADC_VALUES) - , rawHotendTemp(gcode.target_extruder) + , rawHotendTemp(target_extruder) #endif #if NUM_SERIAL > 1 , port @@ -2391,17 +2435,17 @@ void Temperature::isr() { , e ); #endif - SERIAL_PROTOCOLPGM_P(port, " @:"); - SERIAL_PROTOCOL_P(port, getHeaterPower(gcode.target_extruder)); + SERIAL_ECHOPGM_P(port, " @:"); + SERIAL_ECHO_P(port, getHeaterPower(target_extruder)); #if HAS_HEATED_BED - SERIAL_PROTOCOLPGM_P(port, " B@:"); - SERIAL_PROTOCOL_P(port, getHeaterPower(-1)); + SERIAL_ECHOPGM_P(port, " B@:"); + SERIAL_ECHO_P(port, getHeaterPower(-1)); #endif #if HOTENDS > 1 HOTEND_LOOP() { - SERIAL_PROTOCOLPAIR_P(port, " @", e); - SERIAL_PROTOCOLCHAR_P(port, ':'); - SERIAL_PROTOCOL_P(port, getHeaterPower(e)); + SERIAL_ECHOPAIR_P(port, " @", e); + SERIAL_CHAR_P(port, ':'); + SERIAL_ECHO_P(port, getHeaterPower(e)); } #endif } @@ -2414,7 +2458,7 @@ void Temperature::isr() { void Temperature::auto_report_temperatures() { if (auto_report_temp_interval && ELAPSED(millis(), next_temp_report_ms)) { next_temp_report_ms = millis() + 1000UL * auto_report_temp_interval; - print_heaterstates(); + print_heater_states(active_extruder); SERIAL_EOL(); } } @@ -2425,9 +2469,9 @@ void Temperature::isr() { void Temperature::set_heating_message(const uint8_t e) { const bool heating = isHeatingHotend(e); #if HOTENDS > 1 - lcd_status_printf_P(0, heating ? PSTR("E%i " MSG_HEATING) : PSTR("E%i " MSG_COOLING), int(e + 1)); + ui.status_printf_P(0, heating ? PSTR("E%i " MSG_HEATING) : PSTR("E%i " MSG_COOLING), int(e + 1)); #else - lcd_setstatusPGM(heating ? PSTR("E " MSG_HEATING) : PSTR("E " MSG_COOLING)); + ui.set_status_P(heating ? PSTR("E " MSG_HEATING) : PSTR("E " MSG_COOLING)); #endif } #endif @@ -2441,7 +2485,11 @@ void Temperature::isr() { #define MIN_COOLING_SLOPE_TIME 60 #endif - bool Temperature::wait_for_hotend(const uint8_t target_extruder, const bool no_wait_for_cooling/*=true*/) { + bool Temperature::wait_for_hotend(const uint8_t target_extruder, const bool no_wait_for_cooling/*=true*/ + #if G26_CLICK_CAN_CANCEL + , const bool click_to_cancel/*=false*/ + #endif + ) { #if TEMP_RESIDENCY_TIME > 0 millis_t residency_start_ms = 0; // Loop until the temperature has stabilized @@ -2476,15 +2524,15 @@ void Temperature::isr() { } 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(); + print_heater_states(target_extruder); #if TEMP_RESIDENCY_TIME > 0 - SERIAL_PROTOCOLPGM(" W:"); + SERIAL_ECHOPGM(" W:"); if (residency_start_ms) - SERIAL_PROTOCOL(long((((TEMP_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL)); + SERIAL_ECHO(long((((TEMP_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL)); else - SERIAL_PROTOCOLCHAR('?'); + SERIAL_CHAR('?'); #endif SERIAL_EOL(); } @@ -2525,10 +2573,17 @@ void Temperature::isr() { } } + #if G26_CLICK_CAN_CANCEL + if (click_to_cancel && ui.use_click()) { + wait_for_heatup = false; + ui.quick_feedback(); + } + #endif + } while (wait_for_heatup && TEMP_CONDITIONS); if (wait_for_heatup) { - lcd_reset_status(); + ui.reset_status(); #if ENABLED(PRINTER_EVENT_LEDS) printerEventLEDs.onHeatingDone(); #endif @@ -2552,7 +2607,11 @@ void Temperature::isr() { #define MIN_COOLING_SLOPE_TIME_BED 60 #endif - void Temperature::wait_for_bed(const bool no_wait_for_cooling) { + bool Temperature::wait_for_bed(const bool no_wait_for_cooling/*=true*/ + #if G26_CLICK_CAN_CANCEL + , const bool click_to_cancel/*=false*/ + #endif + ) { #if TEMP_BED_RESIDENCY_TIME > 0 millis_t residency_start_ms = 0; // Loop until the temperature has stabilized @@ -2572,8 +2631,6 @@ void Temperature::isr() { KEEPALIVE_STATE(NOT_BUSY); #endif - gcode.target_extruder = active_extruder; // for print_heaterstates - #if ENABLED(PRINTER_EVENT_LEDS) const float start_temp = degBed(); printerEventLEDs.onBedHeatingStart(); @@ -2592,13 +2649,13 @@ void Temperature::isr() { now = millis(); if (ELAPSED(now, next_temp_ms)) { //Print Temp Reading every 1 second while heating up. next_temp_ms = now + 1000UL; - print_heaterstates(); + print_heater_states(active_extruder); #if TEMP_BED_RESIDENCY_TIME > 0 - SERIAL_PROTOCOLPGM(" W:"); + SERIAL_ECHOPGM(" W:"); if (residency_start_ms) - SERIAL_PROTOCOL(long((((TEMP_BED_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL)); + SERIAL_ECHO(long((((TEMP_BED_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL)); else - SERIAL_PROTOCOLCHAR('?'); + SERIAL_CHAR('?'); #endif SERIAL_EOL(); } @@ -2639,13 +2696,22 @@ void Temperature::isr() { } } + #if G26_CLICK_CAN_CANCEL + if (click_to_cancel && ui.use_click()) { + wait_for_heatup = false; + ui.quick_feedback(); + } + #endif + } while (wait_for_heatup && TEMP_BED_CONDITIONS); - if (wait_for_heatup) lcd_reset_status(); + if (wait_for_heatup) ui.reset_status(); #if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE) gcode.busy_state = old_busy_state; #endif + + return wait_for_heatup; } #endif // HAS_HEATED_BED diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 7c56105552..f9d21c3541 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -112,7 +112,7 @@ enum ADCSensorState : char { Prepare_FILWIDTH, Measure_FILWIDTH, #endif - #if ENABLED(ADC_KEYPAD) + #if HAS_ADC_BUTTONS Prepare_ADC_KEY, Measure_ADC_KEY, #endif @@ -138,6 +138,8 @@ enum ADCSensorState : char { #define unscalePID_d(d) ( float(d) * PID_dT ) #endif +#define G26_CLICK_CAN_CANCEL (HAS_LCD_MENU && ENABLED(G26_MESH_VALIDATION)) + class Temperature { public: @@ -289,7 +291,7 @@ class Temperature { #endif public: - #if ENABLED(ADC_KEYPAD) + #if HAS_ADC_BUTTONS static uint32_t current_ADCKey_raw; static uint8_t ADCKey_count; #endif @@ -309,13 +311,13 @@ class Temperature { /** * Static (class) methods */ - static float analog2temp(const int raw, const uint8_t e); + static float analog_to_celsius_hotend(const int raw, const uint8_t e); #if HAS_HEATED_BED - static float analog2tempBed(const int raw); + static float analog_to_celsius_bed(const int raw); #endif #if HAS_TEMP_CHAMBER - static float analog2tempChamber(const int raw); + static float analog_to_celsiusChamber(const int raw); #endif /** @@ -356,7 +358,7 @@ class Temperature { #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) - static float analog2widthFil(); // Convert raw Filament Width to millimeters + static float analog_to_mm_fil_width(); // Convert raw Filament Width to millimeters static int8_t widthFil_to_size_ratio(); // Convert Filament Width (mm) to an extrusion ratio #endif @@ -426,7 +428,11 @@ class Temperature { } #if HAS_TEMP_HOTEND - static bool wait_for_hotend(const uint8_t target_extruder, const bool no_wait_for_cooling=true); + static bool wait_for_hotend(const uint8_t target_extruder, const bool no_wait_for_cooling=true + #if G26_CLICK_CAN_CANCEL + , const bool click_to_cancel=false + #endif + ); #endif #if HAS_HEATED_BED @@ -459,7 +465,11 @@ class Temperature { static void start_watching_bed(); #endif - static void wait_for_bed(const bool no_wait_for_cooling); + static bool wait_for_bed(const bool no_wait_for_cooling=true + #if G26_CLICK_CAN_CANCEL + , const bool click_to_cancel=false + #endif + ); #endif // HAS_HEATED_BED @@ -591,9 +601,9 @@ class Temperature { #endif // HEATER_IDLE_HANDLER #if HAS_TEMP_SENSOR - static void print_heaterstates( + static void print_heater_states(const uint8_t target_extruder #if NUM_SERIAL > 1 - const int8_t port = -1 + , const int8_t port = -1 #endif ); #if ENABLED(AUTO_REPORT_TEMPERATURES) @@ -622,8 +632,23 @@ class Temperature { static void updateTemperaturesFromRawValues(); - #if ENABLED(HEATER_0_USES_MAX6675) - static int read_max6675(); + #define HAS_MAX6675 (ENABLED(HEATER_0_USES_MAX6675) || ENABLED(HEATER_1_USES_MAX6675)) + #if HAS_MAX6675 + #if ENABLED(HEATER_0_USES_MAX6675) && ENABLED(HEATER_1_USES_MAX6675) + #define COUNT_6675 2 + #else + #define COUNT_6675 1 + #endif + #if COUNT_6675 > 1 + #define READ_MAX6675(N) read_max6675(N) + #else + #define READ_MAX6675(N) read_max6675() + #endif + static int read_max6675( + #if COUNT_6675 > 1 + const uint8_t hindex=0 + #endif + ); #endif static void checkExtruderAutoFans(); diff --git a/Marlin/src/module/thermistor/thermistor_1.h b/Marlin/src/module/thermistor/thermistor_1.h index ea887952f5..295bd985c2 100644 --- a/Marlin/src/module/thermistor/thermistor_1.h +++ b/Marlin/src/module/thermistor/thermistor_1.h @@ -22,6 +22,17 @@ // R25 = 100 kOhm, beta25 = 4092 K, 4.7 kOhm pull-up, bed thermistor const short temptable_1[][2] PROGMEM = { + { OV( 1), 355 }, + { OV( 3), 350 }, + { OV( 5), 345 }, + { OV( 7), 340 }, + { OV( 9), 335 }, + { OV( 11), 330 }, + { OV( 13), 325 }, + { OV( 15), 320 }, + { OV( 17), 315 }, + { OV( 19), 310 }, + { OV( 21), 305 }, { OV( 23), 300 }, { OV( 25), 295 }, { OV( 27), 290 }, diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 1d255a88fb..81dbe9043f 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -96,13 +96,11 @@ #endif // DO_SWITCH_EXTRUDER #if ENABLED(SWITCHING_NOZZLE) - void move_nozzle_servo(const uint8_t e) { planner.synchronize(); MOVE_SERVO(SWITCHING_NOZZLE_SERVO_NR, servo_angles[SWITCHING_NOZZLE_SERVO_NR][e]); safe_delay(500); } - #endif // SWITCHING_NOZZLE #if ENABLED(PARKING_EXTRUDER) @@ -417,10 +415,8 @@ inline void invalid_extruder_error(const uint8_t e) { SERIAL_ECHO_START(); - SERIAL_CHAR('T'); - SERIAL_ECHO_F(e, DEC); - SERIAL_CHAR(' '); - SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER); + SERIAL_CHAR('T'); SERIAL_ECHO(int(e)); + SERIAL_CHAR(' '); SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER); } #if ENABLED(DUAL_X_CARRIAGE) @@ -481,6 +477,8 @@ inline void invalid_extruder_error(const uint8_t e) { active_extruder_parked = true; delayed_move_time = 0; break; + default: + break; } #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -498,25 +496,28 @@ inline void invalid_extruder_error(const uint8_t e) { * previous tool out of the way and the new tool into place. */ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool no_move/*=false*/) { - #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 + #if ENABLED(MIXING_EXTRUDER) - if (tmp_extruder >= MIXING_VIRTUAL_TOOLS) - return invalid_extruder_error(tmp_extruder); + UNUSED(fr_mm_s); UNUSED(no_move); + + if (tmp_extruder >= MIXING_VIRTUAL_TOOLS) + return invalid_extruder_error(tmp_extruder); + + #if MIXING_VIRTUAL_TOOLS > 1 // T0-Tnnn: Switch virtual tool by changing the index to the mix mixer.T(uint_fast8_t(tmp_extruder)); - UNUSED(fr_mm_s); - UNUSED(no_move); + #endif #elif EXTRUDERS < 2 + UNUSED(fr_mm_s); UNUSED(no_move); + if (tmp_extruder) invalid_extruder_error(tmp_extruder); return; - #else + #else // EXTRUDERS > 1 - #if DISABLED(MIXING_EXTRUDER) - planner.synchronize(); - #endif + planner.synchronize(); #if ENABLED(DUAL_X_CARRIAGE) // Only T0 allowed if the Printer is in DXC_DUPLICATION_MODE or DXC_SCALED_DUPLICATION_MODE if (tmp_extruder != 0 && dxc_is_duplicating()) @@ -540,7 +541,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n } #if HAS_LCD_MENU - lcd_return_to_status(); + ui.return_to_status(); #endif #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) @@ -552,8 +553,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n #endif if (should_swap) { if (too_cold) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_ERR_HOTEND_TOO_COLD); + SERIAL_ERROR_MSG(MSG_ERR_HOTEND_TOO_COLD); #if ENABLED(SINGLENOZZLE) active_extruder = tmp_extruder; return; @@ -593,8 +593,9 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n #endif + set_destination_from_current(); + if (!no_move) { - set_destination_from_current(); #if DISABLED(SWITCHING_NOZZLE) // Do a small lift to avoid the workpiece in the move back (below) #if ENABLED(TOOLCHANGE_PARK) @@ -748,5 +749,5 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(active_extruder)); - #endif // EXTRUDERS <= 1 && (!MIXING_EXTRUDER || MIXING_VIRTUAL_TOOLS <= 1) + #endif // EXTRUDERS > 1 } diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 9488dff741..da1b0cd435 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -132,12 +132,16 @@ #include "pins_ULTIMAIN_2.h" // ATmega2560 env:megaatmega2560 #elif MB(FORMBOT_RAPTOR) #include "pins_FORMBOT_RAPTOR.h" // ATmega2560 env:megaatmega2560 +#elif MB(FORMBOT_RAPTOR2) + #include "pins_FORMBOT_RAPTOR2.h" // ATmega2560 env:megaatmega2560 #elif MB(FORMBOT_TREX2PLUS) #include "pins_FORMBOT_TREX2PLUS.h" // ATmega2560 env:megaatmega2560 #elif MB(FORMBOT_TREX3) #include "pins_FORMBOT_TREX3.h" // ATmega2560 env:megaatmega2560 #elif MB(RUMBA) #include "pins_RUMBA.h" // ATmega2560 env:megaatmega2560 +#elif MB(RUMBA_RAISE3D) + #include "pins_RUMBA_RAISE3D.h" // ATmega2560 env:megaatmega2560 #elif MB(BQ_ZUM_MEGA_3D) #include "pins_BQ_ZUM_MEGA_3D.h" // ATmega2560 env:megaatmega2560 #elif MB(MAKEBOARD_MINI) @@ -149,7 +153,7 @@ #elif MB(RAMPS_ENDER_4) #include "pins_RAMPS_ENDER_4.h" // ATmega2560 env:megaatmega2560 #elif MB(RAMPS_CREALITY) - #include "pins_RAMPS_CREALITY.h" // ATmega2560 env:megaatmega2560 + #include "pins_RAMPS_CREALITY.h" // ATmega2560 env:megaatmega2560 #elif MB(FYSETC_F6_13) #include "pins_FYSETC_F6_13.h" // ATmega2560 env:megaatmega2560 @@ -365,6 +369,8 @@ #include "pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug #elif MB(ULTRATRONICS_PRO) #include "pins_ULTRATRONICS_PRO.h" // SAM3X8E env:DUE env:DUE_debug +#elif MB(ARCHIM1) + #include "pins_ARCHIM1.h" // SAM3X8E env:DUE env:DUE_debug #elif MB(ARCHIM2) #include "pins_ARCHIM2.h" // SAM3X8E env:DUE env:DUE_debug #elif MB(ALLIGATOR) diff --git a/Marlin/src/pins/pinsDebug.h b/Marlin/src/pins/pinsDebug.h index 108a16b92f..d8d6966a7e 100644 --- a/Marlin/src/pins/pinsDebug.h +++ b/Marlin/src/pins/pinsDebug.h @@ -140,11 +140,11 @@ inline void report_pin_state_extended(pin_t pin, bool ignore, bool extended = fa if (pin == 46 || pin == 47) { if (pin == 46) { print_input_or_output(GET_OUTPUT(46)); - SERIAL_PROTOCOL(READ(46)); + SERIAL_ECHO(READ(46)); } else if (pin == 47) { print_input_or_output(GET_OUTPUT(47)); - SERIAL_PROTOCOL(READ(47)); + SERIAL_ECHO(READ(47)); } } else @@ -160,14 +160,14 @@ inline void report_pin_state_extended(pin_t pin, bool ignore, bool extended = fa // because this could interfere with inductive/capacitive // sensors (high impedance voltage divider) and with PT100 amplifier print_input_or_output(false); - SERIAL_PROTOCOL(digitalRead_mod(pin)); + SERIAL_ECHO(digitalRead_mod(pin)); } else if (pwm_status(pin)) { // do nothing } else { print_input_or_output(true); - SERIAL_PROTOCOL(digitalRead_mod(pin)); + SERIAL_ECHO(digitalRead_mod(pin)); } } if (!multi_name_pin && extended) pwm_details(pin); // report PWM capabilities only on the first pass & only if doing an extended report @@ -193,23 +193,23 @@ inline void report_pin_state_extended(pin_t pin, bool ignore, bool extended = fa if (extended) { #if AVR_AT90USB1286_FAMILY //Teensy IDEs don't know about these pins so must use FASTIO if (pin == 46 || pin == 47) { - SERIAL_PROTOCOL_SP(12); + SERIAL_ECHO_SP(12); if (pin == 46) { print_input_or_output(GET_OUTPUT(46)); - SERIAL_PROTOCOL(READ(46)); + SERIAL_ECHO(READ(46)); } else { print_input_or_output(GET_OUTPUT(47)); - SERIAL_PROTOCOL(READ(47)); + SERIAL_ECHO(READ(47)); } } else #endif { if (GET_PINMODE(pin)) { - SERIAL_PROTOCOL_SP(MAX_NAME_LENGTH - 16); + SERIAL_ECHO_SP(MAX_NAME_LENGTH - 16); print_input_or_output(true); - SERIAL_PROTOCOL(digitalRead_mod(pin)); + SERIAL_ECHO(digitalRead_mod(pin)); } else { if (IS_ANALOG(pin)) { @@ -221,7 +221,7 @@ inline void report_pin_state_extended(pin_t pin, bool ignore, bool extended = fa SERIAL_ECHO_SP(MAX_NAME_LENGTH - 16); // add padding if not an analog pin print_input_or_output(false); - SERIAL_PROTOCOL(digitalRead_mod(pin)); + SERIAL_ECHO(digitalRead_mod(pin)); } //if (!pwm_status(pin)) SERIAL_CHAR(' '); // add padding if it's not a PWM pin if (extended) pwm_details(pin); // report PWM capabilities only if doing an extended report diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index df4e163298..e7e38256e0 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -572,8 +572,11 @@ #if PIN_EXISTS(MAX6675_SCK) REPORT_NAME_DIGITAL(__LINE__, MAX6675_SCK_PIN) #endif -#if defined(MAX6675_SS) && MAX6675_SS >= 0 - REPORT_NAME_DIGITAL(__LINE__, MAX6675_SS) +#if PIN_EXISTS(MAX6675_SS) + REPORT_NAME_DIGITAL(__LINE__, MAX6675_SS_PIN) +#endif +#if PIN_EXISTS(MAX6675_SS2) + REPORT_NAME_DIGITAL(__LINE__, MAX6675_SS2_PIN) #endif // #if defined(MISO) && MISO >= 0 // REPORT_NAME_DIGITAL(__LINE__, MISO) @@ -803,11 +806,11 @@ #if PIN_EXISTS(SUICIDE) REPORT_NAME_DIGITAL(__LINE__, SUICIDE_PIN) #endif -#if defined(THERMO_CS1) && THERMO_CS1 >= 0 - REPORT_NAME_DIGITAL(__LINE__, THERMO_CS1) +#if PIN_EXISTS(THERMO_CS1) + REPORT_NAME_DIGITAL(__LINE__, THERMO_CS1_PIN) #endif -#if defined(THERMO_CS2) && THERMO_CS2 >= 0 - REPORT_NAME_DIGITAL(__LINE__, THERMO_CS2) +#if PIN_EXISTS(THERMO_CS2) + REPORT_NAME_DIGITAL(__LINE__, THERMO_CS2_PIN) #endif #if PIN_EXISTS(THERMO_DO) REPORT_NAME_DIGITAL(__LINE__, THERMO_DO_PIN) diff --git a/Marlin/src/pins/pins_ANET_10.h b/Marlin/src/pins/pins_ANET_10.h index cf26ff6467..95774e4309 100644 --- a/Marlin/src/pins/pins_ANET_10.h +++ b/Marlin/src/pins/pins_ANET_10.h @@ -89,12 +89,10 @@ */ #ifndef __AVR_ATmega1284P__ - #error "Oops! Select 'Anet V1.0', 'Anet V1.0 (Optiboot)' or 'Sanguino' in 'Tools > Board' and 'ATmega1284P' in 'Tools > Processor.'" + #error "Oops! Select 'Sanguino' in 'Tools > Board' and 'ATmega1284P' in 'Tools > Processor.' (For PlatformIO, use 'melzi' or 'melzi_optiboot.')" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "Anet" -#endif +#define BOARD_NAME "Anet 1.0" // // Limit Switches @@ -163,9 +161,6 @@ #define LCD_PINS_D5 11 #define LCD_PINS_D6 16 #define LCD_PINS_D7 17 - #define BTN_EN1 -1 - #define BTN_EN2 -1 - #define BTN_ENC -1 #define ADC_KEYPAD_PIN 1 #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(ANET_FULL_GRAPHICS_LCD) // Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics diff --git a/Marlin/src/pins/pins_ARCHIM1.h b/Marlin/src/pins/pins_ARCHIM1.h new file mode 100644 index 0000000000..5a69561d41 --- /dev/null +++ b/Marlin/src/pins/pins_ARCHIM1.h @@ -0,0 +1,195 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * ARCHIM1 pin assignment + * + * The Archim 1.0 board requires Arduino Archim addons installed. + * + * - Add the following URL to Arduino IDE's Additional Board Manager URLs: + * https://raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json + * + * - In the Arduino IDE Board Manager search for Archim and install the package. + * + * - Change your target board to "Archim". + * + * Further information on the UltiMachine website... + * https://github.com/ultimachine/Archim/wiki + */ + +#ifndef __SAM3X8E__ + #error "Oops! Select 'Archim' in 'Tools > Board.'" +#endif + +#define BOARD_NAME "Archim 1.0" + +// +// Items marked * have been altered from Archim v1.0 +// + +// +// Servos +// +#define SERVO0_PIN 20 // D20 PB12 (Header J20 20) +#define SERVO1_PIN 21 // D21 PB13 (Header J20 19) + + +// +// Limit Switches +// +#define X_MIN_PIN 14 // PD4 MIN ES1 +#define X_MAX_PIN 32 // PD10 MAX ES1 +#define Y_MIN_PIN 29 // PD6 MIN ES2 +#define Y_MAX_PIN 15 // PD5 MAX ES2 +#define Z_MIN_PIN 31 // PA7 MIN ES3 +#define Z_MAX_PIN 30 // PD9 MAX ES3 + +// +// Z Probe (when not Z_MIN_PIN) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN 32 +#endif + +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN 66 // D66 PB15 (Header J20 15) +#endif +#ifndef FIL_RUNOUT2_PIN + #define FIL_RUNOUT2_PIN 67 // D67 PB16 (Header J20 16) +#endif + + +// +// Steppers +// +#define X_STEP_PIN 40 // PC8 STEP1 * +#define X_DIR_PIN 59 // PA4 DIR1 * +#define X_ENABLE_PIN 41 // PC9 EN1 + +#define Y_STEP_PIN 49 // PC14 STEP2 * +#define Y_DIR_PIN 47 // PC16 DIR2 * +#define Y_ENABLE_PIN 48 // PC15 EN2 * + +#define Z_STEP_PIN 36 // PC4 STEP Z * +#define Z_DIR_PIN 107 // PB10 DIR Z * +#define Z_ENABLE_PIN 96 // PC10 EN Z -AddOns * + +#define E0_STEP_PIN 78 // PB23 STEP3 * +#define E0_DIR_PIN 22 // PB26 DIR3 * +#define E0_ENABLE_PIN 97 // PB24 EN3 -Addons * + +#define E1_STEP_PIN 26 // PD1 STEP4 * +#define E1_DIR_PIN 27 // PD2 DIR4 * +#define E1_ENABLE_PIN 28 // PD3 EN4 * + +// Microstepping mode pins * +#define X_MS1_PIN 39 // PC7 MOD0E1 - As listed in schematic +#define X_MS2_PIN 38 // PC6 MOD1E1 +#define X_MS3_PIN 37 // PC5 MOD2E1 + +#define Y_MS1_PIN 50 // PC13 MODE0E2 +#define Y_MS2_PIN 51 // PC12 MODE1E2 +#define Y_MS3_PIN 92 // PC11 MODE2E2 - AddOns + +#define Z_MS1_PIN 44 // PC19 MOD0E Z +#define Z_MS2_PIN 45 // PC18 MOD1E Z +#define Z_MS3_PIN 46 // PC17 MOD2E Z + +#define E0_MS1_PIN 105 // PB22 MOD0E3 - AddOns +#define E0_MS2_PIN 106 // PC27 MOD1E3 - AddOns +#define E0_MS3_PIN 104 // PC20 MOD2E3 - AddOns + +#define E1_MS1_PIN 25 // PD0 MOD0E4 +#define E1_MS2_PIN 18 // PA11 MOD1E4 +#define E1_MS3_PIN 19 // PA10 MOD2E4 + +// Motor current PWM pins * +#define MOTOR_CURRENT_PWM_X_PIN 58 // PA6 X-REF TIOB2 +#define MOTOR_CURRENT_PWM_Y_PIN 12 // PD8 Y-REF TIOB8 +#define MOTOR_CURRENT_PWM_Z_PIN 10 // PC29 Z-REF TIOB7 +#define MOTOR_CURRENT_PWM_E0_PIN 3 // PC28 E1-REF TIOA7 +#define MOTOR_CURRENT_PWM_E1_PIN 11 // PD7 E2-REF TIOA8 + +#define MOTOR_CURRENT_PWM_RANGE 2750 // (3.3 Volts * 100000 Ohms) / (100000 Ohms + 20000 Ohms) = 2.75 Volts (max vref) +#define DEFAULT_PWM_MOTOR_CURRENT { 1000, 1000, 1000 } //, 1000, 1000} // X Y Z E0 E1, 1000 = 1000mAh + +// +// Temperature Sensors +// +#define TEMP_0_PIN 10 // D10 PB19 THERM AN1 * +#define TEMP_1_PIN 9 // D9 PB18 THERM AN2 * +#define TEMP_2_PIN 8 // D8 PB17 THERM AN4 * +#define TEMP_BED_PIN 11 // D11 PB20 THERM AN3 * + +// +// Heaters / Fans +// +#define HEATER_0_PIN 6 // D6 PC24 FET_PWM3 +#define HEATER_1_PIN 7 // D7 PC23 FET_PWM4 +#define HEATER_2_PIN 8 // D8 PC22 FET_PWM5 +#define HEATER_BED_PIN 9 // D9 PC21 BED_PWM + +#ifndef FAN_PIN + #define FAN_PIN 4 // D4 PC26 FET_PWM1 +#endif +#define FAN1_PIN 5 // D5 PC25 FET_PWM2 + +// +// Misc. Functions +// + +// Internal MicroSD card reader on the PCB +#define INT_SCK_PIN 42 // D42 PA19/MCCK +#define INT_MISO_PIN 43 // D43 PA20/MCCDA +#define INT_MOSI_PIN 73 // D73 PA21/MCDA0 +#define INT_SDSS 55 // D55 PA24/MCDA3 + +// External SD card reader on SC2 +#define SCK_PIN 76 // D76 PA27 +#define MISO_PIN 74 // D74 PA25 +#define MOSI_PIN 75 // D75 PA26 +#define SDSS 87 // D87 PA29 + +// 2MB SPI Flash +#define SPI_FLASH_SS 52 // D52 PB21 + +// +// LCD / Controller +// +#if ENABLED(ULTRA_LCD) + #define BEEPER_PIN 23 // D24 PA15_CTS1 + #define LCD_PINS_RS 17 // D17 PA12_RXD1 + #define LCD_PINS_ENABLE 24 // D23 PA14_RTS1 + #define LCD_PINS_D4 69 // D69 PA0_CANTX0 + #define LCD_PINS_D5 54 // D54 PA16_SCK1 + #define LCD_PINS_D6 68 // D68 PA1_CANRX0 + #define LCD_PINS_D7 34 // D34 PC2_PWML0 + + #define SD_DETECT_PIN 2 // D2 PB25_TIOA0 + + #if ENABLED(NEWPANEL) + // Buttons on AUX-2 + #define BTN_EN1 60 // D60 PA3_TIOB1 + #define BTN_EN2 13 // D13 PB27_TIOB0 + #define BTN_ENC 16 // D16 PA13_TXD1 + #endif // NEWPANEL +#endif // ULTRA_LCD diff --git a/Marlin/src/pins/pins_ARCHIM2.h b/Marlin/src/pins/pins_ARCHIM2.h index ad71df72fd..3d532a426f 100644 --- a/Marlin/src/pins/pins_ARCHIM2.h +++ b/Marlin/src/pins/pins_ARCHIM2.h @@ -21,53 +21,53 @@ */ /** - * ARCHIM2 pin assignment (pins_ARCHIM2.h) + * ARCHIM2 pin assignment * - * The Archim2 board requires Arduino Archim addons installed. - * Add the following URL to Arduino IDE's Additional Board Manager URLs: - * https://raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json - * In the Arduino IDE Board Manager search for Archim and install the package. - * Change your target board to "Archim". + * The Archim 2.0 board requires Arduino Archim addons installed. * - * Further information is provided by UltiMachine - * https://github.com/ultimachine/Archim/wiki/Archim-v2.0 - * https://github.com/ultimachine/Archim/wiki + * - Add the following URL to Arduino IDE's Additional Board Manager URLs: + * https://raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json * + * - In the Arduino IDE Board Manager search for Archim and install the package. + * + * - Change your target board to "Archim". + * + * Further information on the UltiMachine website... + * https://github.com/ultimachine/Archim/wiki */ #ifndef __SAM3X8E__ #error "Oops! Select 'Archim' in 'Tools > Board.'" #endif +#define BOARD_NAME "Archim 2.0" + // // Items marked * have been altered from Archim v1.0 // -// TMC2130 Diag Pins (currently just for reference) -#define X_DIAG_PIN 59 // PA4 X_DIAG -#define Y_DIAG_PIN 48 // PC15 Y_DIAG -#define Z_DIAG_PIN 36 // PC4 Z_DIAG -#define E0_DIAG_PIN 78 // PB23 E1_DIAG -#define E1_DIAG_PIN 25 // PD0 E2_DIAG - // // Servos // -#define SERVO0_PIN 20 // D20 PB12 (Header J20 20) -#define SERVO1_PIN 21 // D21 PB13 (Header J20 19) +#define SERVO0_PIN 20 // D20 PB12 (Header J20 20) +#define SERVO1_PIN 21 // D21 PB13 (Header J20 19) // // Limit Switches // -// Only use Diag Pins when SENSORLESS_HOMING is enabled for the TMC2130 drivers. -// Otherwise use a physical endstop based configuration. -#if DISABLED(SENSORLESS_HOMING) - #define X_MIN_PIN 14 // PD4 MIN ES1 - #define X_MAX_PIN 32 // PD10 MAX ES1 - #define Y_MIN_PIN 29 // PD6 MIN ES2 - #define Y_MAX_PIN 15 // PD5 MAX ES2 -#else +#if ENABLED(SENSORLESS_HOMING) + + // Only use Diag Pins when SENSORLESS_HOMING is enabled for the TMC2130 drivers. + // Otherwise use a physical endstop based configuration. + + // TMC2130 Diag Pins + #define X_DIAG_PIN 59 // PA4 + #define Y_DIAG_PIN 48 // PC15 + #define Z_DIAG_PIN 36 // PC4 + #define E0_DIAG_PIN 78 // PB23 + #define E1_DIAG_PIN 25 // PD0 + #if X_HOME_DIR == -1 #define X_MIN_PIN X_DIAG_PIN #define X_MAX_PIN 32 @@ -83,10 +83,18 @@ #define Y_MIN_PIN 29 #define Y_MAX_PIN Y_DIAG_PIN #endif + +#else + + #define X_MIN_PIN 14 // PD4 MIN ES1 + #define X_MAX_PIN 32 // PD10 MAX ES1 + #define Y_MIN_PIN 29 // PD6 MIN ES2 + #define Y_MAX_PIN 15 // PD5 MAX ES2 + #endif - #define Z_MIN_PIN 31 // PA7 MIN ES3 - #define Z_MAX_PIN 30 // PD9 MAX ES3 +#define Z_MIN_PIN 31 // PA7 MIN ES3 +#define Z_MAX_PIN 30 // PD9 MAX ES3 // // Z Probe (when not Z_MIN_PIN) @@ -154,45 +162,67 @@ // // Heaters / Fans // -#ifndef FAN_PIN - #define FAN_PIN 4 // D4 PC26 FET_PWM1 -#endif -#define FAN1_PIN 5 // D5 PC25 FET_PWM2 - #define HEATER_0_PIN 6 // D6 PC24 FET_PWM3 #define HEATER_1_PIN 7 // D7 PC23 FET_PWM4 #define HEATER_2_PIN 8 // D8 PC22 FET_PWM5 #define HEATER_BED_PIN 9 // D9 PC21 BED_PWM +#ifndef FAN_PIN + #define FAN_PIN 4 // D4 PC26 FET_PWM1 +#endif +#define FAN1_PIN 5 // D5 PC25 FET_PWM2 + // // Misc. Functions // // Internal MicroSD card reader on the PCB -#define INT_SCK_PIN 42 // D42 PA19/MCCK -#define INT_MISO_PIN 43 // D43 PA20/MCCDA -#define INT_MOSI_PIN 73 // D73 PA21/MCDA0 -#define INT_SDSS 55 // D55 PA24/MCDA3 +#define INT_SCK_PIN 42 // D42 PA19/MCCK +#define INT_MISO_PIN 43 // D43 PA20/MCCDA +#define INT_MOSI_PIN 73 // D73 PA21/MCDA0 +#define INT_SDSS 55 // D55 PA24/MCDA3 -// The external SD card reader on SC2, as well as 2 Mbyte SPI Flash -#define SCK_PIN 76 // D76 PA27 -#define MISO_PIN 74 // D74 PA25 -#define MOSI_PIN 75 // D75 PA26 -#define SDSS 87 // D87 PA29 -#define SPI_FLASH_SS 52 // D52 PB21 +// External SD card reader on SC2 +#define SCK_PIN 76 // D76 PA27 +#define MISO_PIN 74 // D74 PA25 +#define MOSI_PIN 75 // D75 PA26 +#define SDSS 87 // D87 PA29 + +// Unused Digital GPIO J20 Pins +#define GPIO_PB1_J20_5 94 // D94 PB1 (Header J20 5) +#define GPIO_PB0_J20_6 95 // D95 PB0 (Header J20 6) +#define GPIO_PB3_J20_7 103 // D103 PB3 (Header J20 7) +#define GPIO_PB2_J20_8 93 // D93 PB2 (Header J20 8) +#define GPIO_PB6_J20_9 99 // D99 PB6 (Header J20 9) +#define GPIO_PB5_J20_10 101 // D101 PB5 (Header J20 10) +#define GPIO_PB8_J20_11 100 // D100 PB8 (Header J20 11) +#define GPIO_PB4_J20_12 102 // D102 PB4 (Header J20 12) +#define GPIO_PB9_J20_13 108 // D108 PB9 (Header J20 13) +#define GPIO_PB7_J20_14 98 // D98 PB7 (Header J20 14) +#define GPIO_PB15_J20_15 66 // D66 PB15 (Header J20 15) +#define GPIO_PB16_J20_16 67 // D67 PB16 (Header J20 16) +#define GPIO_PB14_J20_17 53 // D53 PB14 (Header J20 17) +#define GPIO_PA18_J20_21 71 // D71 PA17 (Header J20 21) +#define GPIO_PA17_J20_22 70 // D70 PA17 (Header J20 22) + +// 2MB SPI Flash +#define SPI_FLASH_SS 52 // D52 PB21 + +// +// Filament Runout Sensor +// -// Filament runout sensor pins (or GPIO) #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN 66 // D66 PB15 (Header J20 15) + #define FIL_RUNOUT_PIN GPIO_PB15_J20_15 #endif #ifndef FIL_RUNOUT2_PIN - #define FIL_RUNOUT2_PIN 67 // D67 PB16 (Header J20 16) + #define FIL_RUNOUT2_PIN GPIO_PB16_J20_16 #endif // // LCD / Controller // -#if ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI) +#if ENABLED(ULTRA_LCD) #define BEEPER_PIN 23 // D24 PA15_CTS1 #define LCD_PINS_RS 17 // D17 PA12_RXD1 #define LCD_PINS_ENABLE 24 // D23 PA14_RTS1 @@ -209,4 +239,4 @@ #define BTN_EN2 13 // D13 PB27_TIOB0 #define BTN_ENC 16 // D16 PA13_TXD1 // the click #endif // NEWPANEL -#endif // ULTRA_LCD || EXTENSIBLE_UI +#endif // ULTRA_LCD diff --git a/Marlin/src/pins/pins_AZSMZ_MINI.h b/Marlin/src/pins/pins_AZSMZ_MINI.h index 2fef32bda7..e83ebf46a2 100644 --- a/Marlin/src/pins/pins_AZSMZ_MINI.h +++ b/Marlin/src/pins/pins_AZSMZ_MINI.h @@ -28,9 +28,7 @@ #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#ifndef BOARD_NAME - #define BOARD_NAME "AZSMZ MINI" -#endif +#define BOARD_NAME "AZSMZ MINI" // // Servos diff --git a/Marlin/src/pins/pins_AZTEEG_X5_GT.h b/Marlin/src/pins/pins_AZTEEG_X5_GT.h index 76e1fed268..4d1d824eb3 100644 --- a/Marlin/src/pins/pins_AZTEEG_X5_GT.h +++ b/Marlin/src/pins/pins_AZTEEG_X5_GT.h @@ -29,10 +29,8 @@ #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#ifndef BOARD_NAME - #define BOARD_NAME "Azteeg X5 GT" - #define DEFAULT_WEBSITE_URL "https://www.panucatt.com/azteeg_X5_GT_reprap_3d_printer_controller_p/ax5gt.htm" -#endif +#define BOARD_NAME "Azteeg X5 GT" +#define DEFAULT_WEBSITE_URL "https://www.panucatt.com/azteeg_X5_GT_reprap_3d_printer_controller_p/ax5gt.htm" // // Set CPU diff --git a/Marlin/src/pins/pins_AZTEEG_X5_MINI_WIFI.h b/Marlin/src/pins/pins_AZTEEG_X5_MINI_WIFI.h index dbc86b829b..dee7a783ac 100644 --- a/Marlin/src/pins/pins_AZTEEG_X5_MINI_WIFI.h +++ b/Marlin/src/pins/pins_AZTEEG_X5_MINI_WIFI.h @@ -29,10 +29,8 @@ #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#ifndef BOARD_NAME - #define BOARD_NAME "Azteeg X5 MINI WIFI" - #define DEFAULT_WEBSITE_URL "http://www.panucatt.com/azteeg_X5_mini_reprap_3d_printer_controller_p/ax5mini.htm" -#endif +#define BOARD_NAME "Azteeg X5 MINI WIFI" +#define DEFAULT_WEBSITE_URL "http://www.panucatt.com/azteeg_X5_mini_reprap_3d_printer_controller_p/ax5mini.htm" // // LED diff --git a/Marlin/src/pins/pins_BIQU_BQ111_A4.h b/Marlin/src/pins/pins_BIQU_BQ111_A4.h index bc5c07f107..f499241ab9 100644 --- a/Marlin/src/pins/pins_BIQU_BQ111_A4.h +++ b/Marlin/src/pins/pins_BIQU_BQ111_A4.h @@ -34,9 +34,7 @@ #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#ifndef BOARD_NAME - #define BOARD_NAME "BIQU BQ111-A4" -#endif +#define BOARD_NAME "BIQU BQ111-A4" // // Limit Switches diff --git a/Marlin/src/pins/pins_BRAINWAVE.h b/Marlin/src/pins/pins_BRAINWAVE.h index 2bb3e6d461..e798dfb890 100644 --- a/Marlin/src/pins/pins_BRAINWAVE.h +++ b/Marlin/src/pins/pins_BRAINWAVE.h @@ -71,7 +71,7 @@ #error "Oops! Select 'AT90USB646_TEENSYPP' in 'Tools > Board.'" #endif -#define BOARD_NAME "Brainwave" +#define BOARD_NAME "Brainwave" // // Limit Switches diff --git a/Marlin/src/pins/pins_BRAINWAVE_PRO.h b/Marlin/src/pins/pins_BRAINWAVE_PRO.h index ec27f4a9cb..84542f69fe 100644 --- a/Marlin/src/pins/pins_BRAINWAVE_PRO.h +++ b/Marlin/src/pins/pins_BRAINWAVE_PRO.h @@ -78,7 +78,7 @@ #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" #endif -#define BOARD_NAME "Brainwave Pro" +#define BOARD_NAME "Brainwave Pro" // // Limit Switches diff --git a/Marlin/src/pins/pins_CHEAPTRONIC.h b/Marlin/src/pins/pins_CHEAPTRONIC.h index f484a897bb..65e81ae45d 100644 --- a/Marlin/src/pins/pins_CHEAPTRONIC.h +++ b/Marlin/src/pins/pins_CHEAPTRONIC.h @@ -28,7 +28,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "Cheaptronic v1.0" +#define BOARD_NAME "Cheaptronic v1.0" // // Limit Switches // diff --git a/Marlin/src/pins/pins_CHEAPTRONICv2.h b/Marlin/src/pins/pins_CHEAPTRONICv2.h index 1b93c1b04c..56617c537e 100644 --- a/Marlin/src/pins/pins_CHEAPTRONICv2.h +++ b/Marlin/src/pins/pins_CHEAPTRONICv2.h @@ -30,7 +30,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "Cheaptronic v2.0" +#define BOARD_NAME "Cheaptronic v2.0" // // Limit Switches diff --git a/Marlin/src/pins/pins_CNCONTROLS_12.h b/Marlin/src/pins/pins_CNCONTROLS_12.h index a7bb0ecf6f..a7fcb18162 100644 --- a/Marlin/src/pins/pins_CNCONTROLS_12.h +++ b/Marlin/src/pins/pins_CNCONTROLS_12.h @@ -6,7 +6,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "CN Controls V12" +#define BOARD_NAME "CN Controls V12" // // Limit Switches diff --git a/Marlin/src/pins/pins_COHESION3D_MINI.h b/Marlin/src/pins/pins_COHESION3D_MINI.h index 1348650504..649403b7bb 100644 --- a/Marlin/src/pins/pins_COHESION3D_MINI.h +++ b/Marlin/src/pins/pins_COHESION3D_MINI.h @@ -29,9 +29,7 @@ #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#ifndef BOARD_NAME - #define BOARD_NAME "Cohesion3D Mini" -#endif +#define BOARD_NAME "Cohesion3D Mini" // // Servos diff --git a/Marlin/src/pins/pins_COHESION3D_REMIX.h b/Marlin/src/pins/pins_COHESION3D_REMIX.h index 0810199384..23e8d21d02 100644 --- a/Marlin/src/pins/pins_COHESION3D_REMIX.h +++ b/Marlin/src/pins/pins_COHESION3D_REMIX.h @@ -29,9 +29,7 @@ #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#ifndef BOARD_NAME - #define BOARD_NAME "Cohesion3D ReMix" -#endif +#define BOARD_NAME "Cohesion3D ReMix" // // Servos diff --git a/Marlin/src/pins/pins_DUE3DOM.h b/Marlin/src/pins/pins_DUE3DOM.h index e4725d7d1c..aa84053452 100644 --- a/Marlin/src/pins/pins_DUE3DOM.h +++ b/Marlin/src/pins/pins_DUE3DOM.h @@ -85,9 +85,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS -1 + #define MAX6675_SS_PIN -1 #else - #define MAX6675_SS -1 + #define MAX6675_SS_PIN -1 #endif // diff --git a/Marlin/src/pins/pins_DUE3DOM_MINI.h b/Marlin/src/pins/pins_DUE3DOM_MINI.h index 6ec4053cf9..3cd252a195 100644 --- a/Marlin/src/pins/pins_DUE3DOM_MINI.h +++ b/Marlin/src/pins/pins_DUE3DOM_MINI.h @@ -77,9 +77,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS 53 + #define MAX6675_SS_PIN 53 #else - #define MAX6675_SS 53 + #define MAX6675_SS_PIN 53 #endif // diff --git a/Marlin/src/pins/pins_EINSTART-S.h b/Marlin/src/pins/pins_EINSTART-S.h index 87a29dc501..59fa5b0c66 100644 --- a/Marlin/src/pins/pins_EINSTART-S.h +++ b/Marlin/src/pins/pins_EINSTART-S.h @@ -21,7 +21,7 @@ */ /** - * Einstart S pin assignments + * Einstart-S pin assignments * PCB Silkscreen: 3DPrinterCon_v3.5 */ @@ -37,9 +37,7 @@ #endif #endif -#ifndef BOARD_NAME - #define BOARD_NAME "EINSTART_S" -#endif +#define BOARD_NAME "Einstart-S" // // Limit Switches diff --git a/Marlin/src/pins/pins_EINSY_RAMBO.h b/Marlin/src/pins/pins_EINSY_RAMBO.h index e87076ea23..420edfd65f 100644 --- a/Marlin/src/pins/pins_EINSY_RAMBO.h +++ b/Marlin/src/pins/pins_EINSY_RAMBO.h @@ -28,7 +28,7 @@ #error "Oops! Select 'Arduino Mega 2560 or Rambo' in 'Tools > Board.'" #endif -#define BOARD_NAME "Einsy Rambo" +#define BOARD_NAME "Einsy Rambo" // // TMC2130 Configuration_adv defaults for EinsyRambo diff --git a/Marlin/src/pins/pins_EINSY_RETRO.h b/Marlin/src/pins/pins_EINSY_RETRO.h index 2056ba1c22..23cf3da91e 100644 --- a/Marlin/src/pins/pins_EINSY_RETRO.h +++ b/Marlin/src/pins/pins_EINSY_RETRO.h @@ -28,7 +28,7 @@ #error "Oops! Select 'Arduino Mega 2560 or Rambo' in 'Tools > Board.'" #endif -#define BOARD_NAME "Einsy Retro" +#define BOARD_NAME "Einsy Retro" // // TMC2130 Configuration_adv defaults for EinsyRetro diff --git a/Marlin/src/pins/pins_ESP32.h b/Marlin/src/pins/pins_ESP32.h index ffad5890b2..681b89b0ac 100644 --- a/Marlin/src/pins/pins_ESP32.h +++ b/Marlin/src/pins/pins_ESP32.h @@ -24,9 +24,7 @@ * Espressif ESP32 (Tensilica Xtensa LX6) pin assignments */ -#ifndef BOARD_NAME - #define BOARD_NAME "Espressif ESP32" -#endif +#define BOARD_NAME "Espressif ESP32" // // Limit Switches diff --git a/Marlin/src/pins/pins_FORMBOT_RAPTOR.h b/Marlin/src/pins/pins_FORMBOT_RAPTOR.h index 772be68ab0..7178b267d4 100644 --- a/Marlin/src/pins/pins_FORMBOT_RAPTOR.h +++ b/Marlin/src/pins/pins_FORMBOT_RAPTOR.h @@ -21,7 +21,7 @@ */ /** - * Formbot pin assignments + * Formbot Raptor pin assignments */ #ifndef __AVR_ATmega2560__ @@ -32,8 +32,12 @@ #error "Formbot supports up to 3 hotends / E-steppers. Comment this line to keep going." #endif -#define DEFAULT_MACHINE_NAME "Formbot Raptor" -#define BOARD_NAME "Formbot Raptor" +#ifndef DEFAULT_MACHINE_NAME + #define DEFAULT_MACHINE_NAME "Formbot Raptor" +#endif +#ifndef BOARD_NAME + #define BOARD_NAME "Formbot Raptor" +#endif // // Servos @@ -41,7 +45,6 @@ #define SERVO0_PIN 11 #define SERVO1_PIN 6 #define SERVO2_PIN 5 -#define SERVO3_PIN -1 // // Limit Switches @@ -113,9 +116,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present + #define MAX6675_SS_PIN 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif // @@ -140,11 +143,11 @@ // #define HEATER_0_PIN 10 #define HEATER_1_PIN 7 -#define HEATER_BED_PIN 8 +#define HEATER_BED_PIN 8 -#define LED4_PIN 5 - -#define FAN_PIN 9 +#ifndef FAN_PIN + #define FAN_PIN 9 +#endif #if DISABLED(FILAMENT_RUNOUT_SENSOR) #define FAN1_PIN 4 @@ -153,8 +156,11 @@ // // Misc. Functions // -#define SDSS 53 +#ifndef SDSS + #define SDSS 53 +#endif #define LED_PIN 13 +#define LED4_PIN 5 // Use the RAMPS 1.4 Analog input 5 on the AUX2 connector #define FILWIDTH_PIN 5 // Analog Input diff --git a/Marlin/src/pins/pins_FORMBOT_RAPTOR2.h b/Marlin/src/pins/pins_FORMBOT_RAPTOR2.h new file mode 100644 index 0000000000..5bd356428e --- /dev/null +++ b/Marlin/src/pins/pins_FORMBOT_RAPTOR2.h @@ -0,0 +1,70 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +/** + * Formbot Raptor 2 pin assignments + */ + +#define DEFAULT_MACHINE_NAME "Formbot Raptor2" +#define BOARD_NAME "Formbot Raptor2" + +#define FAN_PIN 6 +#define SDSS 5 + +#include "pins_FORMBOT_RAPTOR.h" + +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN 22 +#endif + +#define GREEDY_PANEL ( ENABLED(PANEL_ONE) || ENABLED(VIKI2) \ + || ENABLED(miniVIKI) || ENABLED(MINIPANEL) \ + || ENABLED(REPRAPWORLD_KEYPAD) ) + +// +// M3/M4/M5 - Spindle/Laser Control +// +#if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENABLE) + #if !NUM_SERVOS // Try to use servo connector first + #define SPINDLE_LASER_ENABLE_PIN 6 // Pin should have a pullup/pulldown! + #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM + #define SPINDLE_DIR_PIN 5 + #elif !GREEDY_PANEL // Try to use AUX2 + #define SPINDLE_LASER_ENABLE_PIN 40 // Pin should have a pullup/pulldown! + #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM + #define SPINDLE_DIR_PIN 65 + #endif +#endif + +#if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) + #if NUM_SERVOS <= 1 // Try to use servo connector first + #define CASE_LIGHT_PIN 6 // MUST BE HARDWARE PWM + #elif !GREEDY_PANEL // Try to use AUX2 + #define CASE_LIGHT_PIN 44 // MUST BE HARDWARE PWM + #endif +#endif + +#undef GREEDY_PANEL + +#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && (CASE_LIGHT_PIN == SPINDLE_LASER_ENABLE_PIN || CASE_LIGHT_PIN == SPINDLE_LASER_PWM_PIN) + #error "CASE_LIGHT_PIN conflicts with a Spindle / Laser pin." +#endif diff --git a/Marlin/src/pins/pins_FORMBOT_TREX2PLUS.h b/Marlin/src/pins/pins_FORMBOT_TREX2PLUS.h index 0aa4a94be2..b5d77c7214 100644 --- a/Marlin/src/pins/pins_FORMBOT_TREX2PLUS.h +++ b/Marlin/src/pins/pins_FORMBOT_TREX2PLUS.h @@ -113,9 +113,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present + #define MAX6675_SS_PIN 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif // diff --git a/Marlin/src/pins/pins_FORMBOT_TREX3.h b/Marlin/src/pins/pins_FORMBOT_TREX3.h index bfe81091c2..07d92cd326 100644 --- a/Marlin/src/pins/pins_FORMBOT_TREX3.h +++ b/Marlin/src/pins/pins_FORMBOT_TREX3.h @@ -109,42 +109,28 @@ // #define TEMP_0_PIN 13 // Analog Input #define TEMP_1_PIN 15 // Analog Input -#define TEMP_BED_PIN 3 // Analog Input +#define TEMP_BED_PIN 14 // Analog Input // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present + #define MAX6675_SS_PIN 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif -// -// Augmentation for auto-assigning RAMPS plugs -// -#if DISABLED(IS_RAMPS_EEB) && DISABLED(IS_RAMPS_EEF) && DISABLED(IS_RAMPS_EFB) && DISABLED(IS_RAMPS_EFF) && DISABLED(IS_RAMPS_SF) && !PIN_EXISTS(MOSFET_D) - #if HOTENDS > 1 - #if TEMP_SENSOR_BED - #define IS_RAMPS_EEB - #else - #define IS_RAMPS_EEF - #endif - #elif TEMP_SENSOR_BED - #define IS_RAMPS_EFB - #else - #define IS_RAMPS_EFF - #endif -#endif + // // Heaters / Fans // #define HEATER_0_PIN 10 #define HEATER_1_PIN 7 -#define HEATER_BED_PIN 8 +#define HEATER_BED_PIN 8 #define FAN_PIN 9 -//#define FAN1_PIN 4 +#define FAN1_PIN 12 +#define NUM_RUNOUT_SENSORS 2 #define FIL_RUNOUT_PIN 23 #define FIL_RUNOUT2_PIN 21 @@ -157,6 +143,9 @@ #define LED_PIN 13 #endif +#define SPINDLE_LASER_PWM_PIN 7 // MUST BE HARDWARE PWM +#define SPINDLE_LASER_ENABLE_PIN 4 // Pin should have a pullup! + // Use the RAMPS 1.4 Analog input 5 on the AUX2 connector #define FILWIDTH_PIN 5 // Analog Input diff --git a/Marlin/src/pins/pins_FYSETC_F6_13.h b/Marlin/src/pins/pins_FYSETC_F6_13.h index c08a23424b..d343e82f5e 100644 --- a/Marlin/src/pins/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/pins_FYSETC_F6_13.h @@ -25,12 +25,10 @@ // #ifndef __AVR_ATmega2560__ - #error "Oops! Select 'FYSETC_F6' in 'Tools > Board.'" + #error "Oops! Select 'FYSETC F6' in 'Tools > Board.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "FYSETC_F6_13" -#endif +#define BOARD_NAME "FYSETC F6 1.3" // // Servos diff --git a/Marlin/src/pins/pins_GEN3_PLUS.h b/Marlin/src/pins/pins_GEN3_PLUS.h index af0524a22b..e30fee2c30 100644 --- a/Marlin/src/pins/pins_GEN3_PLUS.h +++ b/Marlin/src/pins/pins_GEN3_PLUS.h @@ -54,7 +54,7 @@ #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644P' or 'ATmega1284P' in 'Tools > Processor.'" #endif -#define BOARD_NAME "Gen3+" +#define BOARD_NAME "Gen3+" // // Limit Switches diff --git a/Marlin/src/pins/pins_GEN7_CUSTOM.h b/Marlin/src/pins/pins_GEN7_CUSTOM.h index 8f7d75fd1f..7d0f44d7f3 100644 --- a/Marlin/src/pins/pins_GEN7_CUSTOM.h +++ b/Marlin/src/pins/pins_GEN7_CUSTOM.h @@ -58,7 +58,7 @@ #error "Oops! Select 'Sanguino' in 'Tools > Boards' and 'ATmega644', 'ATmega644P', or 'ATmega1284P' in 'Tools > Processor.'" #endif -#define BOARD_NAME "Gen7 Custom" +#define BOARD_NAME "Gen7 Custom" // // Limit Switches diff --git a/Marlin/src/pins/pins_GTM32_PRO_VB.h b/Marlin/src/pins/pins_GTM32_PRO_VB.h index 2dcf9ec2a1..1914db0b43 100644 --- a/Marlin/src/pins/pins_GTM32_PRO_VB.h +++ b/Marlin/src/pins/pins_GTM32_PRO_VB.h @@ -64,17 +64,17 @@ #define Z_DIR_PIN PD3 #define Z_ENABLE_PIN PB3 -#define E0_STEP_PIN PC14 -#define E0_DIR_PIN PC13 -#define E0_ENABLE_PIN PC15 +#define E0_STEP_PIN PB2 +#define E0_DIR_PIN PB11 +#define E0_ENABLE_PIN PC4 #define E1_STEP_PIN PA0 #define E1_DIR_PIN PB6 #define E1_ENABLE_PIN PA1 -#define E2_STEP_PIN PB2 -#define E2_DIR_PIN PB11 -#define E2_ENABLE_PIN PC4 +#define E2_STEP_PIN PC14 +#define E2_DIR_PIN PC13 +#define E2_ENABLE_PIN PC15 // // Heaters / Fans diff --git a/Marlin/src/pins/pins_LEAPFROG.h b/Marlin/src/pins/pins_LEAPFROG.h index 3cd9d75a38..946e20eef5 100644 --- a/Marlin/src/pins/pins_LEAPFROG.h +++ b/Marlin/src/pins/pins_LEAPFROG.h @@ -28,7 +28,7 @@ #error "Oops! Select 'Mega 1280' or 'Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "Leapfrog" +#define BOARD_NAME "Leapfrog" // // Limit Switches diff --git a/Marlin/src/pins/pins_MEGATRONICS.h b/Marlin/src/pins/pins_MEGATRONICS.h index fef44366f1..781529020d 100644 --- a/Marlin/src/pins/pins_MEGATRONICS.h +++ b/Marlin/src/pins/pins_MEGATRONICS.h @@ -28,7 +28,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "Megatronics" +#define BOARD_NAME "Megatronics" // // Limit Switches // diff --git a/Marlin/src/pins/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/pins_MIGHTYBOARD_REVE.h index 834ad4e024..8fb67c8419 100644 --- a/Marlin/src/pins/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/src/pins/pins_MIGHTYBOARD_REVE.h @@ -136,12 +136,14 @@ // #define THERMO_SCK_PIN 78 // E2 #define THERMO_DO_PIN 3 // E5 -#define THERMO_CS1 5 // E3 -#define THERMO_CS2 2 // E4 +#define THERMO_CS1_PIN 5 // E3 +#define THERMO_CS2_PIN 2 // E4 -#define MAX6675_SS THERMO_CS1 +#define MAX6675_SS_PIN THERMO_CS1_PIN +#define MAX6675_SS2_PIN THERMO_CS2_PIN #define MAX6675_SCK_PIN THERMO_SCK_PIN #define MAX6675_DO_PIN THERMO_DO_PIN + // // Augmentation for auto-assigning plugs // diff --git a/Marlin/src/pins/pins_MINITRONICS.h b/Marlin/src/pins/pins_MINITRONICS.h index feea8165ed..7ebaf1c4a1 100644 --- a/Marlin/src/pins/pins_MINITRONICS.h +++ b/Marlin/src/pins/pins_MINITRONICS.h @@ -39,7 +39,7 @@ #error "Minitronics supports up to 2 hotends / E-steppers. Comment out this line to continue." #endif -#define BOARD_NAME "Minitronics v1.0 / v1.1" +#define BOARD_NAME "Minitronics v1.0/1.1" // // Limit Switches // diff --git a/Marlin/src/pins/pins_MKS_SBASE.h b/Marlin/src/pins/pins_MKS_SBASE.h index e5e91be893..4784a8c2a0 100644 --- a/Marlin/src/pins/pins_MKS_SBASE.h +++ b/Marlin/src/pins/pins_MKS_SBASE.h @@ -29,18 +29,8 @@ #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#ifndef BOARD_NAME - #define BOARD_NAME "MKS SBASE" - #define DEFAULT_WEBSITE_URL "https://github.com/makerbase-mks/MKS-SBASE" -#endif - -// unused -/* -#define PIN_P0_27 P0_27 // EXP2/Onboard SD -#define PIN_P0_28 P0_28 // EXP2 -#define PIN_P0_02 P0_02 // AUX1 (Interrupt Capable/ADC/Serial Port 0) -#define PIN_P0_03 P0_03 // AUX1 (Interrupt Capable/ADC/Serial Port 0) -*/ +#define BOARD_NAME "MKS SBASE" +#define DEFAULT_WEBSITE_URL "https://github.com/makerbase-mks/MKS-SBASE" #define LED_PIN P1_18 // Used as a status indicator #define LED2_PIN P1_19 @@ -303,6 +293,12 @@ #define E0_SERIAL_RX_PIN P0_26 // TH4 #endif +// UNUSED +#define PIN_P0_27 P0_27 // EXP2/Onboard SD +#define PIN_P0_28 P0_28 // EXP2 +#define PIN_P0_02 P0_02 // AUX1 (Interrupt Capable/ADC/Serial Port 0) +#define PIN_P0_03 P0_03 // AUX1 (Interrupt Capable/ADC/Serial Port 0) + /** * PWMs * diff --git a/Marlin/src/pins/pins_OMCA.h b/Marlin/src/pins/pins_OMCA.h index 45daa1b87b..85d8faa224 100644 --- a/Marlin/src/pins/pins_OMCA.h +++ b/Marlin/src/pins/pins_OMCA.h @@ -80,7 +80,7 @@ #error "Oops! Select 'Sanguino' in 'Tools > Board' and 'ATmega644' or 'ATmega644P' in 'Tools > Processor.'" #endif -#define BOARD_NAME "Final OMCA" +#define BOARD_NAME "Final OMCA" // // Limit Switches diff --git a/Marlin/src/pins/pins_OMCA_A.h b/Marlin/src/pins/pins_OMCA_A.h index d89ad6970c..19f0e43f92 100644 --- a/Marlin/src/pins/pins_OMCA_A.h +++ b/Marlin/src/pins/pins_OMCA_A.h @@ -79,7 +79,7 @@ #error "Oops! Select 'Sanguino' in 'Tools > Board' and ATmega644 in 'Tools > Processor.'" #endif -#define BOARD_NAME "Alpha OMCA" +#define BOARD_NAME "Alpha OMCA" // // Limit Switches diff --git a/Marlin/src/pins/pins_PRINTRBOARD.h b/Marlin/src/pins/pins_PRINTRBOARD.h index 313bf78d88..a6193d6466 100644 --- a/Marlin/src/pins/pins_PRINTRBOARD.h +++ b/Marlin/src/pins/pins_PRINTRBOARD.h @@ -65,7 +65,7 @@ #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" #endif -#define BOARD_NAME "Printrboard" +#define BOARD_NAME "Printrboard" // Disable JTAG pins so they can be used for the Extrudrboard #define DISABLE_JTAG diff --git a/Marlin/src/pins/pins_PRINTRBOARD_REVF.h b/Marlin/src/pins/pins_PRINTRBOARD_REVF.h index 0b772cf588..e7249702cc 100644 --- a/Marlin/src/pins/pins_PRINTRBOARD_REVF.h +++ b/Marlin/src/pins/pins_PRINTRBOARD_REVF.h @@ -70,7 +70,8 @@ #error "USBCON should be defined by the platform for this board." #endif -#define BOARD_NAME "Printrboard Rev.F" +#define BOARD_NAME "Printrboard Rev.F" + // Disable JTAG pins so EXP1 pins work correctly // (Its pins are used for the Extrudrboard and filament sensor, for example). #define DISABLE_JTAG diff --git a/Marlin/src/pins/pins_RADDS.h b/Marlin/src/pins/pins_RADDS.h index 6e935dcd3d..68f001aaed 100644 --- a/Marlin/src/pins/pins_RADDS.h +++ b/Marlin/src/pins/pins_RADDS.h @@ -28,7 +28,7 @@ #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif -#define BOARD_NAME "RADDS" +#define BOARD_NAME "RADDS" // // Servos @@ -172,9 +172,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS 53 + #define MAX6675_SS_PIN 53 #else - #define MAX6675_SS 49 + #define MAX6675_SS_PIN 49 #endif // @@ -193,7 +193,6 @@ // // Misc. Functions // -#define SDSS 4 #define SD_DETECT_PIN 14 #define PS_ON_PIN 40 // SERVO3_PIN @@ -227,7 +226,6 @@ #define BTN_BACK 71 - #undef SDSS #define SDSS 10 #define SD_DETECT_PIN 14 @@ -246,6 +244,9 @@ #define BTN_EN2 52 #define BTN_ENC 48 + #define SDSS 10 + #define SD_DETECT_PIN 14 + #elif ENABLED(SSD1306_OLED_I2C_CONTROLLER) #define BTN_EN1 50 @@ -268,3 +269,7 @@ #endif // SPARK_FULL_GRAPHICS #endif // ULTRA_LCD + +#ifndef SDSS + #define SDSS 4 +#endif diff --git a/Marlin/src/pins/pins_RAMPS.h b/Marlin/src/pins/pins_RAMPS.h index cf3954c06a..6b9bd11148 100644 --- a/Marlin/src/pins/pins_RAMPS.h +++ b/Marlin/src/pins/pins_RAMPS.h @@ -205,9 +205,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present + #define MAX6675_SS_PIN 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif // diff --git a/Marlin/src/pins/pins_RAMPS4DUE.h b/Marlin/src/pins/pins_RAMPS4DUE.h index 717a12c742..dc56d814dc 100644 --- a/Marlin/src/pins/pins_RAMPS4DUE.h +++ b/Marlin/src/pins/pins_RAMPS4DUE.h @@ -42,9 +42,7 @@ #error "Oops! Select 'Arduino Due' or 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS4DUE" -#endif +#define BOARD_NAME "RAMPS4DUE" #define IS_RAMPS4DUE #include "pins_RAMPS.h" diff --git a/Marlin/src/pins/pins_RAMPS_DUO.h b/Marlin/src/pins/pins_RAMPS_DUO.h index 264882d8ae..efbd647edd 100644 --- a/Marlin/src/pins/pins_RAMPS_DUO.h +++ b/Marlin/src/pins/pins_RAMPS_DUO.h @@ -46,9 +46,7 @@ #error "Oops! Select 'Arduino Due' or 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS Duo" -#endif +#define BOARD_NAME "RAMPS Duo" #define IS_RAMPS_DUO #include "pins_RAMPS.h" @@ -66,11 +64,11 @@ #define TEMP_BED_PIN 10 // Analog Input // SPI for Max6675 or Max31855 Thermocouple -#undef MAX6675_SS +#undef MAX6675_SS_PIN #if DISABLED(SDSUPPORT) - #define MAX6675_SS 69 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 69 // Do not use pin 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS 69 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present + #define MAX6675_SS_PIN 69 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif // diff --git a/Marlin/src/pins/pins_RAMPS_FD_V1.h b/Marlin/src/pins/pins_RAMPS_FD_V1.h index 160b091d57..88df3fdae7 100644 --- a/Marlin/src/pins/pins_RAMPS_FD_V1.h +++ b/Marlin/src/pins/pins_RAMPS_FD_V1.h @@ -32,7 +32,7 @@ #endif #ifndef BOARD_NAME - #define BOARD_NAME "RAMPS-FD" + #define BOARD_NAME "RAMPS-FD v1" #endif #define INVERTED_HEATER_PINS @@ -112,9 +112,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS 53 + #define MAX6675_SS_PIN 53 #else - #define MAX6675_SS 49 + #define MAX6675_SS_PIN 49 #endif // diff --git a/Marlin/src/pins/pins_RAMPS_FD_V2.h b/Marlin/src/pins/pins_RAMPS_FD_V2.h index dec5cf4d53..d4d7012557 100644 --- a/Marlin/src/pins/pins_RAMPS_FD_V2.h +++ b/Marlin/src/pins/pins_RAMPS_FD_V2.h @@ -27,7 +27,7 @@ * Use 1k thermistor tables */ -#define BOARD_NAME "RAMPS-FD v2" +#define BOARD_NAME "RAMPS-FD v2" #ifndef E0_CS_PIN #define E0_CS_PIN 69 // moved from A13 to A15 on v2.2, if not earlier diff --git a/Marlin/src/pins/pins_RAMPS_OLD.h b/Marlin/src/pins/pins_RAMPS_OLD.h index 81f930e956..3181d0f752 100644 --- a/Marlin/src/pins/pins_RAMPS_OLD.h +++ b/Marlin/src/pins/pins_RAMPS_OLD.h @@ -28,7 +28,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#define BOARD_NAME "MEGA/RAMPS <1.2" +#define BOARD_NAME "RAMPS <1.2" // Uncomment the following line for RAMPS v1.0 //#define RAMPS_V_1_0 @@ -77,9 +77,9 @@ // SPI for Max6675 or Max31855 Thermocouple #if DISABLED(SDSUPPORT) - #define MAX6675_SS 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 66 // Do not use pin 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present + #define MAX6675_SS_PIN 66 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif // diff --git a/Marlin/src/pins/pins_RAMPS_PLUS.h b/Marlin/src/pins/pins_RAMPS_PLUS.h index 5169c1e679..3a945353cc 100644 --- a/Marlin/src/pins/pins_RAMPS_PLUS.h +++ b/Marlin/src/pins/pins_RAMPS_PLUS.h @@ -41,9 +41,7 @@ #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS 1.4 Plus" -#endif +#define BOARD_NAME "RAMPS 1.4 Plus" #define RAMPS_D8_PIN 10 #define RAMPS_D10_PIN 8 diff --git a/Marlin/src/pins/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/pins_RAMPS_RE_ARM.h index 79e8c8d7c1..29f31fc630 100644 --- a/Marlin/src/pins/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/pins_RAMPS_RE_ARM.h @@ -34,15 +34,13 @@ * */ -// numbers in parenthesis () are the mega2560 equivalent pin numbers +// Numbers in parentheses () are the corresponding mega2560 pin numbers #ifndef TARGET_LPC1768 #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#ifndef BOARD_NAME - #define BOARD_NAME "Re-ARM RAMPS 1.4" -#endif +#define BOARD_NAME "Re-ARM RAMPS 1.4" // // Servos @@ -100,13 +98,6 @@ #define E1_CS_PIN -1 #endif -//#define E2_STEP_PIN P2_08 // (36) -//#define E2_DIR_PIN P2_13 // (34) -//#define E2_ENABLE_PIN P4_29 // (30) -//#ifndef E2_CS_PIN -// #define E2_CS_PIN -1 -//#endif - // // Software SPI pins for TMC2130 stepper drivers // @@ -120,14 +111,14 @@ // Temperature Sensors // 3.3V max when defined as an analog input // -#define TEMP_0_PIN 0 // A0 (T0) - (67) - TEMP_0_PIN -#define TEMP_BED_PIN 1 // A1 (T1) - (68) - TEMP_BED_PIN -#define TEMP_1_PIN 2 // A2 (T2) - (69) - TEMP_1_PIN -#define TEMP_2_PIN 3 // A3 - (63) - J5-3 & AUX-2 -#define TEMP_3_PIN 4 // A4 - (37) - BUZZER_PIN -//#define TEMP_4_PIN 5 // A5 - (49) - SD_DETECT_PIN -//#define ?? 6 // A6 - ( 0) - RXD0 - J4-4 & AUX-1 -#define FILWIDTH_PIN 7 // A7 - ( 1) - TXD0 - J4-5 & AUX-1 +#define TEMP_0_PIN 0 // A0 (T0) - (67) - TEMP_0_PIN +#define TEMP_BED_PIN 1 // A1 (T1) - (68) - TEMP_BED_PIN +#define TEMP_1_PIN 2 // A2 (T2) - (69) - TEMP_1_PIN +#define TEMP_2_PIN 3 // A3 - (63) - J5-3 & AUX-2 +#define TEMP_3_PIN 4 // A4 - (37) - BUZZER_PIN +//#define TEMP_4_PIN 5 // A5 - (49) - SD_DETECT_PIN +//#define ?? 6 // A6 - ( 0) - RXD0 - J4-4 & AUX-1 +#define FILWIDTH_PIN 7 // A7 - ( 1) - TXD0 - J4-5 & AUX-1 // // Augmentation for auto-assigning RAMPS plugs @@ -197,55 +188,57 @@ // // Misc. Functions // -#define LED_PIN P4_28 // (13) +#define LED_PIN P4_28 // (13) // define digital pin 4 for the filament runout sensor. Use the RAMPS 1.4 digital input 4 on the servos connector #ifndef FIL_RUNOUT_PIN - #define FIL_RUNOUT_PIN P1_18 // (4) + #define FIL_RUNOUT_PIN P1_18 // (4) #endif -#define PS_ON_PIN P2_12 // (12) +#define PS_ON_PIN P2_12 // (12) #if ENABLED(CASE_LIGHT_ENABLE) && !PIN_EXISTS(CASE_LIGHT) && !defined(SPINDLE_LASER_ENABLE_PIN) - #if !defined(NUM_SERVOS) || NUM_SERVOS < 4 // try to use servo connector - #define CASE_LIGHT_PIN P1_18 // (4) MUST BE HARDWARE PWM + #if !defined(NUM_SERVOS) || NUM_SERVOS < 4 // Try to use servo connector + #define CASE_LIGHT_PIN P1_18 // (4) MUST BE HARDWARE PWM #endif #endif // // M3/M4/M5 - Spindle/Laser Control +// Use servo pins, if available // #if ENABLED(SPINDLE_LASER_ENABLE) && !PIN_EXISTS(SPINDLE_LASER_ENABLE) - #if !defined(NUM_SERVOS) || NUM_SERVOS == 1 // must use servo connector - #undef SERVO1 - #undef SERVO2 - #undef SERVO3 - #define SPINDLE_LASER_ENABLE_PIN P1_21 // (6) Pin should have a pullup/pulldown! - #define SPINDLE_LASER_PWM_PIN P1_18 // (4) MUST BE HARDWARE PWM - #define SPINDLE_DIR_PIN P1_19 // (5) + #if NUM_SERVOS > 1 + #error "SPINDLE_LASER_ENABLE requires 3 free servo pins." #endif + #define SPINDLE_LASER_ENABLE_PIN SERVO1_PIN // (6) Pin should have a pullup/pulldown! + #define SPINDLE_LASER_PWM_PIN SERVO3_PIN // (4) MUST BE HARDWARE PWM + #define SPINDLE_DIR_PIN SERVO2_PIN // (5) #endif // // Průša i3 MK2 Multiplexer Support // #if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0 - #define E_MUX0_PIN P0_03 // ( 0) Z_CS_PIN - #define E_MUX1_PIN P0_02 // ( 1) E0_CS_PIN + #define E_MUX0_PIN P0_03 // ( 0) Z_CS_PIN + #define E_MUX1_PIN P0_02 // ( 1) E0_CS_PIN #endif #define E_MUX2_PIN P0_26 // (63) E1_CS_PIN /** * LCD / Controller * - * All controllers can use J3 and J5 on the Re-ARM board. Custom cabling will be required. + * All controllers can use J3 and J5 on the Re-ARM board. Custom cabling will be required. + * + * - https://github.com/wolfmanjm/universal-panel-adapter + * - http://panucattdevices.freshdesk.com/support/solutions/articles/1000243195-lcd-display-installation */ /** * Smart LCD adapter * * The Smart LCD adapter can be used for the two 10 pin LCD controllers such as - * REPRAP_DISCOUNT_SMART_CONTROLLER. It can't be used for controllers that use + * REPRAP_DISCOUNT_SMART_CONTROLLER. It can't be used for controllers that use * DOGLCD_A0, DOGLCD_CS, LCD_PINS_D5, LCD_PINS_D6 or LCD_PINS_D7. A custom cable * is needed to pick up 5V for the EXP1 connection. * @@ -254,95 +247,91 @@ * that the garbage/lines are erased immediately after the SD card accesses are completed. */ -#if ENABLED(ULTRA_LCD) +#if ENABLED(CR10_STOCKDISPLAY) - #if ENABLED(CR10_STOCKDISPLAY) + // Re-Arm can support Creality stock display without SD card reader and single cable on EXP3. + // Re-Arm J3 pins 1 (p1.31) & 2 (P3.26) are not used. Stock cable will need to have one + // 10-pin IDC connector trimmed or replaced with a 12-pin IDC connector to fit J3. + // Requires REVERSE_ENCODER_DIRECTION in Configuration.h - // Re-Arm can support Creality stock display without SD card reader and single cable on EXP3. - // Re-Arm J3 pins 1 (p1.31) & 2 (P3.26) are not used. Stock cable will need to have one - // 10-pin IDC connector trimmed or replaced with a 12-pin IDC connector to fit J3. - // Requires REVERSE_ENCODER_DIRECTION in Configuration.h + #define BEEPER_PIN P2_11 // J3-3 & AUX-4 - #define BEEPER_PIN P2_11 // J3-3 & AUX-4 + #define BTN_EN1 P0_16 // J3-7 & AUX-4 + #define BTN_EN2 P1_23 // J3-5 & AUX-4 + #define BTN_ENC P3_25 // J3-4 & AUX-4 - #define BTN_EN1 P0_16 // J3-7 & AUX-4 - #define BTN_EN2 P1_23 // J3-5 & AUX-4 - #define BTN_ENC P3_25 // J3-4 & AUX-4 + #define LCD_PINS_RS P0_15 // J3-9 & AUX-4 (CS) + #define LCD_PINS_ENABLE P0_18 // J3-10 & AUX-3 (SID, MOSI) + #define LCD_PINS_D4 P2_06 // J3-8 & AUX-3 (SCK, CLK) - #define LCD_PINS_RS P0_15 // J3-9 & AUX-4 (CS) - #define LCD_PINS_ENABLE P0_18 // J3-10 & AUX-3 (SID, MOSI) - #define LCD_PINS_D4 P2_06 // J3-8 & AUX-3 (SCK, CLK) +#elif ENABLED(ULTRA_LCD) + #define BEEPER_PIN P1_30 // (37) not 5V tolerant + + #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4 + #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4 + #define BTN_ENC P2_11 // (35) J3-3 & AUX-4 + + #define SD_DETECT_PIN P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant) + #define KILL_PIN P1_22 // (41) J5-4 & AUX-4 + #define LCD_PINS_RS P0_16 // (16) J3-7 & AUX-4 + #define LCD_SDSS P0_16 // (16) J3-7 & AUX-4 + + #if ENABLED(NEWPANEL) + #if ENABLED(REPRAPWORLD_KEYPAD) + #define SHIFT_OUT P0_18 // (51) (MOSI) J3-10 & AUX-3 + #define SHIFT_CLK P0_15 // (52) (SCK) J3-9 & AUX-3 + #define SHIFT_LD P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant) + #endif #else + //#define SHIFT_CLK P3_26 // (31) J3-2 & AUX-4 + //#define SHIFT_LD P3_25 // (33) J3-4 & AUX-4 + //#define SHIFT_OUT P2_11 // (35) J3-3 & AUX-4 + //#define SHIFT_EN P1_22 // (41) J5-4 & AUX-4 + #endif - #define BEEPER_PIN P1_30 // (37) not 5V tolerant + #if ENABLED(VIKI2) || ENABLED(miniVIKI) + // #define LCD_SCREEN_ROT_180 - #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4 - #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4 - #define BTN_ENC P2_11 // (35) J3-3 & AUX-4 + #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4 + #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4 + #define BTN_ENC P2_11 // (35) J3-3 & AUX-4 - #define SD_DETECT_PIN P1_31 // (49) not 5V tolerant J3-1 & AUX-3 - #define KILL_PIN P1_22 // (41) J5-4 & AUX-4 - #define LCD_PINS_RS P0_16 // (16) J3-7 & AUX-4 - #define LCD_SDSS P0_16 // (16) J3-7 & AUX-4 + #define SD_DETECT_PIN P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant) + #define KILL_PIN P1_22 // (41) J5-4 & AUX-4 - #if ENABLED(NEWPANEL) - #if ENABLED(REPRAPWORLD_KEYPAD) - #define SHIFT_OUT P0_18 // (51) (MOSI) J3-10 & AUX-3 - #define SHIFT_CLK P0_15 // (52) (SCK) J3-9 & AUX-3 - #define SHIFT_LD P1_31 // (49) not 5V tolerant J3-1 & AUX-3 - #endif - #else - //#define SHIFT_CLK P3_26 // (31) J3-2 & AUX-4 - //#define SHIFT_LD P3_25 // (33) J3-4 & AUX-4 - //#define SHIFT_OUT P2_11 // (35) J3-3 & AUX-4 - //#define SHIFT_EN P1_22 // (41) J5-4 & AUX-4 + #define DOGLCD_CS P0_16 // (16) + #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 + #define DOGLCD_SCK SCK_PIN + #define DOGLCD_MOSI MOSI_PIN + + #define STAT_LED_BLUE_PIN P0_26 //(63) may change if cable changes + #define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes + #else + #define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2 + #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 + #define LCD_BACKLIGHT_PIN P0_16 //(16) J3-7 & AUX-4 - only used on DOGLCD controllers + #define LCD_PINS_ENABLE P0_18 // (51) (MOSI) J3-10 & AUX-3 + #define LCD_PINS_D4 P0_15 // (52) (SCK) J3-9 & AUX-3 + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 P1_17 // (71) ENET_MDIO + #define LCD_PINS_D6 P1_14 // (73) ENET_RX_ER + #define LCD_PINS_D7 P1_10 // (75) ENET_RXD1 #endif + #endif - #if ENABLED(VIKI2) || ENABLED(miniVIKI) - // #define LCD_SCREEN_ROT_180 - - #define BTN_EN1 P3_26 // (31) J3-2 & AUX-4 - #define BTN_EN2 P3_25 // (33) J3-4 & AUX-4 - #define BTN_ENC P2_11 // (35) J3-3 & AUX-4 - - #define SD_DETECT_PIN P1_31 // (49) not 5V tolerant J3-1 & AUX-3 - #define KILL_PIN P1_22 // (41) J5-4 & AUX-4 - - #define DOGLCD_CS P0_16 // (16) - #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 - #define DOGLCD_SCK SCK_PIN - #define DOGLCD_MOSI MOSI_PIN - - #define STAT_LED_BLUE_PIN P0_26 // (63) may change if cable changes - #define STAT_LED_RED_PIN P1_21 // ( 6) may change if cable changes - #else - #define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2 - #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 - #define LCD_BACKLIGHT_PIN P0_16 // (16) J3-7 & AUX-4 - only used on DOGLCD controllers - #define LCD_PINS_ENABLE P0_18 // (51) (MOSI) J3-10 & AUX-3 - #define LCD_PINS_D4 P0_15 // (52) (SCK) J3-9 & AUX-3 - #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 P1_17 // (71) ENET_MDIO - #define LCD_PINS_D6 P1_14 // (73) ENET_RX_ER - #define LCD_PINS_D7 P1_10 // (75) ENET_RXD1 - #endif - #endif - - //#define MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3 - //#define MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3 - //#define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3 - //#define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 - sometimes called SDSS - - #if ENABLED(MINIPANEL) - // GLCD features - //#define LCD_CONTRAST 190 - // Uncomment screen orientation - //#define LCD_SCREEN_ROT_90 - //#define LCD_SCREEN_ROT_180 - //#define LCD_SCREEN_ROT_270 - #endif + //#define MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3 + //#define MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3 + //#define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3 + //#define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS) + #if ENABLED(MINIPANEL) + // GLCD features + //#define LCD_CONTRAST 190 + // Uncomment screen orientation + //#define LCD_SCREEN_ROT_90 + //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROT_270 #endif #endif // ULTRA_LCD @@ -351,17 +340,17 @@ // Ethernet pins // #if DISABLED(ULTIPANEL) - #define ENET_MDIO P1_17 // (71) J12-4 - #define ENET_RX_ER P1_14 // (73) J12-6 - #define ENET_RXD1 P1_10 // (75) J12-8 + #define ENET_MDIO P1_17 // (71) J12-4 + #define ENET_RX_ER P1_14 // (73) J12-6 + #define ENET_RXD1 P1_10 // (75) J12-8 #endif -#define ENET_MOC P1_16 // (70) J12-3 -#define REF_CLK P1_15 // (72) J12-5 -#define ENET_RXD0 P1_09 // (74) J12-7 -#define ENET_CRS P1_08 // (76) J12-9 -#define ENET_TX_EN P1_04 // (77) J12-10 -#define ENET_TXD0 P1_00 // (78) J12-11 -#define ENET_TXD1 P1_01 // (79) J12-12 +#define ENET_MOC P1_16 // (70) J12-3 +#define REF_CLK P1_15 // (72) J12-5 +#define ENET_RXD0 P1_09 // (74) J12-7 +#define ENET_CRS P1_08 // (76) J12-9 +#define ENET_TX_EN P1_04 // (77) J12-10 +#define ENET_TXD0 P1_00 // (78) J12-11 +#define ENET_TXD1 P1_01 // (79) J12-12 //#define USB_SD_DISABLED #define USB_SD_ONBOARD // Provide the onboard SD card to the host as a USB mass storage device @@ -371,11 +360,11 @@ #if ENABLED(LPC_SD_LCD) - #define SCK_PIN P0_15 - #define MISO_PIN P0_17 - #define MOSI_PIN P0_18 - #define SS_PIN P1_23 // Chip select for SD card used by Marlin - #define ONBOARD_SD_CS P0_06 // Chip select for "System" SD card + #define SCK_PIN P0_15 + #define MISO_PIN P0_17 + #define MOSI_PIN P0_18 + #define SS_PIN P1_23 // Chip select for SD card used by Marlin + #define ONBOARD_SD_CS P0_06 // Chip select for "System" SD card #elif ENABLED(LPC_SD_ONBOARD) @@ -385,66 +374,51 @@ #define SHARED_SD_CARD #undef SD_DETECT_PIN // there is also no detect pin for the onboard card #endif - #define SCK_PIN P0_07 - #define MISO_PIN P0_08 - #define MOSI_PIN P0_09 - #define SS_PIN P0_06 // Chip select for SD card used by Marlin - #define ONBOARD_SD_CS P0_06 // Chip select for "System" SD card + + #define SCK_PIN P0_07 + #define MISO_PIN P0_08 + #define MOSI_PIN P0_09 + #define SS_PIN P0_06 // Chip select for SD card used by Marlin + #define ONBOARD_SD_CS P0_06 // Chip select for "System" SD card #endif /** * Fast PWMs * - * The LPC1768's hardware PWM controller has 6 channels. Each channel + * The LPC1768's hardware PWM controller has 6 channels. Each channel * can be setup to either control a dedicated pin directly or to generate - * an interrupt. The direct method's duty cycle is accurate to within a - * a microsecond. The interrupt method's average duty cycle has the + * an interrupt. The direct method's duty cycle is accurate to within a + * a microsecond. The interrupt method's average duty cycle has the * the same accuracy but the individual cycles can vary because of higher * priority interrupts. * * All Fast PWMs have a 50Hz rate. * - * The following pins/signals use the direct method. All other pins use the + * The following pins/signals use the direct method. All other pins use the * the interrupt method. Note that SERVO2_PIN and RAMPS_D8_PIN use the * interrupt method. + * * P1_20 (11) SERVO0_PIN * P1_21 ( 6) SERVO1_PIN J5-1 * P0_18 ( 4) SERVO3_PIN 5V output * *P2_04 ( 9) RAMPS_D9_PIN * *P2_05 (10) RAMPS_D10_PIN * - * * - If used as a heater driver then a Fast PWM is NOT assigned. If used as + * * - If used as a heater driver then a Fast PWM is NOT assigned. If used as * a fan driver then enabling FAST_PWM_FAN assigns a Fast PWM to it. */ /** * Special pins - * P1_30 (37) - not 5V tolerant - * P1_31 (49) - not 5V tolerant - * P0_27 (57) - open collector - * P0_28 (58) - open collector - * - */ + * P1_30 (37) (NOT 5V tolerant) + * P1_31 (49) (NOT 5V tolerant) + * P0_27 (57) (Open collector) + * P0_28 (58) (Open collector) + */ /** - * The following mega2560 pins are NOT available in a Re-ARM system - * 7 - * 17 - * 22 - * 23 - * 25 - * 27 - * 29 - * 32 - * 39 - * 40 - * 42 - * 43 - * 44 - * 45 - * 47 - * 64 - * 65 - * 66 + * The following mega2560 pins are NOT available in a Re-ARM system: + * + * 7, 17, 22, 23, 25, 27, 29, 32, 39, 40, 42, 43, 44, 45, 47, 64, 65, 66 */ diff --git a/Marlin/src/pins/pins_RAMPS_SMART.h b/Marlin/src/pins/pins_RAMPS_SMART.h index 8788d03b52..851117cad5 100644 --- a/Marlin/src/pins/pins_RAMPS_SMART.h +++ b/Marlin/src/pins/pins_RAMPS_SMART.h @@ -63,9 +63,7 @@ #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "RAMPS-SMART" -#endif +#define BOARD_NAME "RAMPS-SMART" #define IS_RAMPS_SMART #include "pins_RAMPS.h" @@ -89,12 +87,11 @@ #define TEMP_BED_PIN 11 // Analog Input // SPI for Max6675 or Max31855 Thermocouple +#undef MAX6675_SS_PIN #if DISABLED(SDSUPPORT) - #undef MAX6675_SS - #define MAX6675_SS 67 // Do not use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 67 // Do not use pin 53 if there is even the remote possibility of using Display/SD card #else - #undef MAX6675_SS - #define MAX6675_SS 67 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present + #define MAX6675_SS_PIN 67 // Do not use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif // diff --git a/Marlin/src/pins/pins_REMRAM_V1.h b/Marlin/src/pins/pins_REMRAM_V1.h index bd6ac29126..78c796a7bd 100644 --- a/Marlin/src/pins/pins_REMRAM_V1.h +++ b/Marlin/src/pins/pins_REMRAM_V1.h @@ -83,9 +83,9 @@ // // Temperature Sensors // -#define TEMP_0_PIN 65 // THERM_2 -#define TEMP_1_PIN 66 // THERM_3 -#define TEMP_BED_PIN 64 // THERM_1 +#define TEMP_0_PIN 64 // THERM_1 +#define TEMP_1_PIN 65 // THERM_2 +#define TEMP_BED_PIN 66 // THERM_3 // // Heaters / Fans diff --git a/Marlin/src/pins/pins_RIGIDBOARD.h b/Marlin/src/pins/pins_RIGIDBOARD.h index f783d83c61..4247ace87c 100644 --- a/Marlin/src/pins/pins_RIGIDBOARD.h +++ b/Marlin/src/pins/pins_RIGIDBOARD.h @@ -73,11 +73,11 @@ #define TEMP_BED_PIN 15 // Analog Input // SPI for Max6675 or Max31855 Thermocouple -#undef MAX6675_SS +#undef MAX6675_SS_PIN #if DISABLED(SDSUPPORT) - #define MAX6675_SS 53 // Don't use pin 53 if there is even the remote possibility of using Display/SD card + #define MAX6675_SS_PIN 53 // Don't use pin 53 if there is even the remote possibility of using Display/SD card #else - #define MAX6675_SS 49 // Don't use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present + #define MAX6675_SS_PIN 49 // Don't use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present #endif // diff --git a/Marlin/src/pins/pins_RUMBA.h b/Marlin/src/pins/pins_RUMBA.h index b2869f1205..e40f165779 100644 --- a/Marlin/src/pins/pins_RUMBA.h +++ b/Marlin/src/pins/pins_RUMBA.h @@ -32,13 +32,17 @@ #error "RUMBA supports up to 3 hotends / E-steppers. Comment out this line to continue." #endif -#define DEFAULT_MACHINE_NAME "Rumba" -#define BOARD_NAME "Rumba" +#ifndef DEFAULT_MACHINE_NAME + #define DEFAULT_MACHINE_NAME "Rumba" +#endif +#ifndef BOARD_NAME + #define BOARD_NAME "Rumba" +#endif // // Servos // -#define SERVO0_PIN 5 +#define SERVO0_PIN 5 // // Limit Switches @@ -87,16 +91,20 @@ // // Temperature Sensors // -#if TEMP_SENSOR_0 == -1 - #define TEMP_0_PIN 6 // Analog Input (connector *K1* on RUMBA thermocouple ADD ON is used) -#else - #define TEMP_0_PIN 15 // Analog Input (default connector for thermistor *T0* on rumba board is used) +#ifndef TEMP_0_PIN + #if TEMP_SENSOR_0 == -1 + #define TEMP_0_PIN 6 // Analog Input (connector *K1* on RUMBA thermocouple ADD ON is used) + #else + #define TEMP_0_PIN 15 // Analog Input (default connector for thermistor *T0* on rumba board is used) + #endif #endif -#if TEMP_SENSOR_1 == -1 - #define TEMP_1_PIN 5 // Analog Input (connector *K2* on RUMBA thermocouple ADD ON is used) -#else - #define TEMP_1_PIN 14 // Analog Input (default connector for thermistor *T1* on rumba board is used) +#ifndef TEMP_1_PIN + #if TEMP_SENSOR_1 == -1 + #define TEMP_1_PIN 5 // Analog Input (connector *K2* on RUMBA thermocouple ADD ON is used) + #else + #define TEMP_1_PIN 14 // Analog Input (default connector for thermistor *T1* on rumba board is used) + #endif #endif #if TEMP_SENSOR_2 == -1 @@ -105,7 +113,7 @@ #define TEMP_2_PIN 13 // Analog Input (default connector for thermistor *T2* on rumba board is used) #endif -// optional for extruder 4 or chamber: +// Optional for extruder 4 or chamber: //#define TEMP_X_PIN 12 // Analog Input (default connector for thermistor *T3* on rumba board is used) //#define TEMP_CHAMBER_PIN 12 // Analog Input (default connector for thermistor *T3* on rumba board is used) @@ -142,13 +150,13 @@ // M3/M4/M5 - Spindle/Laser Control // #ifndef SPINDLE_LASER_PWM_PIN - #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM. Pin 4 interrupts OC0* and OC1* always in use? + #define SPINDLE_LASER_PWM_PIN 4 // MUST BE HARDWARE PWM. Pin 4 interrupts OC0* and OC1* always in use? #endif #ifndef SPINDLE_LASER_ENABLE_PIN #define SPINDLE_LASER_ENABLE_PIN 14 // Pin should have a pullup! #endif #ifndef SPINDLE_DIR_PIN - #define SPINDLE_DIR_PIN 15 + #define SPINDLE_DIR_PIN 15 #endif // @@ -162,8 +170,8 @@ #define BTN_ENC 43 #if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306) - #define LCD_PINS_DC 38 // Set as output on init - #define LCD_PINS_RS 41 // Pull low for 1s to init + #define LCD_PINS_DC 38 // Set as output on init + #define LCD_PINS_RS 41 // Pull low for 1s to init // DOGM SPI LCD Support #define DOGLCD_CS 19 #define DOGLCD_MOSI 42 diff --git a/Marlin/src/pins/pins_RUMBA_RAISE3D.h b/Marlin/src/pins/pins_RUMBA_RAISE3D.h new file mode 100644 index 0000000000..80d7c76ed7 --- /dev/null +++ b/Marlin/src/pins/pins_RUMBA_RAISE3D.h @@ -0,0 +1,30 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#define DEFAULT_MACHINE_NAME "Raise3D N Series" +#define BOARD_NAME "Raise3D Rumba" + +// Raise3D uses thermocouples on the standard input pins +#define TEMP_0_PIN 15 // Analog Input +#define TEMP_1_PIN 14 // Analog Input + +#include "pins_RUMBA.h" diff --git a/Marlin/src/pins/pins_RURAMPS4D_11.h b/Marlin/src/pins/pins_RURAMPS4D_11.h index 564fbb5149..0785085cc5 100644 --- a/Marlin/src/pins/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/pins_RURAMPS4D_11.h @@ -36,9 +36,7 @@ #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "RuRAMPS4Due v1.1" -#endif +#define BOARD_NAME "RuRAMPS4Due v1.1" // // Servos @@ -160,11 +158,13 @@ #endif // SPI for Max6675 or Max31855 Thermocouple -//#if DISABLED(SDSUPPORT) -// #define MAX6675_SS 53 -//#else -// #define MAX6675_SS 49 -//#endif +/* +#if DISABLED(SDSUPPORT) + #define MAX6675_SS_PIN 53 +#else + #define MAX6675_SS_PIN 49 +#endif +*/ // // Misc. Functions diff --git a/Marlin/src/pins/pins_RURAMPS4D_13.h b/Marlin/src/pins/pins_RURAMPS4D_13.h index 521f0e99ab..629e61da1f 100644 --- a/Marlin/src/pins/pins_RURAMPS4D_13.h +++ b/Marlin/src/pins/pins_RURAMPS4D_13.h @@ -36,9 +36,7 @@ #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "RuRAMPS4Due v1.3" -#endif +#define BOARD_NAME "RuRAMPS4Due v1.3" // // Servos @@ -146,11 +144,13 @@ #endif // SPI for Max6675 or Max31855 Thermocouple -//#if DISABLED(SDSUPPORT) -// #define MAX6675_SS 53 -//#else -// #define MAX6675_SS 49 -//#endif +/* +#if DISABLED(SDSUPPORT) + #define MAX6675_SS_PIN 53 +#else + #define MAX6675_SS_PIN 49 +#endif +*/ // // Misc. Functions diff --git a/Marlin/src/pins/pins_SELENA_COMPACT.h b/Marlin/src/pins/pins_SELENA_COMPACT.h index 14c5f05975..ce2324c30e 100644 --- a/Marlin/src/pins/pins_SELENA_COMPACT.h +++ b/Marlin/src/pins/pins_SELENA_COMPACT.h @@ -29,10 +29,8 @@ #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#ifndef BOARD_NAME - #define BOARD_NAME "Selena Compact" - #define DEFAULT_WEBSITE_URL "https://github.com/Ales2-k/Selena" -#endif +#define BOARD_NAME "Selena Compact" +#define DEFAULT_WEBSITE_URL "https://github.com/Ales2-k/Selena" // // Limit Switches diff --git a/Marlin/src/pins/pins_SILVER_GATE.h b/Marlin/src/pins/pins_SILVER_GATE.h index 372a22459d..09bd33024c 100644 --- a/Marlin/src/pins/pins_SILVER_GATE.h +++ b/Marlin/src/pins/pins_SILVER_GATE.h @@ -24,9 +24,7 @@ #error "Oops! Select 'Silvergate' in 'Tools > Board.'" #endif -#ifndef BOARD_NAME - #define BOARD_NAME "Silver Gate" -#endif +#define BOARD_NAME "Silver Gate" #define X_STEP_PIN 43 #define X_DIR_PIN 44 diff --git a/Marlin/src/pins/pins_SMOOTHIEBOARD.h b/Marlin/src/pins/pins_SMOOTHIEBOARD.h index f10771780a..7e12ec66f2 100644 --- a/Marlin/src/pins/pins_SMOOTHIEBOARD.h +++ b/Marlin/src/pins/pins_SMOOTHIEBOARD.h @@ -29,10 +29,8 @@ #error "Oops! Make sure you have the LPC1768 environment selected in your IDE." #endif -#ifndef BOARD_NAME - #define BOARD_NAME "Smoothieboard" - #define DEFAULT_WEBSITE_URL "http://smoothieware.org/smoothieboard" -#endif +#define BOARD_NAME "Smoothieboard" +#define DEFAULT_WEBSITE_URL "http://smoothieware.org/smoothieboard" #undef F_CPU #define F_CPU 120000000 diff --git a/Marlin/src/pins/pins_TEENSY2.h b/Marlin/src/pins/pins_TEENSY2.h index 714d15ebed..beb7ca0011 100644 --- a/Marlin/src/pins/pins_TEENSY2.h +++ b/Marlin/src/pins/pins_TEENSY2.h @@ -110,7 +110,7 @@ #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" #endif -#define BOARD_NAME "Teensy++2.0" +#define BOARD_NAME "Teensy++2.0" // // Limit Switches diff --git a/Marlin/src/pins/pins_TEENSY35_36.h b/Marlin/src/pins/pins_TEENSY35_36.h index c023354a2c..9d81d3c0bc 100644 --- a/Marlin/src/pins/pins_TEENSY35_36.h +++ b/Marlin/src/pins/pins_TEENSY35_36.h @@ -62,7 +62,7 @@ AUX2 25 | 41 * * 52 | A21 DAC0 AUX2 FAN_PIN SCL2 TX1 26 | 42 * * 51 | 39 A20 MISO0 SDSS AUX2 Z-PROBE PWR SCK0 RX1 27 | * * * * * | 38 A19 PWM SDA1 AUX2 SOL1_PIN MOSI0 28 | 43 * * 50 | 37 A18 PWM SCL1 -D10 CONTROLLERFAN_PIN CAN0TX PWM 29 | 44 * * 49 | 36 A17 PWM +D10 CONTROLLER_FAN_PIN CAN0TX PWM 29 | 44 * * 49 | 36 A17 PWM D9 HEATER_0_PIN CAN0RX PWM 30 | 45 * * 48 | 35 A16 PWM E1_ENABLE_PIN D8 HEATER_BED_PIN CS1 RX4 A12 31 | 46 * * 47 | 34 A15 PWM SDA0 RX5 E1_DIR_PIN SCK1 TX4 A13 32 |__GND_*_*_3.3V_| 33 A14 PWM SCL0 TX5 E1_STEP_PIN @@ -146,7 +146,16 @@ D8 HEATER_BED_PIN CS1 RX4 A12 31 | 46 * * 47 | 34 A15 PWM #define LCD_PINS_D5 43 #define LCD_PINS_D6 44 #define LCD_PINS_D7 45 +#endif + +#if ENABLED(NEWPANEL) #define BTN_EN1 46 #define BTN_EN2 47 #define BTN_ENC 48 #endif + +#if ENABLED(REPRAPWORLD_KEYPAD) + #define SHIFT_OUT 40 + #define SHIFT_CLK 44 + #define SHIFT_LD 42 +#endif diff --git a/Marlin/src/pins/pins_TEENSYLU.h b/Marlin/src/pins/pins_TEENSYLU.h index d3195105a6..13002607ac 100644 --- a/Marlin/src/pins/pins_TEENSYLU.h +++ b/Marlin/src/pins/pins_TEENSYLU.h @@ -77,7 +77,7 @@ #error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'" #endif -#define BOARD_NAME "Teensylu" +#define BOARD_NAME "Teensylu" // // Limit Switch definitions that match the SCHEMATIC diff --git a/Marlin/src/pins/pins_TRIGORILLA_13.h b/Marlin/src/pins/pins_TRIGORILLA_13.h index 0907eaf286..ee0687439e 100644 --- a/Marlin/src/pins/pins_TRIGORILLA_13.h +++ b/Marlin/src/pins/pins_TRIGORILLA_13.h @@ -24,9 +24,7 @@ * Arduino Mega with RAMPS v1.3 for Anycubic */ -#ifndef BOARD_NAME - #define BOARD_NAME "Anycubic RAMPS 1.3" -#endif +#define BOARD_NAME "Anycubic RAMPS 1.3" #define IS_RAMPS_EFB #define RAMPS_D9_PIN 44 diff --git a/Marlin/src/pins/pins_TRIGORILLA_14.h b/Marlin/src/pins/pins_TRIGORILLA_14.h index afadbe0d55..5e9b58be7d 100644 --- a/Marlin/src/pins/pins_TRIGORILLA_14.h +++ b/Marlin/src/pins/pins_TRIGORILLA_14.h @@ -24,9 +24,7 @@ * Arduino Mega with RAMPS v1.4 for Anycubic */ -#ifndef BOARD_NAME - #define BOARD_NAME "Anycubic RAMPS 1.4" -#endif +#define BOARD_NAME "Anycubic RAMPS 1.4" // Labeled pins #define TRIGORILLA_HEATER_BED_PIN 8 diff --git a/Marlin/src/pins/pins_ULTRATRONICS_PRO.h b/Marlin/src/pins/pins_ULTRATRONICS_PRO.h index 832a7e20e8..699d472586 100644 --- a/Marlin/src/pins/pins_ULTRATRONICS_PRO.h +++ b/Marlin/src/pins/pins_ULTRATRONICS_PRO.h @@ -24,13 +24,12 @@ * ReprapWorld ULTRATRONICS v1.0 */ -#define KNOWN_BOARD -#define BOARD_NAME "Ultratronics v1.0" - #ifndef ARDUINO_ARCH_SAM #error "Oops! Select 'Arduino Due' in 'Tools > Board.'" #endif +#define BOARD_NAME "Ultratronics v1.0" + // // Servos // @@ -126,7 +125,7 @@ #define SPI_FLASH_CS -1 // SPI for Max6675 or Max31855 Thermocouple -#define MAX6675_SS 65 +#define MAX6675_SS_PIN 65 #define MAX31855_SS0 65 #define MAX31855_SS1 52 #define MAX31855_SS2 50 diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 63e0740f62..8315f59470 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -905,7 +905,7 @@ int SdBaseFile::peek() { // print uint8_t with width 2 static void print2u(const uint8_t v) { if (v < 10) SERIAL_CHAR('0'); - SERIAL_ECHO_F(v, DEC); + SERIAL_ECHO(int(v)); } /** diff --git a/Marlin/src/sd/SdBaseFile.h b/Marlin/src/sd/SdBaseFile.h index 8fa91a650f..03be97bfcc 100644 --- a/Marlin/src/sd/SdBaseFile.h +++ b/Marlin/src/sd/SdBaseFile.h @@ -108,7 +108,7 @@ static inline uint16_t FAT_YEAR(uint16_t fatDate) { return 1980 + (fatDate >> 9) * * \return Extracted month [1,12] */ -static inline uint8_t FAT_MONTH(uint16_t fatDate) { return (fatDate >> 5) & 0XF; } +static inline uint8_t FAT_MONTH(uint16_t fatDate) { return (fatDate >> 5) & 0xF; } /** * day part of FAT directory date field diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index c221475c1f..a8893e0f12 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -45,7 +45,75 @@ #include "../feature/pause.h" #endif -#include +// public: + +card_flags_t CardReader::flag; +char CardReader::filename[FILENAME_LENGTH], CardReader::longFilename[LONG_FILENAME_LENGTH]; +int8_t CardReader::autostart_index; + +#if ENABLED(FAST_FILE_TRANSFER) + #if NUM_SERIAL > 1 + uint8_t CardReader::transfer_port; + #endif +#endif + +// private: + +SdFile CardReader::root, CardReader::workDir, CardReader::workDirParents[MAX_DIR_DEPTH]; +uint8_t CardReader::workDirDepth; + +#if ENABLED(SDCARD_SORT_ALPHA) + uint16_t CardReader::sort_count; + #if ENABLED(SDSORT_GCODE) + bool CardReader::sort_alpha; + int CardReader::sort_folders; + //bool CardReader::sort_reverse; + #endif + + #if ENABLED(SDSORT_DYNAMIC_RAM) + uint8_t *CardReader::sort_order; + #else + uint8_t CardReader::sort_order[SDSORT_LIMIT]; + #endif + + #if ENABLED(SDSORT_USES_RAM) + + #if ENABLED(SDSORT_CACHE_NAMES) + #if ENABLED(SDSORT_DYNAMIC_RAM) + char **CardReader::sortshort, **CardReader::sortnames; + #else + char CardReader::sortshort[SDSORT_LIMIT][FILENAME_LENGTH]; + char CardReader::sortnames[SDSORT_LIMIT][SORTED_LONGNAME_MAXLEN]; + #endif + #elif DISABLED(SDSORT_USES_STACK) + char CardReader::sortnames[SDSORT_LIMIT][SORTED_LONGNAME_MAXLEN]; + #endif + + #if HAS_FOLDER_SORTING + #if ENABLED(SDSORT_DYNAMIC_RAM) + uint8_t *CardReader::isDir; + #elif ENABLED(SDSORT_CACHE_NAMES) || DISABLED(SDSORT_USES_STACK) + uint8_t CardReader::isDir[(SDSORT_LIMIT+7)>>3]; + #endif + #endif + + #endif // SDSORT_USES_RAM + +#endif // SDCARD_SORT_ALPHA + +Sd2Card CardReader::sd2card; +SdVolume CardReader::volume; +SdFile CardReader::file; + +uint8_t CardReader::file_subcall_ctr; +uint32_t CardReader::filespos[SD_PROCEDURE_DEPTH]; +char CardReader::proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; + +uint32_t CardReader::filesize, CardReader::sdpos; + +LsAction CardReader::lsAction; //stored for recursion. +uint16_t CardReader::nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory. +char *CardReader::diveDirName; CardReader::CardReader() { #if ENABLED(SDCARD_SORT_ALPHA) @@ -56,9 +124,8 @@ CardReader::CardReader() { //sort_reverse = false; #endif #endif - sdprinting = cardOK = saving = logging = false; - filesize = 0; - sdpos = 0; + flag.sdprinting = flag.cardOK = flag.saving = flag.logging = false; + filesize = sdpos = 0; file_subcall_ctr = 0; workDirDepth = 0; @@ -73,7 +140,7 @@ CardReader::CardReader() { #endif } -char *createFilename(char *buffer, const dir_t &p) { //buffer > 12characters +char *createFilename(char *buffer, const dir_t &p) { char *pos = buffer; for (uint8_t i = 0; i < 11; i++) { if (p.name[i] == ' ') continue; @@ -120,8 +187,8 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m // It contains the full path to the "parent" argument. // We now have the full path to the item in this folder. strcpy(path, prepend_is_empty ? "/" : prepend); // root slash if prepend is empty - strcat(path, dosFilename); // FILENAME_LENGTH-1 characters maximum - strcat(path, "/"); // 1 character + strcat(path, dosFilename); // FILENAME_LENGTH characters maximum + strcat(path, "/"); // 1 character // Serial.print(path); @@ -150,9 +217,9 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; - filenameIsDir = DIR_IS_SUBDIR(&p); + flag.filenameIsDir = DIR_IS_SUBDIR(&p); - if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; + if (!flag.filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { // 1 based file count case LS_Count: @@ -161,10 +228,10 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m case LS_SerialPrint: createFilename(filename, p); - if (prepend) SERIAL_PROTOCOL_P(port, prepend); - SERIAL_PROTOCOL_P(port, filename); - SERIAL_PROTOCOLCHAR_P(port, ' '); - SERIAL_PROTOCOLLN_P(port, p.fileSize); + if (prepend) SERIAL_ECHO_P(port, prepend); + SERIAL_ECHO_P(port, filename); + SERIAL_CHAR_P(port, ' '); + SERIAL_ECHOLN_P(port, p.fileSize); break; case LS_GetFilename: @@ -238,11 +305,11 @@ void CardReader::ls( ); // Print /LongNamePart to serial output - SERIAL_PROTOCOLCHAR_P(port, '/'); - SERIAL_PROTOCOL_P(port, longFilename[0] ? longFilename : "???"); + SERIAL_CHAR_P(port, '/'); + SERIAL_ECHO_P(port, longFilename[0] ? longFilename : "???"); // If the filename was printed then that's it - if (!filenameIsDir) break; + if (!flag.filenameIsDir) break; // SERIAL_ECHOPGM_P(port, "Opening dir: "); SERIAL_ECHOLN_P(port, segment); @@ -293,7 +360,7 @@ void CardReader::printFilename( } void CardReader::initsd() { - cardOK = false; + flag.cardOK = false; if (root.isOpen()) root.close(); #ifndef SPI_SPEED @@ -306,28 +373,22 @@ void CardReader::initsd() { #endif ) { //if (!sd2card.init(SPI_HALF_SPEED,SDSS)) - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_SD_INIT_FAIL); - } - else if (!volume.init(&sd2card)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_SD_VOL_INIT_FAIL); - } - else if (!root.openRoot(&volume)) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_SD_OPENROOT_FAIL); + SERIAL_ECHO_MSG(MSG_SD_INIT_FAIL); } + else if (!volume.init(&sd2card)) + SERIAL_ERROR_MSG(MSG_SD_VOL_INIT_FAIL); + else if (!root.openRoot(&volume)) + SERIAL_ERROR_MSG(MSG_SD_OPENROOT_FAIL); else { - cardOK = true; - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM(MSG_SD_CARD_OK); + flag.cardOK = true; + SERIAL_ECHO_MSG(MSG_SD_CARD_OK); } setroot(); } void CardReader::release() { stopSDPrint(); - cardOK = false; + flag.cardOK = false; } void CardReader::openAndPrintFile(const char *name) { @@ -339,8 +400,8 @@ void CardReader::openAndPrintFile(const char *name) { } void CardReader::startFileprint() { - if (cardOK) { - sdprinting = true; + if (flag.cardOK) { + flag.sdprinting = true; #if SD_RESORT flush_presort(); #endif @@ -355,7 +416,7 @@ void CardReader::stopSDPrint( #if ENABLED(ADVANCED_PAUSE_FEATURE) did_pause_print = 0; #endif - sdprinting = abort_sd_printing = false; + flag.sdprinting = flag.abort_sd_printing = false; if (isFileOpen()) file.close(); #if SD_RESORT if (re_sort) presort(); @@ -363,7 +424,7 @@ void CardReader::stopSDPrint( } void CardReader::openLogFile(char * const path) { - logging = true; + flag.logging = true; openFile(path, false); } @@ -380,7 +441,7 @@ void CardReader::getAbsFilename(char *t) { for (uint8_t i = 0; i < workDirDepth; i++) // Loop to current work dir appendAtom(workDirParents[i], t, cnt); - if (cnt < MAXPATHNAMELENGTH - (FILENAME_LENGTH)) { + if (cnt < MAXPATHNAMELENGTH - (FILENAME_LENGTH) - 1) { // Leave room for filename and nul appendAtom(file, t, cnt); --t; } @@ -389,15 +450,13 @@ void CardReader::getAbsFilename(char *t) { void CardReader::openFile(char * const path, const bool read, const bool subcall/*=false*/) { - if (!cardOK) return; + if (!flag.cardOK) return; uint8_t doing = 0; if (isFileOpen()) { // Replacing current file or doing a subroutine if (subcall) { if (file_subcall_ctr > SD_PROCEDURE_DEPTH - 1) { - SERIAL_ERROR_START(); - SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:"); - SERIAL_ERRORLN((int)SD_PROCEDURE_DEPTH); + SERIAL_ERROR_MSG("trying to call sub-gcode files with too many levels. MAX level is:" STRINGIFY(SD_PROCEDURE_DEPTH)); kill(); return; } @@ -415,10 +474,8 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall else doing = 1; } - else if (subcall) { // Returning from a subcall? - SERIAL_ECHO_START(); - SERIAL_ECHOLNPGM("END SUBROUTINE"); - } + else if (subcall) // Returning from a subcall? + SERIAL_ECHO_MSG("END SUBROUTINE"); else { // Opening fresh file doing = 2; file_subcall_ctr = 0; // Reset procedure depth in case user cancels print while in procedure @@ -441,61 +498,59 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall if (file.open(curDir, fname, O_READ)) { filesize = file.fileSize(); sdpos = 0; - SERIAL_PROTOCOLPAIR(MSG_SD_FILE_OPENED, fname); - SERIAL_PROTOCOLLNPAIR(MSG_SD_SIZE, filesize); - SERIAL_PROTOCOLLNPGM(MSG_SD_FILE_SELECTED); + SERIAL_ECHOPAIR(MSG_SD_FILE_OPENED, fname); + SERIAL_ECHOLNPAIR(MSG_SD_SIZE, filesize); + SERIAL_ECHOLNPGM(MSG_SD_FILE_SELECTED); getfilename(0, fname); - lcd_setstatus(longFilename[0] ? longFilename : fname); + ui.set_status(longFilename[0] ? longFilename : fname); //if (longFilename[0]) { - // SERIAL_PROTOCOLPAIR(MSG_SD_FILE_LONG_NAME, longFilename); + // SERIAL_ECHOPAIR(MSG_SD_FILE_LONG_NAME, longFilename); //} } else { - SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname); - SERIAL_PROTOCOLCHAR('.'); + SERIAL_ECHOPAIR(MSG_SD_OPEN_FILE_FAIL, fname); + SERIAL_CHAR('.'); SERIAL_EOL(); } } else { //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { - SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, fname); - SERIAL_PROTOCOLCHAR('.'); + SERIAL_ECHOPAIR(MSG_SD_OPEN_FILE_FAIL, fname); + SERIAL_CHAR('.'); SERIAL_EOL(); } else { - saving = true; + flag.saving = true; getfilename(0, fname); #if ENABLED(EMERGENCY_PARSER) emergency_parser.disable(); #endif - SERIAL_PROTOCOLLNPAIR(MSG_SD_WRITE_TO_FILE, fname); - lcd_setstatus(fname); + SERIAL_ECHOLNPAIR(MSG_SD_WRITE_TO_FILE, fname); + ui.set_status(fname); } } } void CardReader::removeFile(const char * const name) { - if (!cardOK) return; + if (!flag.cardOK) return; - stopSDPrint(); + //stopSDPrint(); SdFile *curDir; const char * const fname = diveToFile(curDir, name, false); if (!fname) return; if (file.remove(curDir, fname)) { - SERIAL_PROTOCOLPGM("File deleted:"); - SERIAL_PROTOCOLLN(fname); + SERIAL_ECHOLNPAIR("File deleted:", fname); sdpos = 0; #if ENABLED(SDCARD_SORT_ALPHA) presort(); #endif } else { - SERIAL_PROTOCOLPGM("Deletion failed, File: "); - SERIAL_PROTOCOL(fname); - SERIAL_PROTOCOLCHAR('.'); + SERIAL_ECHOPAIR("Deletion failed, File: ", fname); + SERIAL_CHAR('.'); } } @@ -504,14 +559,14 @@ void CardReader::getStatus( const int8_t port/*= -1*/ #endif ) { - if (cardOK && sdprinting) { - SERIAL_PROTOCOLPGM_P(port, MSG_SD_PRINTING_BYTE); - SERIAL_PROTOCOL_P(port, sdpos); - SERIAL_PROTOCOLCHAR_P(port, '/'); - SERIAL_PROTOCOLLN_P(port, filesize); + if (flag.cardOK && flag.sdprinting) { + SERIAL_ECHOPGM_P(port, MSG_SD_PRINTING_BYTE); + SERIAL_ECHO_P(port, sdpos); + SERIAL_CHAR_P(port, '/'); + SERIAL_ECHOLN_P(port, filesize); } else - SERIAL_PROTOCOLLNPGM_P(port, MSG_SD_NOT_PRINTING); + SERIAL_ECHOLNPGM_P(port, MSG_SD_NOT_PRINTING); } void CardReader::write_command(char *buf) { @@ -528,10 +583,8 @@ void CardReader::write_command(char *buf) { end[2] = '\n'; end[3] = '\0'; file.write(begin); - if (file.writeError) { - SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_SD_ERR_WRITE_TO_FILE); - } + + if (file.writeError) SERIAL_ERROR_MSG(MSG_SD_ERR_WRITE_TO_FILE); } // @@ -543,13 +596,13 @@ void CardReader::write_command(char *buf) { void CardReader::checkautostart() { - if (autostart_index < 0 || sdprinting) return; + if (autostart_index < 0 || flag.sdprinting) return; - if (!cardOK) initsd(); + if (!flag.cardOK) initsd(); - if (cardOK + if (flag.cardOK #if ENABLED(POWER_LOSS_RECOVERY) - && !jobRecoverFileExists() // Don't run auto#.g when a resume file exists + && !recovery.valid() // Don't run auto#.g when a resume file exists #endif ) { char autoname[8]; @@ -576,7 +629,8 @@ void CardReader::beginautostart() { void CardReader::closefile(const bool store_location) { file.sync(); file.close(); - saving = logging = false; + flag.saving = flag.logging = false; + sdpos = 0; #if ENABLED(EMERGENCY_PARSER) emergency_parser.enable(); #endif @@ -602,7 +656,7 @@ void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) { if (nr < sort_count) { strcpy(filename, sortshort[nr]); strcpy(longFilename, sortnames[nr]); - filenameIsDir = TEST(isDir[nr>>3], nr & 0x07); + flag.filenameIsDir = TEST(isDir[nr>>3], nr & 0x07); return; } #endif // SDSORT_CACHE_NAMES @@ -622,8 +676,12 @@ uint16_t CardReader::getnrfilenames() { } /** - * Dive to the given file path, with optional echo. - * On exit set curDir and return the name part of the path. + * Dive to the given DOS 8.3 file path, with optional echo of the dive paths. + * + * On exit, curDir contains an SdFile reference to the file's directory. + * + * Returns a pointer to the last segment (filename) of the given DOS 8.3 path. + * * A NULL result indicates an unrecoverable error. */ const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, const bool echo) { @@ -643,8 +701,8 @@ const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, con if (echo) SERIAL_ECHOLN(dosSubdirname); if (!myDir.open(curDir, dosSubdirname, O_READ)) { - SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, dosSubdirname); - SERIAL_PROTOCOLCHAR('.'); + SERIAL_ECHOPAIR(MSG_SD_OPEN_FILE_FAIL, dosSubdirname); + SERIAL_CHAR('.'); SERIAL_EOL(); return NULL; } @@ -668,8 +726,7 @@ void CardReader::chdir(const char * relpath) { } else { SERIAL_ECHO_START(); - SERIAL_ECHOPGM(MSG_SD_CANT_ENTER_SUBDIR); - SERIAL_ECHOLN(relpath); + SERIAL_ECHOLNPAIR(MSG_SD_CANT_ENTER_SUBDIR, relpath); } } @@ -707,6 +764,33 @@ void CardReader::setroot() { ); } + #if ENABLED(SDSORT_USES_RAM) + #if ENABLED(SDSORT_DYNAMIC_RAM) + // Use dynamic method to copy long filename + #define SET_SORTNAME(I) (sortnames[I] = strdup(longest_filename())) + #if ENABLED(SDSORT_CACHE_NAMES) + // When caching also store the short name, since + // we're replacing the getfilename() behavior. + #define SET_SORTSHORT(I) (sortshort[I] = strdup(filename)) + #else + #define SET_SORTSHORT(I) NOOP + #endif + #else + // Copy filenames into the static array + #if SORTED_LONGNAME_MAXLEN != LONG_FILENAME_LENGTH + #define SET_SORTNAME(I) do{ strncpy(sortnames[I], longest_filename(), SORTED_LONGNAME_MAXLEN); \ + sortnames[I][SORTED_LONGNAME_MAXLEN] = '\0'; }while(0) + #else + #define SET_SORTNAME(I) strncpy(sortnames[I], longest_filename(), SORTED_LONGNAME_MAXLEN) + #endif + #if ENABLED(SDSORT_CACHE_NAMES) + #define SET_SORTSHORT(I) strcpy(sortshort[I], filename) + #else + #define SET_SORTSHORT(I) NOOP + #endif + #endif + #endif + /** * Read all the files and produce a sort key * @@ -766,7 +850,7 @@ void CardReader::setroot() { // By default re-read the names from SD for every compare // retaining only two filenames at a time. This is very // slow but is safest and uses minimal RAM. - char name1[LONG_FILENAME_LENGTH + 1]; + char name1[LONG_FILENAME_LENGTH]; #endif @@ -778,33 +862,15 @@ void CardReader::setroot() { // If using RAM then read all filenames now. #if ENABLED(SDSORT_USES_RAM) getfilename(i); - #if ENABLED(SDSORT_DYNAMIC_RAM) - // Use dynamic method to copy long filename - sortnames[i] = strdup(longest_filename()); - #if ENABLED(SDSORT_CACHE_NAMES) - // When caching also store the short name, since - // we're replacing the getfilename() behavior. - sortshort[i] = strdup(filename); - #endif - #else - // Copy filenames into the static array - #if SORTED_LONGNAME_MAXLEN != LONG_FILENAME_LENGTH - strncpy(sortnames[i], longest_filename(), SORTED_LONGNAME_MAXLEN); - sortnames[i][SORTED_LONGNAME_MAXLEN - 1] = '\0'; - #else - strncpy(sortnames[i], longest_filename(), SORTED_LONGNAME_MAXLEN); - #endif - #if ENABLED(SDSORT_CACHE_NAMES) - strcpy(sortshort[i], filename); - #endif - #endif + SET_SORTNAME(i); + SET_SORTSHORT(i); // char out[30]; - // sprintf_P(out, PSTR("---- %i %s %s"), i, filenameIsDir ? "D" : " ", sortnames[i]); + // sprintf_P(out, PSTR("---- %i %s %s"), i, flag.filenameIsDir ? "D" : " ", sortnames[i]); // SERIAL_ECHOLN(out); #if HAS_FOLDER_SORTING const uint16_t bit = i & 0x07, ind = i >> 3; if (bit == 0) isDir[ind] = 0x00; - if (filenameIsDir) isDir[ind] |= _BV(bit); + if (flag.filenameIsDir) isDir[ind] |= _BV(bit); #endif #endif } @@ -832,7 +898,7 @@ void CardReader::setroot() { ? _SORT_CMP_NODIR() \ : (isDir[fs > 0 ? ind1 : ind2] & (fs > 0 ? _BV(bit1) : _BV(bit2))) != 0) #else - #define _SORT_CMP_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_NODIR() : (fs > 0 ? dir1 : !dir1)) + #define _SORT_CMP_DIR(fs) ((dir1 == flag.filenameIsDir) ? _SORT_CMP_NODIR() : (fs > 0 ? dir1 : !dir1)) #endif #endif @@ -842,7 +908,7 @@ void CardReader::setroot() { getfilename(o1); strcpy(name1, longest_filename()); // save (or getfilename below will trounce it) #if HAS_FOLDER_SORTING - bool dir1 = filenameIsDir; + bool dir1 = flag.filenameIsDir; #endif getfilename(o2); char *name2 = longest_filename(); // use the string in-place @@ -880,27 +946,17 @@ void CardReader::setroot() { else { sort_order[0] = 0; #if ENABLED(SDSORT_USES_RAM) && ENABLED(SDSORT_CACHE_NAMES) - getfilename(0); #if ENABLED(SDSORT_DYNAMIC_RAM) sortnames = new char*[1]; - sortnames[0] = strdup(longest_filename()); // malloc #if ENABLED(SDSORT_CACHE_NAMES) sortshort = new char*[1]; - sortshort[0] = strdup(filename); // malloc #endif isDir = new uint8_t[1]; - #else - #if SORTED_LONGNAME_MAXLEN != LONG_FILENAME_LENGTH - strncpy(sortnames[0], longest_filename(), SORTED_LONGNAME_MAXLEN); - sortnames[0][SORTED_LONGNAME_MAXLEN - 1] = '\0'; - #else - strncpy(sortnames[0], longest_filename(), SORTED_LONGNAME_MAXLEN); - #endif - #if ENABLED(SDSORT_CACHE_NAMES) - strcpy(sortshort[0], filename); - #endif #endif - isDir[0] = filenameIsDir ? 0x01 : 0x00; + getfilename(0); + SET_SORTNAME(0); + SET_SORTSHORT(0); + isDir[0] = flag.filenameIsDir ? 0x01 : 0x00; #endif } @@ -956,17 +1012,22 @@ void CardReader::printingHasFinished() { #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND) planner.finish_and_disable(); #endif + print_job_timer.stop(); - if (print_job_timer.duration() > 60) - enqueue_and_echo_commands_P(PSTR("M31")); + if (print_job_timer.duration() > 60) enqueue_and_echo_commands_P(PSTR("M31")); + #if ENABLED(SDCARD_SORT_ALPHA) presort(); #endif + #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY) - progress_bar_percent = 0; + ui.progress_bar_percent = 0; #endif + + ui.reset_status(); + #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - lcd_reselect_last_file(); + ui.reselect_last_file(); #endif } } @@ -993,48 +1054,35 @@ void CardReader::printingHasFinished() { #if ENABLED(POWER_LOSS_RECOVERY) - char job_recovery_file_name[4] = "bin"; - - void CardReader::openJobRecoveryFile(const bool read) { - if (!cardOK) return; - if (jobRecoveryFile.isOpen()) return; - if (!jobRecoveryFile.open(&root, job_recovery_file_name, read ? O_READ : O_CREAT | O_WRITE | O_TRUNC | O_SYNC)) { - SERIAL_PROTOCOLPAIR(MSG_SD_OPEN_FILE_FAIL, job_recovery_file_name); - SERIAL_PROTOCOLCHAR('.'); - SERIAL_EOL(); - } - else if (!read) - SERIAL_PROTOCOLLNPAIR(MSG_SD_WRITE_TO_FILE, job_recovery_file_name); - } - - void CardReader::closeJobRecoveryFile() { jobRecoveryFile.close(); } + constexpr char job_recovery_file_name[4] = "BIN"; bool CardReader::jobRecoverFileExists() { - const bool exists = jobRecoveryFile.open(&root, job_recovery_file_name, O_READ); - if (exists) jobRecoveryFile.close(); + const bool exists = recovery.file.open(&root, job_recovery_file_name, O_READ); + if (exists) recovery.file.close(); return exists; } - int16_t CardReader::saveJobRecoveryInfo() { - jobRecoveryFile.seekSet(0); - const int16_t ret = jobRecoveryFile.write(&job_recovery_info, sizeof(job_recovery_info)); - #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - if (ret == -1) SERIAL_PROTOCOLLNPGM("Power-loss file write failed."); - #endif - return ret; - } - - int16_t CardReader::loadJobRecoveryInfo() { - return jobRecoveryFile.read(&job_recovery_info, sizeof(job_recovery_info)); + void CardReader::openJobRecoveryFile(const bool read) { + if (!flag.cardOK) return; + if (recovery.file.isOpen()) return; + if (!recovery.file.open(&root, job_recovery_file_name, read ? O_READ : O_CREAT | O_WRITE | O_TRUNC | O_SYNC)) { + SERIAL_ECHOPAIR(MSG_SD_OPEN_FILE_FAIL, job_recovery_file_name); + SERIAL_CHAR('.'); + SERIAL_EOL(); + } + else if (!read) + SERIAL_ECHOLNPAIR(MSG_SD_WRITE_TO_FILE, job_recovery_file_name); } + // Removing the job recovery file currently requires closing + // the file being printed, so during SD printing the file should + // be zeroed and written instead of deleted. void CardReader::removeJobRecoveryFile() { - job_recovery_info.valid_head = job_recovery_info.valid_foot = job_recovery_commands_count = 0; if (jobRecoverFileExists()) { - closefile(); + //closefile(); removeFile(job_recovery_file_name); #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) - SERIAL_PROTOCOLPGM("Power-loss file delete"); + SERIAL_ECHOPGM("Power-loss file delete"); serialprintPGM(jobRecoverFileExists() ? PSTR(" failed.\n") : PSTR("d.\n")); #endif } diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index a1653753f1..b9c71875c8 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -27,109 +27,121 @@ #define SD_RESORT ENABLED(SDCARD_SORT_ALPHA) && ENABLED(SDSORT_DYNAMIC_RAM) -#define MAX_DIR_DEPTH 10 // Maximum folder depth +#define MAX_DIR_DEPTH 10 // Maximum folder depth +#define MAXDIRNAMELENGTH 8 // DOS folder name size +#define MAXPATHNAMELENGTH (1 + (MAXDIRNAMELENGTH + 1) * (MAX_DIR_DEPTH) + 1 + FILENAME_LENGTH) // "/" + N * ("ADIRNAME/") + "filename.ext" #include "SdFile.h" enum LsAction : uint8_t { LS_SerialPrint, LS_Count, LS_GetFilename }; +typedef struct { + bool saving:1, + logging:1, + sdprinting:1, + cardOK:1, + filenameIsDir:1, + abort_sd_printing:1 + #if ENABLED(FAST_FILE_TRANSFER) + , binary_mode:1 + #endif + ; +} card_flags_t; + class CardReader { public: CardReader(); - void initsd(); - void write_command(char *buf); + static void initsd(); + static void write_command(char *buf); - void beginautostart(); - void checkautostart(); + static void beginautostart(); + static void checkautostart(); - void openFile(char * const path, const bool read, const bool subcall=false); - void openLogFile(char * const path); - void removeFile(const char * const name); - void closefile(const bool store_location=false); - void release(); - void openAndPrintFile(const char *name); - void startFileprint(); - void stopSDPrint( + static void openFile(char * const path, const bool read, const bool subcall=false); + static void openLogFile(char * const path); + static void removeFile(const char * const name); + static void closefile(const bool store_location=false); + static void release(); + static void openAndPrintFile(const char *name); + static void startFileprint(); + static void stopSDPrint( #if SD_RESORT const bool re_sort=false #endif ); - void getStatus( + static void getStatus( #if NUM_SERIAL > 1 const int8_t port = -1 #endif ); - void printingHasFinished(); - void printFilename( + static void printingHasFinished(); + static void printFilename( #if NUM_SERIAL > 1 const int8_t port = -1 #endif ); #if ENABLED(LONG_FILENAME_HOST_SUPPORT) - void printLongPath(char *path + static void printLongPath(char *path #if NUM_SERIAL > 1 , const int8_t port = -1 #endif ); #endif - void getfilename(uint16_t nr, const char* const match=NULL); - uint16_t getnrfilenames(); + static void getfilename(uint16_t nr, const char* const match=NULL); + static uint16_t getnrfilenames(); - void getAbsFilename(char *t); + static void getAbsFilename(char *t); - void ls( + static void ls( #if NUM_SERIAL > 1 const int8_t port = -1 #endif ); - void chdir(const char *relpath); - int8_t updir(); - void setroot(); + static void chdir(const char *relpath); + static int8_t updir(); + static void setroot(); - const char* diveToFile(SdFile*& curDir, const char * const path, const bool echo); + static const char* diveToFile(SdFile*& curDir, const char * const path, const bool echo); - uint16_t get_num_Files(); + static uint16_t get_num_Files(); #if ENABLED(SDCARD_SORT_ALPHA) - void presort(); - void getfilename_sorted(const uint16_t nr); + static void presort(); + static void getfilename_sorted(const uint16_t nr); #if ENABLED(SDSORT_GCODE) - FORCE_INLINE void setSortOn(bool b) { sort_alpha = b; presort(); } - FORCE_INLINE void setSortFolders(int i) { sort_folders = i; presort(); } - //FORCE_INLINE void setSortReverse(bool b) { sort_reverse = b; } + FORCE_INLINE static void setSortOn(bool b) { sort_alpha = b; presort(); } + FORCE_INLINE static void setSortFolders(int i) { sort_folders = i; presort(); } + //FORCE_INLINE static void setSortReverse(bool b) { sort_reverse = b; } #endif #else - FORCE_INLINE void getfilename_sorted(const uint16_t nr) { getfilename(nr); } + FORCE_INLINE static void getfilename_sorted(const uint16_t nr) { getfilename(nr); } #endif #if ENABLED(POWER_LOSS_RECOVERY) - void openJobRecoveryFile(const bool read); - void closeJobRecoveryFile(); - bool jobRecoverFileExists(); - int16_t saveJobRecoveryInfo(); - int16_t loadJobRecoveryInfo(); - void removeJobRecoveryFile(); + static bool jobRecoverFileExists(); + static void openJobRecoveryFile(const bool read); + static void removeJobRecoveryFile(); #endif - FORCE_INLINE void pauseSDPrint() { sdprinting = false; } - FORCE_INLINE bool isFileOpen() { return file.isOpen(); } - FORCE_INLINE bool eof() { return sdpos >= filesize; } - FORCE_INLINE int16_t get() { sdpos = file.curPosition(); return (int16_t)file.read(); } - FORCE_INLINE void setIndex(const uint32_t index) { sdpos = index; file.seekSet(index); } - FORCE_INLINE uint32_t getIndex() { return sdpos; } - FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; } - FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; } - FORCE_INLINE int16_t read(void* buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; } - FORCE_INLINE int16_t write(void* buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; } + static inline void pauseSDPrint() { flag.sdprinting = false; } + static inline bool isFileOpen() { return file.isOpen(); } + static inline bool eof() { return sdpos >= filesize; } + static inline int16_t get() { sdpos = file.curPosition(); return (int16_t)file.read(); } + static inline void setIndex(const uint32_t index) { sdpos = index; file.seekSet(index); } + static inline uint32_t getIndex() { return sdpos; } + static inline uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; } + static inline char* getWorkDirName() { workDir.getFilename(filename); return filename; } + static inline int16_t read(void* buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; } + static inline int16_t write(void* buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; } - Sd2Card& getSd2Card() { return sd2card; } + static Sd2Card& getSd2Card() { return sd2card; } #if ENABLED(AUTO_REPORT_SD_STATUS) - void auto_report_sd_status(void); - FORCE_INLINE void set_auto_report_interval(uint8_t v + static void auto_report_sd_status(void); + static inline void set_auto_report_interval(uint8_t v #if NUM_SERIAL > 1 , int8_t port #endif @@ -143,40 +155,39 @@ public: } #endif - FORCE_INLINE char* longest_filename() { return longFilename[0] ? longFilename : filename; } + static inline char* longest_filename() { return longFilename[0] ? longFilename : filename; } public: - bool saving, logging, sdprinting, cardOK, filenameIsDir, abort_sd_printing; - char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH]; - int8_t autostart_index; + static card_flags_t flag; + static char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH]; + static int8_t autostart_index; #if ENABLED(FAST_FILE_TRANSFER) - bool binary_mode; #if NUM_SERIAL > 1 - uint8_t transfer_port; + static uint8_t transfer_port; #else static constexpr uint8_t transfer_port = 0; #endif #endif private: - SdFile root, workDir, workDirParents[MAX_DIR_DEPTH]; - uint8_t workDirDepth; + static SdFile root, workDir, workDirParents[MAX_DIR_DEPTH]; + static uint8_t workDirDepth; // Sort files and folders alphabetically. #if ENABLED(SDCARD_SORT_ALPHA) - uint16_t sort_count; // Count of sorted items in the current directory + static uint16_t sort_count; // Count of sorted items in the current directory #if ENABLED(SDSORT_GCODE) - bool sort_alpha; // Flag to enable / disable the feature - int sort_folders; // Flag to enable / disable folder sorting - //bool sort_reverse; // Flag to enable / disable reverse sorting + static bool sort_alpha; // Flag to enable / disable the feature + static int sort_folders; // Folder sorting before/none/after + //static bool sort_reverse; // Flag to enable / disable reverse sorting #endif // By default the sort index is static #if ENABLED(SDSORT_DYNAMIC_RAM) - uint8_t *sort_order; + static uint8_t *sort_order; #else - uint8_t sort_order[SDSORT_LIMIT]; + static uint8_t sort_order[SDSORT_LIMIT]; #endif #if ENABLED(SDSORT_USES_RAM) && ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM) @@ -191,21 +202,21 @@ private: // If using dynamic ram for names, allocate on the heap. #if ENABLED(SDSORT_CACHE_NAMES) #if ENABLED(SDSORT_DYNAMIC_RAM) - char **sortshort, **sortnames; + static char **sortshort, **sortnames; #else - char sortshort[SDSORT_LIMIT][FILENAME_LENGTH]; - char sortnames[SDSORT_LIMIT][SORTED_LONGNAME_MAXLEN]; + static char sortshort[SDSORT_LIMIT][FILENAME_LENGTH]; + static char sortnames[SDSORT_LIMIT][SORTED_LONGNAME_MAXLEN]; #endif #elif DISABLED(SDSORT_USES_STACK) - char sortnames[SDSORT_LIMIT][SORTED_LONGNAME_MAXLEN]; + static char sortnames[SDSORT_LIMIT][SORTED_LONGNAME_MAXLEN]; #endif // Folder sorting uses an isDir array when caching items. #if HAS_FOLDER_SORTING #if ENABLED(SDSORT_DYNAMIC_RAM) - uint8_t *isDir; + static uint8_t *isDir; #elif ENABLED(SDSORT_CACHE_NAMES) || DISABLED(SDSORT_USES_STACK) - uint8_t isDir[(SDSORT_LIMIT+7)>>3]; + static uint8_t isDir[(SDSORT_LIMIT+7)>>3]; #endif #endif @@ -213,32 +224,31 @@ private: #endif // SDCARD_SORT_ALPHA - Sd2Card sd2card; - SdVolume volume; - SdFile file; + static Sd2Card sd2card; + static SdVolume volume; + static SdFile file; - #if ENABLED(POWER_LOSS_RECOVERY) - SdFile jobRecoveryFile; + #ifndef SD_PROCEDURE_DEPTH + #define SD_PROCEDURE_DEPTH 1 #endif - #define SD_PROCEDURE_DEPTH 1 - #define MAXPATHNAMELENGTH (FILENAME_LENGTH*MAX_DIR_DEPTH + MAX_DIR_DEPTH + 1) - uint8_t file_subcall_ctr; - uint32_t filespos[SD_PROCEDURE_DEPTH]; - char proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; - uint32_t filesize, sdpos; + static uint8_t file_subcall_ctr; + static uint32_t filespos[SD_PROCEDURE_DEPTH]; + static char proc_filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH]; - LsAction lsAction; //stored for recursion. - uint16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory. - char* diveDirName; - void lsDive(const char *prepend, SdFile parent, const char * const match=NULL + static uint32_t filesize, sdpos; + + static LsAction lsAction; //stored for recursion. + static uint16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory. + static char *diveDirName; + static void lsDive(const char *prepend, SdFile parent, const char * const match=NULL #if NUM_SERIAL > 1 , const int8_t port = -1 #endif ); #if ENABLED(SDCARD_SORT_ALPHA) - void flush_presort(); + static void flush_presort(); #endif #if ENABLED(AUTO_REPORT_SD_STATUS) @@ -263,7 +273,7 @@ private: #define IS_SD_INSERTED() true #endif -#define IS_SD_PRINTING() card.sdprinting +#define IS_SD_PRINTING() card.flag.sdprinting #define IS_SD_FILE_OPEN() card.isFileOpen() extern CardReader card; diff --git a/buildroot/bin/opt_add b/buildroot/bin/opt_add index 8361cac527..8ef7e07917 100755 --- a/buildroot/bin/opt_add +++ b/buildroot/bin/opt_add @@ -1,3 +1,3 @@ #!/usr/bin/env bash -eval "echo \"#define ${1} ${2}\" >>Marlin/Configuration.h" +eval "echo \"#define ${1} ${2}\" >>Marlin/Configuration_adv.h" diff --git a/buildroot/bin/opt_disable b/buildroot/bin/opt_disable index c219f36170..1d36159968 100755 --- a/buildroot/bin/opt_disable +++ b/buildroot/bin/opt_disable @@ -5,3 +5,7 @@ SED=$(which gsed || which sed) for opt in "$@" ; do eval "${SED} -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration.h" done + +for opt in "$@" ; do + eval "${SED} -i 's/\([[:blank:]]*\)\(#define \b${opt}\b\)/\1\/\/\2/g' Marlin/Configuration_adv.h" +done diff --git a/buildroot/bin/opt_enable b/buildroot/bin/opt_enable index 7be02ed9b4..f5540d2c63 100755 --- a/buildroot/bin/opt_enable +++ b/buildroot/bin/opt_enable @@ -5,3 +5,7 @@ SED=$(which gsed || which sed) for opt in "$@" ; do eval "${SED} -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration.h" done + +for opt in "$@" ; do + eval "${SED} -i 's/\/\/[[:blank:]]*\(#define \b${opt}\b\)/\1/g' Marlin/Configuration_adv.h" +done diff --git a/buildroot/bin/opt_set b/buildroot/bin/opt_set index 4b6f034bdb..ef37a358ec 100755 --- a/buildroot/bin/opt_set +++ b/buildroot/bin/opt_set @@ -3,3 +3,4 @@ SED=$(which gsed || which sed) eval "${SED} -E -i 's/(\/\/)?(#define \b${1}\b).*$/\2 ${2}/g' Marlin/Configuration.h" +eval "${SED} -E -i 's/(\/\/)?(#define \b${1}\b).*$/\2 ${2}/g' Marlin/Configuration_adv.h" diff --git a/buildroot/share/fonts/genallfont.sh b/buildroot/share/fonts/genallfont.sh index 945bfe1156..ff4a18aa9c 100644 --- a/buildroot/share/fonts/genallfont.sh +++ b/buildroot/share/fonts/genallfont.sh @@ -29,43 +29,60 @@ DN_EXEC=$(dirname $(my_getpath "$0") ) EXEC_WXGGEN="${DN_EXEC}/uxggenpages.sh" +# +# Locate the bdf2u8g command +# EXEC_BDF2U8G=`which bdf2u8g` [ -x "${EXEC_BDF2U8G}" ] || EXEC_BDF2U8G="${DN_EXEC}/bdf2u8g" [ -x "${EXEC_BDF2U8G}" ] || EXEC_BDF2U8G="${PWD}/bdf2u8g" [ -x "${EXEC_BDF2U8G}" ] || { EOL=$'\n' ; echo "ERR: Can't find bdf2u8g!${EOL}See uxggenpages.md for bdf2u8g build instructions." >&2 ; exit 1; } -#FN_FONT="${1:-}" +# +# Get language arguments +# +LANG_ARG="$@" + +# +# Use 6x12 combined font data for Western languages +# FN_FONT="${DN_EXEC}/marlin-6x12-3.bdf" -[ "$1" = "" ] || FN_FONT="$1" -DN_FONT0=`dirname ${FN_FONT}` -DN_FONT="$(my_getpath ${DN_FONT0})" -FN_FONT="$(my_getpath "${DN_FONT}")/"`basename ${FN_FONT}` -[ -z "${FN_FONT}" ] && FN_FONT=${DN_DATA}/../${FN_FONT_BASE}.bdf -[ -f "${FN_FONT}" ] || FN_FONT=${DN_EXEC}/${FN_FONT_BASE}.bdf -[ -f "${FN_FONT}" ] || FN_FONT="$FONTHOME/wenquanyi/${FN_FONT_BASE}.bdf" -[ -f "${FN_FONT}" ] || FN_FONT="$FONTHOME/X11/misc/${FN_FONT_BASE}.bdf" -[ -f "${FN_FONT}" ] || FN_FONT="$FONTHOME/misc/${FN_FONT_BASE}.bdf" -#echo "genallfont.sh: FN_FONT=${FN_FONT}" - -DN_WORK=./tmp1 +# +# Change to working directory 'Marlin' +# +OLDWD=`pwd` +[[ $(basename "$OLDWD") != 'Marlin' && -d "Marlin" ]] && cd Marlin +[[ -f "Configuration.h" ]] || { echo -n "cd to the 'Marlin' folder to run " ; basename $0 ; exit 1; } +# +# Compile the 'genpages' command in-place +# (cd ${DN_EXEC}; gcc -o genpages genpages.c getline.c) +# +# By default loop through all languages +# LANGS_DEFAULT="an bg ca cz da de el el-gr en es eu fi fr gl hr it jp-kana ko_KR nl pl pt pt-br ru sk tr uk zh_CN zh_TW test" -for LANG in ${MARLIN_LANGS:=$LANGS_DEFAULT} ; do +# +# Generate data for language list MARLIN_LANGS or all if not provided +# +for LANG in ${LANG_ARG:=$LANGS_DEFAULT} ; do echo "Generating Marlin language data for '${LANG}'" >&2 - rm -rf ${DN_WORK}/ - mkdir -p ${DN_WORK} + case "$LANG" in + zh_* ) FONTFILE="wenquanyi_12pt" ;; + ko_* ) FONTFILE="${DN_EXEC}/NanumGothic.bdf" ;; + * ) FONTFILE="${DN_EXEC}/marlin-6x12-3.bdf" ;; + esac + DN_WORK=`mktemp -d` cp Configuration.h ${DN_WORK}/ cp src/lcd/language/language_${LANG}.h ${DN_WORK}/ - cd ${DN_WORK}/ - ${EXEC_WXGGEN} "${FN_FONT}" + cd "${DN_WORK}" + ${EXEC_WXGGEN} "${FONTFILE}" sed -i fontutf8-data.h -e 's|fonts//|fonts/|g' -e 's|fonts//|fonts/|g' -e 's|[/0-9a-zA-Z_\-]*buildroot/share/fonts|buildroot/share/fonts|' 2>/dev/null - cd ../ + cd - >/dev/null mv ${DN_WORK}/fontutf8-data.h src/lcd/dogm/fontdata/langdata_${LANG}.h - rm -rf ${DN_WORK}/ + rm -rf ${DN_WORK} done # @@ -74,15 +91,16 @@ done # #if [ "${MARLIN_LANGS}" == "${LANGS_DEFAULT}" ]; then if [ 1 = 1 ]; then - rm -rf ${DN_WORK}/ - mkdir -p ${DN_WORK} - cd ${DN_WORK}/ + DN_WORK=`mktemp -d` + cd ${DN_WORK} ${EXEC_BDF2U8G} -b 1 -e 127 ${FN_FONT} ISO10646_1_5x7 tmp1.h >/dev/null ${EXEC_BDF2U8G} -b 1 -e 255 ${FN_FONT} ISO10646_1_5x7 tmp2.h >/dev/null - TMP1=$(cat tmp1.h) ; rm tmp1.h - TMP2=$(cat tmp2.h) ; rm tmp2.h + TMP1=$(cat tmp1.h) + TMP2=$(cat tmp2.h) + cd - >/dev/null + rm -rf ${DN_WORK} - cat <../src/lcd/dogm/fontdata/fontdata_ISO10646_1.h + cat <src/lcd/dogm/fontdata/fontdata_ISO10646_1.h /** * Marlin 3D Printer Firmware * Copyright (C) 2018 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] @@ -115,6 +133,8 @@ $TMP2 #endif EOF - rmdir ../${DN_WORK} - cd - >/dev/null fi + +(cd ${DN_EXEC}; rm genpages) + +cd "$OLDWD" diff --git a/buildroot/share/fonts/marlin-6x12-1.bdf b/buildroot/share/fonts/marlin-6x12-1.bdf index 11609c13d8..b40fce0152 100644 --- a/buildroot/share/fonts/marlin-6x12-1.bdf +++ b/buildroot/share/fonts/marlin-6x12-1.bdf @@ -108,17 +108,14 @@ STARTCHAR uni0006 ENCODING 6 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 9 0 -1 +BBX 5 6 0 1 BITMAP E0 -80 -C0 -B0 -A8 -28 -30 -28 -28 +8C +EA +8C +8A +0A ENDCHAR STARTCHAR uni0007 ENCODING 7 @@ -1646,7 +1643,7 @@ STARTCHAR twosuperior ENCODING 178 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 A0 @@ -1658,7 +1655,7 @@ STARTCHAR threesuperior ENCODING 179 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP C0 20 @@ -1727,7 +1724,7 @@ STARTCHAR onesuperior ENCODING 185 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 C0 @@ -26792,7 +26789,7 @@ STARTCHAR zerosuperior ENCODING 8304 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 A0 @@ -26816,7 +26813,7 @@ STARTCHAR foursuperior ENCODING 8308 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 80 80 @@ -26828,7 +26825,7 @@ STARTCHAR fivesuperior ENCODING 8309 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP E0 80 @@ -26840,7 +26837,7 @@ STARTCHAR sixsuperior ENCODING 8310 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 60 80 @@ -26852,7 +26849,7 @@ STARTCHAR sevensuperior ENCODING 8311 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP E0 20 @@ -26864,7 +26861,7 @@ STARTCHAR eightsuperior ENCODING 8312 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 A0 @@ -26876,7 +26873,7 @@ STARTCHAR ninesuperior ENCODING 8313 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 A0 @@ -26916,7 +26913,7 @@ STARTCHAR parenleftsuperior ENCODING 8317 SWIDTH 480 0 DWIDTH 6 0 -BBX 2 5 1 5 +BBX 2 5 1 4 BITMAP 40 80 @@ -26928,7 +26925,7 @@ STARTCHAR parenrightsuperior ENCODING 8318 SWIDTH 480 0 DWIDTH 6 0 -BBX 2 5 1 5 +BBX 2 5 1 4 BITMAP 80 40 @@ -26940,7 +26937,7 @@ STARTCHAR nsuperior ENCODING 8319 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 4 1 5 +BBX 3 4 1 4 BITMAP C0 A0 diff --git a/buildroot/share/fonts/marlin-6x12-2.bdf b/buildroot/share/fonts/marlin-6x12-2.bdf index 9a612e3fb4..d36a6e9f63 100644 --- a/buildroot/share/fonts/marlin-6x12-2.bdf +++ b/buildroot/share/fonts/marlin-6x12-2.bdf @@ -108,17 +108,14 @@ STARTCHAR uni0006 ENCODING 6 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 9 0 -1 +BBX 5 6 0 1 BITMAP E0 -80 -C0 -B0 -A8 -28 -30 -28 -28 +8C +EA +8C +8A +0A ENDCHAR STARTCHAR uni0007 ENCODING 7 @@ -1644,7 +1641,7 @@ STARTCHAR twosuperior ENCODING 178 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 A0 @@ -1656,7 +1653,7 @@ STARTCHAR threesuperior ENCODING 179 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP C0 20 @@ -1725,7 +1722,7 @@ STARTCHAR onesuperior ENCODING 185 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 C0 @@ -26790,7 +26787,7 @@ STARTCHAR zerosuperior ENCODING 8304 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 A0 @@ -26814,7 +26811,7 @@ STARTCHAR foursuperior ENCODING 8308 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 80 80 @@ -26826,7 +26823,7 @@ STARTCHAR fivesuperior ENCODING 8309 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP E0 80 @@ -26838,7 +26835,7 @@ STARTCHAR sixsuperior ENCODING 8310 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 60 80 @@ -26850,7 +26847,7 @@ STARTCHAR sevensuperior ENCODING 8311 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP E0 20 @@ -26862,7 +26859,7 @@ STARTCHAR eightsuperior ENCODING 8312 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 A0 @@ -26874,7 +26871,7 @@ STARTCHAR ninesuperior ENCODING 8313 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 A0 @@ -26914,7 +26911,7 @@ STARTCHAR parenleftsuperior ENCODING 8317 SWIDTH 480 0 DWIDTH 6 0 -BBX 2 5 1 5 +BBX 2 5 1 4 BITMAP 40 80 @@ -26926,7 +26923,7 @@ STARTCHAR parenrightsuperior ENCODING 8318 SWIDTH 480 0 DWIDTH 6 0 -BBX 2 5 1 5 +BBX 2 5 1 4 BITMAP 80 40 @@ -26938,7 +26935,7 @@ STARTCHAR nsuperior ENCODING 8319 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 4 1 5 +BBX 3 4 1 4 BITMAP C0 A0 diff --git a/buildroot/share/fonts/marlin-6x12-3.bdf b/buildroot/share/fonts/marlin-6x12-3.bdf index 0dc909c5f4..30f2a4fcdf 100644 --- a/buildroot/share/fonts/marlin-6x12-3.bdf +++ b/buildroot/share/fonts/marlin-6x12-3.bdf @@ -108,17 +108,14 @@ STARTCHAR uni0006 ENCODING 6 SWIDTH 545 0 DWIDTH 6 0 -BBX 5 9 0 -1 +BBX 5 6 0 1 BITMAP E0 -80 -C0 -B0 -A8 -28 -30 -28 -28 +8C +EA +8C +8A +0A ENDCHAR STARTCHAR uni0007 ENCODING 7 @@ -1644,7 +1641,7 @@ STARTCHAR twosuperior ENCODING 178 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 A0 @@ -1656,7 +1653,7 @@ STARTCHAR threesuperior ENCODING 179 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP C0 20 @@ -1725,7 +1722,7 @@ STARTCHAR onesuperior ENCODING 185 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 C0 @@ -27124,7 +27121,7 @@ STARTCHAR zerosuperior ENCODING 8304 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 A0 @@ -27148,7 +27145,7 @@ STARTCHAR foursuperior ENCODING 8308 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 80 80 @@ -27160,7 +27157,7 @@ STARTCHAR fivesuperior ENCODING 8309 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP E0 80 @@ -27172,7 +27169,7 @@ STARTCHAR sixsuperior ENCODING 8310 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 60 80 @@ -27184,7 +27181,7 @@ STARTCHAR sevensuperior ENCODING 8311 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP E0 20 @@ -27196,7 +27193,7 @@ STARTCHAR eightsuperior ENCODING 8312 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 A0 @@ -27208,7 +27205,7 @@ STARTCHAR ninesuperior ENCODING 8313 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 5 1 5 +BBX 3 5 1 4 BITMAP 40 A0 @@ -27248,7 +27245,7 @@ STARTCHAR parenleftsuperior ENCODING 8317 SWIDTH 480 0 DWIDTH 6 0 -BBX 2 5 1 5 +BBX 2 5 1 4 BITMAP 40 80 @@ -27260,7 +27257,7 @@ STARTCHAR parenrightsuperior ENCODING 8318 SWIDTH 480 0 DWIDTH 6 0 -BBX 2 5 1 5 +BBX 2 5 1 4 BITMAP 80 40 @@ -27272,7 +27269,7 @@ STARTCHAR nsuperior ENCODING 8319 SWIDTH 480 0 DWIDTH 6 0 -BBX 3 4 1 5 +BBX 3 4 1 4 BITMAP C0 A0 diff --git a/buildroot/share/fonts/uxggenpages.sh b/buildroot/share/fonts/uxggenpages.sh index 6cf6c49769..9207835148 100644 --- a/buildroot/share/fonts/uxggenpages.sh +++ b/buildroot/share/fonts/uxggenpages.sh @@ -169,6 +169,6 @@ cat <fontutf8-data.h */ #include $TMPA -#define FONTDATA_ITEM(page, begin, end, data) {page, begin, end, NUM_ARRAY(data), data} +#define FONTDATA_ITEM(page, begin, end, data) { page, begin, end, COUNT(data), data } static const uxg_fontinfo_t g_fontinfo[] PROGMEM = {$TMPB}; EOF diff --git a/buildroot/share/git/mfpub b/buildroot/share/git/mfpub index 6885216a0b..200602506c 100755 --- a/buildroot/share/git/mfpub +++ b/buildroot/share/git/mfpub @@ -97,6 +97,8 @@ fi echo echo "Generating MarlinDocumentation..." +rm -rf _site + # build the site statically and proof it bundle exec jekyll build --profile --trace --no-watch bundle exec htmlproofer ./_site --only-4xx --allow-hash-href --check-favicon --check-html --url-swap ".*marlinfw.org/:/" diff --git a/buildroot/share/tests/DUE_tests b/buildroot/share/tests/DUE_tests index e24cce2edd..78ca3bd2dd 100644 --- a/buildroot/share/tests/DUE_tests +++ b/buildroot/share/tests/DUE_tests @@ -15,14 +15,14 @@ exec_test $1 $2 "RAMPS4DUE_EFB S_CURVE_ACCELERATION EEPROM_SETTINGS" restore_configs opt_set MOTHERBOARD BOARD_RADDS -opt_enable USE_XMAX_PLUG USE_YMAX_PLUG FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR -opt_enable_adv Z_TRIPLE_STEPPER_DRIVERS Z_TRIPLE_ENDSTOPS Z_STEPPER_AUTO_ALIGN -opt_add_adv Z2_MAX_ENDSTOP_INVERTING false -opt_add_adv Z3_MAX_ENDSTOP_INVERTING false +opt_enable USE_XMAX_PLUG USE_YMAX_PLUG FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR \ + Z_TRIPLE_STEPPER_DRIVERS Z_TRIPLE_ENDSTOPS Z_STEPPER_AUTO_ALIGN +opt_add Z2_MAX_ENDSTOP_INVERTING false +opt_add Z3_MAX_ENDSTOP_INVERTING false pins_set RAMPS X_MAX_PIN -1 pins_set RAMPS Y_MAX_PIN -1 -opt_add_adv Z2_MAX_PIN 2 -opt_add_adv Z3_MAX_PIN 3 +opt_add Z2_MAX_PIN 2 +opt_add Z3_MAX_PIN 3 exec_test $1 $2 "Test RADDS with Z_TRIPLE_STEPPER_DRIVERS and Z_STEPPER_AUTO_ALIGN" # diff --git a/buildroot/share/tests/LPC1768_tests b/buildroot/share/tests/LPC1768_tests index aeb37b4ee0..371619b04d 100644 --- a/buildroot/share/tests/LPC1768_tests +++ b/buildroot/share/tests/LPC1768_tests @@ -31,7 +31,7 @@ opt_enable SWITCHING_EXTRUDER ULTIMAKERCONTROLLER exec_test $1 $2 "MKS_SBASE SWITCHING_EXTRUDER" restore_configs -opt_set MOTHERBOARD BOARD_MKS_SBASE +opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EEB opt_set EXTRUDERS 2 opt_set TEMP_SENSOR_0 1 opt_set TEMP_SENSOR_1 5 @@ -40,26 +40,26 @@ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT \ FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY \ FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ - PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT -opt_enable_adv ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ - LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA + PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ + ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \ + LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA opt_set GRID_MAX_POINTS_X 16 exec_test $1 $2 "MKS SBASE Many Features" restore_configs -opt_set MOTHERBOARD BOARD_MKS_SBASE +opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB opt_enable COREYX USE_XMAX_PLUG DAC_MOTOR_CURRENT_DEFAULT \ REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING \ AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS \ - FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR FAN_SOFT_PWM -opt_enable_adv SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER FAN_KICKSTART_TIME \ - ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED ADVANCED_OK \ - VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ - EXTRA_FAN_SPEED FWERETRACT Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS \ - MENU_ADDAUTOSTART SDCARD_SORT_ALPHA -opt_set_adv FAN_MIN_PWM 50 -opt_set_adv FAN_KICKSTART_TIME 100 -opt_set_adv XY_FREQUENCY_LIMIT 15 + FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR FAN_SOFT_PWM \ + SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER FAN_KICKSTART_TIME \ + ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED ADVANCED_OK \ + VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ + EXTRA_FAN_SPEED FWRETRACT Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS \ + MENU_ADDAUTOSTART SDCARD_SORT_ALPHA +opt_set FAN_MIN_PWM 50 +opt_set FAN_KICKSTART_TIME 100 +opt_set XY_FREQUENCY_LIMIT 15 exec_test $1 $2 "MKS SBASE Many less common options" restore_configs @@ -70,8 +70,8 @@ opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN opt_set X_DRIVER_TYPE TMC2130 opt_set Y_DRIVER_TYPE TMC2130 opt_set Z_DRIVER_TYPE TMC2130 -opt_enable_adv TMC_USE_SW_SPI MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD TMC_DEBUG \ - SENSORLESS_PROBING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY +opt_enable TMC_USE_SW_SPI MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD TMC_DEBUG \ + SENSORLESS_PROBING X_STALL_SENSITIVITY Y_STALL_SENSITIVITY Z_STALL_SENSITIVITY exec_test $1 $2 "Delta Config (generic) + BOARD_COHESION3D_REMIX + UBL + EEPROM_SETTINGS + SENSORLESS_PROBING" # clean up diff --git a/buildroot/share/tests/STM32F1_tests b/buildroot/share/tests/STM32F1_tests index af1cf0fb9c..1a503ef114 100644 --- a/buildroot/share/tests/STM32F1_tests +++ b/buildroot/share/tests/STM32F1_tests @@ -13,8 +13,5 @@ opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSU PAREN_COMMENTS GCODE_MOTION_MODES SINGLENOZZLE TOOLCHANGE_FILAMENT_SWAP TOOLCHANGE_PARK exec_test $1 $2 "STM32F1R EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT PAREN_COMMENTS GCODE_MOTION_MODES" -opt_enable SPINDLE_LASER_ENABLE NO_LCD_MENUS -exec_test $1 $2 "STM32F1R SPINDLE_LASER_ENABLE" - # cleanup restore_configs diff --git a/buildroot/share/tests/megaatmega2560_tests b/buildroot/share/tests/megaatmega2560_tests index b4a91611cb..501eb8d96c 100644 --- a/buildroot/share/tests/megaatmega2560_tests +++ b/buildroot/share/tests/megaatmega2560_tests @@ -30,16 +30,16 @@ opt_set TEMP_SENSOR_BED 1 opt_set POWER_SUPPLY 1 opt_set GRID_MAX_POINTS_X 16 opt_enable PIDTEMPBED FIX_MOUNTED_PROBE Z_SAFE_HOMING \ - SDSUPPORT EEPROM_SETTINGS FAST_FILE_TRANSFER \ - REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST \ - BLINKM PCA9632 RGB_LED NEOPIXEL_LED AUTO_POWER_CONTROL PINS_DEBUGGING \ + SDSUPPORT EEPROM_SETTINGS REPRAP_DISCOUNT_SMART_CONTROLLER \ + BLINKM PCA9632 RGB_LED NEOPIXEL_LED AUTO_POWER_CONTROL \ NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR FILAMENT_RUNOUT_DISTANCE_MM \ AUTO_BED_LEVELING_LINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ - SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE -opt_enable_adv FWRETRACT ARC_P_CIRCLES ADVANCED_PAUSE_FEATURE CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \ - POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE \ - MAX7219_DEBUG LED_CONTROL_MENU CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CODEPENDENT_XY_HOMING -opt_set_adv FANMUX0_PIN 53 + SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE \ + FWRETRACT ARC_P_CIRCLES ADVANCED_PAUSE_FEATURE CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \ + POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE FAST_FILE_TRANSFER \ + LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST PINS_DEBUGGING \ + MAX7219_DEBUG LED_CONTROL_MENU CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CODEPENDENT_XY_HOMING +opt_set FANMUX0_PIN 53 exec_test $1 $2 "RAMPS with 2 extruders, RRDFGSC, Linear ABL, LEDs, and many options" # @@ -55,9 +55,9 @@ opt_set TEMP_SENSOR_3 20 opt_set TEMP_SENSOR_4 999 opt_set TEMP_SENSOR_BED 1 opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_EDITING ENABLE_LEVELING_FADE_HEIGHT SKEW_CORRECTION \ - EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT -opt_enable_adv USB_FLASH_DRIVE_SUPPORT SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES LIGHTWEIGHT_UI \ - CUSTOM_USER_MENUS I2C_POSITION_ENCODERS BABYSTEPPING BABYSTEP_XY LIN_ADVANCE NANODLP_Z_SYNC QUICK_HOME JUNCTION_DEVIATION + EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT \ + USB_FLASH_DRIVE_SUPPORT SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES LIGHTWEIGHT_UI \ + CUSTOM_USER_MENUS I2C_POSITION_ENCODERS BABYSTEPPING BABYSTEP_XY LIN_ADVANCE NANODLP_Z_SYNC QUICK_HOME JUNCTION_DEVIATION exec_test $1 $2 "Azteeg X3 with 5 extruders, RRDFGSC, probeless UBL, Linear Advance, and more" # @@ -66,7 +66,7 @@ exec_test $1 $2 "Azteeg X3 with 5 extruders, RRDFGSC, probeless UBL, Linear Adva opt_enable Z_PROBE_SLED SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE opt_set LCD_LANGUAGE jp-kana opt_disable SEGMENT_LEVELED_MOVES -opt_enable_adv BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_HOTEND_Z_OFFSET +opt_enable BABYSTEP_ZPROBE_OFFSET DOUBLECLICK_FOR_Z_BABYSTEPPING BABYSTEP_HOTEND_Z_OFFSET exec_test $1 $2 "... Sled Z Probe, Skew, UBL Cartesian moves, Japanese, and Z probe BABYSTEPPING" # @@ -74,11 +74,11 @@ exec_test $1 $2 "... Sled Z Probe, Skew, UBL Cartesian moves, Japanese, and Z pr # ...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES # restore_configs -opt_enable Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE \ +opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE \ AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT opt_set NUM_SERVOS 1 -opt_enable_adv NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET -exec_test $1 $2 "RAMPS with Servo Probe, 3-Point ABL, DEBUG_LEVELING_FEATURE, EEPROM, G38, and more" +opt_enable NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET +exec_test $1 $2 "RAMPS with ZONESTAR_LCD, Servo Probe, 3-Point ABL, DEBUG_LEVELING_FEATURE, EEPROM, G38, and more" # # Test MESH_BED_LEVELING feature, with LCD @@ -97,12 +97,12 @@ opt_enable PROBE_MANUALLY AUTO_BED_LEVELING_BILINEAR G26_MESH_EDITING LCD_BED_LE M100_FREE_MEMORY_WATCHER M100_FREE_MEMORY_DUMPER M100_FREE_MEMORY_CORRUPTOR \ INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \ ULTIMAKERCONTROLLER SDSUPPORT \ - PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE PCA9632 -opt_enable_adv BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS \ - ADVANCED_PAUSE_FEATURE ADVANCED_PAUSE_CONTINUOUS_PURGE FILAMENT_LOAD_UNLOAD_GCODES PARK_HEAD_ON_PAUSE \ - LCD_INFO_MENU M114_DETAIL -opt_set_adv PWM_MOTOR_CURRENT "{ 1300, 1300, 1250 }" -opt_set_adv I2C_SLAVE_ADDRESS 63 + PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE PCA9632 \ + BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS \ + ADVANCED_PAUSE_FEATURE ADVANCED_PAUSE_CONTINUOUS_PURGE FILAMENT_LOAD_UNLOAD_GCODES PARK_HEAD_ON_PAUSE \ + LCD_INFO_MENU M114_DETAIL +opt_set PWM_MOTOR_CURRENT "{ 1300, 1300, 1250 }" +opt_set I2C_SLAVE_ADDRESS 63 exec_test $1 $2 "MINIRAMBO for PWM_MOTOR_CURRENT etc" # @@ -122,8 +122,7 @@ restore_configs opt_set MOTHERBOARD BOARD_RUMBA opt_set EXTRUDERS 2 opt_set TEMP_SENSOR_1 1 -opt_enable USE_XMAX_PLUG -opt_enable_adv DUAL_X_CARRIAGE +opt_enable USE_XMAX_PLUG DUAL_X_CARRIAGE exec_test $1 $2 "DUAL_X_CARRIAGE" # @@ -154,15 +153,15 @@ opt_enable COREYX USE_XMAX_PLUG \ REPRAP_DISCOUNT_SMART_CONTROLLER BABYSTEPPING DAC_MOTOR_CURRENT_DEFAULT \ FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR \ ENDSTOP_INTERRUPTS_FEATURE ENDSTOP_NOISE_THRESHOLD FAN_SOFT_PWM SDSUPPORT \ - SWITCHING_TOOLHEAD NUM_SERVOS DEBUG_LEVELING_FEATURE -opt_set_adv FAN_MIN_PWM 50 -opt_set_adv FAN_KICKSTART_TIME 100 -opt_set_adv XY_FREQUENCY_LIMIT 15 -opt_enable_adv SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER \ - ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED ADVANCED_OK \ - VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ - EXTRA_FAN_SPEED FWERETRACT Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS \ - MENU_ADDAUTOSTART SDCARD_SORT_ALPHA + SWITCHING_TOOLHEAD NUM_SERVOS DEBUG_LEVELING_FEATURE \ + SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER \ + ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED ADVANCED_OK \ + VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS ACTION_ON_KILL \ + EXTRA_FAN_SPEED FWRETRACT Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS \ + MENU_ADDAUTOSTART SDCARD_SORT_ALPHA +opt_set FAN_MIN_PWM 50 +opt_set FAN_KICKSTART_TIME 100 +opt_set XY_FREQUENCY_LIMIT 15 exec_test $1 $2 "Many less common options" ######## Other Standard LCD/Panels ############## @@ -196,12 +195,11 @@ exec_test $1 $2 "Many less common options" # G3D_PANEL with SDCARD_SORT_ALPHA and STATUS_MESSAGE_SCROLLING # #restore_configs -#opt_enable G3D_PANEL SDSUPPORT -#opt_enable_adv SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES -#opt_set_adv SDSORT_GCODE true -#opt_set_adv SDSORT_USES_RAM true -#opt_set_adv SDSORT_USES_STACK true -#opt_set_adv SDSORT_CACHE_NAMES true +#opt_enable G3D_PANEL SDSUPPORT SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES +#opt_set SDSORT_GCODE true +#opt_set SDSORT_USES_RAM true +#opt_set SDSORT_USES_STACK true +#opt_set SDSORT_CACHE_NAMES true #exec_test $1 $2 "Stuff" # # REPRAPWORLD_KEYPAD @@ -297,12 +295,12 @@ exec_test $1 $2 "Delta Config (FLSUN AC because it's complex)" # use_example_configs SCARA opt_enable USE_ZMIN_PLUG FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR PAUSE_BEFORE_DEPLOY_STOW \ - EEPROM_SETTINGS EEPROM_CHITCHAT ULTIMAKERCONTROLLER + EEPROM_SETTINGS EEPROM_CHITCHAT ULTIMAKERCONTROLLER \ + MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD SENSORLESS_HOMING opt_set X_DRIVER_TYPE TMC2130 opt_set Y_DRIVER_TYPE TMC2130 opt_set Z_DRIVER_TYPE TMC2130 opt_set E0_DRIVER_TYPE TMC2130 -opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD SENSORLESS_HOMING exec_test $1 $2 "SCARA with TMC2130" # # TMC2208 Config @@ -313,7 +311,7 @@ opt_set Y_DRIVER_TYPE TMC2208 opt_set Z_DRIVER_TYPE TMC2208 opt_set E0_DRIVER_TYPE TMC2208 opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN -opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD TMC_DEBUG +opt_enable REPRAPWORLD_KEYPAD MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD TMC_DEBUG exec_test $1 $2 "TMC2208 Config" # # tvrrug Config need to check board type for sanguino atmega644p diff --git a/buildroot/share/tests/teensy35_tests b/buildroot/share/tests/teensy35_tests index 185c960c1b..053ad97a43 100644 --- a/buildroot/share/tests/teensy35_tests +++ b/buildroot/share/tests/teensy35_tests @@ -23,9 +23,9 @@ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT \ FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY \ FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \ BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \ - PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT M100_FREE_MEMORY_WATCHER -opt_enable_adv ADVANCED_PAUSE_FEATURE LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA PARK_HEAD_ON_PAUSE -opt_set_adv I2C_SLAVE_ADDRESS 63 + PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT M100_FREE_MEMORY_WATCHER \ + ADVANCED_PAUSE_FEATURE LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA PARK_HEAD_ON_PAUSE +opt_set I2C_SLAVE_ADDRESS 63 opt_set GRID_MAX_POINTS_X 16 exec_test $1 $2 "Teensy3.5 with many features" @@ -33,9 +33,7 @@ exec_test $1 $2 "Teensy3.5 with many features" # Test a Sled Z Probe with Linear leveling # restore_configs -opt_enable EEPROM_SETTINGS \ - Z_PROBE_SLED AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE -opt_enable_adv GCODE_MACROS +opt_enable EEPROM_SETTINGS Z_PROBE_SLED AUTO_BED_LEVELING_LINEAR DEBUG_LEVELING_FEATURE GCODE_MACROS exec_test $1 $2 "Sled Z Probe with Linear leveling" # @@ -49,8 +47,8 @@ exec_test $1 $2 "Sled Z Probe with Linear leveling" # # ...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES # -# opt_enable AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS -# opt_enable_adv EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES +# opt_enable AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS \ +# EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES # exec_test $1 $2 "...with AUTO_BED_LEVELING_3POINT, DEBUG_LEVELING_FEATURE, EEPROM_SETTINGS, EEPROM_CHITCHAT, EXTENDED_CAPABILITIES_REPORT, and AUTO_REPORT_TEMPERATURES" # @@ -94,9 +92,9 @@ exec_test $1 $2 "COREXZ" # Enable Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS # restore_configs -opt_enable_adv Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS +opt_enable Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS pins_set RAMPS X_MAX_PIN -1 -opt_add_adv Z2_MAX_PIN 2 +opt_add Z2_MAX_PIN 2 opt_enable USE_XMAX_PLUG exec_test $1 $2 "Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS" diff --git a/platformio.ini b/platformio.ini index 7a15f62789..27216c0609 100644 --- a/platformio.ini +++ b/platformio.ini @@ -86,7 +86,6 @@ framework = arduino board = at90usb1286 build_flags = ${common.build_flags} lib_deps = ${common.lib_deps} -lib_ignore = Teensy_ADC lib_ldf_mode = deep+ src_filter = ${common.default_src_filter} + extra_scripts = pre:buildroot/share/atom/create_custom_upload_command_CDC.py @@ -104,7 +103,6 @@ framework = arduino board = at90usb1286 build_flags = ${common.build_flags} lib_deps = ${common.lib_deps} -lib_ignore = Teensy_ADC lib_ldf_mode = deep+ src_filter = ${common.default_src_filter} + extra_scripts = pre:buildroot/share/atom/create_custom_upload_command_DFU.py @@ -346,3 +344,16 @@ lib_ignore = TMC26XStepper c1921b4 src_filter = ${common.default_src_filter} + + +# +# FYSETC F6 V1.3 +# +[env:fysetc_f6_13] +platform = atmelavr +framework = arduino +board = fysetc_f6_13 +build_flags = ${common.build_flags} +board_build.f_cpu = 16000000L +lib_deps = ${common.lib_deps} +src_filter = ${common.default_src_filter} + +monitor_speed = 250000