From 4d09457891fe435017705d148fcdd2f7208a225e Mon Sep 17 00:00:00 2001 From: InsanityAutomation Date: Mon, 29 Oct 2018 14:53:25 -0400 Subject: [PATCH] Bump to head --- Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp | 2 +- Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp | 5 +- Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp | 245 +- .../src/HAL/HAL_DUE/MarlinSerialUSB_Due.cpp | 4 +- Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.cpp | 2 +- Marlin/src/HAL/HAL_DUE/Servo_Due.cpp | 6 +- Marlin/src/HAL/HAL_DUE/usb/sd_mmc_spi_mem.cpp | 14 +- .../HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp | 318 + Marlin/src/HAL/HAL_LPC1768/HAL.cpp | 233 +- Marlin/src/HAL/HAL_LPC1768/HAL.h | 99 +- Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp | 75 +- Marlin/src/HAL/HAL_LPC1768/HAL_temp.h | 1 - Marlin/src/HAL/HAL_LPC1768/HAL_timers.h | 3 +- Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.cpp | 576 -- Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.h | 79 - Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.cpp | 163 - Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.h | 62 - Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp | 56 + Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h | 71 + .../{servo_private.h => MarlinServo.h} | 42 +- Marlin/src/HAL/HAL_LPC1768/SanityCheck.h | 8 + Marlin/src/HAL/HAL_LPC1768/SoftwareSPI.cpp | 90 - Marlin/src/HAL/HAL_LPC1768/SoftwareSPI.h | 50 - Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp | 162 - Marlin/src/HAL/HAL_LPC1768/arduino.cpp | 179 - .../src/HAL/HAL_LPC1768/debug_extra_script.py | 21 - Marlin/src/HAL/HAL_LPC1768/fastio.h | 28 +- Marlin/src/HAL/HAL_LPC1768/include/Arduino.h | 125 - .../HAL_LPC1768/include/HardwareSerial.cpp | 335 - .../HAL/HAL_LPC1768/include/HardwareSerial.h | 91 - .../HAL_LPC1768/include/SoftwareSerial.cpp | 329 - .../HAL/HAL_LPC1768/include/SoftwareSerial.h | 120 - Marlin/src/HAL/HAL_LPC1768/include/Wire.cpp | 219 - Marlin/src/HAL/HAL_LPC1768/include/Wire.h | 67 - .../HAL/HAL_LPC1768/include/pinmapping.cpp | 74 - .../src/HAL/HAL_LPC1768/include/pinmapping.h | 294 - Marlin/src/HAL/HAL_LPC1768/include/serial.h | 161 - .../HAL/HAL_LPC1768/lpc1768_flag_script.py | 60 - Marlin/src/HAL/HAL_LPC1768/main.cpp | 148 +- .../HAL/HAL_LPC1768/persistent_store_api.h | 2 +- .../HAL_LPC1768/persistent_store_flash.cpp | 19 +- Marlin/src/HAL/HAL_LPC1768/spi_pins.h | 3 +- .../HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c | 8 +- .../{ => u8g}/u8g_com_HAL_LPC1768_hw_spi.cpp | 2 +- .../u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp | 2 +- ...LPC1768_ssd_sw_i2c.cpp under construction | 0 .../u8g_com_HAL_LPC1768_st7920_hw_spi.cpp | 4 +- .../u8g_com_HAL_LPC1768_st7920_sw_spi.cpp | 5 +- .../{ => u8g}/u8g_com_HAL_LPC1768_sw_spi.cpp | 3 +- Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp | 13 + Marlin/src/HAL/HAL_LPC1768/watchdog.cpp | 30 +- .../win_usb_driver/lpc176x_usb_driver.inf | 36 + Marlin/src/HAL/HAL_STM32/HAL.cpp | 2 + Marlin/src/HAL/HAL_STM32/HAL.h | 3 +- Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.cpp | 4 +- Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.h | 65 +- Marlin/src/HAL/HAL_STM32/endstop_interrupts.h | 7 +- .../HAL/HAL_STM32/persistent_store_impl.cpp | 34 +- Marlin/src/HAL/HAL_STM32/spi_pins.h | 35 +- Marlin/src/HAL/HAL_STM32/watchdog_STM32.cpp | 7 +- Marlin/src/HAL/HAL_STM32/watchdog_STM32.h | 2 - .../HAL_STM32F4/EEPROM_Emul/eeprom_emul.cpp | 2 +- Marlin/src/HAL/HAL_STM32F4/EmulatedEeprom.cpp | 2 +- Marlin/src/HAL/HAL_STM32F4/HAL.cpp | 2 +- .../src/HAL/HAL_STM32F4/HAL_Servo_STM32F4.cpp | 2 +- .../src/HAL/HAL_STM32F4/HAL_spi_STM32F4.cpp | 2 +- .../HAL/HAL_STM32F4/HAL_timers_STM32F4.cpp | 4 +- .../HAL_STM32F4/persistent_store_eeprom.cpp | 2 +- Marlin/src/HAL/HAL_STM32F4/spi_pins.h | 50 +- .../src/HAL/HAL_STM32F4/watchdog_STM32F4.cpp | 8 +- .../HAL/HAL_STM32F7/HAL_timers_STM32F7.cpp | 4 +- Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp | 6 +- Marlin/src/HAL/HAL_STM32F7/spi_pins.h | 41 +- Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp | 28 +- Marlin/src/HAL/shared/Delay.h | 4 +- Marlin/src/HAL/shared/servo.h | 2 +- Marlin/src/Marlin.cpp | 58 +- Marlin/src/Marlin.h | 9 +- Marlin/src/config/default/Configuration.h | 39 +- Marlin/src/config/default/Configuration_adv.h | 51 +- .../AlephObjects/TAZ4/Configuration.h | 39 +- .../AlephObjects/TAZ4/Configuration_adv.h | 51 +- .../AliExpress/CL-260/Configuration.h | 39 +- .../config/examples/Anet/A2/Configuration.h | 39 +- .../examples/Anet/A2/Configuration_adv.h | 51 +- .../examples/Anet/A2plus/Configuration.h | 39 +- .../examples/Anet/A2plus/Configuration_adv.h | 51 +- .../config/examples/Anet/A6/Configuration.h | 39 +- .../examples/Anet/A6/Configuration_adv.h | 51 +- .../config/examples/Anet/A8/Configuration.h | 39 +- .../examples/Anet/A8/Configuration_adv.h | 51 +- .../examples/AnimationExample/_Bootscreen.h | 339 + .../src/config/examples/ArmEd/Configuration.h | 2036 ++++++ .../config/examples/ArmEd/Configuration_adv.h | 1811 ++++++ .../examples/Azteeg/X5GT/Configuration.h | 39 +- .../BIBO/TouchX/cyclops/Configuration.h | 39 +- .../BIBO/TouchX/cyclops/Configuration_adv.h | 51 +- .../BIBO/TouchX/default/Configuration.h | 39 +- .../BIBO/TouchX/default/Configuration_adv.h | 51 +- .../examples/BQ/Hephestos/Configuration.h | 39 +- .../examples/BQ/Hephestos/Configuration_adv.h | 51 +- .../examples/BQ/Hephestos_2/Configuration.h | 39 +- .../BQ/Hephestos_2/Configuration_adv.h | 50 +- .../config/examples/BQ/WITBOX/Configuration.h | 39 +- .../examples/BQ/WITBOX/Configuration_adv.h | 51 +- .../config/examples/Cartesio/Configuration.h | 39 +- .../examples/Cartesio/Configuration_adv.h | 51 +- .../examples/Creality/CR-10/Configuration.h | 39 +- .../Creality/CR-10/Configuration_adv.h | 51 +- .../examples/Creality/CR-10S/Configuration.h | 45 +- .../Creality/CR-10S/Configuration_adv.h | 51 +- .../Creality/CR-10mini/Configuration.h | 39 +- .../Creality/CR-10mini/Configuration_adv.h | 51 +- .../examples/Creality/CR-8/Configuration.h | 39 +- .../Creality/CR-8/Configuration_adv.h | 51 +- .../examples/Creality/Ender-2/Configuration.h | 39 +- .../Creality/Ender-2/Configuration_adv.h | 51 +- .../examples/Creality/Ender-3/Configuration.h | 41 +- .../Creality/Ender-3/Configuration_adv.h | 51 +- .../examples/Creality/Ender-4/Configuration.h | 77 +- .../Creality/Ender-4/Configuration_adv.h | 75 +- .../examples/Einstart-S/Configuration.h | 39 +- .../examples/Einstart-S/Configuration_adv.h | 51 +- .../src/config/examples/Einstart-S/readme.md | 2 +- .../src/config/examples/Felix/Configuration.h | 39 +- .../config/examples/Felix/Configuration_adv.h | 51 +- .../examples/Felix/DUAL/Configuration.h | 39 +- .../FolgerTech/i3-2020/Configuration.h | 39 +- .../FolgerTech/i3-2020/Configuration_adv.h | 51 +- .../examples/Formbot/Raptor/Configuration.h | 39 +- .../Formbot/Raptor/Configuration_adv.h | 47 +- .../examples/Formbot/T_Rex_2+/Configuration.h | 39 +- .../Formbot/T_Rex_2+/Configuration_adv.h | 47 +- .../examples/Formbot/T_Rex_2+/_Bootscreen.h | 2 - .../examples/Formbot/T_Rex_3/Configuration.h | 39 +- .../Formbot/T_Rex_3/Configuration_adv.h | 47 +- .../examples/Formbot/T_Rex_3/_Bootscreen.h | 2 - .../examples/Geeetech/GT2560/Configuration.h | 39 +- .../Geeetech/I3_Pro_X-GT2560/Configuration.h | 39 +- .../Geeetech/MeCreator2/Configuration.h | 39 +- .../Geeetech/MeCreator2/Configuration_adv.h | 43 +- .../Prusa i3 Pro B/bltouch/Configuration.h | 39 +- .../Prusa i3 Pro B/noprobe/Configuration.h | 39 +- .../Geeetech/Prusa i3 Pro C/Configuration.h | 39 +- .../Prusa i3 Pro C/Configuration_adv.h | 51 +- .../Geeetech/Prusa i3 Pro W/Configuration.h | 39 +- .../Prusa i3 Pro W/Configuration_adv.h | 51 +- .../examples/Infitary/i3-M508/Configuration.h | 39 +- .../Infitary/i3-M508/Configuration_adv.h | 51 +- .../examples/JGAurora/A5/Configuration.h | 39 +- .../examples/JGAurora/A5/Configuration_adv.h | 51 +- .../examples/MakerParts/Configuration.h | 39 +- .../examples/MakerParts/Configuration_adv.h | 51 +- .../examples/Malyan/M150/Configuration.h | 39 +- .../examples/Malyan/M150/Configuration_adv.h | 51 +- .../examples/Malyan/M200/Configuration.h | 39 +- .../examples/Malyan/M200/Configuration_adv.h | 51 +- .../Micromake/C1/basic/Configuration.h | 39 +- .../Micromake/C1/enhanced/Configuration.h | 39 +- .../Micromake/C1/enhanced/Configuration_adv.h | 51 +- .../config/examples/Mks/Sbase/Configuration.h | 39 +- .../examples/Mks/Sbase/Configuration_adv.h | 51 +- .../examples/RepRapPro/Huxley/Configuration.h | 39 +- .../RepRapWorld/Megatronics/Configuration.h | 39 +- .../config/examples/RigidBot/Configuration.h | 39 +- .../examples/RigidBot/Configuration_adv.h | 51 +- .../src/config/examples/SCARA/Configuration.h | 39 +- .../config/examples/SCARA/Configuration_adv.h | 51 +- .../config/examples/STM32F10/Configuration.h | 39 +- .../config/examples/STM32F4/Configuration.h | 39 +- .../examples/Sanguinololu/Configuration.h | 39 +- .../examples/Sanguinololu/Configuration_adv.h | 51 +- .../config/examples/TheBorg/Configuration.h | 39 +- .../examples/TheBorg/Configuration_adv.h | 51 +- .../config/examples/TinyBoy2/Configuration.h | 39 +- .../examples/TinyBoy2/Configuration_adv.h | 51 +- .../config/examples/Tronxy/X1/Configuration.h | 39 +- .../examples/Tronxy/X3A/Configuration.h | 39 +- .../examples/Tronxy/X3A/Configuration_adv.h | 51 +- .../examples/Tronxy/X5S/Configuration.h | 39 +- .../examples/Tronxy/XY100/Configuration.h | 39 +- .../UltiMachine/Archim2/Configuration.h | 39 +- .../UltiMachine/Archim2/Configuration_adv.h | 51 +- .../examples/Velleman/K8200/Configuration.h | 39 +- .../Velleman/K8200/Configuration_adv.h | 51 +- .../examples/Velleman/K8400/Configuration.h | 39 +- .../Velleman/K8400/Configuration_adv.h | 51 +- .../Velleman/K8400/Dual-head/Configuration.h | 39 +- .../Wanhao/Duplicator 6/Configuration.h | 39 +- .../Wanhao/Duplicator 6/Configuration_adv.h | 51 +- .../examples/adafruit/ST7565/Configuration.h | 39 +- .../delta/Anycubic/Kossel/Configuration.h | 52 +- .../delta/Anycubic/Kossel/Configuration_adv.h | 51 +- .../FLSUN/auto_calibrate/Configuration.h | 41 +- .../FLSUN/auto_calibrate/Configuration_adv.h | 51 +- .../delta/FLSUN/kossel/Configuration.h | 41 +- .../delta/FLSUN/kossel/Configuration_adv.h | 51 +- .../delta/FLSUN/kossel_mini/Configuration.h | 41 +- .../FLSUN/kossel_mini/Configuration_adv.h | 51 +- .../delta/Hatchbox_Alpha/Configuration.h | 41 +- .../examples/delta/generic/Configuration.h | 41 +- .../delta/generic/Configuration_adv.h | 51 +- .../delta/kossel_mini/Configuration.h | 41 +- .../delta/kossel_mini/Configuration_adv.h | 51 +- .../examples/delta/kossel_pro/Configuration.h | 39 +- .../examples/delta/kossel_xl/Configuration.h | 41 +- .../delta/kossel_xl/Configuration_adv.h | 51 +- .../examples/gCreate/gMax1.5+/Configuration.h | 39 +- .../gCreate/gMax1.5+/Configuration_adv.h | 51 +- .../config/examples/makibox/Configuration.h | 39 +- .../examples/makibox/Configuration_adv.h | 51 +- .../examples/stm32f103ret6/Configuration.h | 39 +- .../examples/tvrrug/Round2/Configuration.h | 39 +- .../tvrrug/Round2/Configuration_adv.h | 51 +- .../src/config/examples/wt150/Configuration.h | 39 +- .../config/examples/wt150/Configuration_adv.h | 51 +- Marlin/src/core/boards.h | 2 + Marlin/src/core/language.h | 5 +- Marlin/src/core/macros.h | 5 +- Marlin/src/core/{types.h => millis_t.h} | 21 +- Marlin/src/core/utility.cpp | 7 +- Marlin/src/core/utility.h | 2 +- Marlin/src/feature/I2CPositionEncoder.cpp | 2 +- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 2 +- Marlin/src/feature/fwretract.cpp | 15 +- Marlin/src/feature/fwretract.h | 19 + Marlin/src/feature/leds/leds.h | 10 + Marlin/src/feature/mixing.cpp | 137 +- Marlin/src/feature/mixing.h | 89 +- Marlin/src/feature/pause.cpp | 8 +- Marlin/src/feature/pause.h | 10 +- Marlin/src/feature/power.h | 8 +- Marlin/src/feature/power_loss_recovery.h | 8 +- Marlin/src/feature/runout.cpp | 43 +- Marlin/src/feature/runout.h | 318 +- Marlin/src/feature/tmc_util.cpp | 2 +- Marlin/src/gcode/bedlevel/abl/G29.cpp | 21 +- Marlin/src/gcode/calibrate/G28.cpp | 1 - Marlin/src/gcode/calibrate/G33.cpp | 2 +- Marlin/src/gcode/config/M217.cpp | 51 +- Marlin/src/gcode/config/M92.cpp | 4 +- Marlin/src/gcode/control/M108_M112_M410.cpp | 2 +- Marlin/src/gcode/control/M3-M5.cpp | 22 - Marlin/src/gcode/control/M605.cpp | 85 +- Marlin/src/gcode/control/M80_M81.cpp | 4 +- Marlin/src/gcode/eeprom/M500-M504.cpp | 3 + .../src/gcode/feature/fwretract/M207-M209.cpp | 4 +- Marlin/src/gcode/feature/mixing/M163-M165.cpp | 55 +- Marlin/src/gcode/gcode.cpp | 23 +- Marlin/src/gcode/gcode.h | 19 +- Marlin/src/gcode/lcd/M145.cpp | 2 +- Marlin/src/gcode/lcd/M73.cpp | 2 +- Marlin/src/gcode/motion/G0_G1.cpp | 42 +- Marlin/src/gcode/parser.h | 29 +- Marlin/src/gcode/queue.cpp | 4 +- ...M928.cpp => M20-M30_M32-M34_M524_M928.cpp} | 7 + Marlin/src/gcode/temperature/M106_M107.cpp | 8 - Marlin/src/inc/Conditionals_LCD.h | 40 +- Marlin/src/inc/Conditionals_post.h | 85 +- Marlin/src/inc/MarlinConfigPre.h | 2 +- Marlin/src/inc/SanityCheck.h | 81 +- Marlin/src/inc/Version.h | 16 +- .../lcd/{ => HD44780}/lcdprint_hd44780.cpp | 38 +- .../{ => HD44780}/ultralcd_common_HD44780.h | 26 +- .../ultralcd_impl_HD44780.cpp} | 534 +- Marlin/src/lcd/dogm/HAL_LCD_class_defines.h | 7 +- Marlin/src/lcd/dogm/dogm_Bootscreen.h | 137 + .../{dogm_bitmaps.h => dogm_Statusscreen.h} | 213 +- .../fontdata_6x9_marlin.h} | 0 .../fontdata_ISO10646_1.h} | 0 .../dogm/{ => fontdata}/language_data_an.h | 0 .../dogm/{ => fontdata}/language_data_bg.h | 0 .../dogm/{ => fontdata}/language_data_ca.h | 0 .../dogm/{ => fontdata}/language_data_cz.h | 0 .../dogm/{ => fontdata}/language_data_da.h | 0 .../dogm/{ => fontdata}/language_data_de.h | 0 .../dogm/{ => fontdata}/language_data_el-gr.h | 0 .../dogm/{ => fontdata}/language_data_el.h | 0 .../dogm/{ => fontdata}/language_data_en.h | 0 .../dogm/{ => fontdata}/language_data_es.h | 0 .../dogm/{ => fontdata}/language_data_eu.h | 0 .../dogm/{ => fontdata}/language_data_fi.h | 0 .../dogm/{ => fontdata}/language_data_fr.h | 0 .../dogm/{ => fontdata}/language_data_gl.h | 0 .../dogm/{ => fontdata}/language_data_hr.h | 0 .../dogm/{ => fontdata}/language_data_it.h | 0 .../{ => fontdata}/language_data_jp-kana.h | 0 .../dogm/{ => fontdata}/language_data_ko_KR.h | 0 .../dogm/{ => fontdata}/language_data_nl.h | 0 .../dogm/{ => fontdata}/language_data_pl.h | 0 .../dogm/{ => fontdata}/language_data_pt-br.h | 0 .../dogm/{ => fontdata}/language_data_pt.h | 0 .../dogm/{ => fontdata}/language_data_ru.h | 0 .../dogm/{ => fontdata}/language_data_sk.h | 0 .../dogm/{ => fontdata}/language_data_test.h | 0 .../dogm/{ => fontdata}/language_data_tr.h | 0 .../dogm/{ => fontdata}/language_data_uk.h | 0 .../dogm/{ => fontdata}/language_data_zh_CN.h | 0 .../dogm/{ => fontdata}/language_data_zh_TW.h | 0 Marlin/src/lcd/{ => dogm}/lcdprint_u8g.cpp | 10 +- ...s_screen_DOGM.h => status_screen_DOGM.cpp} | 107 +- ...ST7920.h => status_screen_lite_ST7920.cpp} | 29 +- .../dogm/status_screen_lite_ST7920_class.h | 6 +- Marlin/src/lcd/{ => dogm}/u8g_fontutf8.cpp | 4 +- Marlin/src/lcd/{ => dogm}/u8g_fontutf8.h | 15 +- .../ultralcd_impl_DOGM.cpp} | 426 +- .../dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp | 4 +- .../lib/{dummy.cpp => example.cpp} | 31 +- Marlin/src/lcd/extensible_ui/ui_api.cpp | 266 +- Marlin/src/lcd/extensible_ui/ui_api.h | 53 +- Marlin/src/lcd/fontutils.h | 5 +- Marlin/src/lcd/language/language_an.h | 8 +- Marlin/src/lcd/language/language_bg.h | 24 +- Marlin/src/lcd/language/language_ca.h | 8 +- Marlin/src/lcd/language/language_cz.h | 24 +- Marlin/src/lcd/language/language_da.h | 24 +- Marlin/src/lcd/language/language_de.h | 331 +- Marlin/src/lcd/language/language_el-gr.h | 8 +- Marlin/src/lcd/language/language_el.h | 8 +- Marlin/src/lcd/language/language_en.h | 60 +- Marlin/src/lcd/language/language_es.h | 8 +- Marlin/src/lcd/language/language_eu.h | 24 +- Marlin/src/lcd/language/language_fi.h | 24 +- Marlin/src/lcd/language/language_fr.h | 40 +- Marlin/src/lcd/language/language_gl.h | 24 +- Marlin/src/lcd/language/language_hr.h | 8 +- Marlin/src/lcd/language/language_it.h | 34 +- Marlin/src/lcd/language/language_jp-kana.h | 16 +- Marlin/src/lcd/language/language_ko_KR.h | 24 +- Marlin/src/lcd/language/language_nl.h | 16 +- Marlin/src/lcd/language/language_pl.h | 16 +- Marlin/src/lcd/language/language_pt-br.h | 38 +- Marlin/src/lcd/language/language_pt.h | 24 +- Marlin/src/lcd/language/language_ru.h | 24 +- Marlin/src/lcd/language/language_sk.h | 42 +- Marlin/src/lcd/language/language_tr.h | 8 +- Marlin/src/lcd/language/language_uk.h | 6 +- Marlin/src/lcd/language/language_zh_CN.h | 24 +- Marlin/src/lcd/language/language_zh_TW.h | 24 +- Marlin/src/lcd/lcdprint.h | 13 +- Marlin/src/lcd/malyanlcd.cpp | 4 +- Marlin/src/lcd/menu/menu.cpp | 479 ++ Marlin/src/lcd/menu/menu.h | 396 ++ Marlin/src/lcd/menu/menu_advanced.cpp | 644 ++ Marlin/src/lcd/menu/menu_bed_leveling.cpp | 339 + Marlin/src/lcd/menu/menu_configuration.cpp | 373 ++ Marlin/src/lcd/menu/menu_custom.cpp | 87 + Marlin/src/lcd/menu/menu_delta_calibrate.cpp | 137 + Marlin/src/lcd/menu/menu_filament.cpp | 581 ++ Marlin/src/lcd/menu/menu_info.cpp | 198 + Marlin/src/lcd/menu/menu_job_recovery.cpp | 106 + Marlin/src/lcd/menu/menu_led.cpp | 83 + Marlin/src/lcd/menu/menu_main.cpp | 166 + Marlin/src/lcd/menu/menu_motion.cpp | 499 ++ Marlin/src/lcd/menu/menu_sdcard.cpp | 137 + Marlin/src/lcd/menu/menu_temperature.cpp | 389 ++ Marlin/src/lcd/menu/menu_tune.cpp | 206 + Marlin/src/lcd/menu/menu_ubl.cpp | 606 ++ Marlin/src/lcd/ultralcd.cpp | 5784 ++--------------- Marlin/src/lcd/ultralcd.h | 294 +- Marlin/src/libs/buzzer.h | 2 +- Marlin/src/libs/duration_t.h | 6 +- Marlin/src/libs/point_t.h | 6 +- Marlin/src/libs/stopwatch.h | 2 +- Marlin/src/module/configuration_store.cpp | 62 +- Marlin/src/module/endstops.cpp | 27 +- Marlin/src/module/motion.cpp | 12 +- Marlin/src/module/motion.h | 10 +- Marlin/src/module/planner.cpp | 32 +- Marlin/src/module/planner.h | 12 +- Marlin/src/module/probe.cpp | 127 +- Marlin/src/module/servo.h | 3 +- Marlin/src/module/stepper.cpp | 149 +- Marlin/src/module/stepper.h | 27 +- Marlin/src/module/stepper_indirection.h | 4 +- Marlin/src/module/temperature.cpp | 9 +- Marlin/src/module/thermistor/thermistor_75.h | 99 +- Marlin/src/module/tool_change.cpp | 122 +- Marlin/src/module/tool_change.h | 22 +- Marlin/src/pins/pins.h | 14 +- Marlin/src/pins/pins_ARMED.h | 174 + Marlin/src/pins/pins_AZTEEG_X5_MINI_WIFI.h | 47 +- Marlin/src/pins/pins_FORMBOT_RAPTOR.h | 2 +- Marlin/src/pins/pins_FORMBOT_TREX2PLUS.h | 2 +- Marlin/src/pins/pins_FORMBOT_TREX3.h | 6 +- Marlin/src/pins/pins_MELZI_CREALITY.h | 4 + Marlin/src/pins/pins_MKS_SBASE.h | 95 +- Marlin/src/pins/pins_RAMPS_CREALITY.h | 43 + Marlin/src/pins/pins_RAMPS_RE_ARM.h | 35 +- Marlin/src/pins/pins_REMRAM_V1.h | 12 +- Marlin/src/pins/pins_STM32F4.h | 2 +- Marlin/src/pins/pins_THE_BORG.h | 2 +- Marlin/src/pins/pins_TRIGORILLA_14.h | 40 +- Marlin/src/sd/Sd2Card.cpp | 18 +- Marlin/src/sd/Sd2Card.h | 2 +- Marlin/src/sd/cardreader.cpp | 8 +- Marlin/src/sd/cardreader.h | 18 +- .../sd/usb_flashdrive/Sd2Card_FlashDrive.cpp | 139 +- .../sd/usb_flashdrive/Sd2Card_FlashDrive.h | 44 +- Marlin/src/sd/usb_flashdrive/usb_host.cpp | 4 +- 400 files changed, 19178 insertions(+), 13161 deletions(-) create mode 100644 Marlin/src/HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp delete mode 100644 Marlin/src/HAL/HAL_LPC1768/HAL_temp.h delete mode 100644 Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.cpp delete mode 100644 Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.h delete mode 100644 Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.cpp delete mode 100644 Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.h create mode 100644 Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp create mode 100644 Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h rename Marlin/src/HAL/HAL_LPC1768/{servo_private.h => MarlinServo.h} (69%) delete mode 100644 Marlin/src/HAL/HAL_LPC1768/SoftwareSPI.cpp delete mode 100644 Marlin/src/HAL/HAL_LPC1768/SoftwareSPI.h delete mode 100644 Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp delete mode 100644 Marlin/src/HAL/HAL_LPC1768/arduino.cpp delete mode 100644 Marlin/src/HAL/HAL_LPC1768/debug_extra_script.py delete mode 100644 Marlin/src/HAL/HAL_LPC1768/include/Arduino.h delete mode 100644 Marlin/src/HAL/HAL_LPC1768/include/HardwareSerial.cpp delete mode 100644 Marlin/src/HAL/HAL_LPC1768/include/HardwareSerial.h delete mode 100644 Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.cpp delete mode 100644 Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.h delete mode 100644 Marlin/src/HAL/HAL_LPC1768/include/Wire.cpp delete mode 100644 Marlin/src/HAL/HAL_LPC1768/include/Wire.h delete mode 100644 Marlin/src/HAL/HAL_LPC1768/include/pinmapping.cpp delete mode 100644 Marlin/src/HAL/HAL_LPC1768/include/pinmapping.h delete mode 100644 Marlin/src/HAL/HAL_LPC1768/include/serial.h delete mode 100644 Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py rename Marlin/src/HAL/HAL_LPC1768/{ => u8g}/u8g_com_HAL_LPC1768_hw_spi.cpp (99%) rename Marlin/src/HAL/HAL_LPC1768/{ => u8g}/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp (99%) rename Marlin/src/HAL/HAL_LPC1768/{ => u8g}/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction (100%) rename Marlin/src/HAL/HAL_LPC1768/{ => u8g}/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp (98%) rename Marlin/src/HAL/HAL_LPC1768/{ => u8g}/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp (98%) rename Marlin/src/HAL/HAL_LPC1768/{ => u8g}/u8g_com_HAL_LPC1768_sw_spi.cpp (98%) create mode 100644 Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp create mode 100644 Marlin/src/HAL/HAL_LPC1768/win_usb_driver/lpc176x_usb_driver.inf create mode 100644 Marlin/src/config/examples/AnimationExample/_Bootscreen.h create mode 100644 Marlin/src/config/examples/ArmEd/Configuration.h create mode 100644 Marlin/src/config/examples/ArmEd/Configuration_adv.h rename Marlin/src/core/{types.h => millis_t.h} (52%) rename Marlin/src/gcode/sdcard/{M20-M30_M32-M34_M928.cpp => M20-M30_M32-M34_M524_M928.cpp} (97%) rename Marlin/src/lcd/{ => HD44780}/lcdprint_hd44780.cpp (98%) rename Marlin/src/lcd/{ => HD44780}/ultralcd_common_HD44780.h (92%) rename Marlin/src/lcd/{ultralcd_impl_HD44780.h => HD44780/ultralcd_impl_HD44780.cpp} (85%) create mode 100644 Marlin/src/lcd/dogm/dogm_Bootscreen.h rename Marlin/src/lcd/dogm/{dogm_bitmaps.h => dogm_Statusscreen.h} (91%) rename Marlin/src/lcd/dogm/{dogm_font_data_6x9_marlin.h => fontdata/fontdata_6x9_marlin.h} (100%) rename Marlin/src/lcd/dogm/{dogm_font_data_ISO10646_1.h => fontdata/fontdata_ISO10646_1.h} (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_an.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_bg.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_ca.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_cz.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_da.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_de.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_el-gr.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_el.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_en.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_es.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_eu.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_fi.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_fr.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_gl.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_hr.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_it.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_jp-kana.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_ko_KR.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_nl.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_pl.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_pt-br.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_pt.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_ru.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_sk.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_test.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_tr.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_uk.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_zh_CN.h (100%) rename Marlin/src/lcd/dogm/{ => fontdata}/language_data_zh_TW.h (100%) rename Marlin/src/lcd/{ => dogm}/lcdprint_u8g.cpp (91%) rename Marlin/src/lcd/dogm/{status_screen_DOGM.h => status_screen_DOGM.cpp} (88%) rename Marlin/src/lcd/dogm/{status_screen_lite_ST7920.h => status_screen_lite_ST7920.cpp} (97%) rename Marlin/src/lcd/{ => dogm}/u8g_fontutf8.cpp (99%) rename Marlin/src/lcd/{ => dogm}/u8g_fontutf8.h (58%) rename Marlin/src/lcd/{ultralcd_impl_DOGM.h => dogm/ultralcd_impl_DOGM.cpp} (59%) rename Marlin/src/lcd/extensible_ui/lib/{dummy.cpp => example.cpp} (72%) create mode 100644 Marlin/src/lcd/menu/menu.cpp create mode 100644 Marlin/src/lcd/menu/menu.h create mode 100644 Marlin/src/lcd/menu/menu_advanced.cpp create mode 100644 Marlin/src/lcd/menu/menu_bed_leveling.cpp create mode 100644 Marlin/src/lcd/menu/menu_configuration.cpp create mode 100644 Marlin/src/lcd/menu/menu_custom.cpp create mode 100644 Marlin/src/lcd/menu/menu_delta_calibrate.cpp create mode 100644 Marlin/src/lcd/menu/menu_filament.cpp create mode 100644 Marlin/src/lcd/menu/menu_info.cpp create mode 100644 Marlin/src/lcd/menu/menu_job_recovery.cpp create mode 100644 Marlin/src/lcd/menu/menu_led.cpp create mode 100644 Marlin/src/lcd/menu/menu_main.cpp create mode 100644 Marlin/src/lcd/menu/menu_motion.cpp create mode 100644 Marlin/src/lcd/menu/menu_sdcard.cpp create mode 100644 Marlin/src/lcd/menu/menu_temperature.cpp create mode 100644 Marlin/src/lcd/menu/menu_tune.cpp create mode 100644 Marlin/src/lcd/menu/menu_ubl.cpp create mode 100644 Marlin/src/pins/pins_ARMED.h create mode 100644 Marlin/src/pins/pins_RAMPS_CREALITY.h diff --git a/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp b/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp index ea5c489f65..36134f7b89 100644 --- a/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp +++ b/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp @@ -43,7 +43,7 @@ #include "MarlinSerial.h" #include "../../Marlin.h" - template typename MarlinSerial::ring_buffer_r MarlinSerial::rx_buffer = { 0 }; + template typename MarlinSerial::ring_buffer_r MarlinSerial::rx_buffer = { 0, 0, { 0 } }; template typename MarlinSerial::ring_buffer_t MarlinSerial::tx_buffer = { 0 }; template bool MarlinSerial::_written = false; template uint8_t MarlinSerial::xon_xoff_state = MarlinSerial::XON_XOFF_CHAR_SENT | MarlinSerial::XON_CHAR; diff --git a/Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp b/Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp index 6af106439a..8845fa04ac 100644 --- a/Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp +++ b/Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp @@ -63,9 +63,8 @@ void watchdog_init() { ISR(WDT_vect) { sei(); // With the interrupt driven serial we need to allow interrupts. SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM("Watchdog barked, please turn off the printer."); - kill(PSTR("ERR:Watchdog")); //kill blocks //up to 16 characters so it fits on a 16x2 display - while (1); //wait for user or serial reset + SERIAL_ERRORLNPGM(MSG_WATCHDOG_FIRED); + minkill(); // interrupt-safe final kill and infinite loop } #endif // WATCHDOG_RESET_MANUAL diff --git a/Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp b/Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp index a45306e316..a333e2e350 100644 --- a/Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/HAL_spi_Due.cpp @@ -581,84 +581,124 @@ // -------------------------------------------------------------------------- // hardware SPI // -------------------------------------------------------------------------- - // 8.4 MHz, 4 MHz, 2 MHz, 1 MHz, 0.5 MHz, 0.329 MHz, 0.329 MHz - int spiDueDividors[] = { 10, 21, 42, 84, 168, 255, 255 }; - bool spiInitMaded = false; - - void spiBegin() { - if (spiInitMaded == false) { - // Configure SPI pins - PIO_Configure( - g_APinDescription[SCK_PIN].pPort, - g_APinDescription[SCK_PIN].ulPinType, - g_APinDescription[SCK_PIN].ulPin, - g_APinDescription[SCK_PIN].ulPinConfiguration); - PIO_Configure( - g_APinDescription[MOSI_PIN].pPort, - g_APinDescription[MOSI_PIN].ulPinType, - g_APinDescription[MOSI_PIN].ulPin, - g_APinDescription[MOSI_PIN].ulPinConfiguration); - PIO_Configure( - g_APinDescription[MISO_PIN].pPort, - g_APinDescription[MISO_PIN].ulPinType, - g_APinDescription[MISO_PIN].ulPin, - g_APinDescription[MISO_PIN].ulPinConfiguration); - - // set master mode, peripheral select, fault detection - SPI_Configure(SPI0, ID_SPI0, SPI_MR_MSTR | SPI_MR_MODFDIS | SPI_MR_PS); - SPI_Enable(SPI0); - - #if MB(ALLIGATOR) - SET_OUTPUT(DAC0_SYNC); - #if EXTRUDERS > 1 - SET_OUTPUT(DAC1_SYNC); - WRITE(DAC1_SYNC, HIGH); - #endif - SET_OUTPUT(SPI_EEPROM1_CS); - SET_OUTPUT(SPI_EEPROM2_CS); - SET_OUTPUT(SPI_FLASH_CS); - WRITE(DAC0_SYNC, HIGH); - WRITE(SPI_EEPROM1_CS, HIGH ); - WRITE(SPI_EEPROM2_CS, HIGH ); - WRITE(SPI_FLASH_CS, HIGH ); - WRITE(SS_PIN, HIGH ); - #endif // MB(ALLIGATOR) - - OUT_WRITE(SDSS,0); - - PIO_Configure( - g_APinDescription[SPI_PIN].pPort, - g_APinDescription[SPI_PIN].ulPinType, - g_APinDescription[SPI_PIN].ulPin, - g_APinDescription[SPI_PIN].ulPinConfiguration); - - spiInit(1); - spiInitMaded = true; - } - } + static bool spiInitialized = false; void spiInit(uint8_t spiRate) { - if (spiInitMaded == false) { - if (spiRate > 6) spiRate = 1; + if (spiInitialized) return; - #if MB(ALLIGATOR) - // Set SPI mode 1, clock, select not active after transfer, with delay between transfers - SPI_ConfigureNPCS(SPI0, SPI_CHAN_DAC, - SPI_CSR_CSAAT | SPI_CSR_SCBR(spiDueDividors[spiRate]) | - SPI_CSR_DLYBCT(1)); - // Set SPI mode 0, clock, select not active after transfer, with delay between transfers - SPI_ConfigureNPCS(SPI0, SPI_CHAN_EEPROM1, SPI_CSR_NCPHA | - SPI_CSR_CSAAT | SPI_CSR_SCBR(spiDueDividors[spiRate]) | - SPI_CSR_DLYBCT(1)); - #endif//MB(ALLIGATOR) + // 8.4 MHz, 4 MHz, 2 MHz, 1 MHz, 0.5 MHz, 0.329 MHz, 0.329 MHz + constexpr int spiDivider[] = { 10, 21, 42, 84, 168, 255, 255 }; + if (spiRate > 6) spiRate = 1; - // Set SPI mode 0, clock, select not active after transfer, with delay between transfers - SPI_ConfigureNPCS(SPI0, SPI_CHAN, SPI_CSR_NCPHA | - SPI_CSR_CSAAT | SPI_CSR_SCBR(spiDueDividors[spiRate]) | - SPI_CSR_DLYBCT(1)); - SPI_Enable(SPI0); - spiInitMaded = true; + // Set SPI mode 1, clock, select not active after transfer, with delay between transfers + SPI_ConfigureNPCS(SPI0, SPI_CHAN_DAC, + SPI_CSR_CSAAT | SPI_CSR_SCBR(spiDivider[spiRate]) | + SPI_CSR_DLYBCT(1)); + // Set SPI mode 0, clock, select not active after transfer, with delay between transfers + SPI_ConfigureNPCS(SPI0, SPI_CHAN_EEPROM1, SPI_CSR_NCPHA | + SPI_CSR_CSAAT | SPI_CSR_SCBR(spiDivider[spiRate]) | + SPI_CSR_DLYBCT(1)); + + // Set SPI mode 0, clock, select not active after transfer, with delay between transfers + SPI_ConfigureNPCS(SPI0, SPI_CHAN, SPI_CSR_NCPHA | + SPI_CSR_CSAAT | SPI_CSR_SCBR(spiDivider[spiRate]) | + SPI_CSR_DLYBCT(1)); + SPI_Enable(SPI0); + spiInitialized = true; + } + + void spiBegin() { + if (spiInitialized) return; + + // Configure SPI pins + PIO_Configure( + g_APinDescription[SCK_PIN].pPort, + g_APinDescription[SCK_PIN].ulPinType, + g_APinDescription[SCK_PIN].ulPin, + g_APinDescription[SCK_PIN].ulPinConfiguration); + PIO_Configure( + g_APinDescription[MOSI_PIN].pPort, + g_APinDescription[MOSI_PIN].ulPinType, + g_APinDescription[MOSI_PIN].ulPin, + g_APinDescription[MOSI_PIN].ulPinConfiguration); + PIO_Configure( + g_APinDescription[MISO_PIN].pPort, + g_APinDescription[MISO_PIN].ulPinType, + g_APinDescription[MISO_PIN].ulPin, + g_APinDescription[MISO_PIN].ulPinConfiguration); + + // set master mode, peripheral select, fault detection + SPI_Configure(SPI0, ID_SPI0, SPI_MR_MSTR | SPI_MR_MODFDIS | SPI_MR_PS); + SPI_Enable(SPI0); + + SET_OUTPUT(DAC0_SYNC); + #if EXTRUDERS > 1 + SET_OUTPUT(DAC1_SYNC); + WRITE(DAC1_SYNC, HIGH); + #endif + SET_OUTPUT(SPI_EEPROM1_CS); + SET_OUTPUT(SPI_EEPROM2_CS); + SET_OUTPUT(SPI_FLASH_CS); + WRITE(DAC0_SYNC, HIGH); + WRITE(SPI_EEPROM1_CS, HIGH ); + WRITE(SPI_EEPROM2_CS, HIGH ); + WRITE(SPI_FLASH_CS, HIGH ); + WRITE(SS_PIN, HIGH ); + + OUT_WRITE(SDSS,0); + + PIO_Configure( + g_APinDescription[SPI_PIN].pPort, + g_APinDescription[SPI_PIN].ulPinType, + g_APinDescription[SPI_PIN].ulPin, + g_APinDescription[SPI_PIN].ulPinConfiguration); + + spiInit(1); + } + + // Read single byte from SPI + uint8_t spiRec() { + // write dummy byte with address and end transmission flag + SPI0->SPI_TDR = 0x000000FF | SPI_PCS(SPI_CHAN) | SPI_TDR_LASTXFER; + // wait for transmit register empty + while ((SPI0->SPI_SR & SPI_SR_TDRE) == 0); + + // wait for receive register + while ((SPI0->SPI_SR & SPI_SR_RDRF) == 0); + // get byte from receive register + //DELAY_US(1U); + return SPI0->SPI_RDR; + } + + uint8_t spiRec(uint32_t chan) { + uint8_t spirec_tmp; + // wait for transmit register empty + while ((SPI0->SPI_SR & SPI_SR_TDRE) == 0); + while ((SPI0->SPI_SR & SPI_SR_RDRF) == 1) + spirec_tmp = SPI0->SPI_RDR; + UNUSED(spirec_tmp); + + // write dummy byte with address and end transmission flag + SPI0->SPI_TDR = 0x000000FF | SPI_PCS(chan) | SPI_TDR_LASTXFER; + + // wait for receive register + while ((SPI0->SPI_SR & SPI_SR_RDRF) == 0); + // get byte from receive register + return SPI0->SPI_RDR; + } + + // Read from SPI into buffer + void spiRead(uint8_t* buf, uint16_t nbyte) { + if (nbyte-- == 0) return; + + for (int i = 0; i < nbyte; i++) { + //while ((SPI0->SPI_SR & SPI_SR_TDRE) == 0); + SPI0->SPI_TDR = 0x000000FF | SPI_PCS(SPI_CHAN); + while ((SPI0->SPI_SR & SPI_SR_RDRF) == 0); + buf[i] = SPI0->SPI_RDR; + //DELAY_US(1U); } + buf[nbyte] = spiRec(); } // Write single byte to SPI @@ -714,51 +754,6 @@ spiSend(chan, buf[n - 1]); } - // Read single byte from SPI - uint8_t spiRec() { - // write dummy byte with address and end transmission flag - SPI0->SPI_TDR = 0x000000FF | SPI_PCS(SPI_CHAN) | SPI_TDR_LASTXFER; - // wait for transmit register empty - while ((SPI0->SPI_SR & SPI_SR_TDRE) == 0); - - // wait for receive register - while ((SPI0->SPI_SR & SPI_SR_RDRF) == 0); - // get byte from receive register - //DELAY_US(1U); - return SPI0->SPI_RDR; - } - - uint8_t spiRec(uint32_t chan) { - uint8_t spirec_tmp; - // wait for transmit register empty - while ((SPI0->SPI_SR & SPI_SR_TDRE) == 0); - while ((SPI0->SPI_SR & SPI_SR_RDRF) == 1) - spirec_tmp = SPI0->SPI_RDR; - UNUSED(spirec_tmp); - - // write dummy byte with address and end transmission flag - SPI0->SPI_TDR = 0x000000FF | SPI_PCS(chan) | SPI_TDR_LASTXFER; - - // wait for receive register - while ((SPI0->SPI_SR & SPI_SR_RDRF) == 0); - // get byte from receive register - return SPI0->SPI_RDR; - } - - // Read from SPI into buffer - void spiRead(uint8_t* buf, uint16_t nbyte) { - if (nbyte-- == 0) return; - - for (int i = 0; i < nbyte; i++) { - //while ((SPI0->SPI_SR & SPI_SR_TDRE) == 0); - SPI0->SPI_TDR = 0x000000FF | SPI_PCS(SPI_CHAN); - while ((SPI0->SPI_SR & SPI_SR_RDRF) == 0); - buf[i] = SPI0->SPI_RDR; - //DELAY_US(1U); - } - buf[nbyte] = spiRec(); - } - // Write from buffer to SPI void spiSendBlock(uint8_t token, const uint8_t* buf) { SPI0->SPI_TDR = (uint32_t)token | SPI_PCS(SPI_CHAN); @@ -780,7 +775,7 @@ // TODO: to be implemented } - #else // U8G compatible hardware SPI + #else // U8G compatible hardware SPI #define SPI_MODE_0_DUE_HW 2 // DUE CPHA control bit is inverted #define SPI_MODE_1_DUE_HW 3 @@ -789,7 +784,7 @@ void spiInit(uint8_t spiRate=6) { // Default to slowest rate if not specified) // 8.4 MHz, 4 MHz, 2 MHz, 1 MHz, 0.5 MHz, 0.329 MHz, 0.329 MHz - int spiDueDividors[] = { 10, 21, 42, 84, 168, 255, 255 }; + constexpr int spiDivider[] = { 10, 21, 42, 84, 168, 255, 255 }; if (spiRate > 6) spiRate = 1; // Enable PIOA and SPI0 @@ -809,7 +804,11 @@ // Master mode, no fault detection, PCS bits in data written to TDR select CSR register SPI0->SPI_MR = SPI_MR_MSTR | SPI_MR_PS | SPI_MR_MODFDIS; // SPI mode 0, 8 Bit data transfer, baud rate - SPI0->SPI_CSR[3] = SPI_CSR_SCBR(spiDueDividors[spiRate]) | SPI_CSR_CSAAT | SPI_MODE_0_DUE_HW; // use same CSR as TMC2130 + SPI0->SPI_CSR[3] = SPI_CSR_SCBR(spiDivider[spiRate]) | SPI_CSR_CSAAT | SPI_MODE_0_DUE_HW; // use same CSR as TMC2130 + } + + void spiBegin() { + spiInit(); } static uint8_t spiTransfer(uint8_t data) { @@ -828,10 +827,6 @@ return SPI0->SPI_RDR; } - void spiBegin() { - spiInit(); - } - uint8_t spiRec() { uint8_t data = spiTransfer(0xFF); return data; diff --git a/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.cpp b/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.cpp index b0a00840ad..b176f9d0d9 100644 --- a/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/MarlinSerialUSB_Due.cpp @@ -143,8 +143,8 @@ void MarlinSerialUSB::write(const uint8_t c) { } /** -* Imports from print.h -*/ + * Imports from print.h + */ void MarlinSerialUSB::print(char c, int base) { print((long)c, base); diff --git a/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.cpp b/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.cpp index cbcd9dcd3f..ef72c38270 100644 --- a/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/MarlinSerial_Due.cpp @@ -33,7 +33,7 @@ #include "InterruptVectors_Due.h" #include "../../Marlin.h" -template typename MarlinSerial::ring_buffer_r MarlinSerial::rx_buffer = { 0 }; +template typename MarlinSerial::ring_buffer_r MarlinSerial::rx_buffer = { 0, 0, { 0 } }; template typename MarlinSerial::ring_buffer_t MarlinSerial::tx_buffer = { 0 }; template bool MarlinSerial::_written = false; template uint8_t MarlinSerial::xon_xoff_state = MarlinSerial::XON_XOFF_CHAR_SENT | MarlinSerial::XON_CHAR; diff --git a/Marlin/src/HAL/HAL_DUE/Servo_Due.cpp b/Marlin/src/HAL/HAL_DUE/Servo_Due.cpp index d2207d91aa..db1b3e39ba 100644 --- a/Marlin/src/HAL/HAL_DUE/Servo_Due.cpp +++ b/Marlin/src/HAL/HAL_DUE/Servo_Due.cpp @@ -76,14 +76,14 @@ void Servo_Handler(timer16_Sequence_t timer, Tc *tc, uint8_t channel) { tc->TC_CHANNEL[channel].TC_SR; if (Channel[timer] < 0) tc->TC_CHANNEL[channel].TC_CCR |= TC_CCR_SWTRG; // channel set to -1 indicated that refresh interval completed so reset the timer - else if (SERVO_INDEX(timer,Channel[timer]) < ServoCount && SERVO(timer,Channel[timer]).Pin.isActive) - digitalWrite(SERVO(timer,Channel[timer]).Pin.nbr, LOW); // pulse this channel low if activated + else if (SERVO_INDEX(timer, Channel[timer]) < ServoCount && SERVO(timer, Channel[timer]).Pin.isActive) + digitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, LOW); // pulse this channel low if activated Channel[timer]++; // increment to the next channel if (SERVO_INDEX(timer, Channel[timer]) < ServoCount && Channel[timer] < SERVOS_PER_TIMER) { tc->TC_CHANNEL[channel].TC_RA = tc->TC_CHANNEL[channel].TC_CV + SERVO(timer,Channel[timer]).ticks; if (SERVO(timer,Channel[timer]).Pin.isActive) // check if activated - digitalWrite( SERVO(timer,Channel[timer]).Pin.nbr,HIGH); // its an active channel so pulse it high + digitalWrite(SERVO(timer, Channel[timer]).Pin.nbr, HIGH); // its an active channel so pulse it high } else { // finished all channels so wait for the refresh period to expire before starting over 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 4de46104e2..1054f5ab34 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,15 +19,17 @@ 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.cardOK) return CTRL_NO_PRESENT; return CTRL_GOOD; } +// 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.cardOK) return CTRL_NO_PRESENT; - *nb_sector = card.getSd2Card().cardSize(); + *nb_sector = card.getSd2Card().cardSize() - 1; return CTRL_GOOD; } @@ -40,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.cardOK) return true; return false; } @@ -59,7 +61,7 @@ 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.cardOK) return CTRL_NO_PRESENT; #ifdef DEBUG_MMC @@ -93,7 +95,7 @@ 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.cardOK) return CTRL_NO_PRESENT; #ifdef DEBUG_MMC diff --git a/Marlin/src/HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp b/Marlin/src/HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp new file mode 100644 index 0000000000..6798d60cc6 --- /dev/null +++ b/Marlin/src/HAL/HAL_LPC1768/DebugMonitor_LPC1768.cpp @@ -0,0 +1,318 @@ +/** + * 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 . + * + */ + +#ifdef TARGET_LPC1768 + +#include "../../core/macros.h" +#include "../../core/serial.h" +#include + +#include "../shared/backtrace/unwinder.h" +#include "../shared/backtrace/unwmemaccess.h" +#include "watchdog.h" +#include + + +// Debug monitor that dumps to the Programming port all status when +// an exception or WDT timeout happens - And then resets the board + +// All the Monitor routines must run with interrupts disabled and +// under an ISR execution context. That is why we cannot reuse the +// Serial interrupt routines or any C runtime, as we don't know the +// state we are when running them + +// A SW memory barrier, to ensure GCC does not overoptimize loops +#define sw_barrier() __asm__ volatile("": : :"memory"); + +// (re)initialize UART0 as a monitor output to 250000,n,8,1 +static void TXBegin(void) { +} + +// Send character through UART with no interrupts +static void TX(char c) { + _DBC(c); +} + +// Send String through UART +static void TX(const char* s) { + while (*s) TX(*s++); +} + +static void TXDigit(uint32_t d) { + if (d < 10) TX((char)(d+'0')); + else if (d < 16) TX((char)(d+'A'-10)); + else TX('?'); +} + +// Send Hex number thru UART +static void TXHex(uint32_t v) { + TX("0x"); + for (uint8_t i = 0; i < 8; i++, v <<= 4) + TXDigit((v >> 28) & 0xF); +} + +// Send Decimal number thru UART +static void TXDec(uint32_t v) { + if (!v) { + TX('0'); + return; + } + + char nbrs[14]; + char *p = &nbrs[0]; + while (v != 0) { + *p++ = '0' + (v % 10); + v /= 10; + } + do { + p--; + TX(*p); + } while (p != &nbrs[0]); +} + +// Dump a backtrace entry +static bool UnwReportOut(void* ctx, const UnwReport* bte) { + int* p = (int*)ctx; + + (*p)++; + TX('#'); TXDec(*p); TX(" : "); + TX(bte->name?bte->name:"unknown"); TX('@'); TXHex(bte->function); + TX('+'); TXDec(bte->address - bte->function); + TX(" PC:");TXHex(bte->address); TX('\n'); + return true; +} + +#ifdef UNW_DEBUG + void UnwPrintf(const char* format, ...) { + char dest[256]; + va_list argptr; + va_start(argptr, format); + vsprintf(dest, format, argptr); + va_end(argptr); + TX(&dest[0]); + } +#endif + +/* Table of function pointers for passing to the unwinder */ +static const UnwindCallbacks UnwCallbacks = { + UnwReportOut, + UnwReadW, + UnwReadH, + UnwReadB + #if defined(UNW_DEBUG) + ,UnwPrintf + #endif +}; + + +/** + * HardFaultHandler_C: + * This is called from the HardFault_HandlerAsm with a pointer the Fault stack + * as the parameter. We can then read the values from the stack and place them + * into local variables for ease of reading. + * We then read the various Fault Status and Address Registers to help decode + * cause of the fault. + * The function ends with a BKPT instruction to force control back into the debugger + */ +extern "C" +void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause) { + + static const char* causestr[] = { + "NMI","Hard","Mem","Bus","Usage","Debug","WDT","RSTC" + }; + + UnwindFrame btf; + + // Dump report to the Programming port (interrupts are DISABLED) + TXBegin(); + TX("\n\n## Software Fault detected ##\n"); + TX("Cause: "); TX(causestr[cause]); TX('\n'); + + TX("R0 : "); TXHex(((unsigned long)sp[0])); TX('\n'); + TX("R1 : "); TXHex(((unsigned long)sp[1])); TX('\n'); + TX("R2 : "); TXHex(((unsigned long)sp[2])); TX('\n'); + TX("R3 : "); TXHex(((unsigned long)sp[3])); TX('\n'); + TX("R12 : "); TXHex(((unsigned long)sp[4])); TX('\n'); + TX("LR : "); TXHex(((unsigned long)sp[5])); TX('\n'); + TX("PC : "); TXHex(((unsigned long)sp[6])); TX('\n'); + TX("PSR : "); TXHex(((unsigned long)sp[7])); TX('\n'); + + // Configurable Fault Status Register + // Consists of MMSR, BFSR and UFSR + TX("CFSR : "); TXHex((*((volatile unsigned long *)(0xE000ED28)))); TX('\n'); + + // Hard Fault Status Register + TX("HFSR : "); TXHex((*((volatile unsigned long *)(0xE000ED2C)))); TX('\n'); + + // Debug Fault Status Register + TX("DFSR : "); TXHex((*((volatile unsigned long *)(0xE000ED30)))); TX('\n'); + + // Auxiliary Fault Status Register + TX("AFSR : "); TXHex((*((volatile unsigned long *)(0xE000ED3C)))); TX('\n'); + + // Read the Fault Address Registers. These may not contain valid values. + // Check BFARVALID/MMARVALID to see if they are valid values + // MemManage Fault Address Register + TX("MMAR : "); TXHex((*((volatile unsigned long *)(0xE000ED34)))); TX('\n'); + + // Bus Fault Address Register + TX("BFAR : "); TXHex((*((volatile unsigned long *)(0xE000ED38)))); TX('\n'); + + TX("ExcLR: "); TXHex(lr); TX('\n'); + TX("ExcSP: "); TXHex((unsigned long)sp); TX('\n'); + + btf.sp = ((unsigned long)sp) + 8*4; // The original stack pointer + btf.fp = btf.sp; + btf.lr = ((unsigned long)sp[5]); + btf.pc = ((unsigned long)sp[6]) | 1; // Force Thumb, as CORTEX only support it + + // Perform a backtrace + TX("\nBacktrace:\n\n"); + int ctr = 0; + UnwindStart(&btf, &UnwCallbacks, &ctr); + + // Disable all NVIC interrupts + NVIC->ICER[0] = 0xFFFFFFFF; + NVIC->ICER[1] = 0xFFFFFFFF; + + // Relocate VTOR table to default position + SCB->VTOR = 0; + + // Clear cause of reset to prevent entering smoothie bootstrap + HAL_clear_reset_source(); + // Restart watchdog + //WDT_Restart(WDT); + watchdog_init(); + + // Reset controller + NVIC_SystemReset(); + + while(1) { watchdog_init(); } +} + +extern "C" { +__attribute__((naked)) void NMI_Handler(void) { + __asm__ __volatile__ ( + ".syntax unified" "\n\t" + A("tst lr, #4") + A("ite eq") + A("mrseq r0, msp") + A("mrsne r0, psp") + A("mov r1,lr") + A("mov r2,#0") + A("b HardFault_HandlerC") + ); +} + +__attribute__((naked)) void HardFault_Handler(void) { + __asm__ __volatile__ ( + ".syntax unified" "\n\t" + A("tst lr, #4") + A("ite eq") + A("mrseq r0, msp") + A("mrsne r0, psp") + A("mov r1,lr") + A("mov r2,#1") + A("b HardFault_HandlerC") + ); +} + +__attribute__((naked)) void MemManage_Handler(void) { + __asm__ __volatile__ ( + ".syntax unified" "\n\t" + A("tst lr, #4") + A("ite eq") + A("mrseq r0, msp") + A("mrsne r0, psp") + A("mov r1,lr") + A("mov r2,#2") + A("b HardFault_HandlerC") + ); +} + +__attribute__((naked)) void BusFault_Handler(void) { + __asm__ __volatile__ ( + ".syntax unified" "\n\t" + A("tst lr, #4") + A("ite eq") + A("mrseq r0, msp") + A("mrsne r0, psp") + A("mov r1,lr") + A("mov r2,#3") + A("b HardFault_HandlerC") + ); +} + +__attribute__((naked)) void UsageFault_Handler(void) { + __asm__ __volatile__ ( + ".syntax unified" "\n\t" + A("tst lr, #4") + A("ite eq") + A("mrseq r0, msp") + A("mrsne r0, psp") + A("mov r1,lr") + A("mov r2,#4") + A("b HardFault_HandlerC") + ); +} + +__attribute__((naked)) void DebugMon_Handler(void) { + __asm__ __volatile__ ( + ".syntax unified" "\n\t" + A("tst lr, #4") + A("ite eq") + A("mrseq r0, msp") + A("mrsne r0, psp") + A("mov r1,lr") + A("mov r2,#5") + A("b HardFault_HandlerC") + ); +} + +/* This is NOT an exception, it is an interrupt handler - Nevertheless, the framing is the same */ +__attribute__((naked)) void WDT_IRQHandler(void) { + __asm__ __volatile__ ( + ".syntax unified" "\n\t" + A("tst lr, #4") + A("ite eq") + A("mrseq r0, msp") + A("mrsne r0, psp") + A("mov r1,lr") + A("mov r2,#6") + A("b HardFault_HandlerC") + ); +} + +__attribute__((naked)) void RSTC_Handler(void) { + __asm__ __volatile__ ( + ".syntax unified" "\n\t" + A("tst lr, #4") + A("ite eq") + A("mrseq r0, msp") + A("mrsne r0, psp") + A("mov r1,lr") + A("mov r2,#7") + A("b HardFault_HandlerC") + ); +} +} +#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL.cpp b/Marlin/src/HAL/HAL_LPC1768/HAL.cpp index 33cd9a9995..020a1660b3 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/HAL.cpp @@ -22,8 +22,7 @@ #include "../../inc/MarlinConfig.h" #include "../shared/Delay.h" - -HalSerial usb_serial; +#include "../../../gcode/parser.h" // U8glib required functions extern "C" void u8g_xMicroDelay(uint16_t val) { @@ -51,231 +50,11 @@ int freeMemory() { return result; } -// -------------------------------------------------------------------------- -// ADC -// -------------------------------------------------------------------------- - -#define ADC_DONE 0x80000000 -#define ADC_OVERRUN 0x40000000 - -void HAL_adc_init(void) { - LPC_SC->PCONP |= (1 << 12); // Enable CLOCK for internal ADC controller - LPC_SC->PCLKSEL0 &= ~(0x3 << 24); - LPC_SC->PCLKSEL0 |= (0x1 << 24); // 0: 25MHz, 1: 100MHz, 2: 50MHz, 3: 12.5MHZ to ADC clock divider - LPC_ADC->ADCR = (0 << 0) // SEL: 0 = no channels selected - | (0xFF << 8) // select slowest clock for A/D conversion 150 - 190 uS for a complete conversion - | (0 << 16) // BURST: 0 = software control - | (0 << 17) // CLKS: not applicable - | (1 << 21) // PDN: 1 = operational - | (0 << 24) // START: 0 = no start - | (0 << 27); // EDGE: not applicable -} - -// externals need to make the call to KILL compile -#include "../../core/language.h" - -extern void kill(PGM_P); - -void HAL_adc_enable_channel(int ch) { - pin_t pin = analogInputToDigitalPin(ch); - - if (pin == -1) { - serial_error_start(); - SERIAL_PRINTF("INVALID ANALOG PORT:%d\n", ch); - kill(MSG_KILLED); - } - - int8_t pin_port = LPC1768_PIN_PORT(pin), - pin_port_pin = LPC1768_PIN_PIN(pin), - pinsel_start_bit = pin_port_pin > 15 ? 2 * (pin_port_pin - 16) : 2 * pin_port_pin; - uint8_t pin_sel_register = (pin_port == 0 && pin_port_pin <= 15) ? 0 : - pin_port == 0 ? 1 : - pin_port == 1 ? 3 : 10; - - switch (pin_sel_register) { - case 1: - LPC_PINCON->PINSEL1 &= ~(0x3 << pinsel_start_bit); - LPC_PINCON->PINSEL1 |= (0x1 << pinsel_start_bit); - break; - case 3: - LPC_PINCON->PINSEL3 &= ~(0x3 << pinsel_start_bit); - LPC_PINCON->PINSEL3 |= (0x3 << pinsel_start_bit); - break; - case 0: - LPC_PINCON->PINSEL0 &= ~(0x3 << pinsel_start_bit); - LPC_PINCON->PINSEL0 |= (0x2 << pinsel_start_bit); - break; - }; -} - -void HAL_adc_start_conversion(const uint8_t ch) { - if (analogInputToDigitalPin(ch) == -1) { - SERIAL_PRINTF("HAL: HAL_adc_start_conversion: invalid channel %d\n", ch); - return; - } - - LPC_ADC->ADCR &= ~0xFF; // Reset - SBI(LPC_ADC->ADCR, ch); // Select Channel - SBI(LPC_ADC->ADCR, 24); // Start conversion -} - -bool HAL_adc_finished(void) { - return LPC_ADC->ADGDR & ADC_DONE; -} - -// possible config options if something similar is extended to more platforms. -#define ADC_USE_MEDIAN_FILTER // Filter out erroneous readings -#define ADC_MEDIAN_FILTER_SIZE 23 // Higher values increase step delay (phase shift), - // (ADC_MEDIAN_FILTER_SIZE + 1) / 2 sample step delay (12 samples @ 500Hz: 24ms phase shift) - // Memory usage per ADC channel (bytes): (6 * ADC_MEDIAN_FILTER_SIZE) + 16 - // 8 * ((6 * 23) + 16 ) = 1232 Bytes for 8 channels - -#define ADC_USE_LOWPASS_FILTER // Filter out high frequency noise -#define ADC_LOWPASS_K_VALUE 6 // Higher values increase rise time - // Rise time sample delays for 100% signal convergence on full range step - // (1 : 13, 2 : 32, 3 : 67, 4 : 139, 5 : 281, 6 : 565, 7 : 1135, 8 : 2273) - // K = 6, 565 samples, 500Hz sample rate, 1.13s convergence on full range step - // Memory usage per ADC channel (bytes): 4 (32 Bytes for 8 channels) - - -// Sourced from https://embeddedgurus.com/stack-overflow/tag/median-filter/ -struct MedianFilter { - #define STOPPER 0 // Smaller than any datum - struct Pair { - Pair *point; // Pointers forming list linked in sorted order - uint16_t value; // Values to sort - }; - - Pair buffer[ADC_MEDIAN_FILTER_SIZE] = {}; // Buffer of nwidth pairs - Pair *datpoint = buffer; // Pointer into circular buffer of data - Pair small = {NULL, STOPPER}; // Chain stopper - Pair big = {&small, 0}; // Pointer to head (largest) of linked list. - - uint16_t update(uint16_t datum) { - Pair *successor; // Pointer to successor of replaced data item - Pair *scan; // Pointer used to scan down the sorted list - Pair *scanold; // Previous value of scan - Pair *median; // Pointer to median - uint16_t i; - - if (datum == STOPPER) { - datum = STOPPER + 1; // No stoppers allowed. - } - - if ( (++datpoint - buffer) >= (ADC_MEDIAN_FILTER_SIZE)) { - datpoint = buffer; // Increment and wrap data in pointer. - } - - datpoint->value = datum; // Copy in new datum - successor = datpoint->point; // Save pointer to old value's successor - median = &big; // Median initially to first in chain - scanold = NULL; // Scanold initially null. - scan = &big; // Points to pointer to first (largest) datum in chain - - // Handle chain-out of first item in chain as special case - if (scan->point == datpoint) { - scan->point = successor; - } - scanold = scan; // Save this pointer and - scan = scan->point ; // step down chain - - // Loop through the chain, normal loop exit via break. - for (i = 0 ; i < ADC_MEDIAN_FILTER_SIZE; ++i) { - // Handle odd-numbered item in chain - if (scan->point == datpoint) { - scan->point = successor; // Chain out the old datum - } - - if (scan->value < datum) { // If datum is larger than scanned value - datpoint->point = scanold->point; // Chain it in here - scanold->point = datpoint; // Mark it chained in - datum = STOPPER; - } - - // Step median pointer down chain after doing odd-numbered element - median = median->point; // Step median pointer - if (scan == &small) { - break; // Break at end of chain - } - scanold = scan; // Save this pointer and - scan = scan->point; // step down chain - - // Handle even-numbered item in chain. - if (scan->point == datpoint) { - scan->point = successor; - } - - if (scan->value < datum) { - datpoint->point = scanold->point; - scanold->point = datpoint; - datum = STOPPER; - } - - if (scan == &small) { - break; - } - - scanold = scan; - scan = scan->point; - } - return median->value; - } -}; - -struct LowpassFilter { - uint32_t data_delay = 0; - uint16_t update(const uint16_t value) { - data_delay -= (data_delay >> (ADC_LOWPASS_K_VALUE)) - value; - return (uint16_t)(data_delay >> (ADC_LOWPASS_K_VALUE)); - } -}; - -uint16_t HAL_adc_get_result(void) { - uint32_t adgdr = LPC_ADC->ADGDR; - CBI(LPC_ADC->ADCR, 24); // Stop conversion - - if (adgdr & ADC_OVERRUN) return 0; - uint16_t data = (adgdr >> 4) & 0xFFF; // copy the 12bit data value - uint8_t adc_channel = (adgdr >> 24) & 0x7; // copy the 3bit used channel - - #ifdef ADC_USE_MEDIAN_FILTER - static MedianFilter median_filter[NUM_ANALOG_INPUTS]; - data = median_filter[adc_channel].update(data); - #endif - - #ifdef ADC_USE_LOWPASS_FILTER - static LowpassFilter lowpass_filter[NUM_ANALOG_INPUTS]; - data = lowpass_filter[adc_channel].update(data); - #endif - - return ((data >> 2) & 0x3FF); // return 10bit value as Marlin expects -} - -#define SBIT_CNTEN 0 -#define SBIT_PWMEN 2 -#define SBIT_PWMMR0R 1 - -#define PWM_1 0 //P2_00 (0-1 Bits of PINSEL4) -#define PWM_2 2 //P2_01 (2-3 Bits of PINSEL4) -#define PWM_3 4 //P2_02 (4-5 Bits of PINSEL4) -#define PWM_4 6 //P2_03 (6-7 Bits of PINSEL4) -#define PWM_5 8 //P2_04 (8-9 Bits of PINSEL4) -#define PWM_6 10 //P2_05 (10-11 Bits of PINSEL4) - -void HAL_pwm_init(void) { - LPC_PINCON->PINSEL4 = _BV(PWM_5) | _BV(PWM_6); - - LPC_PWM1->TCR = _BV(SBIT_CNTEN) | _BV(SBIT_PWMEN); - LPC_PWM1->PR = 0x0; // No prescalar - LPC_PWM1->MCR = _BV(SBIT_PWMMR0R); // Reset on PWMMR0, reset TC if it matches MR0 - LPC_PWM1->MR0 = 255; // set PWM cycle(Ton+Toff)=255) - LPC_PWM1->MR5 = 0; // Set 50% Duty Cycle for the channels - LPC_PWM1->MR6 = 0; - - // Trigger the latch Enable Bits to load the new Match Values MR0, MR5, MR6 - LPC_PWM1->LER = _BV(0) | _BV(5) | _BV(6); - // Enable the PWM output pins for PWM_5-PWM_6(P2_04 - P2_05) - LPC_PWM1->PCR = _BV(13) | _BV(14); +int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) { + const uint16_t val = (uint16_t)parser.intval(code), port = val / 100, pin = val % 100; + const int16_t ind = (port < (NUM_DIGITAL_PINS >> 5) && (pin < 32)) + ? GET_PIN_MAP_INDEX(port << 5 | pin) : -2; + return ind > -2 ? ind : dval; } #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL.h b/Marlin/src/HAL/HAL_LPC1768/HAL.h index 1447b45d6e..db14170eac 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL.h +++ b/Marlin/src/HAL/HAL_LPC1768/HAL.h @@ -29,42 +29,27 @@ #define _HAL_LPC1768_H_ #define CPU_32_BIT +#define HAL_INIT -// -------------------------------------------------------------------------- -// Includes -// -------------------------------------------------------------------------- +void HAL_init(); #include #include - -#undef min -#undef max - #include -void _printf (const char *format, ...); -void _putc(uint8_t c); -uint8_t _getc(); - -extern "C" volatile uint32_t _millis; - -//arduino: Print.h -#define DEC 10 -#define HEX 16 -#define OCT 8 -#define BIN 2 -//arduino: binary.h (weird defines) -#define B01 1 -#define B10 2 +extern "C" volatile millis_t _millis; #include #include +#include #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" #include "fastio.h" +#include #include "watchdog.h" #include "HAL_timers.h" +#include "MarlinSerial.h" // // Default graphical display delays @@ -79,32 +64,20 @@ extern "C" volatile uint32_t _millis; #define ST7920_DELAY_3 DELAY_NS(750) #endif -// -// Arduino-style serial ports -// -#include "serial.h" -#include "HardwareSerial.h" - -extern HalSerial usb_serial; - #if !WITHIN(SERIAL_PORT, -1, 3) #error "SERIAL_PORT must be from -1 to 3" #endif #if SERIAL_PORT == -1 - #define MYSERIAL0 usb_serial + #define MYSERIAL0 UsbSerial #elif SERIAL_PORT == 0 - extern HardwareSerial Serial; - #define MYSERIAL0 Serial + #define MYSERIAL0 MSerial #elif SERIAL_PORT == 1 - extern HardwareSerial Serial1; - #define MYSERIAL0 Serial1 + #define MYSERIAL0 MSerial1 #elif SERIAL_PORT == 2 - extern HardwareSerial Serial2; - #define MYSERIAL0 Serial2 + #define MYSERIAL0 MSerial2 #elif SERIAL_PORT == 3 - #define MYSERIAL0 Serial3 - extern HardwareSerial Serial3; + #define MYSERIAL0 MSerial3 #endif #ifdef SERIAL_PORT_2 @@ -115,19 +88,15 @@ extern HalSerial usb_serial; #endif #define NUM_SERIAL 2 #if SERIAL_PORT_2 == -1 - #define MYSERIAL1 usb_serial + #define MYSERIAL1 UsbSerial #elif SERIAL_PORT_2 == 0 - extern HardwareSerial Serial; - #define MYSERIAL1 Serial + #define MYSERIAL1 MSerial #elif SERIAL_PORT_2 == 1 - extern HardwareSerial Serial1; - #define MYSERIAL1 Serial1 + #define MYSERIAL1 MSerial1 #elif SERIAL_PORT_2 == 2 - extern HardwareSerial Serial2; - #define MYSERIAL1 Serial2 + #define MYSERIAL1 MSerial2 #elif SERIAL_PORT_2 == 3 - extern HardwareSerial Serial3; - #define MYSERIAL1 Serial3 + #define MYSERIAL1 MSerial3 #endif #else #define NUM_SERIAL 1 @@ -159,17 +128,33 @@ void spiSend(uint32_t chan, const uint8_t* buf, size_t n); uint8_t spiRec(uint32_t chan); // -// ADC +// ADC API // -#define HAL_ANALOG_SELECT(pin) HAL_adc_enable_channel(pin) -#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin) -#define HAL_READ_ADC() HAL_adc_get_result() -#define HAL_ADC_READY() HAL_adc_finished() -void HAL_adc_init(void); -void HAL_adc_enable_channel(int pin); -void HAL_adc_start_conversion(const uint8_t adc_pin); -uint16_t HAL_adc_get_result(void); -bool HAL_adc_finished(void); +#define ADC_MEDIAN_FILTER_SIZE (23) // Higher values increase step delay (phase shift), + // (ADC_MEDIAN_FILTER_SIZE + 1) / 2 sample step delay (12 samples @ 500Hz: 24ms phase shift) + // Memory usage per ADC channel (bytes): (6 * ADC_MEDIAN_FILTER_SIZE) + 16 + // 8 * ((6 * 23) + 16 ) = 1232 Bytes for 8 channels + +#define ADC_LOWPASS_K_VALUE (6) // Higher values increase rise time + // Rise time sample delays for 100% signal convergence on full range step + // (1 : 13, 2 : 32, 3 : 67, 4 : 139, 5 : 281, 6 : 565, 7 : 1135, 8 : 2273) + // K = 6, 565 samples, 500Hz sample rate, 1.13s convergence on full range step + // Memory usage per ADC channel (bytes): 4 (32 Bytes for 8 channels) + +using FilteredADC = LPC176x::ADC; +#define HAL_adc_init() FilteredADC::init() +#define HAL_ANALOG_SELECT(pin) FilteredADC::enable_channel(pin) +#define HAL_START_ADC(pin) FilteredADC::start_conversion(pin) +#define HAL_READ_ADC() FilteredADC::get_result() +#define HAL_ADC_READY() FilteredADC::finished_conversion() + +// Parse a G-code word into a pin index +int16_t PARSED_PIN_INDEX(const char code, const int16_t dval); +// P0.6 thru P0.9 are for the onboard SD card +#define HAL_SENSITIVE_PINS P0_06, P0_07, P0_08, P0_09 + +#define HAL_IDLETASK 1 +void HAL_idletask(void); #endif // _HAL_LPC1768_H_ diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp b/Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp index c8fe029d39..2765bb553a 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/HAL_spi.cpp @@ -49,7 +49,6 @@ #ifdef TARGET_LPC1768 #include "../../inc/MarlinConfig.h" - // -------------------------------------------------------------------------- // Includes // -------------------------------------------------------------------------- @@ -59,7 +58,6 @@ // -------------------------------------------------------------------------- // Public functions // -------------------------------------------------------------------------- - #if ENABLED(LPC_SOFTWARE_SPI) #include "SoftwareSPI.h" @@ -127,8 +125,25 @@ #include #include - void spiBegin() { // setup SCK, MOSI & MISO pins for SSP0 + // decide which HW SPI device to use + #ifndef LPC_HW_SPI_DEV + #if (SCK_PIN == P0_07 && MISO_PIN == P0_08 && MOSI_PIN == P0_09) + #define LPC_HW_SPI_DEV 1 + #else + #if (SCK_PIN == P0_15 && MISO_PIN == P0_17 && MOSI_PIN == P0_18) + #define LPC_HW_SPI_DEV 0 + #else + #error "Invalid pins selected for hardware SPI" + #endif + #endif + #endif + #if (LPC_HW_SPI_DEV == 0) + #define LPC_SSPn LPC_SSP0 + #else + #define LPC_SSPn LPC_SSP1 + #endif + void spiBegin() { // setup SCK, MOSI & MISO pins for SSP0 PINSEL_CFG_Type PinCfg; // data structure to hold init values PinCfg.Funcnum = 2; PinCfg.OpenDrain = 0; @@ -147,10 +162,13 @@ PinCfg.Portnum = LPC1768_PIN_PORT(MOSI_PIN); PINSEL_ConfigPin(&PinCfg); SET_OUTPUT(MOSI_PIN); + // divide PCLK by 2 for SSP0 + CLKPWR_SetPCLKDiv(LPC_HW_SPI_DEV == 0 ? CLKPWR_PCLKSEL_SSP0 : CLKPWR_PCLKSEL_SSP1, CLKPWR_PCLKSEL_CCLK_DIV_2); + spiInit(0); + SSP_Cmd(LPC_SSPn, ENABLE); // start SSP running } void spiInit(uint8_t spiRate) { - SSP_Cmd(LPC_SSP0, DISABLE); // Disable SSP0 before changing rate // table to convert Marlin spiRates (0-5 plus default) into bit rates uint32_t Marlin_speed[7]; // CPSR is always 2 Marlin_speed[0] = 8333333; //(SCR: 2) desired: 8,000,000 actual: 8,333,333 +4.2% SPI_FULL_SPEED @@ -160,33 +178,32 @@ Marlin_speed[4] = 500000; //(SCR: 49) desired: 500,000 actual: 500,000 SPI_SPEED_5 Marlin_speed[5] = 250000; //(SCR: 99) desired: 250,000 actual: 250,000 SPI_SPEED_6 Marlin_speed[6] = 125000; //(SCR:199) desired: 125,000 actual: 125,000 Default from HAL.h - - // divide PCLK by 2 for SSP0 - CLKPWR_SetPCLKDiv(CLKPWR_PCLKSEL_SSP0, CLKPWR_PCLKSEL_CCLK_DIV_2); - // setup for SPI mode SSP_CFG_Type HW_SPI_init; // data structure to hold init values SSP_ConfigStructInit(&HW_SPI_init); // set values for SPI mode HW_SPI_init.ClockRate = Marlin_speed[MIN(spiRate, 6)]; // put in the specified bit rate - SSP_Init(LPC_SSP0, &HW_SPI_init); // puts the values into the proper bits in the SSP0 registers + HW_SPI_init.Mode |= SSP_CR1_SSP_EN; + SSP_Init(LPC_SSPn, &HW_SPI_init); // puts the values into the proper bits in the SSP0 registers + } - SSP_Cmd(LPC_SSP0, ENABLE); // start SSP0 running + + static uint8_t doio(uint8_t b) { + /* send and receive a single byte */ + SSP_SendData(LPC_SSPn, b & 0x00FF); + while (SSP_GetStatus(LPC_SSPn, SSP_STAT_BUSY)); // wait for it to finish + return SSP_ReceiveData(LPC_SSPn) & 0x00FF; } void spiSend(uint8_t b) { - while (!SSP_GetStatus(LPC_SSP0, SSP_STAT_TXFIFO_NOTFULL)); // wait for room in the buffer - SSP_SendData(LPC_SSP0, b & 0x00FF); - while (SSP_GetStatus(LPC_SSP0, SSP_STAT_BUSY)); // wait for it to finish + doio(b); } void spiSend(const uint8_t* buf, size_t n) { if (n == 0) return; for (uint16_t i = 0; i < n; i++) { - while (!SSP_GetStatus(LPC_SSP0, SSP_STAT_TXFIFO_NOTFULL)); // wait for room in the buffer - SSP_SendData(LPC_SSP0, buf[i] & 0x00FF); + doio(buf[i]); } - while (SSP_GetStatus(LPC_SSP0, SSP_STAT_BUSY)); // wait for it to finish } void spiSend(uint32_t chan, byte b) { @@ -195,17 +212,9 @@ void spiSend(uint32_t chan, const uint8_t* buf, size_t n) { } - static uint8_t get_one_byte() { - // send a dummy byte so can clock in receive data - SSP_SendData(LPC_SSP0,0x00FF); - while (SSP_GetStatus(LPC_SSP0, SSP_STAT_BUSY)); // wait for it to finish - return SSP_ReceiveData(LPC_SSP0) & 0x00FF; - } - // Read single byte from SPI uint8_t spiRec() { - while (SSP_GetStatus(LPC_SSP0, SSP_STAT_RXFIFO_NOTEMPTY) || SSP_GetStatus(LPC_SSP0, SSP_STAT_BUSY)) SSP_ReceiveData(LPC_SSP0); //flush the receive buffer - return get_one_byte(); + return doio(0xff); } uint8_t spiRec(uint32_t chan) { @@ -214,22 +223,25 @@ // Read from SPI into buffer void spiRead(uint8_t*buf, uint16_t nbyte) { - while (SSP_GetStatus(LPC_SSP0, SSP_STAT_RXFIFO_NOTEMPTY) || SSP_GetStatus(LPC_SSP0, SSP_STAT_BUSY)) SSP_ReceiveData(LPC_SSP0); //flush the receive buffer if (nbyte == 0) return; for (int i = 0; i < nbyte; i++) { - buf[i] = get_one_byte(); + buf[i] = doio(0xff); } } static uint8_t spiTransfer(uint8_t b) { - while (SSP_GetStatus(LPC_SSP0, SSP_STAT_RXFIFO_NOTEMPTY) || SSP_GetStatus(LPC_SSP0, SSP_STAT_BUSY)) SSP_ReceiveData(LPC_SSP0); //flush the receive buffer - SSP_SendData(LPC_SSP0, b); // send the byte - while (SSP_GetStatus(LPC_SSP0, SSP_STAT_BUSY)); // wait for it to finish - return SSP_ReceiveData(LPC_SSP0) & 0x00FF; + return doio(b); } // Write from buffer to SPI void spiSendBlock(uint8_t token, const uint8_t* buf) { + uint8_t response; + response = spiTransfer(token); + + for (uint16_t i = 0; i < 512; i++) { + response = spiTransfer(buf[i]); + } + UNUSED(response); } /** Begin SPI transaction, set clock, bit order, data mode */ @@ -270,4 +282,3 @@ uint16_t SPIClass::transfer16(uint16_t data) { SPIClass SPI; #endif // TARGET_LPC1768 - diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL_temp.h b/Marlin/src/HAL/HAL_LPC1768/HAL_temp.h deleted file mode 100644 index 20d2cf8d05..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/HAL_temp.h +++ /dev/null @@ -1 +0,0 @@ -// blank file needed until I get platformio to update it's copy of U8Glib-HAL \ No newline at end of file diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL_timers.h b/Marlin/src/HAL/HAL_LPC1768/HAL_timers.h index 4257028fc6..d818589104 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL_timers.h +++ b/Marlin/src/HAL/HAL_LPC1768/HAL_timers.h @@ -20,9 +20,8 @@ */ /** - * HAL for Arduino Due and compatible (SAM3X8E) * - * For ARDUINO_ARCH_SAM + * HAL For LPC1768 */ #ifndef _HAL_TIMERS_H diff --git a/Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.cpp b/Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.cpp deleted file mode 100644 index b27d8e1f31..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.cpp +++ /dev/null @@ -1,576 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * The class Servo uses the PWM class to implement its functions - * - * All PWMs use the same repetition rate - 20mS because that's the normal servo rate - */ - -/** - * This is a hybrid system. - * - * The PWM1 module is used to directly control the Servo 0, 1 & 3 pins and D9 & D10 pins. This keeps - * the pulse width jitter to under a microsecond. - * - * For all other pins a timer is used to generate interrupts. The ISR - * routine does the actual setting/clearing of pins. The upside is that any pin can - * have a PWM channel assigned to it. The downside is that there is more pulse width - * jitter. The jitter depends on what else is happening in the system and what ISRs - * pre-empt the PWM ISR. - */ - -/** - * The data structures are set up to minimize the computation done by the ISR which - * minimizes ISR execution time. Execution times are 5-14µs depending on how full the - * ISR table is. 14uS is for a 20 element ISR table. - * - * Two tables are used. One table contains the data used by the ISR to update/control - * the PWM pins. The other is used as an aid when updating the ISR table. - * - * See the end of this file for details on the hardware/firmware interaction - */ - -/** - * Directly controlled PWM pins ( - * NA means not being used as a directly controlled PWM pin - * - * Re-ARM MKS Sbase - * PWM1.1 P1_18 SERVO3_PIN NA(no connection) - * PWM1.1 P2_00 NA(E0_STEP_PIN) NA(X stepper) - * PWM1.2 P1_20 SERVO0_PIN NA(no connection) - * PWM1.2 P2_01 NA(X_STEP_PIN) NA(Y stepper) - * PWM1.3 P1_21 SERVO1_PIN NA(no connection) - * PWM1.3 P2_02 NA(Y_STEP_PIN) NA(Z stepper) - * PWM1.4 P1_23 NA(SDSS(SSEL0)) SERVO0_PIN - * PWM1.4 P2_03 NA(Z_STEP_PIN) NA(E0 stepper) - * PWM1.5 P1_24 NA(X_MIN_PIN) NA(X_MIN_pin) - * PWM1.5 P2_04 RAMPS_D9_PIN FAN_PIN - * PWM1.6 P1_26 NA(Y_MIN_PIN) NA(Y_MIN_pin) - * PWM1.6 P2_05 RAMPS_D10_PIN HEATER_BED_PIN - */ - -#ifdef TARGET_LPC1768 - -#include "../../inc/MarlinConfig.h" -#include -#include "LPC1768_PWM.h" -#include - -#define NUM_ISR_PWMS 20 - -#define HAL_PWM_TIMER LPC_TIM3 -#define HAL_PWM_TIMER_ISR extern "C" void TIMER3_IRQHandler(void) -#define HAL_PWM_TIMER_IRQn TIMER3_IRQn - -#define LPC_PORT_OFFSET (0x0020) -#define LPC_PIN(pin) (1UL << pin) -#define LPC_GPIO(port) ((volatile LPC_GPIO_TypeDef *)(LPC_GPIO0_BASE + LPC_PORT_OFFSET * port)) - -typedef struct { // holds all data needed to control/init one of the PWM channels - bool active_flag; // THIS TABLE ENTRY IS ACTIVELY TOGGLING A PIN - pin_t pin; - volatile uint32_t* set_register; - volatile uint32_t* clr_register; - uint32_t write_mask; // USED BY SET/CLEAR COMMANDS - uint32_t microseconds; // value written to MR register - uint32_t min; // lower value limit checked by WRITE routine before writing to the MR register - uint32_t max; // upper value limit checked by WRITE routine before writing to the MR register - uint8_t servo_index; // 0 - MAX_SERVO -1 : servo index, 0xFF : PWM channel -} PWM_map; - -PWM_map PWM1_map_A[NUM_ISR_PWMS]; // compiler will initialize to all zeros -PWM_map PWM1_map_B[NUM_ISR_PWMS]; // compiler will initialize to all zeros - -PWM_map *active_table = PWM1_map_A; -PWM_map *work_table = PWM1_map_B; -PWM_map *temp_table; - -#define P1_18_PWM_channel 1 // servo 3 -#define P1_20_PWM_channel 2 // servo 0 -#define P1_21_PWM_channel 3 // servo 1 -#define P1_23_PWM_channel 4 // servo 0 for MKS Sbase -#define P2_04_PWM_channel 5 // D9 -#define P2_05_PWM_channel 6 // D10 - -typedef struct { - uint32_t min; - uint32_t max; - bool assigned; -} table_direct; - -table_direct direct_table[6]; // compiler will initialize to all zeros - -/** - * Prescale register and MR0 register values - * - * 100MHz PCLK 50MHz PCLK 25MHz PCLK 12.5MHz PCLK - * ----------------- ----------------- ----------------- ----------------- - * desired prescale MR0 prescale MR0 prescale MR0 prescale MR0 resolution - * prescale register register register register register register register register in degrees - * freq value value value value value value value value - * - * 8 11.5 159,999 5.25 159,999 2.13 159,999 0.5625 159,999 0.023 - * 4 24 79,999 11.5 79,999 5.25 79,999 2.125 79,999 0.045 - * 2 49 39,999 24 39,999 11.5 39,999 5.25 39,999 0.090 - * 1 99 19,999 49 19,999 24 19,999 11.5 19,999 0.180 - * 0.5 199 9,999 99 9,999 49 9,999 24 9,999 0.360 - * 0.25 399 4,999 199 4,999 99 4,999 49 4,999 0.720 - * 0.125 799 2,499 399 2,499 199 2,499 99 2,499 1.440 - * - * The desired prescale frequency column comes from an input in the range of 544 - 2400 microseconds - * and the desire to just shift the input left or right as needed. - * - * A resolution of 0.2 degrees seems reasonable so a prescale frequency output of 1MHz is being used. - * It also means we don't need to scale the input. - * - * The PCLK is set to 25MHz because that's the slowest one that gives whole numbers for prescale and - * MR0 registers. - * - * Final settings: - * PCLKSEL0: 0x0 - * PWM1PR: 0x018 (24) - * PWM1MR0: 0x04E1F (19,999) - * - */ - -void LPC1768_PWM_init(void) { - - ///// directly controlled PWM pins (interrupts not used for these) - - #define SBIT_CNTEN 0 // PWM1 counter & pre-scaler enable/disable - #define SBIT_CNTRST 1 // reset counters to known state - #define SBIT_PWMEN 3 // 1 - PWM, 0 - timer - #define SBIT_PWMMR0R 1 - #define PCPWM1 6 - #define PCLK_PWM1 12 - - SBI(LPC_SC->PCONP, PCPWM1); // Enable PWM1 controller (enabled on power up) - LPC_SC->PCLKSEL0 &= ~(0x3 << PCLK_PWM1); - LPC_SC->PCLKSEL0 |= (LPC_PWM1_PCLKSEL0 << PCLK_PWM1); - - uint32_t PR = (CLKPWR_GetPCLK(CLKPWR_PCLKSEL_PWM1) / 1000000) - 1; // Prescalar to create 1 MHz output - - LPC_PWM1->MR0 = LPC_PWM1_MR0; // TC resets every 19,999 + 1 cycles - sets PWM cycle(Ton+Toff) to 20 mS - // MR0 must be set before TCR enables the PWM - LPC_PWM1->TCR = _BV(SBIT_CNTEN) | _BV(SBIT_CNTRST) | _BV(SBIT_PWMEN); // Enable counters, reset counters, set mode to PWM - CBI(LPC_PWM1->TCR, SBIT_CNTRST); // Take counters out of reset - LPC_PWM1->PR = PR; - LPC_PWM1->MCR = _BV(SBIT_PWMMR0R) | _BV(0); // Reset TC if it matches MR0, disable all interrupts except for MR0 - LPC_PWM1->CTCR = 0; // Disable counter mode (enable PWM mode) - LPC_PWM1->LER = 0x07F; // Set the latch Enable Bits to load the new Match Values for MR0 - MR6 - LPC_PWM1->PCR = 0; // Single edge mode for all channels, PWM1 control of outputs off - - //// interrupt controlled PWM setup - - LPC_SC->PCONP |= 1 << 23; // power on timer3 - HAL_PWM_TIMER->PR = PR; - HAL_PWM_TIMER->MCR = 0x0B; // Interrupt on MR0 & MR1, reset on MR0 - HAL_PWM_TIMER->MR0 = LPC_PWM1_MR0; - HAL_PWM_TIMER->MR1 = 0; - HAL_PWM_TIMER->TCR = _BV(0); // enable - NVIC_EnableIRQ(HAL_PWM_TIMER_IRQn); - NVIC_SetPriority(HAL_PWM_TIMER_IRQn, NVIC_EncodePriority(0, 4, 0)); -} - - -bool ISR_table_update = false; // flag to tell the ISR that the tables need to be updated & swapped -uint8_t ISR_index = 0; // index used by ISR to skip already actioned entries -#define COPY_ACTIVE_TABLE for (uint8_t i = 0; i < NUM_ISR_PWMS ; i++) work_table[i] = active_table[i] -uint32_t first_MR1_value = LPC_PWM1_MR0 + 1; - -void LPC1768_PWM_sort(void) { - - for (uint8_t i = NUM_ISR_PWMS; --i;) { // (bubble) sort table by microseconds - bool didSwap = false; - PWM_map temp; - for (uint16_t j = 0; j < i; ++j) { - if (work_table[j].microseconds > work_table[j + 1].microseconds) { - temp = work_table[j + 1]; - work_table[j + 1] = work_table[j]; - work_table[j] = temp; - didSwap = true; - } - } - if (!didSwap) break; - } -} - -bool LPC1768_PWM_attach_pin(pin_t pin, uint32_t min /* = 1 */, uint32_t max /* = (LPC_PWM1_MR0 - 1) */, uint8_t servo_index /* = 0xFF */) { - - pin = GET_PIN_MAP_PIN(GET_PIN_MAP_INDEX(pin & 0xFF)); // Sometimes the upper byte is garbled - -//// direct control PWM code - switch (pin) { - case P1_23: // MKS Sbase Servo 0, PWM1 channel 4 (J3-8 PWM1.4) - direct_table[P1_23_PWM_channel - 1].min = min; - direct_table[P1_23_PWM_channel - 1].max = MIN(max, LPC_PWM1_MR0 - MR0_MARGIN); - direct_table[P1_23_PWM_channel - 1].assigned = true; - return true; - case P1_20: // Servo 0, PWM1 channel 2 (Pin 11 P1.20 PWM1.2) - direct_table[P1_20_PWM_channel - 1].min = min; - direct_table[P1_20_PWM_channel - 1].max = MIN(max, LPC_PWM1_MR0 - MR0_MARGIN); - direct_table[P1_20_PWM_channel - 1].assigned = true; - return true; - case P1_21: // Servo 1, PWM1 channel 3 (Pin 6 P1.21 PWM1.3) - direct_table[P1_21_PWM_channel - 1].min = min; - direct_table[P1_21_PWM_channel - 1].max = MIN(max, LPC_PWM1_MR0 - MR0_MARGIN); - direct_table[P1_21_PWM_channel - 1].assigned = true; - return true; - case P1_18: // Servo 3, PWM1 channel 1 (Pin 4 P1.18 PWM1.1) - direct_table[P1_18_PWM_channel - 1].min = min; - direct_table[P1_18_PWM_channel - 1].max = MIN(max, LPC_PWM1_MR0 - MR0_MARGIN); - direct_table[P1_18_PWM_channel - 1].assigned = true; - return true; - case P2_04: // D9 FET, PWM1 channel 5 (Pin 9 P2_04 PWM1.5) - direct_table[P2_04_PWM_channel - 1].min = min; - direct_table[P2_04_PWM_channel - 1].max = MIN(max, LPC_PWM1_MR0 - MR0_MARGIN); - direct_table[P2_04_PWM_channel - 1].assigned = true; - return true; - case P2_05: // D10 FET, PWM1 channel 6 (Pin 10 P2_05 PWM1.6) - direct_table[P2_05_PWM_channel - 1].min = min; - direct_table[P2_05_PWM_channel - 1].max = MIN(max, LPC_PWM1_MR0 - MR0_MARGIN); - direct_table[P2_05_PWM_channel - 1].assigned = true; - return true; - } - -//// interrupt controlled PWM code - NVIC_DisableIRQ(HAL_PWM_TIMER_IRQn); // make it safe to update the active table - // OK to update the active table because the - // ISR doesn't use any of the changed items - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); - - if (ISR_table_update) //use work table if that's the newest - temp_table = work_table; - else - temp_table = active_table; - - uint8_t slot = 0; - for (uint8_t i = 0; i < NUM_ISR_PWMS; i++) // see if already in table - if (temp_table[i].pin == pin) { - NVIC_EnableIRQ(HAL_PWM_TIMER_IRQn); // re-enable PWM interrupts - return 1; - } - - for (uint8_t i = 1; (i < NUM_ISR_PWMS + 1) && !slot; i++) // find empty slot - if ( !(temp_table[i - 1].set_register)) { slot = i; break; } // any item that can't be zero when active or just attached is OK - - if (!slot) { - NVIC_EnableIRQ(HAL_PWM_TIMER_IRQn); // re-enable PWM interrupts - return 0; - } - - slot--; // turn it into array index - - temp_table[slot].pin = pin; // init slot - temp_table[slot].set_register = &LPC_GPIO(LPC1768_PIN_PORT(pin))->FIOSET; - temp_table[slot].clr_register = &LPC_GPIO(LPC1768_PIN_PORT(pin))->FIOCLR; - temp_table[slot].write_mask = LPC_PIN(LPC1768_PIN_PIN(pin)); - temp_table[slot].min = min; - temp_table[slot].max = max; // different max for ISR PWMs than for direct PWMs - temp_table[slot].servo_index = servo_index; - temp_table[slot].active_flag = false; - - NVIC_EnableIRQ(HAL_PWM_TIMER_IRQn); // re-enable PWM interrupts - - return 1; -} - - -bool LPC1768_PWM_detach_pin(pin_t pin) { - - pin = GET_PIN_MAP_PIN(GET_PIN_MAP_INDEX(pin & 0xFF)); - -//// direct control PWM code - switch (pin) { - case P1_23: // MKS Sbase Servo 0, PWM1 channel 4 (J3-8 PWM1.4) - if (!direct_table[P1_23_PWM_channel - 1].assigned) return false; - CBI(LPC_PWM1->PCR, 8 + P1_23_PWM_channel); // disable PWM1 module control of this pin - LPC_PINCON->PINSEL3 &= ~(0x3 << 14); // return pin to general purpose I/O - direct_table[P1_23_PWM_channel - 1].assigned = false; - return true; - case P1_20: // Servo 0, PWM1 channel 2 (Pin 11 P1.20 PWM1.2) - if (!direct_table[P1_20_PWM_channel - 1].assigned) return false; - CBI(LPC_PWM1->PCR, 8 + P1_20_PWM_channel); // disable PWM1 module control of this pin - LPC_PINCON->PINSEL3 &= ~(0x3 << 8); // return pin to general purpose I/O - direct_table[P1_20_PWM_channel - 1].assigned = false; - return true; - case P1_21: // Servo 1, PWM1 channel 3 (Pin 6 P1.21 PWM1.3) - if (!direct_table[P1_21_PWM_channel - 1].assigned) return false; - CBI(LPC_PWM1->PCR, 8 + P1_21_PWM_channel); // disable PWM1 module control of this pin - LPC_PINCON->PINSEL3 &= ~(0x3 << 10); // return pin to general purpose I/O - direct_table[P1_21_PWM_channel - 1].assigned = false; - return true; - case P1_18: // Servo 3, PWM1 channel 1 (Pin 4 P1.18 PWM1.1) - if (!direct_table[P1_18_PWM_channel - 1].assigned) return false; - CBI(LPC_PWM1->PCR, 8 + P1_18_PWM_channel); // disable PWM1 module control of this pin - LPC_PINCON->PINSEL3 &= ~(0x3 << 4); // return pin to general purpose I/O - direct_table[P1_18_PWM_channel - 1].assigned = false; - return true; - case P2_04: // D9 FET, PWM1 channel 5 (Pin 9 P2_04 PWM1.5) - if (!direct_table[P2_04_PWM_channel - 1].assigned) return false; - CBI(LPC_PWM1->PCR, 8 + P2_04_PWM_channel); // disable PWM1 module control of this pin - LPC_PINCON->PINSEL4 &= ~(0x3 << 10); // return pin to general purpose I/O - direct_table[P2_04_PWM_channel - 1].assigned = false; - return true; - case P2_05: // D10 FET, PWM1 channel 6 (Pin 10 P2_05 PWM1.6) - if (!direct_table[P2_05_PWM_channel - 1].assigned) return false; - CBI(LPC_PWM1->PCR, 8 + P2_05_PWM_channel); // disable PWM1 module control of this pin - LPC_PINCON->PINSEL4 &= ~(0x3 << 4); // return pin to general purpose I/O - direct_table[P2_05_PWM_channel - 1].assigned = false; - return true; - } - -//// interrupt controlled PWM code - NVIC_DisableIRQ(HAL_PWM_TIMER_IRQn); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); - - if (ISR_table_update) { - ISR_table_update = false; // don't update yet - have another update to do - NVIC_EnableIRQ(HAL_PWM_TIMER_IRQn); // re-enable PWM interrupts - } - else { - NVIC_EnableIRQ(HAL_PWM_TIMER_IRQn); // re-enable PWM interrupts - COPY_ACTIVE_TABLE; // copy active table into work table - } - - uint8_t slot = 0xFF; - for (uint8_t i = 0; i < NUM_ISR_PWMS; i++) { // find slot - if (work_table[i].pin == pin) { - slot = i; - break; - } - } - if (slot == 0xFF) // return error if pin not found - return false; - - work_table[slot] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; - - LPC1768_PWM_sort(); // sort table by microseconds - ISR_table_update = true; - return true; -} - -// value is 0-20,000 microseconds (0% to 100% duty cycle) -// servo routine provides values in the 544 - 2400 range -bool LPC1768_PWM_write(pin_t pin, uint32_t value) { - - pin = GET_PIN_MAP_PIN(GET_PIN_MAP_INDEX(pin & 0xFF)); - -//// direct control PWM code - switch (pin) { - case P1_23: // MKS Sbase Servo 0, PWM1 channel 4 (J3-8 PWM1.4) - if (!direct_table[P1_23_PWM_channel - 1].assigned) return false; - LPC_PWM1->PCR |= _BV(8 + P1_23_PWM_channel); // enable PWM1 module control of this pin - LPC_PINCON->PINSEL3 = 0x2 << 14; // must set pin function AFTER setting PCR - // load the new time value - LPC_PWM1->MR4 = MAX(MIN(value, direct_table[P1_23_PWM_channel - 1].max), direct_table[P1_23_PWM_channel - 1].min); - LPC_PWM1->LER = 0x1 << P1_23_PWM_channel; // Set the latch Enable Bit to load the new Match Value on the next MR0 - return true; - case P1_20: // Servo 0, PWM1 channel 2 (Pin 11 P1.20 PWM1.2) - if (!direct_table[P1_20_PWM_channel - 1].assigned) return false; - LPC_PWM1->PCR |= _BV(8 + P1_20_PWM_channel); // enable PWM1 module control of this pin - LPC_PINCON->PINSEL3 |= 0x2 << 8; // must set pin function AFTER setting PCR - // load the new time value - LPC_PWM1->MR2 = MAX(MIN(value, direct_table[P1_20_PWM_channel - 1].max), direct_table[P1_20_PWM_channel - 1].min); - LPC_PWM1->LER = 0x1 << P1_20_PWM_channel; // Set the latch Enable Bit to load the new Match Value on the next MR0 - return true; - case P1_21: // Servo 1, PWM1 channel 3 (Pin 6 P1.21 PWM1.3) - if (!direct_table[P1_21_PWM_channel - 1].assigned) return false; - LPC_PWM1->PCR |= _BV(8 + P1_21_PWM_channel); // enable PWM1 module control of this pin - LPC_PINCON->PINSEL3 |= 0x2 << 10; // must set pin function AFTER setting PCR - // load the new time value - LPC_PWM1->MR3 = MAX(MIN(value, direct_table[P1_21_PWM_channel - 1].max), direct_table[P1_21_PWM_channel - 1].min); - LPC_PWM1->LER = 0x1 << P1_21_PWM_channel; // Set the latch Enable Bit to load the new Match Value on the next MR0 - return true; - case P1_18: // Servo 3, PWM1 channel 1 (Pin 4 P1.18 PWM1.1) - if (!direct_table[P1_18_PWM_channel - 1].assigned) return false; - LPC_PWM1->PCR |= _BV(8 + P1_18_PWM_channel); // enable PWM1 module control of this pin - LPC_PINCON->PINSEL3 |= 0x2 << 4; // must set pin function AFTER setting PCR - // load the new time value - LPC_PWM1->MR1 = MAX(MIN(value, direct_table[P1_18_PWM_channel - 1].max), direct_table[P1_18_PWM_channel - 1].min); - LPC_PWM1->LER = 0x1 << P1_18_PWM_channel; // Set the latch Enable Bit to load the new Match Value on the next MR0 - return true; - case P2_04: // D9 FET, PWM1 channel 5 (Pin 9 P2_04 PWM1.5) - if (!direct_table[P2_04_PWM_channel - 1].assigned) return false; - LPC_PWM1->PCR |= _BV(8 + P2_04_PWM_channel); // enable PWM1 module control of this pin - LPC_PINCON->PINSEL4 |= 0x1 << 8; // must set pin function AFTER setting PCR - // load the new time value - LPC_PWM1->MR5 = MAX(MIN(value, direct_table[P2_04_PWM_channel - 1].max), direct_table[P2_04_PWM_channel - 1].min); - LPC_PWM1->LER = 0x1 << P2_04_PWM_channel; // Set the latch Enable Bit to load the new Match Value on the next MR0 - return true; - case P2_05: // D10 FET, PWM1 channel 6 (Pin 10 P2_05 PWM1.6) - if (!direct_table[P2_05_PWM_channel - 1].assigned) return false; - LPC_PWM1->PCR |= _BV(8 + P2_05_PWM_channel); // enable PWM1 module control of this pin - LPC_PINCON->PINSEL4 |= 0x1 << 10; // must set pin function AFTER setting PCR - // load the new time value - LPC_PWM1->MR6 = MAX(MIN(value, direct_table[P2_05_PWM_channel - 1].max), direct_table[P2_05_PWM_channel - 1].min); - LPC_PWM1->LER = 0x1 << P2_05_PWM_channel; // Set the latch Enable Bit to load the new Match Value on the next MR0 - return true; - } - -//// interrupt controlled PWM code - NVIC_DisableIRQ(HAL_PWM_TIMER_IRQn); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); - - if (!ISR_table_update) // use the most up to date table - COPY_ACTIVE_TABLE; // copy active table into work table - - uint8_t slot = 0xFF; - for (uint8_t i = 0; i < NUM_ISR_PWMS; i++) // find slot - if (work_table[i].pin == pin) { slot = i; break; } - if (slot == 0xFF) { // return error if pin not found - NVIC_EnableIRQ(HAL_PWM_TIMER_IRQn); - return false; - } - - work_table[slot].microseconds = MAX(MIN(value, work_table[slot].max), work_table[slot].min);; - work_table[slot].active_flag = true; - - LPC1768_PWM_sort(); // sort table by microseconds - ISR_table_update = true; - - NVIC_EnableIRQ(HAL_PWM_TIMER_IRQn); // re-enable PWM interrupts - return 1; -} - - -bool useable_hardware_PWM(pin_t pin) { - - pin = GET_PIN_MAP_PIN(GET_PIN_MAP_INDEX(pin & 0xFF)); - - NVIC_DisableIRQ(HAL_PWM_TIMER_IRQn); - - // We NEED memory barriers to ensure Interrupts are actually disabled! - // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) - __DSB(); - __ISB(); - - bool return_flag = false; - for (uint8_t i = 0; i < NUM_ISR_PWMS; i++) // see if it's already setup - if (active_table[i].pin == pin) return_flag = true; - for (uint8_t i = 0; i < NUM_ISR_PWMS; i++) // see if there is an empty slot - if (!active_table[i].set_register) return_flag = true; - NVIC_EnableIRQ(HAL_PWM_TIMER_IRQn); // re-enable PWM interrupts - return return_flag; -} - - -//////////////////////////////////////////////////////////////////////////////// - - -#define PWM_LPC1768_ISR_SAFETY_FACTOR 5 // amount of time needed to guarantee MR1 count will be above TC -volatile bool in_PWM_isr = false; - -HAL_PWM_TIMER_ISR { - bool first_active_entry = true; - uint32_t next_MR1_val; - - if (in_PWM_isr) goto exit_PWM_ISR; // prevent re-entering this ISR - in_PWM_isr = true; - - if (HAL_PWM_TIMER->IR & 0x01) { // MR0 interrupt - next_MR1_val = first_MR1_value; // only used if have a blank ISR table - if (ISR_table_update) { // new values have been loaded so swap tables - temp_table = active_table; - active_table = work_table; - work_table = temp_table; - ISR_table_update = false; - } - } - HAL_PWM_TIMER->IR = 0x3F; // clear all interrupts - - for (uint8_t i = 0; i < NUM_ISR_PWMS; i++) { - if (active_table[i].active_flag) { - if (first_active_entry) { - first_active_entry = false; - next_MR1_val = active_table[i].microseconds; - } - if (HAL_PWM_TIMER->TC < active_table[i].microseconds) { - *active_table[i].set_register = active_table[i].write_mask; // set pin high - } - else { - *active_table[i].clr_register = active_table[i].write_mask; // set pin low - next_MR1_val = (i == NUM_ISR_PWMS -1) - ? LPC_PWM1_MR0 + 1 // done with table, wait for MR0 - : active_table[i + 1].microseconds; // set next MR1 interrupt? - } - } - } - if (first_active_entry) next_MR1_val = LPC_PWM1_MR0 + 1; // empty table so disable MR1 interrupt - HAL_PWM_TIMER->MR1 = MAX(next_MR1_val, HAL_PWM_TIMER->TC + PWM_LPC1768_ISR_SAFETY_FACTOR); // set next - in_PWM_isr = false; - - exit_PWM_ISR: - return; -} -#endif - - -///////////////////////////////////////////////////////////////// -///////////////// HARDWARE FIRMWARE INTERACTION //////////////// -///////////////////////////////////////////////////////////////// - -/** - * There are two distinct systems used for PWMs: - * directly controlled pins - * ISR controlled pins. - * - * The two systems are independent of each other. The use the same counter frequency so there's no - * translation needed when setting the time values. The init, attach, detach and write routines all - * start with the direct pin code which is followed by the ISR pin code. - * - * The PMW1 module handles the directly controlled pins. Each directly controlled pin is associated - * with a match register (MR1 - MR6). When the associated MR equals the module's TIMER/COUNTER (TC) - * then the pins is set to low. The MR0 register controls the repetition rate. When the TC equals - * MR0 then the TC is reset and ALL directly controlled pins are set high. The resulting pulse widths - * are almost immune to system loading and ISRs. No PWM1 interrupts are used. - * - * The ISR controlled pins use the TIMER/COUNTER, MR0 and MR1 registers from one timer. MR0 controls - * period of the controls the repetition rate. When the TC equals MR0 then the TC is reset and an - * interrupt is generated. When the TC equals MR1 then an interrupt is generated. - * - * Each interrupt does the following: - * 1) Swaps the tables if it's a MR0 interrupt and the swap flag is set. It then clears the swap flag. - * 2) Scans the entire ISR table (it's been sorted low to high time) - * a. If its the first active entry then it grabs the time as a tentative time for MR1 - * b. If active and TC is less than the time then it sets the pin high - * c. If active and TC is more than the time it sets the pin high - * d. On every entry that sets a pin low it grabs the NEXT entry's time for use as the next MR1. - * This results in MR1 being set to the time in the first active entry that does NOT set a - * pin low. - * e. If it's setting the last entry's pin low then it sets MR1 to a value bigger than MR0 - * f. If no value has been grabbed for the next MR1 then it's an empty table and MR1 is set to a - * value greater than MR0 - */ diff --git a/Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.h b/Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.h deleted file mode 100644 index 6c1a2480b8..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/LPC1768_PWM.h +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * The class Servo uses the PWM class to implement its functions - * - * All PWMs use the same repetition rate - 20mS because that's the normal servo rate - */ - -/** - * This is a hybrid system. - * - * The PWM1 module is used to directly control the Servo 0, 1 & 3 pins. This keeps - * the pulse width jitter to under a microsecond. - * - * For all other pins the PWM1 module is used to generate interrupts. The ISR - * routine does the actual setting/clearing of pins. The upside is that any pin can - * have a PWM channel assigned to it. The downside is that there is more pulse width - * jitter. The jitter depends on what else is happening in the system and what ISRs - * prempt the PWM ISR. Writing to the SD card can add 20 microseconds to the pulse - * width. - */ - -/** - * The data structures are setup to minimize the computation done by the ISR which - * minimizes ISR execution time. Execution times are 2.2 - 3.7 microseconds. - * - * Two tables are used. active_table is used by the ISR. Changes to the table are - * are done by copying the active_table into the work_table, updating the work_table - * and then swapping the two tables. Swapping is done by manipulating pointers. - * - * Immediately after the swap the ISR uses the work_table until the start of the - * next 20mS cycle. During this transition the "work_table" is actually the table - * that was being used before the swap. The "active_table" contains the data that - * will start being used at the start of the next 20mS period. This keeps the pins - * well behaved during the transition. - * - * The ISR's priority is set to the maximum otherwise other ISRs can cause considerable - * jitter in the PWM high time. - * - * See the end of this file for details on the hardware/firmware interaction - */ - -#ifndef _LPC1768_PWM_H_ -#define _LPC1768_PWM_H_ - -#include -#include - -#define LPC_PWM1_MR0 19999 // base repetition rate minus one count - 20mS -#define LPC_PWM1_PCLKSEL0 CLKPWR_PCLKSEL_CCLK_DIV_4 // select clock divider for prescaler - defaults to 4 on power up -#define MR0_MARGIN 200 // if channel value too close to MR0 the system locks up - -void LPC1768_PWM_init(void); -bool LPC1768_PWM_attach_pin(pin_t pin, uint32_t min=1, uint32_t max=(LPC_PWM1_MR0 - (MR0_MARGIN)), uint8_t servo_index=0xFF); -bool LPC1768_PWM_write(pin_t pin, uint32_t value); -bool LPC1768_PWM_detach_pin(pin_t pin); -bool useable_hardware_PWM(pin_t pin); - -#endif // _LPC1768_PWM_H_ diff --git a/Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.cpp b/Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.cpp deleted file mode 100644 index 4997c5e4bc..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/** - * 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 . - * - */ - -/** - * Based on servo.cpp - Interrupt driven Servo library for Arduino using 16 bit - * timers- Version 2 Copyright (c) 2009 Michael Margolis. All right reserved. - */ - -/** - * A servo is activated by creating an instance of the Servo class passing the desired pin to the attach() method. - * The servos are pulsed in the background using the value most recently written using the write() method - * - * Note that analogWrite of PWM on pins associated with the timer are disabled when the first servo is attached. - * Timers are seized as needed in groups of 12 servos - 24 servos use two timers, 48 servos will use four. - * - * The methods are: - * - * Servo - Class for manipulating servo motors connected to Arduino pins. - * - * attach(pin) - Attach a servo motor to an i/o pin. - * attach(pin, min, max) - Attach to a pin, setting min and max values in microseconds - * Default min is 544, max is 2400 - * - * write() - Set the servo angle in degrees. (Invalid angles —over MIN_PULSE_WIDTH— are treated as µs.) - * writeMicroseconds() - Set the servo pulse width in microseconds. - * move(pin, angle) - Sequence of attach(pin), write(angle), safe_delay(servo_delay[servoIndex]). - * With DEACTIVATE_SERVOS_AFTER_MOVE it detaches after servo_delay[servoIndex]. - * read() - Get the last-written servo pulse width as an angle between 0 and 180. - * readMicroseconds() - Get the last-written servo pulse width in microseconds. - * attached() - Return true if a servo is attached. - * detach() - Stop an attached servo from pulsing its i/o pin. - * - */ - -/** - * The only time that this library wants physical movement is when a WRITE - * command is issued. Before that all the attach & detach activity is solely - * within the data base. - * - * The PWM output is inactive until the first WRITE. After that it stays active - * unless DEACTIVATE_SERVOS_AFTER_MOVE is enabled and a MOVE command was issued. - */ - -#ifdef TARGET_LPC1768 - -#include "../../inc/MarlinConfig.h" - -#if HAS_SERVOS - - #include "LPC1768_PWM.h" - #include "LPC1768_Servo.h" - #include "servo_private.h" - - ServoInfo_t servo_info[MAX_SERVOS]; // static array of servo info structures - uint8_t ServoCount = 0; // the total number of attached servos - - #define US_TO_PULSE_WIDTH(p) p - #define PULSE_WIDTH_TO_US(p) p - #define TRIM_DURATION 0 - #define SERVO_MIN() MIN_PULSE_WIDTH // minimum value in uS for this servo - #define SERVO_MAX() MAX_PULSE_WIDTH // maximum value in uS for this servo - - Servo::Servo() { - if (ServoCount < MAX_SERVOS) { - this->servoIndex = ServoCount++; // assign a servo index to this instance - servo_info[this->servoIndex].pulse_width = US_TO_PULSE_WIDTH(DEFAULT_PULSE_WIDTH); // store default values - 12 Aug 2009 - } - else - this->servoIndex = INVALID_SERVO; // too many servos - } - - int8_t Servo::attach(const int pin) { - return this->attach(pin, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH); - } - - int8_t Servo::attach(const int pin, const int min, const int max) { - - if (this->servoIndex >= MAX_SERVOS) return -1; - - if (pin > 0) servo_info[this->servoIndex].Pin.nbr = pin; // only assign a pin value if the pin info is - // greater than zero. This way the init routine can - // assign the pin and the MOVE command only needs the value. - - this->min = MIN_PULSE_WIDTH; //resolution of min/max is 1 uS - this->max = MAX_PULSE_WIDTH; - - servo_info[this->servoIndex].Pin.isActive = true; - - return this->servoIndex; - } - - void Servo::detach() { - servo_info[this->servoIndex].Pin.isActive = false; - } - - void Servo::write(int value) { - if (value < MIN_PULSE_WIDTH) { // treat values less than 544 as angles in degrees (valid values in microseconds are handled as microseconds) - value = map(constrain(value, 0, 180), 0, 180, SERVO_MIN(), SERVO_MAX()); - // odd - this sets zero degrees to 544 and 180 degrees to 2400 microseconds but the literature says - // zero degrees should be 500 microseconds and 180 should be 2500 - } - this->writeMicroseconds(value); - } - - void Servo::writeMicroseconds(int value) { - // calculate and store the values for the given channel - byte channel = this->servoIndex; - if (channel < MAX_SERVOS) { // ensure channel is valid - // ensure pulse width is valid - value = constrain(value, SERVO_MIN(), SERVO_MAX()) - (TRIM_DURATION); - value = US_TO_PULSE_WIDTH(value); // convert to pulse_width after compensating for interrupt overhead - 12 Aug 2009 - - servo_info[channel].pulse_width = value; - LPC1768_PWM_attach_pin(servo_info[this->servoIndex].Pin.nbr, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH, this->servoIndex); - LPC1768_PWM_write(servo_info[this->servoIndex].Pin.nbr, value); - - } - } - - // return the value as degrees - int Servo::read() { return map(this->readMicroseconds() + 1, SERVO_MIN(), SERVO_MAX(), 0, 180); } - - int Servo::readMicroseconds() { - return (this->servoIndex == INVALID_SERVO) ? 0 : PULSE_WIDTH_TO_US(servo_info[this->servoIndex].pulse_width) + TRIM_DURATION; - } - - bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; } - - void Servo::move(const int value) { - constexpr uint16_t servo_delay[] = SERVO_DELAY; - static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); - if (this->attach(0) >= 0) { // notice the pin number is zero here - this->write(value); - safe_delay(servo_delay[this->servoIndex]); - #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) - this->detach(); - LPC1768_PWM_detach_pin(servo_info[this->servoIndex].Pin.nbr); // shut down the PWM signal - LPC1768_PWM_attach_pin(servo_info[this->servoIndex].Pin.nbr, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH, this->servoIndex); // make sure no one else steals the slot - #endif - } - } - -#endif // HAS_SERVOS -#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.h b/Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.h deleted file mode 100644 index f0d6f048a5..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/LPC1768_Servo.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2017 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 . - * - */ - -/** - * The class Servo uses the PWM class to implement its functions - * - * The PWM1 module is only used to generate interrups at specified times. It - * is NOT used to directly toggle pins. The ISR writes to the pin assigned to - * that interrupt - * - * All PWMs use the same repetition rate - 20mS because that's the normal servo rate - * - */ - -#ifndef LPC1768_SERVO_H -#define LPC1768_SERVO_H - -#include - - class Servo { - public: - Servo(); - int8_t attach(const int pin); // attach the given pin to the next free channel, set pinMode, return channel number (-1 on fail) - int8_t attach(const int pin, const int min, const int max); // as above but also sets min and max values for writes. - void detach(); - void write(int value); // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds - void writeMicroseconds(int value); // write pulse width in microseconds - void move(const int value); // attach the servo, then move to value - // if value is < 200 it is treated as an angle, otherwise as pulse width in microseconds - // if DEACTIVATE_SERVOS_AFTER_MOVE wait SERVO_DELAY, then detach - int read(); // returns current pulse width as an angle between 0 and 180 degrees - int readMicroseconds(); // returns current pulse width in microseconds for this servo (was read_us() in first release) - bool attached(); // return true if this servo is attached, otherwise false - - private: - uint8_t servoIndex; // index into the channel data for this servo - int min; - int max; - }; - - #define HAL_SERVO_LIB Servo - -#endif // LPC1768_SERVO_H diff --git a/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp b/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp new file mode 100644 index 0000000000..248e9007f1 --- /dev/null +++ b/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.cpp @@ -0,0 +1,56 @@ +/** + * 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 . + * + */ + +#ifdef TARGET_LPC1768 + +#include "../../inc/MarlinConfigPre.h" +#include "MarlinSerial.h" + +#if (defined(SERIAL_PORT) && SERIAL_PORT == 0) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 0) + MarlinSerial MSerial(LPC_UART0); + extern "C" void UART0_IRQHandler(void) { + MSerial.IRQHandler(); + } +#endif + +#if (defined(SERIAL_PORT) && SERIAL_PORT == 1) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 1) + MarlinSerial MSerial1((LPC_UART_TypeDef *) LPC_UART1); + extern "C" void UART1_IRQHandler(void) { + MSerial1.IRQHandler(); + } +#endif + +#if (defined(SERIAL_PORT) && SERIAL_PORT == 2) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 2) + MarlinSerial MSerial2(LPC_UART2); + extern "C" void UART2_IRQHandler(void) { + MSerial2.IRQHandler(); + } +#endif + +#if (defined(SERIAL_PORT) && SERIAL_PORT == 3) || (defined(SERIAL_PORT_2) && SERIAL_PORT_2 == 3) + MarlinSerial MSerial3(LPC_UART3); + extern "C" void UART3_IRQHandler(void) { + MSerial3.IRQHandler(); + } +#endif + +#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h b/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h new file mode 100644 index 0000000000..889b278e99 --- /dev/null +++ b/Marlin/src/HAL/HAL_LPC1768/MarlinSerial.h @@ -0,0 +1,71 @@ +/** + * 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 . + * + */ + +#ifndef MARLINSERIAL_H +#define MARLINSERIAL_H +#include +#include + +#include "../../inc/MarlinConfigPre.h" +#if ENABLED(EMERGENCY_PARSER) + #include "../../feature/emergency_parser.h" +#endif + +#ifndef SERIAL_PORT + #define SERIAL_PORT 0 +#endif + +#ifndef RX_BUFFER_SIZE + #define RX_BUFFER_SIZE 128 +#endif +#ifndef TX_BUFFER_SIZE + #define TX_BUFFER_SIZE 32 +#endif + +class MarlinSerial : public HardwareSerial { +public: + MarlinSerial(LPC_UART_TypeDef *UARTx) : + HardwareSerial(UARTx) + #if ENABLED(EMERGENCY_PARSER) + , emergency_state(EmergencyParser::State::EP_RESET) + #endif + { + } + + #if ENABLED(EMERGENCY_PARSER) + bool recv_callback(const char c) override { + emergency_parser.update(emergency_state, c); + return true; // do not discard character + } + #endif + + #if ENABLED(EMERGENCY_PARSER) + EmergencyParser::State emergency_state; + #endif +}; + +extern MarlinSerial MSerial; +extern MarlinSerial MSerial1; +extern MarlinSerial MSerial2; +extern MarlinSerial MSerial3; + +#endif // MARLINSERIAL_H diff --git a/Marlin/src/HAL/HAL_LPC1768/servo_private.h b/Marlin/src/HAL/HAL_LPC1768/MarlinServo.h similarity index 69% rename from Marlin/src/HAL/HAL_LPC1768/servo_private.h rename to Marlin/src/HAL/HAL_LPC1768/MarlinServo.h index 451c487d73..6a6fae1fb7 100644 --- a/Marlin/src/HAL/HAL_LPC1768/servo_private.h +++ b/Marlin/src/HAL/HAL_LPC1768/MarlinServo.h @@ -50,35 +50,25 @@ #ifndef SERVO_PRIVATE_H #define SERVO_PRIVATE_H -#include +#include -// Macros -//values in microseconds -#define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo -#define MAX_PULSE_WIDTH 2400 // the longest pulse sent to a servo -#define DEFAULT_PULSE_WIDTH 1500 // default pulse width when servo is attached -#define REFRESH_INTERVAL 20000 // minimum time to refresh servos in microseconds +class MarlinServo: public Servo { + public: + void move(const int value) { + constexpr uint16_t servo_delay[] = SERVO_DELAY; + static_assert(COUNT(servo_delay) == NUM_SERVOS, "SERVO_DELAY must be an array NUM_SERVOS long."); -#define MAX_SERVOS 4 + if (this->attach(servo_info[this->servoIndex].Pin.nbr) >= 0) { // try to reattach + this->write(value); + safe_delay(servo_delay[this->servoIndex]); // delay to allow servo to reach position + #if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE) + this->detach(); + #endif + } -#define INVALID_SERVO 255 // flag indicating an invalid servo index + } +}; - -// Types - -typedef struct { - uint8_t nbr : 8 ; // a pin number from 0 to 254 (255 signals invalid pin) - uint8_t isActive : 1 ; // true if this channel is enabled, pin not pulsed if false -} ServoPin_t; - -typedef struct { - ServoPin_t Pin; - unsigned int pulse_width; // pulse width in microseconds -} ServoInfo_t; - -// Global variables - -extern uint8_t ServoCount; -extern ServoInfo_t servo_info[MAX_SERVOS]; +#define HAL_SERVO_LIB MarlinServo #endif // SERVO_PRIVATE_H diff --git a/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h b/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h index 16299696a1..f18efe60ec 100644 --- a/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h +++ b/Marlin/src/HAL/HAL_LPC1768/SanityCheck.h @@ -74,3 +74,11 @@ || MB(RAMPS_14_RE_ARM_SF)) #error "Re-ARM with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and TMC2130 require TMC_USE_SW_SPI" #endif + +#if 1 < (ENABLED(LPC_SD_CUSTOM_CABLE) + ENABLED(LPC_SD_LCD) + ENABLED(LPC_SD_ONBOARD)) + #error "Enable only one of LPC_SD_CUSTOM_CABLE, LPC_SD_LCD, or LPC_SD_ONBOARD." +#endif + +#if 1 < (ENABLED(USB_SD_DISABLED) + ENABLED(USB_SD_ONBOARD)) + #error "Enable only one of USB_SD_DISABLED or USB_SD_ONBOARD." +#endif diff --git a/Marlin/src/HAL/HAL_LPC1768/SoftwareSPI.cpp b/Marlin/src/HAL/HAL_LPC1768/SoftwareSPI.cpp deleted file mode 100644 index 546a1d50f1..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/SoftwareSPI.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (C) 2016, 2017 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 . - * - */ - -/** - * Software SPI functions originally from Arduino Sd2Card Library - * Copyright (C) 2009 by William Greiman - */ - -/** - * For TARGET_LPC1768 - */ - -#ifdef TARGET_LPC1768 - -#include "../../inc/MarlinConfig.h" - -// -------------------------------------------------------------------------- -// Software SPI -// -------------------------------------------------------------------------- - -/** - * This software SPI runs at multiple rates. The SD software provides an index - * (spiRate) of 0-6. The mapping is: - * 0 - about 5 MHz peak (6 MHz on LPC1769) - * 1-2 - about 2 MHz peak - * 3 - about 1 MHz peak - * 4 - about 500 kHz peak - * 5 - about 250 kHz peak - * 6 - about 125 kHz peak - */ - -uint8_t swSpiTransfer(uint8_t b, const uint8_t spi_speed, const pin_t sck_pin, const pin_t miso_pin, const pin_t mosi_pin) { - for (uint8_t i = 0; i < 8; i++) { - if (spi_speed == 0) { - WRITE(mosi_pin, !!(b & 0x80)); - WRITE(sck_pin, HIGH); - b <<= 1; - if (miso_pin >= 0 && READ(miso_pin)) b |= 1; - WRITE(sck_pin, LOW); - } - else { - const uint8_t state = (b & 0x80) ? HIGH : LOW; - for (uint8_t j = 0; j < spi_speed; j++) - WRITE(mosi_pin, state); - - for (uint8_t j = 0; j < spi_speed + (miso_pin >= 0 ? 0 : 1); j++) - WRITE(sck_pin, HIGH); - - b <<= 1; - if (miso_pin >= 0 && READ(miso_pin)) b |= 1; - - for (uint8_t j = 0; j < spi_speed; j++) - WRITE(sck_pin, LOW); - } - } - return b; -} - -void swSpiBegin(const pin_t sck_pin, const pin_t miso_pin, const pin_t mosi_pin) { - SET_OUTPUT(sck_pin); - if (VALID_PIN(miso_pin)) SET_INPUT(miso_pin); - SET_OUTPUT(mosi_pin); -} - -uint8_t swSpiInit(const uint8_t spiRate, const pin_t sck_pin, const pin_t mosi_pin) { - WRITE(mosi_pin, HIGH); - WRITE(sck_pin, LOW); - return (SystemCoreClock == 120000000 ? 44 : 38) / POW(2, 6 - MIN(spiRate, 6)); -} - -#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/SoftwareSPI.h b/Marlin/src/HAL/HAL_LPC1768/SoftwareSPI.h deleted file mode 100644 index 49136e2aa3..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/SoftwareSPI.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * 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 . - * - */ - -#ifndef _SOFTWARE_SPI_H_ -#define _SOFTWARE_SPI_H_ - -#include - -// -------------------------------------------------------------------------- -// Software SPI -// -------------------------------------------------------------------------- - -/** - * This software SPI runs at multiple rates. The SD software provides an index - * (spiRate) of 0-6. The mapping is: - * 0 - about 5 MHz peak (6 MHz on LPC1769) - * 1-2 - about 2 MHz peak - * 3 - about 1 MHz peak - * 4 - about 500 kHz peak - * 5 - about 250 kHz peak - * 6 - about 125 kHz peak - */ - -void swSpiBegin(const pin_t sck_pin, const pin_t miso_pin, const pin_t mosi_pin); - -// Returns the spi_speed value to be passed to swSpiTransfer -uint8_t swSpiInit(const uint8_t spiRate, const pin_t sck_pin, const pin_t mosi_pin); - -uint8_t swSpiTransfer(uint8_t b, const uint8_t spi_speed, const pin_t sck_pin, const pin_t miso_pin, const pin_t mosi_pin); - -#endif // _SOFTWARE_SPI_H_ diff --git a/Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp b/Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp deleted file mode 100644 index a92a61a8fd..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/WInterrupts.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Copyright (c) 2011-2012 Arduino. All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifdef TARGET_LPC1768 - -#include "../../inc/MarlinConfig.h" - -#define GNUM 31 - -typedef void (*interruptCB)(void); - -static interruptCB callbacksP0[GNUM] = {}; -static interruptCB callbacksP2[GNUM] = {}; - -extern "C" void GpioEnableInt(const uint32_t port, const uint32_t pin, const uint32_t mode); -extern "C" void GpioDisableInt(const uint32_t port, const uint32_t pin); - - -static void __initialize() { - NVIC_SetPriority(EINT3_IRQn, NVIC_EncodePriority(0, 1, 0)); - NVIC_EnableIRQ(EINT3_IRQn); -} - -void attachInterrupt(const pin_t pin, void (*callback)(void), uint32_t mode) { - static int enabled = 0; - - if (!INTERRUPT_PIN(pin)) return; - - if (!enabled) { - __initialize(); - ++enabled; - } - - uint8_t myport = LPC1768_PIN_PORT(pin), - mypin = LPC1768_PIN_PIN(pin); - - if (myport == 0) - callbacksP0[mypin] = callback; - else - callbacksP2[mypin] = callback; - - // Enable interrupt - GpioEnableInt(myport,mypin,mode); -} - -void detachInterrupt(const pin_t pin) { - if (!INTERRUPT_PIN(pin)) return; - - const uint8_t myport = LPC1768_PIN_PORT(pin), - mypin = LPC1768_PIN_PIN(pin); - - // Disable interrupt - GpioDisableInt(myport, mypin); - - // unset callback - if (myport == 0) - callbacksP0[mypin] = 0; - else //if (myport == 2 ) - callbacksP2[mypin] = 0; -} - - -extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode) { - //pin here is the processor pin, not logical pin - if (port == 0) { - LPC_GPIOINT->IO0IntClr = _BV(pin); - if (mode == RISING) { - SBI(LPC_GPIOINT->IO0IntEnR, pin); - CBI(LPC_GPIOINT->IO0IntEnF, pin); - } - else if (mode == FALLING) { - SBI(LPC_GPIOINT->IO0IntEnF, pin); - CBI(LPC_GPIOINT->IO0IntEnR, pin); - } - else if (mode == CHANGE) { - SBI(LPC_GPIOINT->IO0IntEnR, pin); - SBI(LPC_GPIOINT->IO0IntEnF, pin); - } - } - else { - LPC_GPIOINT->IO2IntClr = _BV(pin); - if (mode == RISING) { - SBI(LPC_GPIOINT->IO2IntEnR, pin); - CBI(LPC_GPIOINT->IO2IntEnF, pin); - } - else if (mode == FALLING) { - SBI(LPC_GPIOINT->IO2IntEnF, pin); - CBI(LPC_GPIOINT->IO2IntEnR, pin); - } - else if (mode == CHANGE) { - SBI(LPC_GPIOINT->IO2IntEnR, pin); - SBI(LPC_GPIOINT->IO2IntEnF, pin); - } - } -} - -extern "C" void GpioDisableInt(const uint32_t port, const uint32_t pin) { - if (port == 0) { - CBI(LPC_GPIOINT->IO0IntEnR, pin); - CBI(LPC_GPIOINT->IO0IntEnF, pin); - LPC_GPIOINT->IO0IntClr = _BV(pin); - } - else { - CBI(LPC_GPIOINT->IO2IntEnR, pin); - CBI(LPC_GPIOINT->IO2IntEnF, pin); - LPC_GPIOINT->IO2IntClr = _BV(pin); - } -} - -extern "C" void EINT3_IRQHandler(void) { - // Read in all current interrupt registers. We do this once as the - // GPIO interrupt registers are on the APB bus, and this is slow. - uint32_t rise0 = LPC_GPIOINT->IO0IntStatR, - fall0 = LPC_GPIOINT->IO0IntStatF, - rise2 = LPC_GPIOINT->IO2IntStatR, - fall2 = LPC_GPIOINT->IO2IntStatF; - - // Clear the interrupts ASAP - LPC_GPIOINT->IO0IntClr = LPC_GPIOINT->IO2IntClr = 0xFFFFFFFF; - NVIC_ClearPendingIRQ(EINT3_IRQn); - - while (rise0 > 0) { // If multiple pins changes happened continue as long as there are interrupts pending - const uint8_t bitloc = 31 - __CLZ(rise0); // CLZ returns number of leading zeros, 31 minus that is location of first pending interrupt - if (callbacksP0[bitloc] != NULL) callbacksP0[bitloc](); - rise0 -= _BV(bitloc); - } - - while (fall0 > 0) { - const uint8_t bitloc = 31 - __CLZ(fall0); - if (callbacksP0[bitloc] != NULL) callbacksP0[bitloc](); - fall0 -= _BV(bitloc); - } - - while(rise2 > 0) { - const uint8_t bitloc = 31 - __CLZ(rise2); - if (callbacksP2[bitloc] != NULL) callbacksP2[bitloc](); - rise2 -= _BV(bitloc); - } - - while (fall2 > 0) { - const uint8_t bitloc = 31 - __CLZ(fall2); - if (callbacksP2[bitloc] != NULL) callbacksP2[bitloc](); - fall2 -= _BV(bitloc); - } -} - -#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/arduino.cpp b/Marlin/src/HAL/HAL_LPC1768/arduino.cpp deleted file mode 100644 index e7a3d5e8f4..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/arduino.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/** - * 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 . - * - */ - -#ifdef TARGET_LPC1768 - -#include "LPC1768_PWM.h" -#include - -#include "../../inc/MarlinConfig.h" -#include "../shared/Delay.h" - -// Interrupts -void cli(void) { __disable_irq(); } // Disable -void sei(void) { __enable_irq(); } // Enable - -// Time functions -void _delay_ms(const int delay_ms) { - delay(delay_ms); -} - -uint32_t millis() { - return _millis; -} - -// This is required for some Arduino libraries we are using -void delayMicroseconds(uint32_t us) { - DELAY_US(us); -} - -extern "C" void delay(const int msec) { - volatile millis_t end = _millis + msec; - SysTick->VAL = SysTick->LOAD; // reset systick counter so next systick is in exactly 1ms - // this could extend the time between systicks by upto 1ms - while PENDING(_millis, end) __WFE(); -} - -// IO functions -// As defined by Arduino INPUT(0x0), OUTPUT(0x1), INPUT_PULLUP(0x2) -void pinMode(const pin_t pin, const uint8_t mode) { - if (!VALID_PIN(pin)) return; - - PINSEL_CFG_Type config = { LPC1768_PIN_PORT(pin), - LPC1768_PIN_PIN(pin), - PINSEL_FUNC_0, - PINSEL_PINMODE_TRISTATE, - PINSEL_PINMODE_NORMAL }; - switch (mode) { - case INPUT: - LPC_GPIO(LPC1768_PIN_PORT(pin))->FIODIR &= ~LPC_PIN(LPC1768_PIN_PIN(pin)); - break; - case OUTPUT: - LPC_GPIO(LPC1768_PIN_PORT(pin))->FIODIR |= LPC_PIN(LPC1768_PIN_PIN(pin)); - break; - case INPUT_PULLUP: - LPC_GPIO(LPC1768_PIN_PORT(pin))->FIODIR &= ~LPC_PIN(LPC1768_PIN_PIN(pin)); - config.Pinmode = PINSEL_PINMODE_PULLUP; - break; - case INPUT_PULLDOWN: - LPC_GPIO(LPC1768_PIN_PORT(pin))->FIODIR &= ~LPC_PIN(LPC1768_PIN_PIN(pin)); - config.Pinmode = PINSEL_PINMODE_PULLDOWN; - break; - default: return; - } - PINSEL_ConfigPin(&config); -} - -void digitalWrite(pin_t pin, uint8_t pin_status) { - if (!VALID_PIN(pin)) return; - - if (pin_status) - LPC_GPIO(LPC1768_PIN_PORT(pin))->FIOSET = LPC_PIN(LPC1768_PIN_PIN(pin)); - else - LPC_GPIO(LPC1768_PIN_PORT(pin))->FIOCLR = LPC_PIN(LPC1768_PIN_PIN(pin)); - - pinMode(pin, OUTPUT); // Set pin mode on every write (Arduino version does this) - - /** - * Must be done AFTER the output state is set. Doing this before will cause a - * 2uS glitch if writing a "1". - * - * When the Port Direction bit is written to a "1" the output is immediately set - * to the value of the FIOPIN bit which is "0" because of power up defaults. - */ -} - -bool digitalRead(pin_t pin) { - if (!VALID_PIN(pin)) return false; - - return LPC_GPIO(LPC1768_PIN_PORT(pin))->FIOPIN & LPC_PIN(LPC1768_PIN_PIN(pin)) ? 1 : 0; -} - -void analogWrite(pin_t pin, int pwm_value) { // 1 - 254: pwm_value, 0: LOW, 255: HIGH - if (!VALID_PIN(pin)) return; - - #define MR0_MARGIN 200 // if channel value too close to MR0 the system locks up - - static bool out_of_PWM_slots = false; - - uint value = MAX(MIN(pwm_value, 255), 0); - if (value == 0 || value == 255) { // treat as digital pin - LPC1768_PWM_detach_pin(pin); // turn off PWM - digitalWrite(pin, value); - } - else { - if (LPC1768_PWM_attach_pin(pin, 1, LPC_PWM1->MR0, 0xFF)) - LPC1768_PWM_write(pin, map(value, 0, 255, 1, LPC_PWM1->MR0)); // map 1-254 onto PWM range - else { // out of PWM channels - if (!out_of_PWM_slots) SERIAL_ECHOPGM(".\nWARNING - OUT OF PWM CHANNELS\n.\n"); //only warn once - out_of_PWM_slots = true; - digitalWrite(pin, value); // treat as a digital pin if out of channels - } - } -} - -extern bool HAL_adc_finished(); - -uint16_t analogRead(pin_t adc_pin) { - HAL_adc_start_conversion(adc_pin); - while (!HAL_adc_finished()); // Wait for conversion to finish - return HAL_adc_get_result(); -} - -// ************************** -// Persistent Config Storage -// ************************** - -void eeprom_write_byte(uint8_t *pos, unsigned char value) { - -} - -uint8_t eeprom_read_byte(uint8_t * pos) { return '\0'; } - -void eeprom_read_block(void *__dst, const void *__src, size_t __n) { } - -void eeprom_update_block(const void *__src, void *__dst, size_t __n) { } - -char *dtostrf (double __val, signed char __width, unsigned char __prec, char *__s) { - char format_string[20]; - snprintf(format_string, 20, "%%%d.%df", __width, __prec); - sprintf(__s, format_string, __val); - return __s; -} - -int32_t random(int32_t max) { - return rand() % max; -} - -int32_t random(int32_t min, int32_t max) { - return min + rand() % (max - min); -} - -void randomSeed(uint32_t value) { - srand(value); -} - -int map(uint16_t x, uint16_t in_min, uint16_t in_max, uint16_t out_min, uint16_t out_max) { - return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; -} - -#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/debug_extra_script.py b/Marlin/src/HAL/HAL_LPC1768/debug_extra_script.py deleted file mode 100644 index ae53adea0a..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/debug_extra_script.py +++ /dev/null @@ -1,21 +0,0 @@ -Import("env") - -env.AddPostAction( - "$BUILD_DIR/firmware.hex", - env.VerboseAction(" ".join([ - "sed", "-i.bak", - "s/:10040000FFFFFFFFFFFFFFFFFFFFFFFFDEF9FFFF23/:10040000FFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFD/", - "$BUILD_DIR/firmware.hex" - ]), "Fixing $BUILD_DIR/firmware.hex secure flash flags")) -env.AddPreAction( - "upload", - env.VerboseAction(" ".join([ - "echo", - "'h\\nloadfile $BUILD_DIR/firmware.hex\\nr\\nq\\n'", - ">$BUILD_DIR/aux.jlink" - ]), "Creating auxiliary files")) - -env.Replace( - UPLOADHEXCMD= - 'JLinkExe -device MK20DX256xxx7 -speed 4000 -if swd -autoconnect 1 -CommanderScript $BUILD_DIR/aux.jlink -SkipProgOnCRCMatch = 1 -VerifyDownload = 1' -) diff --git a/Marlin/src/HAL/HAL_LPC1768/fastio.h b/Marlin/src/HAL/HAL_LPC1768/fastio.h index 5f55f73c86..b0ab2089be 100644 --- a/Marlin/src/HAL/HAL_LPC1768/fastio.h +++ b/Marlin/src/HAL/HAL_LPC1768/fastio.h @@ -35,27 +35,23 @@ #ifndef _FASTIO_LPC1768_H #define _FASTIO_LPC1768_H -#include #include -#include -bool useable_hardware_PWM(pin_t pin); -#define USEABLE_HARDWARE_PWM(pin) useable_hardware_PWM(pin) +#define USEABLE_HARDWARE_PWM(pin) TRUE // all pins are PWM capable -#define LPC_PORT_OFFSET (0x0020) -#define LPC_PIN(pin) (1UL << pin) -#define LPC_GPIO(port) ((volatile LPC_GPIO_TypeDef *)(LPC_GPIO0_BASE + LPC_PORT_OFFSET * port)) +#define LPC_PIN(pin) gpio_pin(pin) +#define LPC_GPIO(port) gpio_port(port) -#define SET_DIR_INPUT(IO) (LPC_GPIO(LPC1768_PIN_PORT(IO))->FIODIR &= ~LPC_PIN(LPC1768_PIN_PIN(IO))) -#define SET_DIR_OUTPUT(IO) (LPC_GPIO(LPC1768_PIN_PORT(IO))->FIODIR |= LPC_PIN(LPC1768_PIN_PIN(IO))) +#define SET_DIR_INPUT(IO) gpio_set_input(IO) +#define SET_DIR_OUTPUT(IO) gpio_set_output(IO) -#define SET_MODE(IO, mode) (pin_mode((LPC1768_PIN_PORT(IO), LPC1768_PIN_PIN(IO)), mode)) +#define SET_MODE(IO, mode) pinMode(IO, mode) -#define WRITE_PIN_SET(IO) (LPC_GPIO(LPC1768_PIN_PORT(IO))->FIOSET = LPC_PIN(LPC1768_PIN_PIN(IO))) -#define WRITE_PIN_CLR(IO) (LPC_GPIO(LPC1768_PIN_PORT(IO))->FIOCLR = LPC_PIN(LPC1768_PIN_PIN(IO))) +#define WRITE_PIN_SET(IO) gpio_set(IO) +#define WRITE_PIN_CLR(IO) gpio_clear(IO) -#define READ_PIN(IO) ((LPC_GPIO(LPC1768_PIN_PORT(IO))->FIOPIN & LPC_PIN(LPC1768_PIN_PIN(IO))) ? 1 : 0) -#define WRITE_PIN(IO,V) ((V) ? WRITE_PIN_SET(IO) : WRITE_PIN_CLR(IO)) +#define READ_PIN(IO) gpio_get(IO) +#define WRITE_PIN(IO,V) gpio_set(IO, V) /** * Magic I/O routines @@ -89,10 +85,10 @@ bool useable_hardware_PWM(pin_t pin); #define _PULLDOWN(IO,V) pinMode(IO, (V) ? INPUT_PULLDOWN : INPUT) /// check if pin is an input -#define _GET_INPUT(IO) (LPC_GPIO(LPC1768_PIN_PORT(IO))->FIODIR & LPC_PIN(LPC1768_PIN_PIN(IO)) != 0) +#define _GET_INPUT(IO) (!gpio_get_dir(IO)) /// check if pin is an output -#define _GET_OUTPUT(IO) (LPC_GPIO(LPC1768_PIN_PORT(IO))->FIODIR & LPC_PIN(LPC1768_PIN_PIN(IO)) == 0) +#define _GET_OUTPUT(IO) (gpio_get_dir(IO)) /// check if pin is a timer /// all gpio pins are pwm capable, either interrupt or hardware pwm controlled diff --git a/Marlin/src/HAL/HAL_LPC1768/include/Arduino.h b/Marlin/src/HAL/HAL_LPC1768/include/Arduino.h deleted file mode 100644 index 63502ad710..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/include/Arduino.h +++ /dev/null @@ -1,125 +0,0 @@ -/** - * 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 . - * - */ - -#ifndef __ARDUINO_H__ -#define __ARDUINO_H__ -#include -#include -#include - -#include - -#define HIGH 0x01 -#define LOW 0x00 - -#define INPUT 0x00 -#define OUTPUT 0x01 -#define INPUT_PULLUP 0x02 -#define INPUT_PULLDOWN 0x03 - -#define LSBFIRST 0 -#define MSBFIRST 1 - -#define CHANGE 0x02 -#define FALLING 0x03 -#define RISING 0x04 - -typedef uint8_t byte; -#define PROGMEM -#define PSTR(v) (v) -#define PGM_P const char * - -// Used for libraries, preprocessor, and constants -#define min(a,b) ((a)<(b)?(a):(b)) -#define max(a,b) ((a)>(b)?(a):(b)) -#define abs(x) ((x)>0?(x):-(x)) - -#ifndef isnan - #define isnan std::isnan -#endif -#ifndef isinf - #define isinf std::isinf -#endif - -#define sq(v) ((v) * (v)) -#define square(v) sq(v) -#define constrain(value, arg_min, arg_max) ((value) < (arg_min) ? (arg_min) :((value) > (arg_max) ? (arg_max) : (value))) - -//Interrupts -void cli(void); // Disable -void sei(void); // Enable -void attachInterrupt(const pin_t pin, void (*callback)(void), uint32_t mode); -void detachInterrupt(const pin_t pin); -extern "C" void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode); -extern "C" void GpioDisableInt(uint32_t port, uint32_t pin); - -// Program Memory -#define pgm_read_ptr(addr) (*((void**)(addr))) -#define pgm_read_byte_near(addr) (*((uint8_t*)(addr))) -#define pgm_read_float_near(addr) (*((float*)(addr))) -#define pgm_read_word_near(addr) (*((uint16_t*)(addr))) -#define pgm_read_dword_near(addr) (*((uint32_t*)(addr))) -#define pgm_read_byte(addr) pgm_read_byte_near(addr) -#define pgm_read_float(addr) pgm_read_float_near(addr) -#define pgm_read_word(addr) pgm_read_word_near(addr) -#define pgm_read_dword(addr) pgm_read_dword_near(addr) - -#define memcpy_P memcpy -#define sprintf_P sprintf -#define strstr_P strstr -#define strncpy_P strncpy -#define vsnprintf_P vsnprintf -#define strcpy_P strcpy -#define snprintf_P snprintf -#define strlen_P strlen -#define strchr_P strchr - -// Time functions -extern "C" { - void delay(const int milis); -} -void _delay_ms(const int delay); -void delayMicroseconds(unsigned long); -uint32_t millis(); - -//IO functions -void pinMode(const pin_t, const uint8_t); -void digitalWrite(pin_t, uint8_t); -bool digitalRead(pin_t); -void analogWrite(pin_t, int); -uint16_t analogRead(pin_t); - -// EEPROM -void eeprom_write_byte(uint8_t *pos, unsigned char value); -uint8_t eeprom_read_byte(uint8_t *pos); -void eeprom_read_block (void *__dst, const void *__src, size_t __n); -void eeprom_update_block (const void *__src, void *__dst, size_t __n); - -int32_t random(int32_t); -int32_t random(int32_t, int32_t); -void randomSeed(uint32_t); - -char *dtostrf (double __val, signed char __width, unsigned char __prec, char *__s); - -int map(uint16_t x, uint16_t in_min, uint16_t in_max, uint16_t out_min, uint16_t out_max); - -#endif // __ARDUINO_DEF_H__ diff --git a/Marlin/src/HAL/HAL_LPC1768/include/HardwareSerial.cpp b/Marlin/src/HAL/HAL_LPC1768/include/HardwareSerial.cpp deleted file mode 100644 index 152b045d55..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/include/HardwareSerial.cpp +++ /dev/null @@ -1,335 +0,0 @@ -/** - * 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 . - * - */ - -#ifdef TARGET_LPC1768 - -#include "HardwareSerial.h" - -#if SERIAL_PORT == 0 || SERIAL_PORT_2 == 0 - HardwareSerial Serial = HardwareSerial(LPC_UART0); -#elif SERIAL_PORT == 1 || SERIAL_PORT_2 == 1 - HardwareSerial Serial1 = HardwareSerial((LPC_UART_TypeDef *) LPC_UART1); -#elif SERIAL_PORT == 2 || SERIAL_PORT_2 == 2 - HardwareSerial Serial2 = HardwareSerial(LPC_UART2); -#elif SERIAL_PORT == 3 || SERIAL_PORT_2 == 3 - HardwareSerial Serial3 = HardwareSerial(LPC_UART3); -#endif - -void HardwareSerial::begin(uint32_t baudrate) { - - UART_CFG_Type UARTConfigStruct; - PINSEL_CFG_Type PinCfg; - UART_FIFO_CFG_Type FIFOConfig; - - if (Baudrate == baudrate) return; // No need to re-initialize - - if (UARTx == LPC_UART0) { - // Initialize UART0 pin connect - PinCfg.Funcnum = 1; - PinCfg.OpenDrain = 0; - PinCfg.Pinmode = 0; - PinCfg.Pinnum = 2; - PinCfg.Portnum = 0; - PINSEL_ConfigPin(&PinCfg); - PinCfg.Pinnum = 3; - PINSEL_ConfigPin(&PinCfg); - } else if ((LPC_UART1_TypeDef *) UARTx == LPC_UART1) { - // Initialize UART1 pin connect - PinCfg.Funcnum = 1; - PinCfg.OpenDrain = 0; - PinCfg.Pinmode = 0; - PinCfg.Pinnum = 15; - PinCfg.Portnum = 0; - PINSEL_ConfigPin(&PinCfg); - PinCfg.Pinnum = 16; - PINSEL_ConfigPin(&PinCfg); - } else if (UARTx == LPC_UART2) { - // Initialize UART2 pin connect - PinCfg.Funcnum = 1; - PinCfg.OpenDrain = 0; - PinCfg.Pinmode = 0; - PinCfg.Pinnum = 10; - PinCfg.Portnum = 0; - PINSEL_ConfigPin(&PinCfg); - PinCfg.Pinnum = 11; - PINSEL_ConfigPin(&PinCfg); - } else if (UARTx == LPC_UART3) { - // Initialize UART2 pin connect - PinCfg.Funcnum = 1; - PinCfg.OpenDrain = 0; - PinCfg.Pinmode = 0; - PinCfg.Pinnum = 0; - PinCfg.Portnum = 0; - PINSEL_ConfigPin(&PinCfg); - PinCfg.Pinnum = 1; - PINSEL_ConfigPin(&PinCfg); - } - - /* Initialize UART Configuration parameter structure to default state: - * Baudrate = 9600bps - * 8 data bit - * 1 Stop bit - * None parity - */ - UART_ConfigStructInit(&UARTConfigStruct); - - // Re-configure baudrate - UARTConfigStruct.Baud_rate = baudrate; - - // Initialize eripheral with given to corresponding parameter - UART_Init(UARTx, &UARTConfigStruct); - - // Enable and reset the TX and RX FIFOs - UART_FIFOConfigStructInit(&FIFOConfig); - UART_FIFOConfig(UARTx, &FIFOConfig); - - // Enable UART Transmit - UART_TxCmd(UARTx, ENABLE); - - // Configure Interrupts - UART_IntConfig(UARTx, UART_INTCFG_RBR, ENABLE); - UART_IntConfig(UARTx, UART_INTCFG_RLS, ENABLE); - - // Set proper priority and enable interrupts - if (UARTx == LPC_UART0) { - NVIC_SetPriority(UART0_IRQn, NVIC_EncodePriority(0, 3, 0)); - NVIC_EnableIRQ(UART0_IRQn); - } - else if ((LPC_UART1_TypeDef *) UARTx == LPC_UART1) { - NVIC_SetPriority(UART1_IRQn, NVIC_EncodePriority(0, 3, 0)); - NVIC_EnableIRQ(UART1_IRQn); - } - else if (UARTx == LPC_UART2) { - NVIC_SetPriority(UART2_IRQn, NVIC_EncodePriority(0, 3, 0)); - NVIC_EnableIRQ(UART2_IRQn); - } - else if (UARTx == LPC_UART3) { - NVIC_SetPriority(UART3_IRQn, NVIC_EncodePriority(0, 3, 0)); - NVIC_EnableIRQ(UART3_IRQn); - } - - RxQueueWritePos = RxQueueReadPos = 0; - #if TX_BUFFER_SIZE > 0 - TxQueueWritePos = TxQueueReadPos = 0; - #endif - - // Save the configured baudrate - Baudrate = baudrate; -} - -int16_t HardwareSerial::peek() { - int16_t byte = -1; - - // Temporarily lock out UART receive interrupts during this read so the UART receive - // interrupt won't cause problems with the index values - UART_IntConfig(UARTx, UART_INTCFG_RBR, DISABLE); - - if (RxQueueReadPos != RxQueueWritePos) - byte = RxBuffer[RxQueueReadPos]; - - // Re-enable UART interrupts - UART_IntConfig(UARTx, UART_INTCFG_RBR, ENABLE); - - return byte; -} - -int16_t HardwareSerial::read() { - int16_t byte = -1; - - // Temporarily lock out UART receive interrupts during this read so the UART receive - // interrupt won't cause problems with the index values - UART_IntConfig(UARTx, UART_INTCFG_RBR, DISABLE); - - if (RxQueueReadPos != RxQueueWritePos) { - byte = RxBuffer[RxQueueReadPos]; - RxQueueReadPos = (RxQueueReadPos + 1) % RX_BUFFER_SIZE; - } - - // Re-enable UART interrupts - UART_IntConfig(UARTx, UART_INTCFG_RBR, ENABLE); - - return byte; -} - -size_t HardwareSerial::write(uint8_t send) { -#if TX_BUFFER_SIZE > 0 - size_t bytes = 0; - uint32_t fifolvl = 0; - - // If the Tx Buffer is full, wait for space to clear - if ((TxQueueWritePos+1) % TX_BUFFER_SIZE == TxQueueReadPos) flushTX(); - - // Temporarily lock out UART transmit interrupts during this read so the UART transmit interrupt won't - // cause problems with the index values - UART_IntConfig(UARTx, UART_INTCFG_THRE, DISABLE); - - // LPC17xx.h incorrectly defines FIFOLVL as a uint8_t, when it's actually a 32-bit register - if ((LPC_UART1_TypeDef *) UARTx == LPC_UART1) { - fifolvl = *(reinterpret_cast(&((LPC_UART1_TypeDef *) UARTx)->FIFOLVL)); - } else fifolvl = *(reinterpret_cast(&UARTx->FIFOLVL)); - - // If the queue is empty and there's space in the FIFO, immediately send the byte - if (TxQueueWritePos == TxQueueReadPos && fifolvl < UART_TX_FIFO_SIZE) { - bytes = UART_Send(UARTx, &send, 1, BLOCKING); - } - // Otherwiise, write the byte to the transmit buffer - else if ((TxQueueWritePos+1) % TX_BUFFER_SIZE != TxQueueReadPos) { - TxBuffer[TxQueueWritePos] = send; - TxQueueWritePos = (TxQueueWritePos+1) % TX_BUFFER_SIZE; - bytes++; - } - - // Re-enable the TX Interrupt - UART_IntConfig(UARTx, UART_INTCFG_THRE, ENABLE); - - return bytes; -#else - return UART_Send(UARTx, &send, 1, BLOCKING); -#endif -} - -#if TX_BUFFER_SIZE > 0 - void HardwareSerial::flushTX() { - // Wait for the tx buffer and FIFO to drain - while (TxQueueWritePos != TxQueueReadPos && UART_CheckBusy(UARTx) == SET); - } -#endif - -size_t HardwareSerial::available() { - return (RxQueueWritePos + RX_BUFFER_SIZE - RxQueueReadPos) % RX_BUFFER_SIZE; -} - -void HardwareSerial::flush() { - RxQueueWritePos = 0; - RxQueueReadPos = 0; -} - -size_t HardwareSerial::printf(const char *format, ...) { - char RxBuffer[256]; - va_list vArgs; - va_start(vArgs, format); - int length = vsnprintf(RxBuffer, 256, format, vArgs); - va_end(vArgs); - if (length > 0 && length < 256) { - for (size_t i = 0; i < (size_t)length; ++i) - write(RxBuffer[i]); - } - return length; -} - -void HardwareSerial::IRQHandler() { - uint32_t IIRValue; - uint8_t LSRValue, byte; - - IIRValue = UART_GetIntId(UARTx); - IIRValue &= UART_IIR_INTID_MASK; // check bit 1~3, interrupt identification - - // Receive Line Status - if (IIRValue == UART_IIR_INTID_RLS) { - LSRValue = UART_GetLineStatus(UARTx); - - // Receive Line Status - if (LSRValue & (UART_LSR_OE | UART_LSR_PE | UART_LSR_FE | UART_LSR_RXFE | UART_LSR_BI)) { - // There are errors or break interrupt - // Read LSR will clear the interrupt - Status = LSRValue; - byte = UART_ReceiveByte(UARTx); // Dummy read on RX to clear interrupt, then bail out - return; - } - } - - // Receive Data Available - if (IIRValue == UART_IIR_INTID_RDA) { - // Clear the FIFO - while (UART_Receive(UARTx, &byte, 1, NONE_BLOCKING)) { - #if ENABLED(EMERGENCY_PARSER) - emergency_parser.update(emergency_state, byte); - #endif - if ((RxQueueWritePos + 1) % RX_BUFFER_SIZE != RxQueueReadPos) { - RxBuffer[RxQueueWritePos] = byte; - RxQueueWritePos = (RxQueueWritePos + 1) % RX_BUFFER_SIZE; - } else - break; - } - // Character timeout indicator - } else if (IIRValue == UART_IIR_INTID_CTI) { - // Character Time-out indicator - Status |= 0x100; // Bit 9 as the CTI error - } - - #if TX_BUFFER_SIZE > 0 - if (IIRValue == UART_IIR_INTID_THRE) { - // Disable THRE interrupt - UART_IntConfig(UARTx, UART_INTCFG_THRE, DISABLE); - - // Wait for FIFO buffer empty - while (UART_CheckBusy(UARTx) == SET); - - // Transfer up to UART_TX_FIFO_SIZE bytes of data - for (int i = 0; i < UART_TX_FIFO_SIZE && TxQueueWritePos != TxQueueReadPos; i++) { - // Move a piece of data into the transmit FIFO - if (UART_Send(UARTx, &TxBuffer[TxQueueReadPos], 1, NONE_BLOCKING)) { - TxQueueReadPos = (TxQueueReadPos+1) % TX_BUFFER_SIZE; - } else break; - } - - // If there is no more data to send, disable the transmit interrupt - else enable it or keep it enabled - if (TxQueueWritePos == TxQueueReadPos) { - UART_IntConfig(UARTx, UART_INTCFG_THRE, DISABLE); - } else UART_IntConfig(UARTx, UART_INTCFG_THRE, ENABLE); - } - #endif -} - -#ifdef __cplusplus -extern "C" { -#endif - -void UART0_IRQHandler(void) { - #if SERIAL_PORT == 0 || SERIAL_PORT_2 == 0 - Serial.IRQHandler(); - #endif -} - -void UART1_IRQHandler(void) { - #if SERIAL_PORT == 1 || SERIAL_PORT_2 == 1 - Serial1.IRQHandler(); - #endif -} - -void UART2_IRQHandler(void) { - #if SERIAL_PORT == 2 || SERIAL_PORT_2 == 2 - Serial2.IRQHandler(); - #endif -} - -void UART3_IRQHandler(void) { - #if SERIAL_PORT == 3 || SERIAL_PORT_2 == 3 - Serial3.IRQHandler(); - #endif -} - -#ifdef __cplusplus -} -#endif - -#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/include/HardwareSerial.h b/Marlin/src/HAL/HAL_LPC1768/include/HardwareSerial.h deleted file mode 100644 index f3bd2f6b42..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/include/HardwareSerial.h +++ /dev/null @@ -1,91 +0,0 @@ -/** - * 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 . - * - */ - -#ifndef HARDWARE_SERIAL_H_ -#define HARDWARE_SERIAL_H_ - -#include "../../../inc/MarlinConfigPre.h" -#if ENABLED(EMERGENCY_PARSER) - #include "../../../feature/emergency_parser.h" -#endif - -#include -#include -#include - -extern "C" { - #include - #include "lpc17xx_pinsel.h" -} - -class HardwareSerial : public Stream { -private: - LPC_UART_TypeDef *UARTx; - - uint32_t Baudrate; - uint32_t Status; - uint8_t RxBuffer[RX_BUFFER_SIZE]; - uint32_t RxQueueWritePos; - uint32_t RxQueueReadPos; - #if TX_BUFFER_SIZE > 0 - uint8_t TxBuffer[TX_BUFFER_SIZE]; - uint32_t TxQueueWritePos; - uint32_t TxQueueReadPos; - #endif - #if ENABLED(EMERGENCY_PARSER) - EmergencyParser::State emergency_state; - #endif - -public: - HardwareSerial(LPC_UART_TypeDef *UARTx) - : UARTx(UARTx) - , Baudrate(0) - , RxQueueWritePos(0) - , RxQueueReadPos(0) - #if TX_BUFFER_SIZE > 0 - , TxQueueWritePos(0) - , TxQueueReadPos(0) - #endif - #if ENABLED(EMERGENCY_PARSER) - , emergency_state(EmergencyParser::State::EP_RESET) - #endif - { - } - - void begin(uint32_t baudrate); - int16_t peek(); - int16_t read(); - size_t write(uint8_t send); - #if TX_BUFFER_SIZE > 0 - void flushTX(); - #endif - size_t available(); - void flush(); - size_t printf(const char *format, ...); - - operator bool() { return true; } - - void IRQHandler(); - -}; - -#endif // MARLIN_SRC_HAL_HAL_SERIAL_H_ diff --git a/Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.cpp b/Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.cpp deleted file mode 100644 index 1d469dab3a..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.cpp +++ /dev/null @@ -1,329 +0,0 @@ -/* - * SoftwareSerial.cpp (formerly NewSoftSerial.cpp) - * - * Multi-instance software serial library for Arduino/Wiring - * -- Interrupt-driven receive and other improvements by ladyada - * (http://ladyada.net) - * -- Tuning, circular buffer, derivation from class Print/Stream, - * multi-instance support, porting to 8MHz processors, - * various optimizations, PROGMEM delay tables, inverse logic and - * direct port writing by Mikal Hart (http://www.arduiniana.org) - * -- Pin change interrupt macros by Paul Stoffregen (http://www.pjrc.com) - * -- 20MHz processor support by Garrett Mace (http://www.macetech.com) - * -- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * The latest version of this library can always be found at - * http://arduiniana.org. - */ - -#ifdef TARGET_LPC1768 - -// -// Includes -// -//#include -#include "../../../inc/MarlinConfig.h" -#include "../../shared/Delay.h" -#include -#include -#include -#include -#include "../fastio.h" -#include "SoftwareSerial.h" - -void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode); -void GpioDisableInt(uint32_t port, uint32_t pin); -// -// Statics -// -SoftwareSerial *SoftwareSerial::active_object = 0; -unsigned char SoftwareSerial::_receive_buffer[_SS_MAX_RX_BUFF]; -volatile uint8_t SoftwareSerial::_receive_buffer_tail = 0; -volatile uint8_t SoftwareSerial::_receive_buffer_head = 0; - -typedef struct _DELAY_TABLE { - long baud; - uint16_t rx_delay_centering; - uint16_t rx_delay_intrabit; - uint16_t rx_delay_stopbit; - uint16_t tx_delay; -} DELAY_TABLE; - -// rough delay estimation -static const DELAY_TABLE table[] = { - //baud |rxcenter|rxintra |rxstop |tx { 250000, 2, 4, 4, 4, }, //Done but not good due to instruction cycle error { 115200, 4, 8, 8, 8, }, //Done but not good due to instruction cycle error - //{ 74880, 69, 139, 62, 162, }, // estimation - //{ 57600, 100, 185, 1, 208, }, // Done but not good due to instruction cycle error - //{ 38400, 13, 26, 26, 26, }, // Done - //{ 19200, 26, 52, 52, 52, }, // Done { 9600, 52, 104, 104, 104, }, // Done - //{ 4800, 104, 208, 208, 208, }, - //{ 2400, 208, 417, 417, 417, }, - //{ 1200, 416, 833, 833, 833,}, -}; - -// -// Private methods -// - -inline void SoftwareSerial::tunedDelay(const uint32_t count) { - DELAY_US(count); -} - -// This function sets the current object as the "listening" -// one and returns true if it replaces another -bool SoftwareSerial::listen() { - if (!_rx_delay_stopbit) - return false; - - if (active_object != this) { - if (active_object) - active_object->stopListening(); - - _buffer_overflow = false; - _receive_buffer_head = _receive_buffer_tail = 0; - active_object = this; - - setRxIntMsk(true); - return true; - } - - return false; -} - -// Stop listening. Returns true if we were actually listening. -bool SoftwareSerial::stopListening() { - if (active_object == this) { - setRxIntMsk(false); - active_object = NULL; - return true; - } - return false; -} - -// -// The receive routine called by the interrupt handler -// -void SoftwareSerial::recv() { - uint8_t d = 0; - - // If RX line is high, then we don't see any start bit - // so interrupt is probably not for us - if (_inverse_logic ? rx_pin_read() : !rx_pin_read()) { - // Disable further interrupts during reception, this prevents - // triggering another interrupt directly after we return, which can - // cause problems at higher baudrates. - setRxIntMsk(false);//__disable_irq();// - - // Wait approximately 1/2 of a bit width to "center" the sample - tunedDelay(_rx_delay_centering); - // Read each of the 8 bits - for (uint8_t i=8; i > 0; --i) { - tunedDelay(_rx_delay_intrabit); - d >>= 1; - if (rx_pin_read()) d |= 0x80; - } - - if (_inverse_logic) d = ~d; - - // if buffer full, set the overflow flag and return - uint8_t next = (_receive_buffer_tail + 1) % _SS_MAX_RX_BUFF; - if (next != _receive_buffer_head) { - // save new data in buffer: tail points to where byte goes - _receive_buffer[_receive_buffer_tail] = d; // save new byte - _receive_buffer_tail = next; - } - else { - _buffer_overflow = true; - } - tunedDelay(_rx_delay_stopbit); - // Re-enable interrupts when we're sure to be inside the stop bit - setRxIntMsk(true); //__enable_irq();// - } -} - -uint32_t SoftwareSerial::rx_pin_read() { - return digitalRead(_receivePin); -} - -// -// Interrupt handling -// - -/* static */ -inline void SoftwareSerial::handle_interrupt() { - if (active_object) - active_object->recv(); -} -extern "C" void intWrapper() { - SoftwareSerial::handle_interrupt(); -} -// -// Constructor -// -SoftwareSerial::SoftwareSerial(pin_t receivePin, pin_t transmitPin, bool inverse_logic /* = false */) : - _rx_delay_centering(0), - _rx_delay_intrabit(0), - _rx_delay_stopbit(0), - _tx_delay(0), - _buffer_overflow(false), - _inverse_logic(inverse_logic) { - setTX(transmitPin); - setRX(receivePin); -} - -// -// Destructor -// -SoftwareSerial::~SoftwareSerial() { - end(); -} - -void SoftwareSerial::setTX(pin_t tx) { - // First write, then set output. If we do this the other way around, - // the pin would be output low for a short while before switching to - // output hihg. Now, it is input with pullup for a short while, which - // is fine. With inverse logic, either order is fine. - - digitalWrite(tx, _inverse_logic ? LOW : HIGH); - pinMode(tx,OUTPUT); - _transmitPin = tx; -} - -void SoftwareSerial::setRX(pin_t rx) { - pinMode(rx, INPUT_PULLUP); // pullup for normal logic! - //if (!_inverse_logic) - // digitalWrite(rx, HIGH); - _receivePin = rx; - _receivePort = LPC1768_PIN_PORT(rx); - _receivePortPin = LPC1768_PIN_PIN(rx); - /* GPIO_T * rxPort = digitalPinToPort(rx); - _receivePortRegister = portInputRegister(rxPort); - _receiveBitMask = digitalPinToBitMask(rx);*/ -} - -// -// Public methods -// - -void SoftwareSerial::begin(long speed) { - _rx_delay_centering = _rx_delay_intrabit = _rx_delay_stopbit = _tx_delay = 0; - - for(uint8_t i = 0; i < sizeof(table)/sizeof(table[0]); ++i) { - long baud = table[i].baud; - if (baud == speed) { - _rx_delay_centering = table[i].rx_delay_centering; - _rx_delay_intrabit = table[i].rx_delay_intrabit; - _rx_delay_stopbit = table[i].rx_delay_stopbit; - _tx_delay = table[i].tx_delay; - break; - } - } - - attachInterrupt(_receivePin, intWrapper, CHANGE); //this->handle_interrupt, CHANGE); - - listen(); - tunedDelay(_tx_delay); - -} - -void SoftwareSerial::setRxIntMsk(bool enable) { - if (enable) - GpioEnableInt(_receivePort,_receivePin,CHANGE); - else - GpioDisableInt(_receivePort,_receivePin); -} - -void SoftwareSerial::end() { - stopListening(); -} - - -// Read data from buffer -int16_t SoftwareSerial::read() { - if (!isListening()) return -1; - - // Empty buffer? - if (_receive_buffer_head == _receive_buffer_tail) return -1; - - // Read from "head" - uint8_t d = _receive_buffer[_receive_buffer_head]; // grab next byte - _receive_buffer_head = (_receive_buffer_head + 1) % _SS_MAX_RX_BUFF; - return d; -} - -size_t SoftwareSerial::available() { - if (!isListening()) return 0; - - return (_receive_buffer_tail + _SS_MAX_RX_BUFF - _receive_buffer_head) % _SS_MAX_RX_BUFF; -} - -size_t SoftwareSerial::write(uint8_t b) { - // By declaring these as local variables, the compiler will put them - // in registers _before_ disabling interrupts and entering the - // critical timing sections below, which makes it a lot easier to - // verify the cycle timings - - bool inv = _inverse_logic; - uint16_t delay = _tx_delay; - - if (inv) b = ~b; - - cli(); // turn off interrupts for a clean txmit - - // Write the start bit - digitalWrite(_transmitPin, !!inv); - - tunedDelay(delay); - - // Write each of the 8 bits - for (uint8_t i = 8; i > 0; --i) { - digitalWrite(_transmitPin, b & 1); // send 1 //(GPIO_Desc[_transmitPin].P)->DOUT |= GPIO_Desc[_transmitPin].bit; - // send 0 //(GPIO_Desc[_transmitPin].P)->DOUT &= ~GPIO_Desc[_transmitPin].bit; - tunedDelay(delay); - b >>= 1; - } - - // restore pin to natural state - digitalWrite(_transmitPin, !inv); - - sei(); // turn interrupts back on - tunedDelay(delay); - - return 1; -} - -void SoftwareSerial::flush() { - if (!isListening()) return; - - cli(); - _receive_buffer_head = _receive_buffer_tail = 0; - sei(); -} - -int16_t SoftwareSerial::peek() { - if (!isListening()) - return -1; - - // Empty buffer? - if (_receive_buffer_head == _receive_buffer_tail) - return -1; - - // Read from "head" - return _receive_buffer[_receive_buffer_head]; -} - -#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.h b/Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.h deleted file mode 100644 index f208e14b05..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/include/SoftwareSerial.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * SoftwareSerial.h (formerly NewSoftSerial.h) - * - * Multi-instance software serial library for Arduino/Wiring - * -- Interrupt-driven receive and other improvements by ladyada - * (http://ladyada.net) - * -- Tuning, circular buffer, derivation from class Print/Stream, - * multi-instance support, porting to 8MHz processors, - * various optimizations, PROGMEM delay tables, inverse logic and - * direct port writing by Mikal Hart (http://www.arduiniana.org) - * -- Pin change interrupt macros by Paul Stoffregen (http://www.pjrc.com) - * -- 20MHz processor support by Garrett Mace (http://www.macetech.com) - * -- ATmega1280/2560 support by Brett Hagman (http://www.roguerobotics.com/) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * The latest version of this library can always be found at - * http://arduiniana.org. - */ - -#ifndef SOFTWARESERIAL_H -#define SOFTWARESERIAL_H - -#include -#include -//#include "serial.h" -#include -#include - -/****************************************************************************** -* Definitions -******************************************************************************/ - -#define _SS_MAX_RX_BUFF 64 // RX buffer size - -class SoftwareSerial : public Stream -{ -private: - // per object data - pin_t _receivePin; - pin_t _transmitPin; -// uint32_t _receiveBitMask; // for rx interrupts - uint32_t _receivePort; - uint32_t _receivePortPin; - - - // Expressed as 4-cycle delays (must never be 0!) - uint16_t _rx_delay_centering; - uint16_t _rx_delay_intrabit; - uint16_t _rx_delay_stopbit; - uint16_t _tx_delay; - - uint16_t _buffer_overflow:1; - uint16_t _inverse_logic:1; - - // static data - static unsigned char _receive_buffer[_SS_MAX_RX_BUFF]; - static volatile uint8_t _receive_buffer_tail; - static volatile uint8_t _receive_buffer_head; - static SoftwareSerial *active_object; - - // private methods - void recv(); - uint32_t rx_pin_read(); - void tx_pin_write(uint8_t pin_state); - void setTX(pin_t transmitPin); - void setRX(pin_t receivePin); - void setRxIntMsk(bool enable); - - // private static method for timing - static inline void tunedDelay(uint32_t delay); - -public: - // public methods - - SoftwareSerial(pin_t receivePin, pin_t transmitPin, bool inverse_logic = false); - ~SoftwareSerial(); - void begin(long speed); - bool listen(); - void end(); - bool isListening() { return this == active_object; } - bool stopListening(); - bool overflow() { bool ret = _buffer_overflow; if (ret) _buffer_overflow = false; return ret; } - int16_t peek(); - - virtual size_t write(uint8_t byte); - virtual int16_t read(); - virtual size_t available(); - virtual void flush(); - operator bool() { return true; } - - using Print::write; - //using HalSerial::write; - - // public only for easy access by interrupt handlers - static inline void handle_interrupt() __attribute__((__always_inline__)); -}; - -// Arduino 0012 workaround -#undef int -#undef char -#undef long -#undef byte -#undef float -#undef abs -#undef round - -#endif // SOFTWARESERIAL_H diff --git a/Marlin/src/HAL/HAL_LPC1768/include/Wire.cpp b/Marlin/src/HAL/HAL_LPC1768/include/Wire.cpp deleted file mode 100644 index 28e1fa9b56..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/include/Wire.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/* - TwoWire.cpp - TWI/I2C library for Wiring & Arduino - Copyright (c) 2006 Nicholas Zambetti. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifdef TARGET_LPC1768 - -extern "C" { - #include - #include - #include - #include - #include - #include -} - -#include - -#define USEDI2CDEV_M 1 - -#if (USEDI2CDEV_M == 0) - #define I2CDEV_M LPC_I2C0 -#elif (USEDI2CDEV_M == 1) - #define I2CDEV_M LPC_I2C1 -#elif (USEDI2CDEV_M == 2) - #define I2CDEV_M LPC_I2C2 -#else - #error "Master I2C device not defined!" -#endif - -// Initialize Class Variables ////////////////////////////////////////////////// - -uint8_t TwoWire::rxBuffer[BUFFER_LENGTH]; -uint8_t TwoWire::rxBufferIndex = 0; -uint8_t TwoWire::rxBufferLength = 0; - -uint8_t TwoWire::txAddress = 0; -uint8_t TwoWire::txBuffer[BUFFER_LENGTH]; -uint8_t TwoWire::txBufferIndex = 0; -uint8_t TwoWire::txBufferLength = 0; - -uint8_t TwoWire::transmitting = 0; - -// Constructors //////////////////////////////////////////////////////////////// - -TwoWire::TwoWire() { -} - -// Public Methods ////////////////////////////////////////////////////////////// - -void TwoWire::begin(void) { - rxBufferIndex = 0; - rxBufferLength = 0; - - txBufferIndex = 0; - txBufferLength = 0; - - /* - * Init I2C pin connect - */ - PINSEL_CFG_Type PinCfg; - PinCfg.OpenDrain = 0; - PinCfg.Pinmode = 0; - - #if USEDI2CDEV_M == 0 - PinCfg.Funcnum = 1; - PinCfg.Pinnum = 27; - PinCfg.Portnum = 0; - PINSEL_ConfigPin(&PinCfg); // SDA0 / D57 AUX-1 - PinCfg.Pinnum = 28; - PINSEL_ConfigPin(&PinCfg); // SCL0 / D58 AUX-1 - #endif - - #if USEDI2CDEV_M == 1 - PinCfg.Funcnum = 3; - PinCfg.Pinnum = 0; - PinCfg.Portnum = 0; - PINSEL_ConfigPin(&PinCfg); // SDA1 / D20 SCA - PinCfg.Pinnum = 1; - PINSEL_ConfigPin(&PinCfg); // SCL1 / D21 SCL - #endif - - #if USEDI2CDEV_M == 2 - PinCfg.Funcnum = 2; - PinCfg.Pinnum = 10; - PinCfg.Portnum = 0; - PINSEL_ConfigPin(&PinCfg); // SDA2 / D38 X_ENABLE_PIN - PinCfg.Pinnum = 11; - PINSEL_ConfigPin(&PinCfg); // SCL2 / D55 X_DIR_PIN - #endif - - // Initialize I2C peripheral - I2C_Init(I2CDEV_M, 100000); - - // Enable Master I2C operation - I2C_Cmd(I2CDEV_M, I2C_MASTER_MODE, ENABLE); -} - -uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity) { - // clamp to buffer length - if (quantity > BUFFER_LENGTH) - quantity = BUFFER_LENGTH; - - // perform blocking read into buffer - I2C_M_SETUP_Type transferMCfg; - transferMCfg.sl_addr7bit = address >> 1; // not sure about the right shift - transferMCfg.tx_data = NULL; - transferMCfg.tx_length = 0; - transferMCfg.rx_data = rxBuffer; - transferMCfg.rx_length = quantity; - transferMCfg.retransmissions_max = 3; - I2C_MasterTransferData(I2CDEV_M, &transferMCfg, I2C_TRANSFER_POLLING); - - // set rx buffer iterator vars - rxBufferIndex = 0; - rxBufferLength = transferMCfg.rx_count; - - return transferMCfg.rx_count; -} - -uint8_t TwoWire::requestFrom(int address, int quantity) { - return requestFrom((uint8_t)address, (uint8_t)quantity); -} - -void TwoWire::beginTransmission(uint8_t address) { - // indicate that we are transmitting - transmitting = 1; - // set address of targeted slave - txAddress = address; - // reset tx buffer iterator vars - txBufferIndex = 0; - txBufferLength = 0; -} - -void TwoWire::beginTransmission(int address) { - beginTransmission((uint8_t)address); -} - -uint8_t TwoWire::endTransmission(void) { - // transmit buffer (blocking) - I2C_M_SETUP_Type transferMCfg; - transferMCfg.sl_addr7bit = txAddress >> 1; // not sure about the right shift - transferMCfg.tx_data = txBuffer; - transferMCfg.tx_length = txBufferLength; - transferMCfg.rx_data = NULL; - transferMCfg.rx_length = 0; - transferMCfg.retransmissions_max = 3; - Status status = I2C_MasterTransferData(I2CDEV_M, &transferMCfg, I2C_TRANSFER_POLLING); - - // reset tx buffer iterator vars - txBufferIndex = 0; - txBufferLength = 0; - - // indicate that we are done transmitting - transmitting = 0; - - return status == SUCCESS ? 0 : 4; -} - -// must be called after beginTransmission(address) -size_t TwoWire::write(uint8_t data) { - if (transmitting) { - // don't bother if buffer is full - if (txBufferLength >= BUFFER_LENGTH) return 0; - - // put byte in tx buffer - txBuffer[txBufferIndex++] = data; - - // update amount in buffer - txBufferLength = txBufferIndex; - } - - return 1; -} - -// must be called after beginTransmission(address) -size_t TwoWire::write(const uint8_t *data, size_t quantity) { - size_t sent = 0; - if (transmitting) - for (sent = 0; sent < quantity; ++sent) - if (!write(data[sent])) break; - - return sent; -} - -// Must be called after requestFrom(address, numBytes) -int TwoWire::available(void) { - return rxBufferLength - rxBufferIndex; -} - -// Must be called after requestFrom(address, numBytes) -int TwoWire::read(void) { - return rxBufferIndex < rxBufferLength ? rxBuffer[rxBufferIndex++] : -1; -} - -// Must be called after requestFrom(address, numBytes) -int TwoWire::peek(void) { - return rxBufferIndex < rxBufferLength ? rxBuffer[rxBufferIndex] : -1; -} - -// Preinstantiate Objects ////////////////////////////////////////////////////// - -TwoWire Wire = TwoWire(); - -#endif // TARGET_LPC1768 \ No newline at end of file diff --git a/Marlin/src/HAL/HAL_LPC1768/include/Wire.h b/Marlin/src/HAL/HAL_LPC1768/include/Wire.h deleted file mode 100644 index b833d699e4..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/include/Wire.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - * TwoWire.h - TWI/I2C library for Arduino & Wiring - * Copyright (c) 2006 Nicholas Zambetti. All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Modified 2012 by Todd Krein (todd@krein.org) to implement repeated starts - */ - -#ifndef _TWOWIRE_H_ -#define _TWOWIRE_H_ - -#include - -#define BUFFER_LENGTH 32 - -class TwoWire { - private: - static uint8_t rxBuffer[]; - static uint8_t rxBufferIndex; - static uint8_t rxBufferLength; - - static uint8_t txAddress; - static uint8_t txBuffer[]; - static uint8_t txBufferIndex; - static uint8_t txBufferLength; - - static uint8_t transmitting; - - public: - TwoWire(); - void begin(); - void beginTransmission(uint8_t); - void beginTransmission(int); - uint8_t endTransmission(void); - uint8_t endTransmission(uint8_t); - - uint8_t requestFrom(uint8_t, uint8_t); - uint8_t requestFrom(int, int); - - virtual size_t write(uint8_t); - virtual size_t write(const uint8_t *, size_t); - virtual int available(void); - virtual int read(void); - virtual int peek(void); - - inline size_t write(unsigned long n) { return write((uint8_t)n); } - inline size_t write(long n) { return write((uint8_t)n); } - inline size_t write(unsigned int n) { return write((uint8_t)n); } - inline size_t write(int n) { return write((uint8_t)n); } -}; - -extern TwoWire Wire; - -#endif // _TWOWIRE_H_ diff --git a/Marlin/src/HAL/HAL_LPC1768/include/pinmapping.cpp b/Marlin/src/HAL/HAL_LPC1768/include/pinmapping.cpp deleted file mode 100644 index f05fa00ace..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/include/pinmapping.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/** - * 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 . - * - */ - -#ifdef TARGET_LPC1768 - -#include - -#include "../../../gcode/parser.h" - -// Get the digital pin for an analog index -pin_t analogInputToDigitalPin(const int8_t p) { - return (WITHIN(p, 0, NUM_ANALOG_INPUTS) ? adc_pin_table[p] : P_NC); -} - -// Return the index of a pin number -// The pin number given here is in the form ppp:nnnnn -int16_t GET_PIN_MAP_INDEX(const pin_t pin) { - const uint16_t index = (LPC1768_PIN_PORT(pin) << 5) | LPC1768_PIN_PIN(pin); - return (index < NUM_DIGITAL_PINS && pin_map[index] != P_NC) ? index : -1; -} - -// Test whether the pin is valid -bool VALID_PIN(const pin_t p) { - const int16_t ind = GET_PIN_MAP_INDEX(p); - return ind >= 0 && pin_map[ind] >= 0; -} - -// Get the analog index for a digital pin -int8_t DIGITAL_PIN_TO_ANALOG_PIN(const pin_t p) { - return (VALID_PIN(p) ? LPC1768_PIN_ADC(p) : -1); -} - -// Test whether the pin is PWM -bool PWM_PIN(const pin_t p) { - return VALID_PIN(p) && LPC1768_PIN_PWM(p); -} - -// Test whether the pin is interruptable -bool INTERRUPT_PIN(const pin_t p) { - return VALID_PIN(p) && LPC1768_PIN_INTERRUPT(p); -} - -// Get the pin number at the given index -pin_t GET_PIN_MAP_PIN(const int16_t ind) { - return WITHIN(ind, 0, NUM_DIGITAL_PINS - 1) ? pin_map[ind] : P_NC; -} - -int16_t PARSED_PIN_INDEX(const char code, const int16_t dval) { - const uint16_t val = (uint16_t)parser.intval(code), port = val / 100, pin = val % 100; - const int16_t ind = (port < (NUM_DIGITAL_PINS >> 5) && (pin < 32)) - ? GET_PIN_MAP_INDEX(port << 5 | pin) : -2; - return ind > -2 ? ind : dval; -} - -#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/include/pinmapping.h b/Marlin/src/HAL/HAL_LPC1768/include/pinmapping.h deleted file mode 100644 index de727b8bde..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/include/pinmapping.h +++ /dev/null @@ -1,294 +0,0 @@ -/** - * 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 . - * - */ - -#ifndef _PINMAPPING_H_ -#define _PINMAPPING_H_ - -#include "../../../inc/MarlinConfigPre.h" - -#include - -typedef int16_t pin_t; - -#define PORT_0 000 -#define PORT_1 001 -#define PORT_2 010 -#define PORT_3 011 -#define PORT_4 100 - -#define PORT_(p) PORT_##p -#define PORT(p) PORT_(p) - -#define PIN_0 00000 -#define PIN_1 00001 -#define PIN_2 00010 -#define PIN_3 00011 -#define PIN_4 00100 -#define PIN_5 00101 -#define PIN_6 00110 -#define PIN_7 00111 -#define PIN_8 01000 -#define PIN_9 01001 -#define PIN_10 01010 -#define PIN_11 01011 -#define PIN_12 01100 -#define PIN_13 01101 -#define PIN_14 01110 -#define PIN_15 01111 -#define PIN_16 10000 -#define PIN_17 10001 -#define PIN_18 10010 -#define PIN_19 10011 -#define PIN_20 10100 -#define PIN_21 10101 -#define PIN_22 10110 -#define PIN_23 10111 -#define PIN_24 11000 -#define PIN_25 11001 -#define PIN_26 11010 -#define PIN_27 11011 -#define PIN_28 11100 -#define PIN_29 11101 -#define PIN_30 11110 -#define PIN_31 11111 - -#define PIN_(p) PIN_##p -#define PIN(p) PIN_(p) - -#define ADC_NONE 0000 -#define ADC_CHAN_0 0001 -#define ADC_CHAN_1 0010 -#define ADC_CHAN_2 0011 -#define ADC_CHAN_3 0100 -#define ADC_CHAN_4 0101 -#define ADC_CHAN_5 0110 -#define ADC_CHAN_6 0111 -#define ADC_CHAN_7 1000 - -#define ADC_CHAN_(c) ADC_CHAN_##c -#define ADC_CHAN(p) ADC_CHAN_(p) - -#define BOOL_0 0 -#define BOOL_1 1 -#define BOOL_(b) BOOL_##b - -#define INTERRUPT(b) BOOL_(b) -#define PWM(b) BOOL_(b) - -// Combine elements into pin bits: 0b00AAAAWIPPPNNNNN -#define LPC1768_PIN_(port, pin, int, pwm, adc) 0b00##adc##pwm##int##port##pin -#define LPC1768_PIN(port, pin, int, pwm, adc) LPC1768_PIN_(port, pin, int, pwm, adc) - -constexpr uint8_t LPC1768_PIN_PORT(const pin_t pin) { return ((uint8_t)((pin >> 5) & 0b111)); } -constexpr uint8_t LPC1768_PIN_PIN(const pin_t pin) { return ((uint8_t)(pin & 0b11111)); } -constexpr bool LPC1768_PIN_INTERRUPT(const pin_t pin) { return (((pin >> 8) & 0b1) != 0); } -constexpr bool LPC1768_PIN_PWM(const pin_t pin) { return (((pin >> 9) & 0b1) != 0); } -constexpr int8_t LPC1768_PIN_ADC(const pin_t pin) { return (int8_t)((pin >> 10) & 0b1111) - 1; } - -// ****************** -// Runtime pinmapping -// ****************** -#define P_NC -1 - -#if SERIAL_PORT != 3 && SERIAL_PORT_2 != 3 - #define P0_00 LPC1768_PIN(PORT(0), PIN( 0), INTERRUPT(1), PWM(0), ADC_NONE) - #define P0_01 LPC1768_PIN(PORT(0), PIN( 1), INTERRUPT(1), PWM(0), ADC_NONE) -#endif -#if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0 - #define P0_02 LPC1768_PIN(PORT(0), PIN( 2), INTERRUPT(1), PWM(0), ADC_CHAN(7)) - #define P0_03 LPC1768_PIN(PORT(0), PIN( 3), INTERRUPT(1), PWM(0), ADC_CHAN(6)) -#endif -#define P0_04 LPC1768_PIN(PORT(0), PIN( 4), INTERRUPT(1), PWM(0), ADC_NONE) -#define P0_05 LPC1768_PIN(PORT(0), PIN( 5), INTERRUPT(1), PWM(0), ADC_NONE) -#define P0_06 LPC1768_PIN(PORT(0), PIN( 6), INTERRUPT(1), PWM(0), ADC_NONE) -#define P0_07 LPC1768_PIN(PORT(0), PIN( 7), INTERRUPT(1), PWM(0), ADC_NONE) -#define P0_08 LPC1768_PIN(PORT(0), PIN( 8), INTERRUPT(1), PWM(0), ADC_NONE) -#define P0_09 LPC1768_PIN(PORT(0), PIN( 9), INTERRUPT(1), PWM(0), ADC_NONE) -#if SERIAL_PORT != 2 && SERIAL_PORT_2 != 2 - #define P0_10 LPC1768_PIN(PORT(0), PIN(10), INTERRUPT(1), PWM(0), ADC_NONE) - #define P0_11 LPC1768_PIN(PORT(0), PIN(11), INTERRUPT(1), PWM(0), ADC_NONE) -#endif -#if SERIAL_PORT != 1 && SERIAL_PORT_2 != 1 - #define P0_15 LPC1768_PIN(PORT(0), PIN(15), INTERRUPT(1), PWM(0), ADC_NONE) - #define P0_16 LPC1768_PIN(PORT(0), PIN(16), INTERRUPT(1), PWM(0), ADC_NONE) -#endif -#define P0_17 LPC1768_PIN(PORT(0), PIN(17), INTERRUPT(1), PWM(0), ADC_NONE) -#define P0_18 LPC1768_PIN(PORT(0), PIN(18), INTERRUPT(1), PWM(0), ADC_NONE) -#define P0_19 LPC1768_PIN(PORT(0), PIN(19), INTERRUPT(1), PWM(0), ADC_NONE) -#define P0_20 LPC1768_PIN(PORT(0), PIN(20), INTERRUPT(1), PWM(0), ADC_NONE) -#define P0_21 LPC1768_PIN(PORT(0), PIN(21), INTERRUPT(1), PWM(0), ADC_NONE) -#define P0_22 LPC1768_PIN(PORT(0), PIN(22), INTERRUPT(1), PWM(0), ADC_NONE) -#define P0_23 LPC1768_PIN(PORT(0), PIN(23), INTERRUPT(1), PWM(0), ADC_CHAN(0)) -#define P0_24 LPC1768_PIN(PORT(0), PIN(24), INTERRUPT(1), PWM(0), ADC_CHAN(1)) -#define P0_25 LPC1768_PIN(PORT(0), PIN(25), INTERRUPT(1), PWM(0), ADC_CHAN(2)) -#define P0_26 LPC1768_PIN(PORT(0), PIN(26), INTERRUPT(1), PWM(0), ADC_CHAN(3)) -#define P0_27 LPC1768_PIN(PORT(0), PIN(27), INTERRUPT(1), PWM(0), ADC_NONE) -#define P0_28 LPC1768_PIN(PORT(0), PIN(28), INTERRUPT(1), PWM(0), ADC_NONE) -#if SERIAL_PORT != -1 && SERIAL_PORT_2 != -1 - #define P0_29 LPC1768_PIN(PORT(0), PIN(29), INTERRUPT(1), PWM(0), ADC_NONE) - #define P0_30 LPC1768_PIN(PORT(0), PIN(30), INTERRUPT(1), PWM(0), ADC_NONE) -#endif -#define P1_00 LPC1768_PIN(PORT(1), PIN( 0), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_01 LPC1768_PIN(PORT(1), PIN( 1), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_04 LPC1768_PIN(PORT(1), PIN( 4), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_08 LPC1768_PIN(PORT(1), PIN( 8), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_09 LPC1768_PIN(PORT(1), PIN( 9), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_10 LPC1768_PIN(PORT(1), PIN(10), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_14 LPC1768_PIN(PORT(1), PIN(14), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_15 LPC1768_PIN(PORT(1), PIN(15), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_16 LPC1768_PIN(PORT(1), PIN(16), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_17 LPC1768_PIN(PORT(1), PIN(17), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_18 LPC1768_PIN(PORT(1), PIN(18), INTERRUPT(0), PWM(1), ADC_NONE) -#define P1_19 LPC1768_PIN(PORT(1), PIN(19), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_20 LPC1768_PIN(PORT(1), PIN(20), INTERRUPT(0), PWM(1), ADC_NONE) -#define P1_21 LPC1768_PIN(PORT(1), PIN(21), INTERRUPT(0), PWM(1), ADC_NONE) -#define P1_22 LPC1768_PIN(PORT(1), PIN(22), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_23 LPC1768_PIN(PORT(1), PIN(23), INTERRUPT(0), PWM(1), ADC_NONE) -#define P1_24 LPC1768_PIN(PORT(1), PIN(24), INTERRUPT(0), PWM(1), ADC_NONE) -#define P1_25 LPC1768_PIN(PORT(1), PIN(25), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_26 LPC1768_PIN(PORT(1), PIN(26), INTERRUPT(0), PWM(1), ADC_NONE) -#define P1_27 LPC1768_PIN(PORT(1), PIN(27), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_28 LPC1768_PIN(PORT(1), PIN(28), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_29 LPC1768_PIN(PORT(1), PIN(29), INTERRUPT(0), PWM(0), ADC_NONE) -#define P1_30 LPC1768_PIN(PORT(1), PIN(30), INTERRUPT(0), PWM(0), ADC_CHAN(4)) -#define P1_31 LPC1768_PIN(PORT(1), PIN(31), INTERRUPT(0), PWM(0), ADC_CHAN(5)) -#define P2_00 LPC1768_PIN(PORT(2), PIN( 0), INTERRUPT(1), PWM(1), ADC_NONE) -#define P2_01 LPC1768_PIN(PORT(2), PIN( 1), INTERRUPT(1), PWM(1), ADC_NONE) -#define P2_02 LPC1768_PIN(PORT(2), PIN( 2), INTERRUPT(1), PWM(1), ADC_NONE) -#define P2_03 LPC1768_PIN(PORT(2), PIN( 3), INTERRUPT(1), PWM(1), ADC_NONE) -#define P2_04 LPC1768_PIN(PORT(2), PIN( 4), INTERRUPT(1), PWM(1), ADC_NONE) -#define P2_05 LPC1768_PIN(PORT(2), PIN( 5), INTERRUPT(1), PWM(1), ADC_NONE) -#define P2_06 LPC1768_PIN(PORT(2), PIN( 6), INTERRUPT(1), PWM(0), ADC_NONE) -#define P2_07 LPC1768_PIN(PORT(2), PIN( 7), INTERRUPT(1), PWM(0), ADC_NONE) -#define P2_08 LPC1768_PIN(PORT(2), PIN( 8), INTERRUPT(1), PWM(0), ADC_NONE) -#define P2_09 LPC1768_PIN(PORT(2), PIN( 9), INTERRUPT(1), PWM(0), ADC_NONE) -#define P2_10 LPC1768_PIN(PORT(2), PIN(10), INTERRUPT(1), PWM(0), ADC_NONE) -#define P2_11 LPC1768_PIN(PORT(2), PIN(11), INTERRUPT(1), PWM(0), ADC_NONE) -#define P2_12 LPC1768_PIN(PORT(2), PIN(12), INTERRUPT(1), PWM(0), ADC_NONE) -#define P2_13 LPC1768_PIN(PORT(2), PIN(13), INTERRUPT(1), PWM(0), ADC_NONE) -#define P3_25 LPC1768_PIN(PORT(3), PIN(25), INTERRUPT(0), PWM(1), ADC_NONE) -#define P3_26 LPC1768_PIN(PORT(3), PIN(26), INTERRUPT(0), PWM(1), ADC_NONE) -#define P4_28 LPC1768_PIN(PORT(4), PIN(28), INTERRUPT(0), PWM(0), ADC_NONE) -#define P4_29 LPC1768_PIN(PORT(4), PIN(29), INTERRUPT(0), PWM(0), ADC_NONE) - -// Pin index for M43 and M226 -constexpr pin_t pin_map[] = { - #if SERIAL_PORT != 3 && SERIAL_PORT_2 != 3 - P0_00, P0_01, - #else - P_NC, P_NC, - #endif - #if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0 - P0_02, P0_03, - #else - P_NC, P_NC, - #endif - P0_04, P0_05, P0_06, P0_07, - P0_08, P0_09, - #if SERIAL_PORT != 2 && SERIAL_PORT_2 != 2 - P0_10, P0_11, - #else - P_NC, P_NC, - #endif - P_NC, P_NC, P_NC, - #if SERIAL_PORT != 1 && SERIAL_PORT_2 != 1 - P0_15, - P0_16, - #else - P_NC, - P_NC, - #endif - P0_17, P0_18, P0_19, P0_20, P0_21, P0_22, P0_23, - P0_24, P0_25, P0_26, P0_27, P0_28, - #if SERIAL_PORT != -1 && SERIAL_PORT_2 != -1 - P0_29, P0_30, - #else - P_NC, P_NC, - #endif - P_NC, - - P1_00, P1_01, P_NC, P_NC, P1_04, P_NC, P_NC, P_NC, - P1_08, P1_09, P1_10, P_NC, P_NC, P_NC, P1_14, P1_15, - P1_16, P1_17, P1_18, P1_19, P1_20, P1_21, P1_22, P1_23, - P1_24, P1_25, P1_26, P1_27, P1_28, P1_29, P1_30, P1_31, - - P2_00, P2_01, P2_02, P2_03, P2_04, P2_05, P2_06, P2_07, - P2_08, P2_09, P2_10, P2_11, P2_12, P2_13, P_NC, P_NC, - P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, - P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, - - P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, - P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, - P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, - P_NC, P3_25, P3_26, P_NC, P_NC, P_NC, P_NC, P_NC, - - P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, - P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, - P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, P_NC, - P_NC, P_NC, P_NC, P_NC, P4_28, P4_29, P_NC, P_NC -}; - -constexpr uint8_t NUM_DIGITAL_PINS = COUNT(pin_map); - -constexpr pin_t adc_pin_table[] = { - P0_23, P0_24, P0_25, P0_26, P1_30, P1_31, - #if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0 - P0_03, P0_02 - #endif -}; - -#if SERIAL_PORT != 0 && SERIAL_PORT_2 != 0 - #define NUM_ANALOG_INPUTS 8 -#else - #define NUM_ANALOG_INPUTS 6 -#endif - -// P0.6 thru P0.9 are for the onboard SD card -#define HAL_SENSITIVE_PINS P0_06, P0_07, P0_08, P0_09 - -// Get the digital pin for an analog index -pin_t analogInputToDigitalPin(const int8_t p); -#define digitalPinToInterrupt(pin) (pin) -// Return the index of a pin number -// The pin number given here is in the form ppp:nnnnn -int16_t GET_PIN_MAP_INDEX(const pin_t pin); - -// Test whether the pin is valid -bool VALID_PIN(const pin_t p); - -// Get the analog index for a digital pin -int8_t DIGITAL_PIN_TO_ANALOG_PIN(const pin_t p); - -// Test whether the pin is PWM -bool PWM_PIN(const pin_t p); - -// Test whether the pin is interruptable -bool INTERRUPT_PIN(const pin_t p); -#define LPC1768_PIN_INTERRUPT_M(pin) (((pin >> 8) & 0b1) != 0) - -// Get the pin number at the given index -pin_t GET_PIN_MAP_PIN(const int16_t ind); - -// Parse a G-code word into a pin index -int16_t PARSED_PIN_INDEX(const char code, const int16_t dval); - -#endif // _PINMAPPING_H_ diff --git a/Marlin/src/HAL/HAL_LPC1768/include/serial.h b/Marlin/src/HAL/HAL_LPC1768/include/serial.h deleted file mode 100644 index 3fe8a8cb1d..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/include/serial.h +++ /dev/null @@ -1,161 +0,0 @@ -/** - * 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 . - * - */ - -#ifndef _HAL_SERIAL_H_ -#define _HAL_SERIAL_H_ - -#include "../../../inc/MarlinConfigPre.h" -#if ENABLED(EMERGENCY_PARSER) - #include "../../../feature/emergency_parser.h" -#endif - -#include -#include -#include - -/** - * Generic RingBuffer - * T type of the buffer array - * S size of the buffer (must be power of 2) - */ - -template class RingBuffer { -public: - RingBuffer() {index_read = index_write = 0;} - - uint32_t available() {return mask(index_write - index_read);} - uint32_t free() {return buffer_size - available();} - bool empty() {return index_read == index_write;} - bool full() {return next(index_write) == index_read;} - void clear() {index_read = index_write = 0;} - - bool peek(T *const value) { - if (value == nullptr || empty()) return false; - *value = buffer[index_read]; - return true; - } - - uint32_t read(T *const value) { - if (value == nullptr || empty()) return 0; - *value = buffer[index_read]; - index_read = next(index_read); - return 1; - } - - uint32_t write(T value) { - uint32_t next_head = next(index_write); - if (next_head == index_read) return 0; // buffer full - buffer[index_write] = value; - index_write = next_head; - return 1; - } - -private: - inline uint32_t mask(uint32_t val) { - return val & buffer_mask; - } - - inline uint32_t next(uint32_t val) { - return mask(val + 1); - } - - static const uint32_t buffer_size = S; - static const uint32_t buffer_mask = buffer_size - 1; - T buffer[buffer_size]; - volatile uint32_t index_write; - volatile uint32_t index_read; -}; - -/** - * Serial Interface Class - * Data is injected directly into, and consumed from, the fifo buffers - */ - -class HalSerial: public Print { -public: - - #if ENABLED(EMERGENCY_PARSER) - EmergencyParser::State emergency_state; - #endif - - HalSerial() : host_connected(false) { } - virtual ~HalSerial() { } - - operator bool() { return host_connected; } - - void begin(int32_t baud) { } - - int16_t peek() { - uint8_t value; - return receive_buffer.peek(&value) ? value : -1; - } - - int16_t read() { - uint8_t value; - return receive_buffer.read(&value) ? value : -1; - } - - size_t write(const uint8_t c) { - if (!host_connected) return 0; // Do not fill buffer when host disconnected - while (transmit_buffer.write(c) == 0) { // Block until there is free room in buffer - if (!host_connected) return 0; // Break infinite loop on host disconect - } - return 1; - } - - size_t available() { - return (size_t)receive_buffer.available(); - } - - void flush() { - receive_buffer.clear(); - } - - uint8_t availableForWrite(void) { - return transmit_buffer.free() > 255 ? 255 : (uint8_t)transmit_buffer.free(); - } - - void flushTX(void) { - while (transmit_buffer.available() && host_connected) { /* nada */} - } - - size_t printf(const char *format, ...) { - static char buffer[256]; - va_list vArgs; - va_start(vArgs, format); - int length = vsnprintf((char *) buffer, 256, (char const *) format, vArgs); - va_end(vArgs); - size_t i = 0; - if (length > 0 && length < 256) { - while (i < (size_t)length && host_connected) { - i += transmit_buffer.write(buffer[i]); - } - } - return i; - } - - RingBuffer receive_buffer; - RingBuffer transmit_buffer; - volatile bool host_connected; -}; - -#endif // _HAL_SERIAL_H_ diff --git a/Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py b/Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py deleted file mode 100644 index 44ded586fe..0000000000 --- a/Marlin/src/HAL/HAL_LPC1768/lpc1768_flag_script.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import print_function -import sys - -#dynamic build flags for generic compile options -if __name__ == "__main__": - args = " ".join([ "-std=gnu11", - "-std=gnu++11", - "-Os", - "-mcpu=cortex-m3", - "-mthumb", - - "-fsigned-char", - "-fno-move-loop-invariants", - "-fno-strict-aliasing", - "-fsingle-precision-constant", - - "--specs=nano.specs", - "--specs=nosys.specs", - - # For external libraries - "-IMarlin/src/HAL/HAL_LPC1768/include", - - # For MarlinFirmware/U8glib-HAL - "-IMarlin/src/HAL/HAL_LPC1768/u8g", - "-DU8G_HAL_LINKS", - - "-MMD", - "-MP", - "-DTARGET_LPC1768" - ]) - - for i in range(1, len(sys.argv)): - args += " " + sys.argv[i] - - print(args) - -# extra script for linker options -else: - from SCons.Script import DefaultEnvironment - env = DefaultEnvironment() - env.Append( - ARFLAGS=["rcs"], - - ASFLAGS=["-x", "assembler-with-cpp"], - - CXXFLAGS=[ - "-fabi-version=0", - "-fno-use-cxa-atexit", - "-fno-threadsafe-statics" - ], - LINKFLAGS=[ - "-Wl,-Tframeworks/CMSIS/LPC1768/system/LPC1768.ld,--gc-sections", - "-Os", - "-mcpu=cortex-m3", - "-mthumb", - "--specs=nano.specs", - "--specs=nosys.specs", - "-u_printf_float" - ], - ) diff --git a/Marlin/src/HAL/HAL_LPC1768/main.cpp b/Marlin/src/HAL/HAL_LPC1768/main.cpp index 399120dac7..02207c6109 100644 --- a/Marlin/src/HAL/HAL_LPC1768/main.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/main.cpp @@ -1,15 +1,5 @@ #ifdef TARGET_LPC1768 -// --------------------- -// Userspace entry point -// --------------------- -extern void setup(); -extern void loop(); - -extern "C" { - #include -} - #include #include #include @@ -17,84 +7,78 @@ extern "C" { #include #include #include +#include +#include extern "C" { #include - #include - #include } +#include "../../sd/cardreader.h" #include "../../inc/MarlinConfig.h" #include "HAL.h" -#include "fastio.h" #include "HAL_timers.h" -#include -#include -#include -#include "serial.h" -#include "LPC1768_PWM.h" - -static __INLINE uint32_t SysTick_Config(uint32_t ticks) { - if (ticks > SysTick_LOAD_RELOAD_Msk) return 1; - - SysTick->LOAD = (ticks & SysTick_LOAD_RELOAD_Msk) - 1; // Set reload register - SysTick->VAL = 0; // Load the SysTick Counter Value - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_TICKINT_Msk | - SysTick_CTRL_ENABLE_Msk; // Enable SysTick IRQ and SysTick Timer - - NVIC_SetPriority(SysTick_IRQn, NVIC_EncodePriority(0, 0, 0)); // Set Priority for Cortex-M3 System Interrupts - return 0; -} - -extern "C" { - extern int isLPC1769(); - extern void disk_timerproc(void); - volatile uint32_t _millis; - - void SysTick_Handler(void) { - ++_millis; - disk_timerproc(); - } - - // Runs after clock init and before global static constructors - void SystemPostInit() { - _millis = 0; // Initialize the millisecond counter value - SysTick_Config(SystemCoreClock / 1000); // Start millisecond global counter - - // Runs before setup() to configure LED_PIN and used to indicate successful bootloader execution - #if PIN_EXISTS(LED) - SET_DIR_OUTPUT(LED_PIN); - WRITE_PIN_CLR(LED_PIN); - - // MKS_SBASE has 3 other LEDs the bootloader uses during flashing. Clear them. - SET_DIR_OUTPUT(P1_19); - WRITE_PIN_CLR(P1_19); - SET_DIR_OUTPUT(P1_20); - WRITE_PIN_CLR(P1_20); - SET_DIR_OUTPUT(P1_21); - WRITE_PIN_CLR(P1_21); - - for (uint8_t i = 6; i--;) { - TOGGLE(LED_PIN); - delay(100); - } - #endif - } -} extern uint32_t MSC_SD_Init(uint8_t pdrv); +extern "C" int isLPC1769(); +extern "C" void disk_timerproc(void); -int main(void) { +void SysTick_Callback() { + disk_timerproc(); +} - (void)MSC_SD_Init(0); +void HAL_init() { + + // Support the 4 LEDs some LPC176x boards have + #if PIN_EXISTS(LED) + SET_DIR_OUTPUT(LED_PIN); + WRITE_PIN_CLR(LED_PIN); + #if PIN_EXISTS(LED2) + SET_DIR_OUTPUT(LED2_PIN); + WRITE_PIN_CLR(LED2_PIN); + #if PIN_EXISTS(LED3) + SET_DIR_OUTPUT(LED3_PIN); + WRITE_PIN_CLR(LED3_PIN); + #if PIN_EXISTS(LED4) + SET_DIR_OUTPUT(LED4_PIN); + WRITE_PIN_CLR(LED4_PIN); + #endif + #endif + #endif + + // Flash status LED 3 times to indicate Marlin has started booting + for (uint8_t i = 0; i < 6; ++i) { + TOGGLE(LED_PIN); + delay(100); + } + #endif + + //debug_frmwrk_init(); + //_DBG("\n\nDebug running\n"); + // Initialise the SD card chip select pins as soon as possible + #if PIN_EXISTS(SS) + WRITE(SS_PIN, HIGH); + SET_OUTPUT(SS_PIN); + #endif + + #if defined(ONBOARD_SD_CS) && ONBOARD_SD_CS > -1 + WRITE(ONBOARD_SD_CS, HIGH); + SET_OUTPUT(ONBOARD_SD_CS); + #endif USB_Init(); // USB Initialization - USB_Connect(TRUE); // USB Connect + USB_Connect(FALSE); // USB clear connection + delay(1000); // Give OS time to notice + USB_Connect(TRUE); - const uint32_t usb_timeout = millis() + 2000; + #if DISABLED(USB_SD_DISABLED) + MSC_SD_Init(0); // Enable USB SD card access + #endif + + const millis_t usb_timeout = millis() + 2000; while (!USB_Configuration && PENDING(millis(), usb_timeout)) { delay(50); + HAL_idletask(); #if PIN_EXISTS(LED) TOGGLE(LED_PIN); // Flash quickly during USB initialization #endif @@ -110,11 +94,25 @@ int main(void) { #endif HAL_timer_init(); +} - LPC1768_PWM_init(); - - setup(); - for (;;) loop(); +// HAL idle task +void HAL_idletask(void) { + #if ENABLED(SDSUPPORT) && ENABLED(SHARED_SD_CARD) + // If Marlin is using the SD card we need to lock it to prevent access from + // a PC via USB. + // Other HALs use IS_SD_PRINTING() and IS_SD_FILE_OPEN() to check for access but + // this will not reliably detect delete operations. To be safe we will lock + // 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) + MSC_Aquire_Lock(); + else + MSC_Release_Lock(); + #endif + // Perform USB stack housekeeping + MSC_RunDeferredCommands(); } #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/persistent_store_api.h b/Marlin/src/HAL/HAL_LPC1768/persistent_store_api.h index 9f6d626491..fb659b396c 100644 --- a/Marlin/src/HAL/HAL_LPC1768/persistent_store_api.h +++ b/Marlin/src/HAL/HAL_LPC1768/persistent_store_api.h @@ -21,4 +21,4 @@ */ #include "../shared/persistent_store_api.h" -//#define FLASH_EEPROM +#define FLASH_EEPROM diff --git a/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp b/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp index daffddf079..ce6ab7de65 100644 --- a/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp @@ -69,20 +69,15 @@ bool PersistentStore::access_start() { __disable_irq(); status = BlankCheckSector(EEPROM_SECTOR, EEPROM_SECTOR, &first_nblank_loc, &first_nblank_val); __enable_irq(); - SERIAL_PROTOCOLLNPAIR("Blank check status: ", status); + if (status == CMD_SUCCESS) { // sector is blank so nothing stored yet - SERIAL_PROTOCOLLNPGM("FLASH empty"); for (int i = 0; i < EEPROM_SIZE; i++) ram_eeprom[i] = EEPROM_ERASE; current_slot = EEPROM_SLOTS; - } - else { + } else { // current slot is the first non blank one current_slot = first_nblank_loc / EEPROM_SIZE; - SERIAL_PROTOCOLLNPAIR("Flash slot: ", current_slot); uint8_t *eeprom_data = SLOT_ADDRESS(EEPROM_SECTOR, current_slot); - SERIAL_PROTOCOLLNPAIR("Address: ", (int)eeprom_data); - // load current settings for (int i = 0; i < EEPROM_SIZE; i++) ram_eeprom[i] = eeprom_data[i]; } @@ -100,15 +95,15 @@ bool PersistentStore::access_finish() { PrepareSector(EEPROM_SECTOR, EEPROM_SECTOR); status = EraseSector(EEPROM_SECTOR, EEPROM_SECTOR); __enable_irq(); - SERIAL_PROTOCOLLNPAIR("Erase status: ", status); + current_slot = EEPROM_SLOTS - 1; } - SERIAL_PROTOCOLLNPAIR("Writing data to: ", current_slot); + __disable_irq(); PrepareSector(EEPROM_SECTOR, EEPROM_SECTOR); status = CopyRAM2Flash(SLOT_ADDRESS(EEPROM_SECTOR, current_slot), ram_eeprom, IAP_WRITE_4096); __enable_irq(); - SERIAL_PROTOCOLLNPAIR("CopyRAM2Flash status: ", status); + if (status != CMD_SUCCESS) return false; eeprom_dirty = false; } @@ -116,7 +111,7 @@ bool PersistentStore::access_finish() { } bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { - for (int i = 0; i < size; i++) ram_eeprom[pos + i] = value[i]; + for (size_t i = 0; i < size; i++) ram_eeprom[pos + i] = value[i]; eeprom_dirty = true; crc16(crc, value, size); pos += size; @@ -125,7 +120,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing/*=true*/) { const uint8_t * const buff = writing ? &value[0] : &ram_eeprom[pos]; - if (writing) for (int i = 0; i < size; i++) value[i] = ram_eeprom[pos + i]; + if (writing) for (size_t i = 0; i < size; i++) value[i] = ram_eeprom[pos + i]; crc16(crc, buff, size); pos += size; return false; // return true for any error diff --git a/Marlin/src/HAL/HAL_LPC1768/spi_pins.h b/Marlin/src/HAL/HAL_LPC1768/spi_pins.h index 841a3f845f..76c19c1176 100644 --- a/Marlin/src/HAL/HAL_LPC1768/spi_pins.h +++ b/Marlin/src/HAL/HAL_LPC1768/spi_pins.h @@ -50,7 +50,8 @@ #ifndef SS_PIN #define SS_PIN P1_23 #endif -#ifndef SDSS +#if !defined(SDSS) || SDSS == P_NC // gets defaulted in pins.h + #undef SDSS #define SDSS SS_PIN #endif diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c b/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c index 80bf5fc633..12e8b45990 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/HAL_LCD_I2C_routines.c @@ -33,6 +33,8 @@ #include #include +#include "../../../core/millis_t.h" + ////////////////////////////////////////////////////////////////////////////////////// // These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to @@ -149,14 +151,14 @@ void u8g_i2c_init(uint8_t clock_option) { u8g_i2c_start(0); // send slave address and write bit } -volatile extern uint32_t _millis; +volatile extern millis_t _millis; uint8_t u8g_i2c_send_byte(uint8_t data) { #define I2C_TIMEOUT 3 LPC_I2C1->I2DAT = data & I2C_I2DAT_BITMASK; // transmit data LPC_I2C1->I2CONSET = I2C_I2CONSET_AA; LPC_I2C1->I2CONCLR = I2C_I2CONCLR_SIC; - uint32_t timeout = _millis + I2C_TIMEOUT; - while ((I2C_status != I2C_I2STAT_M_TX_DAT_ACK) && (I2C_status != I2C_I2STAT_M_TX_DAT_NACK) && (timeout > _millis)); // wait for xmit to finish + const millis_t timeout = _millis + I2C_TIMEOUT; + while ((I2C_status != I2C_I2STAT_M_TX_DAT_ACK) && (I2C_status != I2C_I2STAT_M_TX_DAT_NACK) && PENDING(_millis, timeout)); // wait for xmit to finish // had hangs with SH1106 so added time out - have seen temporary screen corruption when this happens return 1; } diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_hw_spi.cpp b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp similarity index 99% rename from Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_hw_spi.cpp rename to Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp index 9cd913f743..9ac0ae460c 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_hw_spi.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp @@ -55,7 +55,7 @@ #ifdef TARGET_LPC1768 -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if ENABLED(DOGLCD) diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp similarity index 99% rename from Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp rename to Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp index 06399d3947..110d9149c4 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp @@ -77,7 +77,7 @@ #ifdef TARGET_LPC1768 -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if ENABLED(DOGLCD) diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction similarity index 100% rename from Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction rename to Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_sw_i2c.cpp under construction diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp similarity index 98% rename from Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp rename to Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp index 6b036ba5ea..827ae5abde 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp @@ -55,13 +55,13 @@ #ifdef TARGET_LPC1768 -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if ENABLED(DOGLCD) //#include #include -#include "../shared/Delay.h" +#include "../../shared/Delay.h" #define SPI_FULL_SPEED 0 #define SPI_HALF_SPEED 1 diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp similarity index 98% rename from Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp rename to Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp index a189b9126d..9e9b76439a 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp @@ -55,14 +55,15 @@ #ifdef TARGET_LPC1768 -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if ENABLED(DOGLCD) #include #include "SoftwareSPI.h" -#include "../shared/Delay.h" +#include "../../shared/Delay.h" +#undef SPI_SPEED #define SPI_SPEED 3 // About 1 MHz static pin_t SCK_pin_ST7920_HAL, MOSI_pin_ST7920_HAL_HAL; diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_sw_spi.cpp b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp similarity index 98% rename from Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_sw_spi.cpp rename to Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp index 533ebda37c..43b46d5ddf 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_sw_spi.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp @@ -55,13 +55,14 @@ #ifdef TARGET_LPC1768 -#include "../../inc/MarlinConfigPre.h" +#include "../../../inc/MarlinConfigPre.h" #if ENABLED(DOGLCD) #include #include "SoftwareSPI.h" +#undef SPI_SPEED #define SPI_SPEED 2 // About 2 MHz static uint8_t SPI_speed = 0; diff --git a/Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp b/Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp new file mode 100644 index 0000000000..d143bae709 --- /dev/null +++ b/Marlin/src/HAL/HAL_LPC1768/usb_serial.cpp @@ -0,0 +1,13 @@ +#ifdef TARGET_LPC1768 +#include "../../inc/MarlinConfigPre.h" + +#if ENABLED(EMERGENCY_PARSER) + #include "../../feature/emergency_parser.h" + EmergencyParser::State emergency_state; + bool CDC_RecvCallback(const char buffer) { + emergency_parser.update(emergency_state, buffer); + return true; + } +#endif // ENABLED(EMERGENCY_PARSER) + +#endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp b/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp index 589e05ebd6..913735636f 100644 --- a/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp @@ -30,7 +30,29 @@ #include "watchdog.h" void watchdog_init(void) { - WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_RESET); + #if ENABLED(WATCHDOG_RESET_MANUAL) + // We enable the watchdog timer, but only for the interrupt. + + // Configure WDT to only trigger an interrupt + // Disable WDT interrupt (just in case, to avoid triggering it!) + NVIC_DisableIRQ(WDT_IRQn); + + // We NEED memory barriers to ensure Interrupts are actually disabled! + // ( https://dzone.com/articles/nvic-disabling-interrupts-on-arm-cortex-m-and-the ) + __DSB(); + __ISB(); + + // Configure WDT to only trigger an interrupt + // Initialize WDT with the given parameters + WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_INT_ONLY); + + // Configure and enable WDT interrupt. + NVIC_ClearPendingIRQ(WDT_IRQn); + NVIC_SetPriority(WDT_IRQn, 0); // Use highest priority, so we detect all kinds of lockups + NVIC_EnableIRQ(WDT_IRQn); + #else + WDT_Init(WDT_CLKSRC_IRC, WDT_MODE_RESET); + #endif WDT_Start(WDT_TIMEOUT); } @@ -45,14 +67,16 @@ uint8_t HAL_get_reset_source(void) { void watchdog_reset() { WDT_Feed(); - #if PIN_EXISTS(LED) - TOGGLE(LED_PIN); // heart beat indicator + #if DISABLED(PINS_DEBUGGING) && PIN_EXISTS(LED) + TOGGLE(LED_PIN); // heartbeat indicator #endif } #else + void HAL_clear_reset_source(void) {} uint8_t HAL_get_reset_source(void) { return RST_POWER_ON; } + #endif // USE_WATCHDOG #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/HAL_LPC1768/win_usb_driver/lpc176x_usb_driver.inf b/Marlin/src/HAL/HAL_LPC1768/win_usb_driver/lpc176x_usb_driver.inf new file mode 100644 index 0000000000..4732eb8552 --- /dev/null +++ b/Marlin/src/HAL/HAL_LPC1768/win_usb_driver/lpc176x_usb_driver.inf @@ -0,0 +1,36 @@ +[Version] +Signature="$Windows NT$" +Class=Ports +ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} +Provider=%PROVIDER% +DriverVer =04/14/2008, 5.1.2600.5512 + +[Manufacturer] +%PROVIDER%=DeviceList,ntamd64 + + +[DeviceList] +%DESCRIPTION%=LPC1768USB, USB\VID_1D50&PID_6029&MI_00 + +[DeviceList.ntamd64] +%DESCRIPTION%=LPC1768USB, USB\VID_1D50&PID_6029&MI_00 + + +[LPC1768USB] +include=mdmcpq.inf +CopyFiles=FakeModemCopyFileSection +AddReg=LowerFilterAddReg,SerialPropPageAddReg + +[LPC1768USB.Services] +include=mdmcpq.inf +AddService=usbser, 0x00000002, LowerFilter_Service_Inst + +[SerialPropPageAddReg] +HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" + + +[Strings] +PROVIDER = "marlinfw.org" +DRIVER.SVC = "Marlin USB Driver" +DESCRIPTION= "Marlin USB Serial" +COMPOSITE = "Marlin USB VCOM" \ No newline at end of file diff --git a/Marlin/src/HAL/HAL_STM32/HAL.cpp b/Marlin/src/HAL/HAL_STM32/HAL.cpp index 2cef2bd0e2..09c598e238 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL.cpp +++ b/Marlin/src/HAL/HAL_STM32/HAL.cpp @@ -29,6 +29,8 @@ #include "HAL.h" +#include "../../inc/MarlinConfig.h" + #if ENABLED(EEPROM_EMULATED_WITH_SRAM) #if STM32F7xx #include "stm32f7xx_ll_pwr.h" diff --git a/Marlin/src/HAL/HAL_STM32/HAL.h b/Marlin/src/HAL/HAL_STM32/HAL.h index 7d789d7418..aa2c98f268 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL.h +++ b/Marlin/src/HAL/HAL_STM32/HAL.h @@ -41,6 +41,7 @@ #include #endif +#include "../../inc/MarlinConfigPre.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" #include "fastio_STM32.h" @@ -87,7 +88,7 @@ #endif #define NUM_SERIAL 2 #if SERIAL_PORT_2 == -1 - #define MYSERIAL1 Serial0 // TODO Once CDC is supported + #define MYSERIAL1 SerialUSB #elif SERIAL_PORT_2 == 1 #define MYSERIAL1 Serial1 #elif SERIAL_PORT_2 == 2 diff --git a/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.cpp b/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.cpp index 24a627aa38..217c8796ef 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.cpp +++ b/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.cpp @@ -79,7 +79,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { TimerHandle[timer_num].timer = STEP_TIMER_DEV; TimerHandle[timer_num].irqHandle = Step_Handler; TimerHandleInit(&TimerHandle[timer_num], (((HAL_TIMER_RATE) / step_prescaler) / frequency) - 1, step_prescaler); - HAL_NVIC_SetPriority(STEP_TIMER_IRQ_NAME, 6, 0); + HAL_NVIC_SetPriority(STEP_TIMER_IRQ_NAME, STEP_TIMER_IRQ_PRIO, 0); break; case TEMP_TIMER_NUM: @@ -87,7 +87,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { TimerHandle[timer_num].timer = TEMP_TIMER_DEV; TimerHandle[timer_num].irqHandle = Temp_Handler; TimerHandleInit(&TimerHandle[timer_num], (((HAL_TIMER_RATE) / temp_prescaler) / frequency) - 1, temp_prescaler); - HAL_NVIC_SetPriority(TEMP_TIMER_IRQ_NAME, 2, 0); + HAL_NVIC_SetPriority(TEMP_TIMER_IRQ_NAME, TEMP_TIMER_IRQ_PRIO, 0); break; } timers_initialised[timer_num] = true; diff --git a/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.h b/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.h index 0e24767ced..4c353b478a 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.h +++ b/Marlin/src/HAL/HAL_STM32/HAL_timers_STM32.h @@ -34,40 +34,64 @@ #define FORCE_INLINE __attribute__((always_inline)) inline #define hal_timer_t uint32_t -#define HAL_TIMER_TYPE_MAX 0xFFFF +#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF // Timers can be 16 or 32 bit #ifdef STM32F0xx - #define HAL_TIMER_RATE (HAL_RCC_GetSysClockFreq()) // frequency of timer peripherals + #define HAL_TIMER_RATE (F_CPU) // frequency of timer peripherals - #define STEP_TIMER 16 - #define TEMP_TIMER 17 + #ifndef STEP_TIMER + #define STEP_TIMER 16 + #endif + + #ifndef TEMP_TIMER + #define TEMP_TIMER 17 + #endif #elif defined STM32F1xx - #define HAL_TIMER_RATE (HAL_RCC_GetPCLK2Freq()) // frequency of timer peripherals + #define HAL_TIMER_RATE (F_CPU) // frequency of timer peripherals - #define STEP_TIMER 4 - #define TEMP_TIMER 2 + #ifndef STEP_TIMER + #define STEP_TIMER 4 + #endif + + #ifndef TEMP_TIMER + #define TEMP_TIMER 2 + #endif #elif defined STM32F4xx - #define HAL_TIMER_RATE (HAL_RCC_GetPCLK2Freq()) // frequency of timer peripherals + #define HAL_TIMER_RATE (F_CPU/2) // frequency of timer peripherals - #define STEP_TIMER 4 - #define TEMP_TIMER 5 + #ifndef STEP_TIMER + #define STEP_TIMER 5 + #endif + + #ifndef TEMP_TIMER + #define TEMP_TIMER 7 + #endif #elif defined STM32F7xx - #define HAL_TIMER_RATE (HAL_RCC_GetSysClockFreq()/2) // frequency of timer peripherals + #define HAL_TIMER_RATE (F_CPU/2) // frequency of timer peripherals - #define STEP_TIMER 5 - #define TEMP_TIMER 7 - - #if MB(REMRAM_V1) - #define STEP_TIMER 2 + #ifndef STEP_TIMER + #define STEP_TIMER 5 #endif + #ifndef TEMP_TIMER + #define TEMP_TIMER 7 + #endif + +#endif + +#ifndef STEP_TIMER_IRQ_PRIO + #define STEP_TIMER_IRQ_PRIO 1 +#endif + +#ifndef TEMP_TIMER_IRQ_PRIO + #define TEMP_TIMER_IRQ_PRIO 2 #endif #define STEP_TIMER_NUM 0 // index of timer to use for stepper @@ -110,9 +134,6 @@ #define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM) #define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM) -#define STEPPER_ISR_ENABLED() HAL_timer_interrupt_enabled(STEP_TIMER_NUM) -#define TEMP_ISR_ENABLED() HAL_timer_interrupt_enabled(TEMP_TIMER_NUM) - extern void Step_Handler(stimer_t *htim); extern void Temp_Handler(stimer_t *htim); #define HAL_STEP_TIMER_ISR void Step_Handler(stimer_t *htim) @@ -153,11 +174,5 @@ FORCE_INLINE static hal_timer_t HAL_timer_get_compare(const uint8_t timer_num) { return __HAL_TIM_GET_AUTORELOAD(&TimerHandle[timer_num].handle); } -FORCE_INLINE static void HAL_timer_restrain(const uint8_t timer_num, const uint16_t interval_ticks) { - const hal_timer_t mincmp = HAL_timer_get_count(timer_num) + interval_ticks; - if (HAL_timer_get_compare(timer_num) < mincmp) - HAL_timer_set_compare(timer_num, mincmp); -} - #define HAL_timer_isr_prologue(TIMER_NUM) #define HAL_timer_isr_epilogue(TIMER_NUM) diff --git a/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h b/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h index b7d47d3dfc..e4a243b43e 100644 --- a/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h +++ b/Marlin/src/HAL/HAL_STM32/endstop_interrupts.h @@ -52,8 +52,13 @@ void setup_endstop_interrupts(void) { #if HAS_Z2_MIN attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE); #endif + #if HAS_Z3_MAX + attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE); + #endif + #if HAS_Z3_MIN + attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE); + #endif #if HAS_Z_MIN_PROBE_PIN attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE); #endif } - diff --git a/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp index b89e29ae99..31715ac664 100644 --- a/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp @@ -28,20 +28,20 @@ #include "../shared/persistent_store_api.h" -#if DISABLED(EEPROM_EMULATED_WITH_SRAM) +#if DISABLED(EEPROM_EMULATED_WITH_SRAM) && DISABLED(SPI_EEPROM) && DISABLED(I2C_EEPROM) #include static bool eeprom_data_written = false; #endif bool PersistentStore::access_start() { - #if DISABLED(EEPROM_EMULATED_WITH_SRAM) + #if DISABLED(EEPROM_EMULATED_WITH_SRAM) && DISABLED(SPI_EEPROM) && DISABLED(I2C_EEPROM) eeprom_buffer_fill(); #endif return true; } bool PersistentStore::access_finish() { - #if DISABLED(EEPROM_EMULATED_WITH_SRAM) + #if DISABLED(EEPROM_EMULATED_WITH_SRAM) && DISABLED(SPI_EEPROM) && DISABLED(I2C_EEPROM) if (eeprom_data_written) { eeprom_buffer_flush(); eeprom_data_written = false; @@ -54,8 +54,20 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui while (size--) { uint8_t v = *value; - // Save to either program flash or Backup SRAM - #if DISABLED(EEPROM_EMULATED_WITH_SRAM) + // Save to either external EEPROM, program flash or Backup SRAM + #if ENABLED(SPI_EEPROM) || ENABLED(I2C_EEPROM) + // EEPROM has only ~100,000 write cycles, + // so only write bytes that have changed! + uint8_t * const p = (uint8_t * const)pos; + 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); + return true; + } + } + #elif DISABLED(EEPROM_EMULATED_WITH_SRAM) eeprom_buffered_write_byte(pos, v); #else *(__IO uint8_t *)(BKPSRAM_BASE + (uint8_t * const)pos) = v; @@ -65,7 +77,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui pos++; value++; }; - #if DISABLED(EEPROM_EMULATED_WITH_SRAM) + #if DISABLED(EEPROM_EMULATED_WITH_SRAM) && DISABLED(SPI_EEPROM) && DISABLED(I2C_EEPROM) eeprom_data_written = true; #endif @@ -74,9 +86,11 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing) { do { - // Read from either program flash or Backup SRAM + // Read from either external EEPROM, program flash or Backup SRAM const uint8_t c = ( - #if DISABLED(EEPROM_EMULATED_WITH_SRAM) + #if ENABLED(SPI_EEPROM) || ENABLED(I2C_EEPROM) + eeprom_read_byte((uint8_t*)pos) + #elif DISABLED(EEPROM_EMULATED_WITH_SRAM) eeprom_buffered_read_byte(pos) #else (*(__IO uint8_t *)(BKPSRAM_BASE + ((uint8_t*)pos))) @@ -92,7 +106,9 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t } size_t PersistentStore::capacity() { - #if DISABLED(EEPROM_EMULATED_WITH_SRAM) + #if ENABLED(SPI_EEPROM) || ENABLED(I2C_EEPROM) + return E2END + 1; + #elif DISABLED(EEPROM_EMULATED_WITH_SRAM) return E2END + 1; #else return 4096; // 4kB diff --git a/Marlin/src/HAL/HAL_STM32/spi_pins.h b/Marlin/src/HAL/HAL_STM32/spi_pins.h index 2a97ee9c6f..df1dd5483d 100644 --- a/Marlin/src/HAL/HAL_STM32/spi_pins.h +++ b/Marlin/src/HAL/HAL_STM32/spi_pins.h @@ -1,26 +1,25 @@ /** -* Marlin 3D Printer Firmware -* Copyright (C) 2016 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 -* 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 . -* -*/ + * Marlin 3D Printer Firmware + * Copyright (C) 2016 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 + * 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 /** * Define SPI Pins: SCK, MISO, MOSI, SS - * */ #ifndef SCK_PIN #define SCK_PIN 13 diff --git a/Marlin/src/HAL/HAL_STM32/watchdog_STM32.cpp b/Marlin/src/HAL/HAL_STM32/watchdog_STM32.cpp index cc2566b146..7b049f1551 100644 --- a/Marlin/src/HAL/HAL_STM32/watchdog_STM32.cpp +++ b/Marlin/src/HAL/HAL_STM32/watchdog_STM32.cpp @@ -31,7 +31,12 @@ void watchdog_init() { IWatchdog.begin(4000000); } // 4 sec timeout - void watchdog_reset() { IWatchdog.reload(); } + void watchdog_reset() { + IWatchdog.reload(); + #if PIN_EXISTS(LED) + TOGGLE(LED_PIN); // heartbeat indicator + #endif + } #endif // USE_WATCHDOG #endif // ARDUINO_ARCH_STM32 diff --git a/Marlin/src/HAL/HAL_STM32/watchdog_STM32.h b/Marlin/src/HAL/HAL_STM32/watchdog_STM32.h index ec0c53b4f0..e860d16793 100644 --- a/Marlin/src/HAL/HAL_STM32/watchdog_STM32.h +++ b/Marlin/src/HAL/HAL_STM32/watchdog_STM32.h @@ -21,7 +21,5 @@ */ #pragma once -#include "../../inc/MarlinConfig.h" - void watchdog_init(); void watchdog_reset(); diff --git a/Marlin/src/HAL/HAL_STM32F4/EEPROM_Emul/eeprom_emul.cpp b/Marlin/src/HAL/HAL_STM32F4/EEPROM_Emul/eeprom_emul.cpp index 0e313c1b46..c13d428187 100644 --- a/Marlin/src/HAL/HAL_STM32F4/EEPROM_Emul/eeprom_emul.cpp +++ b/Marlin/src/HAL/HAL_STM32F4/EEPROM_Emul/eeprom_emul.cpp @@ -47,7 +47,7 @@ /** @addtogroup EEPROM_Emulation * @{ */ -#if defined(STM32F4) || defined(STM32F4xx) +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F4xx)) /* Includes ------------------------------------------------------------------*/ #include "eeprom_emul.h" diff --git a/Marlin/src/HAL/HAL_STM32F4/EmulatedEeprom.cpp b/Marlin/src/HAL/HAL_STM32F4/EmulatedEeprom.cpp index 4820bd6abd..a1ffab376e 100644 --- a/Marlin/src/HAL/HAL_STM32F4/EmulatedEeprom.cpp +++ b/Marlin/src/HAL/HAL_STM32F4/EmulatedEeprom.cpp @@ -17,7 +17,7 @@ * */ -#if defined(STM32F4) || defined(STM32F4xx) +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F4xx)) /** * Description: functions for I2C connected external EEPROM. diff --git a/Marlin/src/HAL/HAL_STM32F4/HAL.cpp b/Marlin/src/HAL/HAL_STM32F4/HAL.cpp index c79af5859a..56823ccc83 100644 --- a/Marlin/src/HAL/HAL_STM32F4/HAL.cpp +++ b/Marlin/src/HAL/HAL_STM32F4/HAL.cpp @@ -21,7 +21,7 @@ * */ -#if defined(STM32F4) || defined(STM32F4xx) +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F4xx)) // -------------------------------------------------------------------------- // Includes diff --git a/Marlin/src/HAL/HAL_STM32F4/HAL_Servo_STM32F4.cpp b/Marlin/src/HAL/HAL_STM32F4/HAL_Servo_STM32F4.cpp index 2877e88d54..9d9c722e58 100644 --- a/Marlin/src/HAL/HAL_STM32F4/HAL_Servo_STM32F4.cpp +++ b/Marlin/src/HAL/HAL_STM32F4/HAL_Servo_STM32F4.cpp @@ -21,7 +21,7 @@ * */ -#if defined(STM32F4) || defined(STM32F4xx) +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F4xx)) #include "../../inc/MarlinConfig.h" diff --git a/Marlin/src/HAL/HAL_STM32F4/HAL_spi_STM32F4.cpp b/Marlin/src/HAL/HAL_STM32F4/HAL_spi_STM32F4.cpp index 5e3ff4d9d9..34582c30ad 100644 --- a/Marlin/src/HAL/HAL_STM32F4/HAL_spi_STM32F4.cpp +++ b/Marlin/src/HAL/HAL_STM32F4/HAL_spi_STM32F4.cpp @@ -30,7 +30,7 @@ * Adapted to the STM32F4 HAL */ -#if defined(STM32F4) || defined(STM32F4xx) +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F4xx)) // -------------------------------------------------------------------------- // Includes diff --git a/Marlin/src/HAL/HAL_STM32F4/HAL_timers_STM32F4.cpp b/Marlin/src/HAL/HAL_STM32F4/HAL_timers_STM32F4.cpp index 64da993ef8..6a23090a24 100644 --- a/Marlin/src/HAL/HAL_STM32F4/HAL_timers_STM32F4.cpp +++ b/Marlin/src/HAL/HAL_STM32F4/HAL_timers_STM32F4.cpp @@ -20,7 +20,7 @@ * */ -#if defined(STM32F4) || defined(STM32F4xx) +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F4xx)) // -------------------------------------------------------------------------- // Includes @@ -91,7 +91,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { TimerHandle[timer_num].irqHandle = TC5_Handler; TimerHandleInit(&TimerHandle[timer_num], (((HAL_TIMER_RATE) / step_prescaler) / frequency) - 1, step_prescaler); #endif - HAL_NVIC_SetPriority(STEP_TIMER_IRQ_ID, 6, 0); + HAL_NVIC_SetPriority(STEP_TIMER_IRQ_ID, 1, 0); break; case TEMP_TIMER_NUM: diff --git a/Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp index 576ecc6dea..648c297687 100644 --- a/Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp @@ -21,7 +21,7 @@ * */ -#if defined(STM32F4) || defined(STM32F4xx) +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F4xx)) #include "../shared/persistent_store_api.h" diff --git a/Marlin/src/HAL/HAL_STM32F4/spi_pins.h b/Marlin/src/HAL/HAL_STM32F4/spi_pins.h index f178ac8107..577b36aeb8 100644 --- a/Marlin/src/HAL/HAL_STM32F4/spi_pins.h +++ b/Marlin/src/HAL/HAL_STM32F4/spi_pins.h @@ -1,41 +1,35 @@ /** -* Marlin 3D Printer Firmware -* Copyright (C) 2016 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 -* 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 . -* -*/ - -#ifndef SPI_PINS_H_ -#define SPI_PINS_H_ - + * Marlin 3D Printer Firmware + * Copyright (C) 2016 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 + * 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 /** * Define SPI Pins: SCK, MISO, MOSI, SS - * */ #ifndef SCK_PIN - #define SCK_PIN PA5 + #define SCK_PIN PA5 #endif #ifndef MISO_PIN - #define MISO_PIN PA6 + #define MISO_PIN PA6 #endif #ifndef MOSI_PIN - #define MOSI_PIN PA7 + #define MOSI_PIN PA7 #endif #ifndef SS_PIN - #define SS_PIN PA8 + #define SS_PIN PA8 #endif - -#endif // SPI_PINS_H_ diff --git a/Marlin/src/HAL/HAL_STM32F4/watchdog_STM32F4.cpp b/Marlin/src/HAL/HAL_STM32F4/watchdog_STM32F4.cpp index f5dd6bdfae..dd4d4391c6 100644 --- a/Marlin/src/HAL/HAL_STM32F4/watchdog_STM32F4.cpp +++ b/Marlin/src/HAL/HAL_STM32F4/watchdog_STM32F4.cpp @@ -20,7 +20,7 @@ * */ -#if defined(STM32F4) || defined(STM32F4xx) +#if defined(STM32GENERIC) && (defined(STM32F4) || defined(STM32F4xx)) #include "../../inc/MarlinConfig.h" @@ -46,9 +46,9 @@ //Error_Handler(); } else { - #if PIN_EXISTS(LED) - TOGGLE(LED_PIN); // heart beat indicator - #endif + #if PIN_EXISTS(LED) + TOGGLE(LED_PIN); // heartbeat indicator + #endif } } diff --git a/Marlin/src/HAL/HAL_STM32F7/HAL_timers_STM32F7.cpp b/Marlin/src/HAL/HAL_STM32F7/HAL_timers_STM32F7.cpp index 3d48f5c291..7949af0c55 100644 --- a/Marlin/src/HAL/HAL_STM32F7/HAL_timers_STM32F7.cpp +++ b/Marlin/src/HAL/HAL_STM32F7/HAL_timers_STM32F7.cpp @@ -85,8 +85,8 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) { timerConfig[0].IRQ_Id = TIM5_IRQn; timerConfig[0].callback = (uint32_t)TC5_Handler; HAL_NVIC_SetPriority(timerConfig[0].IRQ_Id, 1, 0); - pinMode(STEPPER_ENABLE_PIN,OUTPUT); - digitalWrite(STEPPER_ENABLE_PIN,LOW); + SET_OUTPUT(STEPPER_ENABLE_PIN); + WRITE(STEPPER_ENABLE_PIN); break; case TEMP_TIMER_NUM: //TEMP TIMER TIM7 // any available 16bit Timer (1 already used for PWM) diff --git a/Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp b/Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp index 46f02bfe5c..e01a0b42ed 100644 --- a/Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp +++ b/Marlin/src/HAL/HAL_STM32F7/TMC2660.cpp @@ -190,7 +190,7 @@ void TMC26XStepper::start() { pinMode(step_pin, OUTPUT); pinMode(dir_pin, OUTPUT); pinMode(cs_pin, OUTPUT); - //pinMode(STEPPER_ENABLE_PIN, OUTPUT); + //SET_OUTPUT(STEPPER_ENABLE_PIN); digitalWrite(step_pin, LOW); digitalWrite(dir_pin, LOW); digitalWrite(cs_pin, HIGH); @@ -887,7 +887,7 @@ inline void TMC26XStepper::send262(uint32_t datagram) { //} //select the TMC driver - digitalWrite(cs_pin,LOW); + digitalWrite(cs_pin, LOW); //ensure that only valid bist are set (0-19) //datagram &=REGISTER_BIT_PATTERN; @@ -916,7 +916,7 @@ inline void TMC26XStepper::send262(uint32_t datagram) { #endif //deselect the TMC chip - digitalWrite(cs_pin,HIGH); + digitalWrite(cs_pin, HIGH); //restore the previous SPI mode if neccessary //if the mode is not correct set it to mode 3 diff --git a/Marlin/src/HAL/HAL_STM32F7/spi_pins.h b/Marlin/src/HAL/HAL_STM32F7/spi_pins.h index 2d1e96ec59..9301f4dd8c 100644 --- a/Marlin/src/HAL/HAL_STM32F7/spi_pins.h +++ b/Marlin/src/HAL/HAL_STM32F7/spi_pins.h @@ -1,32 +1,27 @@ /** -* Marlin 3D Printer Firmware -* Copyright (C) 2016 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 -* 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 . -* -*/ - -#ifndef SPI_PINS_H_ -#define SPI_PINS_H_ + * Marlin 3D Printer Firmware + * Copyright (C) 2016 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 + * 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 /** * Define SPI Pins: SCK, MISO, MOSI, SS - * */ #define SCK_PIN PA5 #define MISO_PIN PA6 #define MOSI_PIN PA7 #define SS_PIN PA8 - -#endif // SPI_PINS_H_ diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp index 4f7f67a3bb..dba27279ae 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/HAL.cpp @@ -18,7 +18,6 @@ along with this program. If not, see . ****************************************************************************/ - /** * Description: HAL for Teensy35 (MK64FX512) */ @@ -30,7 +29,7 @@ #include -uint16_t HAL_adc_result; +uint16_t HAL_adc_result, HAL_adc_select; static const uint8_t pin2sc1a[] = { 5, 14, 8, 9, 13, 12, 6, 7, 15, 4, 3, 19+128, 14+128, 15+128, // 0-13 -> A0-A13 @@ -59,6 +58,7 @@ static const uint8_t pin2sc1a[] = { void HAL_adc_init() { analog_init(); while (ADC0_SC3 & ADC_SC3_CAL) {}; // Wait for calibration to finish + while (ADC1_SC3 & ADC_SC3_CAL) {}; // Wait for calibration to finish NVIC_ENABLE_IRQ(IRQ_FTM1); } @@ -91,8 +91,28 @@ extern "C" { } } -void HAL_adc_start_conversion(const uint8_t adc_pin) { ADC0_SC1A = pin2sc1a[adc_pin]; } +void HAL_adc_start_conversion(const uint8_t adc_pin) { + uint16_t pin = pin2sc1a[adc_pin]; + if (pin == 0xFF) { + // Digital only + HAL_adc_select = -1; + } + else if (pin & 0x80) { + HAL_adc_select = 1; + ADC1_SC1A = pin & 0x7F; + } + else { + HAL_adc_select = 0; + ADC0_SC1A = pin; + } +} -uint16_t HAL_adc_get_result(void) { return ADC0_RA; } +uint16_t HAL_adc_get_result(void) { + switch (HAL_adc_select) { + case 0: return ADC0_RA; + case 1: return ADC1_RA; + } + return 0; +} #endif // __MK64FX512__ || __MK66FX1M0__ diff --git a/Marlin/src/HAL/shared/Delay.h b/Marlin/src/HAL/shared/Delay.h index 04771a2e03..4cdd479210 100644 --- a/Marlin/src/HAL/shared/Delay.h +++ b/Marlin/src/HAL/shared/Delay.h @@ -140,9 +140,9 @@ #endif // Delay in nanoseconds -#define DELAY_NS(x) DELAY_CYCLES( (x) * (F_CPU/1000000L) / 1000L ) +#define DELAY_NS(x) DELAY_CYCLES( (x) * (F_CPU / 1000000UL) / 1000UL ) // Delay in microseconds -#define DELAY_US(x) DELAY_CYCLES( (x) * (F_CPU/1000000L) ) +#define DELAY_US(x) DELAY_CYCLES( (x) * (F_CPU / 1000000UL) ) #endif // MARLIN_DELAY_H diff --git a/Marlin/src/HAL/shared/servo.h b/Marlin/src/HAL/shared/servo.h index 270923b546..93a10aaf67 100644 --- a/Marlin/src/HAL/shared/servo.h +++ b/Marlin/src/HAL/shared/servo.h @@ -73,7 +73,7 @@ #elif IS_TEENSY35 || IS_TEENSY36 #include "../HAL_TEENSY35_36/HAL_Servo_Teensy.h" #elif defined(TARGET_LPC1768) - #include "../HAL_LPC1768/LPC1768_Servo.h" + #include "../HAL_LPC1768/MarlinServo.h" #elif defined(__STM32F1__) || defined(TARGET_STM32F1) #include "../HAL_STM32F1/HAL_Servo_STM32F1.h" #elif defined(STM32GENERIC) && defined(STM32F4) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index a78cdf2a6e..faf4e6f204 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -42,6 +42,8 @@ #include "module/printcounter.h" // PrintCounter or Stopwatch #include "feature/closedloop.h" +#include "HAL/shared/Delay.h" + #ifdef ARDUINO #include #endif @@ -351,7 +353,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { if (max_inactive_time && ELAPSED(ms, gcode.previous_move_ms + max_inactive_time)) { SERIAL_ERROR_START(); SERIAL_ECHOLNPAIR(MSG_KILL_INACTIVE_TIME, parser.command_ptr); - kill(PSTR(MSG_KILLED)); + kill(); } // Prevent steppers timing-out in the middle of M600 @@ -408,7 +410,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { if (killCount >= KILL_DELAY) { SERIAL_ERROR_START(); SERIAL_ERRORLNPGM(MSG_KILL_BUTTON); - kill(PSTR(MSG_KILLED)); + kill(); } #endif @@ -417,7 +419,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) { // --------------------------------------------------------- static int homeDebounceCount = 0; // poor man's debouncing count const int HOME_DEBOUNCE_DELAY = 2500; - if (!IS_SD_PRINTING && !READ(HOME_PIN)) { + if (!IS_SD_PRINTING() && !READ(HOME_PIN)) { if (!homeDebounceCount) { enqueue_and_echo_commands_P(PSTR("G28")); LCD_MESSAGEPGM(MSG_AUTO_HOME); @@ -609,31 +611,37 @@ void idle( * Kill all activity and lock the machine. * After this the machine will need to be reset. */ -void kill(PGM_P lcd_msg) { +void kill(PGM_P const lcd_msg/*=NULL*/) { + thermalManager.disable_all_heaters(); + SERIAL_ERROR_START(); SERIAL_ERRORLNPGM(MSG_ERR_KILLED); - thermalManager.disable_all_heaters(); - disable_all_steppers(); - - #if ENABLED(EXTENSIBLE_UI) - UI::onPrinterKilled(lcd_msg); - #elif ENABLED(ULTRA_LCD) - kill_screen(lcd_msg); + #if ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI) + kill_screen(lcd_msg ? lcd_msg : PSTR(MSG_KILLED)); #else UNUSED(lcd_msg); #endif - _delay_ms(600); // Wait a short time (allows messages to get out before shutting down. - cli(); // Stop interrupts - - _delay_ms(250); //Wait to ensure all interrupts routines stopped - thermalManager.disable_all_heaters(); //turn off heaters again - #ifdef ACTION_ON_KILL SERIAL_ECHOLNPGM("//action:" ACTION_ON_KILL); #endif + minkill(); +} + +void minkill() { + + // Wait a short time (allows messages to get out before shutting down. + for (int i = 1000; i--;) DELAY_US(600); + + cli(); // Stop interrupts + + // Wait to ensure all interrupts stopped + for (int i = 1000; i--;) DELAY_US(250); + + thermalManager.disable_all_heaters(); // turn off heaters again + #if HAS_POWER_SWITCH PSU_OFF(); #endif @@ -655,6 +663,7 @@ void kill(PGM_P lcd_msg) { */ void stop() { thermalManager.disable_all_heaters(); // 'unpause' taken care of in here + print_job_timer.stop(); #if ENABLED(PROBING_FANS_OFF) if (fans_paused) fans_pause(false); // put things back the way they were @@ -905,8 +914,8 @@ void setup() { lcd_bootscreen(); #endif - #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - mixing_tools_init(); + #if ENABLED(MIXING_EXTRUDER) + mixer.init(); #endif #if ENABLED(BLTOUCH) @@ -965,11 +974,8 @@ void loop() { #if ENABLED(SDSUPPORT) card.checkautostart(); - #endif - #if ENABLED(SDSUPPORT) && (ENABLED(ULTIPANEL) || ENABLED(EXTENSIBLE_UI)) - if (abort_sd_printing) { - abort_sd_printing = false; + if (card.abort_sd_printing) { card.stopSDPrint( #if SD_RESORT true @@ -979,15 +985,13 @@ void loop() { quickstop_stepper(); print_job_timer.stop(); thermalManager.disable_all_heaters(); - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) fan_speed[i] = 0; - #endif + zero_fan_speeds(); wait_for_heatup = false; #if ENABLED(POWER_LOSS_RECOVERY) card.removeJobRecoveryFile(); #endif } - #endif // SDSUPPORT && (ENABLED(ULTIPANEL) || ENABLED(EXTENSIBLE_UI)) + #endif // SDSUPPORT if (commands_in_queue < BUFSIZE) get_available_commands(); advance_command_queue(); diff --git a/Marlin/src/Marlin.h b/Marlin/src/Marlin.h index 6e925f90ce..6326320439 100644 --- a/Marlin/src/Marlin.h +++ b/Marlin/src/Marlin.h @@ -180,7 +180,8 @@ void disable_e_stepper(const uint8_t e); void disable_e_steppers(); void disable_all_steppers(); -void kill(PGM_P); +void kill(PGM_P const lcd_msg=NULL); +void minkill(); void quickstop_stepper(); @@ -218,6 +219,12 @@ extern millis_t max_inactive_time, stepper_inactive_time; #endif #endif +inline void zero_fan_speeds() { + #if FAN_COUNT > 0 + LOOP_L_N(i, FAN_COUNT) fan_speed[i] = 0; + #endif +} + #if ENABLED(USE_CONTROLLER_FAN) extern uint8_t controllerfan_speed; #endif diff --git a/Marlin/src/config/default/Configuration.h b/Marlin/src/config/default/Configuration.h index 3b92bd7452..c241b3f7ce 100644 --- a/Marlin/src/config/default/Configuration.h +++ b/Marlin/src/config/default/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @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 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/default/Configuration_adv.h b/Marlin/src/config/default/Configuration_adv.h index 8ac532d317..149b59453e 100644 --- a/Marlin/src/config/default/Configuration_adv.h +++ b/Marlin/src/config/default/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1021,6 +1028,15 @@ // @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 * @@ -1046,7 +1062,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1056,15 +1072,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1613,10 +1620,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1630,10 +1645,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h index 0e2ec0d1cc..3c3ff26b7a 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -806,6 +802,13 @@ //#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. // @@ -963,6 +966,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 250 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1007,6 +1013,18 @@ #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 //=========================================================================== @@ -1332,10 +1350,12 @@ // @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 230 #define PREHEAT_2_TEMP_BED 110 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1495,6 +1515,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h index 5029d6bd50..9d03e89548 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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, 4, 16, 16, 16 } // [1,2,4,8,16] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h b/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h index 1f79147ed9..50aac9b275 100644 --- a/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h +++ b/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 260 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @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 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Anet/A2/Configuration.h b/Marlin/src/config/examples/Anet/A2/Configuration.h index 97faf5b2c5..938b56b83d 100644 --- a/Marlin/src/config/examples/Anet/A2/Configuration.h +++ b/Marlin/src/config/examples/Anet/A2/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 60 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 230 #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Anet/A2/Configuration_adv.h b/Marlin/src/config/examples/Anet/A2/Configuration_adv.h index 2b4a860970..e27d9c014c 100644 --- a/Marlin/src/config/examples/Anet/A2/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A2/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Anet/A2plus/Configuration.h b/Marlin/src/config/examples/Anet/A2plus/Configuration.h index 65d9243cf8..8213770241 100644 --- a/Marlin/src/config/examples/Anet/A2plus/Configuration.h +++ b/Marlin/src/config/examples/Anet/A2plus/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 60 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 230 #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h b/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h index 2b4a860970..e27d9c014c 100644 --- a/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Anet/A6/Configuration.h b/Marlin/src/config/examples/Anet/A6/Configuration.h index a83da6e7a1..3e26b04622 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -834,6 +830,13 @@ //#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. // @@ -1058,6 +1061,9 @@ #define X_MAX_POS X_BED_SIZE #define Y_MAX_POS Y_BED_SIZE +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1102,6 +1108,18 @@ #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 //=========================================================================== @@ -1465,10 +1483,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 50 #define PREHEAT_1_FAN_SPEED 0 // ANET A6 Default is 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 230 #define PREHEAT_2_TEMP_BED 70 #define PREHEAT_2_FAN_SPEED 0 // ANET A6 Default is 255 @@ -1628,6 +1648,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h index 8dcad0400e..1a224cfa71 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Anet/A8/Configuration.h b/Marlin/src/config/examples/Anet/A8/Configuration.h index 21bb36f949..2743944c0e 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration.h @@ -163,10 +163,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -217,7 +215,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -235,7 +232,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -793,6 +789,13 @@ //#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. // @@ -950,6 +953,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 240 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -994,6 +1000,18 @@ #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 //=========================================================================== @@ -1319,10 +1337,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 190 #define PREHEAT_1_TEMP_BED 60 #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 90 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1482,6 +1502,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h index e422387d5c..0f97e54d55 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/AnimationExample/_Bootscreen.h b/Marlin/src/config/examples/AnimationExample/_Bootscreen.h new file mode 100644 index 0000000000..6a69735626 --- /dev/null +++ b/Marlin/src/config/examples/AnimationExample/_Bootscreen.h @@ -0,0 +1,339 @@ +/** + * 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 . + * + */ + +/** + * Animated boot screen example + */ + +#define ANIMATED_BOOTSCREEN +#define CUSTOM_BOOTSCREEN_FRAME_TIME 100 // (ms) + +#define CUSTOM_BOOTSCREEN_BMPWIDTH 128 +#define CUSTOM_BOOTSCREEN_TIMEOUT 2500 // (ms) + +const unsigned char custom_start_bmp[] PROGMEM = { + B00011111,B11111111,B11111111,B11111111,B11111111,B11001111,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001000,B00000000,B00000000,B00000000,B00000000,B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001000,B00000000,B00000000,B00000000,B00000000,B10010000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000100,B00000000,B00000000,B00000000,B00000001,B10100000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000110,B00000000,B00000000,B00000000,B00000001,B01100000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000010,B00000000,B00000000,B00000000,B00000010,B01000000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000001,B11111111,B10000000,B01111111,B11111110,B11000000,B00000000,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B11111111,B11000000,B01111111,B00001000,B10000001,B11100000,B00111000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00100000,B01000000,B00000001,B00000011,B01000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B11111111,B10110000,B00100111,B11111001,B00000010,B01000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B01000000,B11010000,B00110110,B00001101,B10000110,B10000000,B10100000,B00100010,B00010000,B00000010,B10000000,B11110000,B00000000,B00000000,B00000000, + B00000000,B01100000,B01001000,B00010010,B00000100,B10000101,B10000001,B00100000,B01000011,B00110000,B00000010,B00000000,B00111000,B00000000,B00000000,B00000000, + B00000000,B00100000,B00101000,B00001011,B00000010,B11001001,B00000011,B01000000,B11000011,B00110011,B10011010,B10111000,B00011000,B10001000,B00100010,B00000000, + B00000000,B00110000,B00100100,B00001001,B00000011,B01001011,B00000010,B11000000,B10000011,B00110000,B10010010,B10100100,B00011000,B01110000,B00011100,B00000000, + B00000000,B00010000,B00010110,B00000100,B10000001,B00110010,B00000110,B10000001,B10000010,B11010011,B10010010,B10100100,B00110000,B00100000,B00001000,B00000000, + B00000000,B00001000,B00011010,B00000110,B10000001,B10110100,B00000101,B10000001,B00000010,B11010100,B10010010,B10100100,B01110000,B01110000,B00011100,B00000000, + B00000000,B00001100,B00001011,B00000010,B01000000,B10000100,B00001001,B00000010,B00000010,B00010011,B10010010,B10100100,B11111010,B10001010,B10100010,B00000000, + B00000000,B00000100,B00001101,B00000011,B01100000,B01001000,B00001010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000110,B00000100,B10000001,B00100000,B01111000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000010,B00000010,B10000000,B10110000,B00110000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000001,B00000010,B01000000,B10010000,B00000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000001,B00000001,B01100000,B01001000,B00000000,B01001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B10000001,B10100000,B01101000,B00000000,B01011000,B00010001,B11110000,B00000000,B00000000,B00010000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B11000000,B10110000,B00100100,B00000000,B10010000,B00100000,B01000000,B00000000,B00000000,B00010000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01000000,B11010000,B00110110,B00000001,B10100000,B01100000,B01000011,B00110111,B00011100,B11110011,B10000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01100000,B01001000,B00010010,B00000001,B01100000,B01000000,B01000100,B10100100,B10000101,B10010100,B01000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00100000,B00101100,B00001011,B00000001,B01000000,B11000000,B01000100,B10100100,B10011101,B00010100,B01000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00010000,B00110100,B00001001,B00000001,B01000000,B10000000,B01000100,B10100100,B10100101,B00010100,B01000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00011000,B00010110,B00000100,B10000001,B00100001,B00000000,B01000011,B00100100,B10011100,B11110011,B10000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00001000,B00011010,B00000110,B10000001,B10100011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00001100,B00001001,B00000010,B01000000,B10010010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000100,B00000101,B00000011,B01100000,B01011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000010,B00000100,B10000001,B00100000,B01101100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000010,B00000010,B11000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B00000011,B01000000,B10010000,B00110000,B11110000,B10010000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B10000001,B01100000,B01011000,B00010000,B10000000,B10000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B10000001,B10100000,B11010000,B00110000,B10000111,B10011110,B10111001,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B11000000,B10010000,B10010000,B00100000,B11101100,B10010100,B11000101,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B01000000,B01011001,B00100000,B01000000,B10001000,B10010100,B11000101,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00100000,B01001011,B01100000,B01000000,B10001100,B10010100,B11000101,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00110000,B00101110,B01000000,B10000000,B11110111,B10010110,B10111001,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00010000,B00110110,B11000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00011000,B00010000,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00001000,B00001001,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00001100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000100,B00000110,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000010,B00000110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000011,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B10000000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B10000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B01000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B01000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00110000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00011001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 +}; + +#if ENABLED(ANIMATED_BOOTSCREEN) + + const unsigned char custom_start_bmp1[] PROGMEM = { + B11111001,B11111111,B11111111,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00011011,B00000000,B00000000,B00000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00010010,B00000000,B00000000,B00000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00110100,B00000000,B00000000,B00000000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00101100,B00000000,B00000000,B00000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B01001000,B00000000,B00000000,B00000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00010000,B00111100,B00000111,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00100000,B01101000,B00001011,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00100000,B01001000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B10110000,B11010000,B00010100,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B10010000,B10110000,B00100100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B01011001,B00100000,B01101000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B01101001,B01100000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00100110,B01000000,B11010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00110110,B10000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00010000,B10000001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001001,B00000001,B01000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001111,B00000010,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000110,B00000110,B10000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000101,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00001011,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B10000000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11000000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B01000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B01100000,B00101000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00100000,B00101000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B10010000,B00100100,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11010000,B00110100,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B01001000,B00010010,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B01101100,B00001011,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00100100,B00001101,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00010110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00010010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001011,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00011010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00100100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B01101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11011000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00100000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 + }; + + const unsigned char custom_start_bmp2[] PROGMEM = { + B00011111,B11111111,B11111111,B11111111,B11111111,B11001111,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001000,B00000000,B00000000,B00000000,B00000000,B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001000,B00000000,B00000000,B00000000,B00000000,B10010000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000100,B00000000,B00000000,B00000000,B00000001,B10100000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000110,B00000000,B00000000,B00000000,B00000001,B01100000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000010,B00000000,B00000000,B00000000,B00000010,B01000000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000001,B11111111,B10000000,B01111111,B11111110,B11000000,B00000000,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B11111111,B11000000,B01111111,B00001000,B10000001,B11100000,B00111000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00100000,B01000000,B00000001,B00000011,B01000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B11111111,B10110000,B00100111,B11111001,B00000010,B01000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B01000000,B11010000,B00110110,B00001101,B10000110,B10000000,B10100000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B01100000,B01001000,B00010010,B00000100,B10000101,B10000001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00100000,B00101000,B00001011,B00000010,B11001001,B00000011,B01000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00110000,B00100100,B00001001,B00000011,B01001011,B00000010,B11000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00010000,B00010110,B00000100,B10000001,B00110010,B00000110,B10000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00001000,B00011010,B00000110,B10000001,B10110100,B00000101,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00001100,B00001011,B00000010,B01000000,B10000100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000100,B00001101,B00000011,B01100000,B01001000,B00001010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000110,B00000100,B10000001,B00100000,B01111000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000010,B00000010,B10000000,B10110000,B00110000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000001,B00000010,B01000000,B10010000,B00000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000001,B00000001,B01100000,B01001000,B00000000,B01001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B10000001,B10100000,B01101000,B00000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B11000000,B10110000,B00100100,B00000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01000000,B11010000,B00110110,B00000001,B10100000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01100000,B01001000,B00010010,B00000001,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00100000,B00101100,B00001011,B00000001,B01000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00010000,B00110100,B00001001,B00000001,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00011000,B00010110,B00000100,B10000001,B00100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00001000,B00011010,B00000110,B10000001,B10100011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00001100,B00001001,B00000010,B01000000,B10010010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000100,B00000101,B00000011,B01100000,B01011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000010,B00000100,B10000001,B00100000,B01101100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000010,B00000010,B11000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B00000011,B01000000,B10010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B10000001,B01100000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B10000001,B10100000,B11010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B11000000,B10010000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B01000000,B01011001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00100000,B01001011,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00110000,B00101110,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00010000,B00110110,B11000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00011000,B00010000,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00001000,B00001001,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00001100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000100,B00000110,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000010,B00000110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000011,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B10000000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B10000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B01000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B01000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00110000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00011001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 + }; + + const unsigned char custom_start_bmp3[] PROGMEM = { + B00011111,B11111111,B11111111,B11111111,B11111111,B11001111,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001000,B00000000,B00000000,B00000000,B00000000,B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001000,B00000000,B00000000,B00000000,B00000000,B10010000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000100,B00000000,B00000000,B00000000,B00000001,B10100000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000110,B00000000,B00000000,B00000000,B00000001,B01100000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000010,B00000000,B00000000,B00000000,B00000010,B01000000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000001,B11111111,B10000000,B01111111,B11111110,B11000000,B00000000,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B11111111,B11000000,B01111111,B00001000,B10000001,B11100000,B00111000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00100000,B01000000,B00000001,B00000011,B01000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B11111111,B10110000,B00100111,B11111001,B00000010,B01000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B01000000,B11010000,B00110110,B00001101,B10000110,B10000000,B10100000,B00100010,B00010000,B00000010,B10000000,B11110000,B00000000,B00000000,B00000000, + B00000000,B01100000,B01001000,B00010010,B00000100,B10000101,B10000001,B00100000,B01000011,B00110000,B00000010,B00000000,B00111000,B00000000,B00000000,B00000000, + B00000000,B00100000,B00101000,B00001011,B00000010,B11001001,B00000011,B01000000,B11000011,B00110011,B10011010,B10111000,B00011000,B10001000,B00100010,B00000000, + B00000000,B00110000,B00100100,B00001001,B00000011,B01001011,B00000010,B11000000,B10000011,B00110000,B10010010,B10100100,B00011000,B01110000,B00011100,B00000000, + B00000000,B00010000,B00010110,B00000100,B10000001,B00110010,B00000110,B10000001,B10000010,B11010011,B10010010,B10100100,B00110000,B00100000,B00001000,B00000000, + B00000000,B00001000,B00011010,B00000110,B10000001,B10110100,B00000101,B10000001,B00000010,B11010100,B10010010,B10100100,B01110000,B01110000,B00011100,B00000000, + B00000000,B00001100,B00001011,B00000010,B01000000,B10000100,B00001001,B00000010,B00000010,B00010011,B10010010,B10100100,B11111010,B10001010,B10100010,B00000000, + B00000000,B00000100,B00001101,B00000011,B01100000,B01001000,B00001010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000110,B00000100,B10000001,B00100000,B01111000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000010,B00000010,B10000000,B10110000,B00110000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000001,B00000010,B01000000,B10010000,B00000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000001,B00000001,B01100000,B01001000,B00000000,B01001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B10000001,B10100000,B01101000,B00000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B11000000,B10110000,B00100100,B00000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01000000,B11010000,B00110110,B00000001,B10100000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01100000,B01001000,B00010010,B00000001,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00100000,B00101100,B00001011,B00000001,B01000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00010000,B00110100,B00001001,B00000001,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00011000,B00010110,B00000100,B10000001,B00100001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00001000,B00011010,B00000110,B10000001,B10100011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00001100,B00001001,B00000010,B01000000,B10010010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000100,B00000101,B00000011,B01100000,B01011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000010,B00000100,B10000001,B00100000,B01101100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000010,B00000010,B11000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B00000011,B01000000,B10010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B10000001,B01100000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B10000001,B10100000,B11010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B11000000,B10010000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B01000000,B01011001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00100000,B01001011,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00110000,B00101110,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00010000,B00110110,B11000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00011000,B00010000,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00001000,B00001001,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00001100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000100,B00000110,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000010,B00000110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000011,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B10000000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B10000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B01000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B01000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00110000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00011001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 + }; + + const unsigned char custom_start_bmp4[] PROGMEM = { + B00011111,B11111111,B11111111,B11111111,B11111111,B11001111,B11111111,B11111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001000,B00000000,B00000000,B00000000,B00000000,B11011000,B00000000,B00000000,B00000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00001000,B00000000,B00000000,B00000000,B00000000,B10010000,B00000000,B00000000,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000100,B00000000,B00000000,B00000000,B00000001,B10100000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000110,B00000000,B00000000,B00000000,B00000001,B01100000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000010,B00000000,B00000000,B00000000,B00000010,B01000000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000001,B11111111,B10000000,B01111111,B11111110,B11000000,B00000000,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B11111111,B11000000,B01111111,B00001000,B10000001,B11100000,B00111000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00100000,B01000000,B00000001,B00000011,B01000000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B11111111,B10110000,B00100111,B11111001,B00000010,B01000000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B01000000,B11010000,B00110110,B00001101,B10000110,B10000000,B10100000,B00100010,B00010000,B00000010,B10000000,B11110000,B00000000,B00000000,B00000000, + B00000000,B01100000,B01001000,B00010010,B00000100,B10000101,B10000001,B00100000,B01000011,B00110000,B00000010,B00000000,B00111000,B00000000,B00000000,B00000000, + B00000000,B00100000,B00101000,B00001011,B00000010,B11001001,B00000011,B01000000,B11000011,B00110011,B10011010,B10111000,B00011000,B10001000,B00100010,B00000000, + B00000000,B00110000,B00100100,B00001001,B00000011,B01001011,B00000010,B11000000,B10000011,B00110000,B10010010,B10100100,B00011000,B01110000,B00011100,B00000000, + B00000000,B00010000,B00010110,B00000100,B10000001,B00110010,B00000110,B10000001,B10000010,B11010011,B10010010,B10100100,B00110000,B00100000,B00001000,B00000000, + B00000000,B00001000,B00011010,B00000110,B10000001,B10110100,B00000101,B10000001,B00000010,B11010100,B10010010,B10100100,B01110000,B01110000,B00011100,B00000000, + B00000000,B00001100,B00001011,B00000010,B01000000,B10000100,B00001001,B00000010,B00000010,B00010011,B10010010,B10100100,B11111010,B10001010,B10100010,B00000000, + B00000000,B00000100,B00001101,B00000011,B01100000,B01001000,B00001010,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000110,B00000100,B10000001,B00100000,B01111000,B00010010,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000010,B00000010,B10000000,B10110000,B00110000,B00110100,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000001,B00000010,B01000000,B10010000,B00000000,B00101100,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000001,B00000001,B01100000,B01001000,B00000000,B01001000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B10000001,B10100000,B01101000,B00000000,B01011000,B00010001,B11110000,B00000000,B00000000,B00010000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B11000000,B10110000,B00100100,B00000000,B10010000,B00100000,B01000000,B00000000,B00000000,B00010000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01000000,B11010000,B00110110,B00000001,B10100000,B01100000,B01000011,B00110111,B00011100,B11110011,B10000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B01100000,B01001000,B00010010,B00000001,B01100000,B01000000,B01000100,B10100100,B10000101,B10010010,B01000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00100000,B00101100,B00001011,B00000001,B01000000,B11000000,B01000100,B10100100,B10011101,B00010100,B01000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00010000,B00110100,B00001001,B00000001,B01000000,B10000000,B01000100,B10100100,B10100101,B00010010,B01000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00011000,B00010110,B00000100,B10000001,B00100001,B00000000,B01000011,B00100100,B10011100,B11110011,B10000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00001000,B00011010,B00000110,B10000001,B10100011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00001100,B00001001,B00000010,B01000000,B10010010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000100,B00000101,B00000011,B01100000,B01011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000010,B00000100,B10000001,B00100000,B01101100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000010,B00000010,B11000000,B10110000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B00000011,B01000000,B10010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000001,B10000001,B01100000,B01011000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B10000001,B10100000,B11010000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B11000000,B10010000,B10010000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B01000000,B01011001,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00100000,B01001011,B01100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00110000,B00101110,B01000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00010000,B00110110,B11000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00011000,B00010000,B10000001,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00001000,B00001001,B00000011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00001100,B00001001,B00000010,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000100,B00000110,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000010,B00000110,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000011,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B00000000,B00001000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000001,B10000000,B00010000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B10000000,B00110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B01000000,B00100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B01000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00100000,B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00110000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00011001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000, + B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 + }; + + const unsigned char * const custom_bootscreen_animation[] PROGMEM = { + custom_start_bmp1, custom_start_bmp2, custom_start_bmp3, custom_start_bmp4, custom_start_bmp + }; + +#endif diff --git a/Marlin/src/config/examples/ArmEd/Configuration.h b/Marlin/src/config/examples/ArmEd/Configuration.h new file mode 100644 index 0000000000..79353cc2f1 --- /dev/null +++ b/Marlin/src/config/examples/ArmEd/Configuration.h @@ -0,0 +1,2036 @@ +/** + * 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 . + * + */ + +/** + * 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 + * + */ +#ifndef CONFIGURATION_H +#define CONFIGURATION_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 3 + +/** + * 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_ARMED +#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 1.75 + +// For Cyclops or any "multi-extruder" that shares a single nozzle. +//#define SINGLENOZZLE +#if ENABLED(SINGLENOZZLE) + // Parameters for filament retract / prime on toolchange + #define SINGLENOZZLE_SWAP_LENGTH 12 // (mm) + #define SINGLENOZZLE_SWAP_RETRACT_SPEED 3600 // (mm/m) + #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) + //#define SINGLENOZZLE_SWAP_PARK + #if ENABLED(SINGLENOZZLE_SWAP_PARK) + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) + #endif +#endif + +/** + * 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 5 +#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 13 +#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 + + // Armed + #define DEFAULT_Kp 23.41 + #define DEFAULT_Ki 2.57 + #define DEFAULT_Kd 53.37 + + // 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 144.87 + #define DEFAULT_bedKi 27.00 + #define DEFAULT_bedKd 194.30 + + + //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 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 + +/** + * 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 { 100, 100, 400, 156.84 } + +/** + * Default Max Feed Rate (mm/s) + * Override with M203 + * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] + */ +#define DEFAULT_MAX_FEEDRATE { 300, 300, 20, 120 } + +/** + * 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 { 1000, 1000, 1000, 5000 } + +/** + * Default Acceleration (change/s) change = mm/s + * Override with M204 + * + * M204 P Acceleration + * M204 R Retract Acceleration + * M204 T Travel Acceleration + */ +#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 1000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // 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 8.0 +#define DEFAULT_YJERK 8.0 +#define DEFAULT_ZJERK 0.4 +#define DEFAULT_EJERK 1.5 + +/** + * 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 + +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + +/** + * 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 MBL_Z_STEP 0.025 // Step size while manually probing Z axis. + #define LCD_PROBE_Z_RANGE 4 // Z Range centered on Z_MIN_POS for LCD Z adjustment +#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, 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', '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 + +#endif // CONFIGURATION_H diff --git a/Marlin/src/config/examples/ArmEd/Configuration_adv.h b/Marlin/src/config/examples/ArmEd/Configuration_adv.h new file mode 100644 index 0000000000..174f825427 --- /dev/null +++ b/Marlin/src/config/examples/ArmEd/Configuration_adv.h @@ -0,0 +1,1811 @@ +/** + * 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 . + * + */ + +/** + * 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 + * + */ +#ifndef CONFIGURATION_ADV_H +#define CONFIGURATION_ADV_H +#define CONFIGURATION_ADV_H_VERSION 020000 + +// @section temperature + +//=========================================================================== +//=============================Thermal Settings ============================ +//=========================================================================== + +#define HEATER_BED_INVERTING true +#define HEATER_0_INVERTING true +#define HEATER_1_INVERTING true + +// +// 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 + +// @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 + +// 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=========================== +//=========================================================================== + +#define ENCODER_RATE_MULTIPLIER // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly +#define ENCODER_10X_STEPS_PER_SEC 75 // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value +#define ENCODER_100X_STEPS_PER_SEC 160 // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value + +//#define CHDK 4 //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/ +#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again + +// @section lcd + +// 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_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 // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY + +/** + * 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 + +#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 + +#endif // DOGLCD + +// @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 + +// @section extras + +/** + * 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 + +/** + * 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 + +/** + * 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 + +/** + * 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 + +/** + * 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 + +#endif // CONFIGURATION_ADV_H diff --git a/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h b/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h index 86d2c9d045..eb4a626c8b 100644 --- a/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h +++ b/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @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 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 CYRILLIC +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h index 0961057549..e889bedda0 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h +++ b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS 186 #define Z_MAX_POS 186 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 190 #define PREHEAT_1_TEMP_BED 65 #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 100 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 41c7058aaf..2634bc8650 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h index 2c5cc0b77d..fe867929da 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h +++ b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS 93 #define Z_MAX_POS 186 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 180 #define PREHEAT_1_TEMP_BED 60 #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 80 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 974039419e..334fe1c3b9 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration.h index f109f715e7..73bd806644 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -774,6 +770,13 @@ //#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. // @@ -931,6 +934,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 180 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -975,6 +981,18 @@ #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 //=========================================================================== @@ -1300,10 +1318,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 0 #define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 220 #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1463,6 +1483,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h index 2d3b24252a..afbeb9eb42 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h index f68c7c06e2..d0402bc83a 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h @@ -170,10 +170,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -224,7 +222,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -242,7 +239,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -787,6 +783,13 @@ //#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. // @@ -944,6 +947,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 210 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 180 #define PREHEAT_1_TEMP_BED 50 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 210 #define PREHEAT_2_TEMP_BED 60 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 0a4b650376..f013ccf4c0 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -567,7 +574,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -739,7 +746,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1028,6 +1035,15 @@ // @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 * @@ -1053,7 +1069,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1063,15 +1079,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1620,10 +1627,17 @@ /** * 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 /** * User-defined menu items that execute custom GCode */ @@ -1637,10 +1651,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration.h index 12c11b00ce..e3c8c3035e 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -774,6 +770,13 @@ //#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. // @@ -931,6 +934,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -975,6 +981,18 @@ #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 //=========================================================================== @@ -1300,10 +1318,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 0 #define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 220 #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1463,6 +1483,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h index 2d3b24252a..afbeb9eb42 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Cartesio/Configuration.h b/Marlin/src/config/examples/Cartesio/Configuration.h index b8ca6b5c9e..4b24ca6c34 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration.h +++ b/Marlin/src/config/examples/Cartesio/Configuration.h @@ -163,10 +163,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -217,7 +215,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -235,7 +232,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -785,6 +781,13 @@ //#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. // @@ -942,6 +945,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 400 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -986,6 +992,18 @@ #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 //=========================================================================== @@ -1311,10 +1329,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 190 #define PREHEAT_1_TEMP_BED 50 #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 @@ -1474,6 +1494,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Cartesio/Configuration_adv.h b/Marlin/src/config/examples/Cartesio/Configuration_adv.h index 9ca51d6fdd..eddd117c11 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration_adv.h +++ b/Marlin/src/config/examples/Cartesio/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration.h b/Marlin/src/config/examples/Creality/CR-10/Configuration.h index e4fea3531d..bb8d386934 100644 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -796,6 +792,13 @@ //#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. // @@ -953,6 +956,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 400 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -997,6 +1003,18 @@ #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 //=========================================================================== @@ -1322,10 +1340,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 190 #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 @@ -1485,6 +1505,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 0211927b73..fa2eaad486 100644 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1615,10 +1622,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1632,10 +1647,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Creality/CR-10S/Configuration.h b/Marlin/src/config/examples/Creality/CR-10S/Configuration.h index d3a0e38083..27fa4105dc 100644 --- a/Marlin/src/config/examples/Creality/CR-10S/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-10S/Configuration.h @@ -133,11 +133,7 @@ // The following define selects which electronics board you have. // Please choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_RAMPS_14_EFB - #define PIN_EXP1 65 // A11 - #define PIN_EXP2 66 // A12 - #define PIN_EXP3 11 // SERVO0_PIN - #define PIN_EXP4 12 // PS_ON_PIN + #define MOTHERBOARD BOARD_RAMPS_CREALITY #endif // Optional custom name for your RepStrap or other custom machine @@ -166,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -220,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -238,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -790,6 +782,13 @@ //#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. // @@ -947,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 400 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -992,6 +994,18 @@ //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. #define FILAMENT_RUNOUT_SCRIPT "M600" #define FIL_RUNOUT_PIN 2 // Creality CR10-S stock sensor + + // 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 //=========================================================================== @@ -1317,10 +1331,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 205 #define PREHEAT_1_TEMP_BED 60 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 250 #define PREHEAT_2_TEMP_BED 80 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1480,6 +1496,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 cfcc0df375..f2a642b81b 100644 --- a/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar #define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h b/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h index 1bd40c6b49..9ecfac26af 100644 --- a/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h @@ -171,10 +171,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -225,7 +223,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -243,7 +240,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -805,6 +801,13 @@ //#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. // @@ -962,6 +965,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 300 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1006,6 +1012,18 @@ #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 //=========================================================================== @@ -1331,10 +1349,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #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 @@ -1494,6 +1514,13 @@ */ #define DISPLAY_CHARSET_HD44780 WESTERN +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 40e037c9a6..2eb7baad9d 100644 --- a/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Creality/CR-8/Configuration.h b/Marlin/src/config/examples/Creality/CR-8/Configuration.h index a229beaaf4..0a4a6af0df 100644 --- a/Marlin/src/config/examples/Creality/CR-8/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-8/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -796,6 +792,13 @@ //#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. // @@ -953,6 +956,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 310 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -997,6 +1003,18 @@ #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 //=========================================================================== @@ -1322,10 +1340,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 60 #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 @@ -1485,6 +1505,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 225e43e483..e6ef7567c1 100644 --- a/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Creality/Ender-2/Configuration.h b/Marlin/src/config/examples/Creality/Ender-2/Configuration.h index 4b4c26ac36..ced14703a4 100644 --- a/Marlin/src/config/examples/Creality/Ender-2/Configuration.h +++ b/Marlin/src/config/examples/Creality/Ender-2/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -790,6 +786,13 @@ //#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. // @@ -947,6 +950,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -991,6 +997,18 @@ #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 //=========================================================================== @@ -1316,10 +1334,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 185 #define PREHEAT_1_TEMP_BED 45 #define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 240 #define PREHEAT_2_TEMP_BED 0 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1479,6 +1499,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 c8fe6aefc0..a256498211 100644 --- a/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Creality/Ender-3/Configuration.h b/Marlin/src/config/examples/Creality/Ender-3/Configuration.h index a87f2ecf2f..bef05d1d79 100644 --- a/Marlin/src/config/examples/Creality/Ender-3/Configuration.h +++ b/Marlin/src/config/examples/Creality/Ender-3/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -790,6 +786,13 @@ //#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. // @@ -947,6 +950,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 250 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -991,6 +997,18 @@ #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 //=========================================================================== @@ -1207,7 +1225,7 @@ #endif // Homing speeds (mm/m) -#define HOMING_FEEDRATE_XY (50*60) +#define HOMING_FEEDRATE_XY (20*60) #define HOMING_FEEDRATE_Z (4*60) // Validate that endstops are triggered on homing moves @@ -1316,10 +1334,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 185 #define PREHEAT_1_TEMP_BED 45 #define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 240 #define PREHEAT_2_TEMP_BED 0 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1479,6 +1499,13 @@ */ #define DISPLAY_CHARSET_HD44780 WESTERN +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 f1cd39c313..3690c8f049 100644 --- a/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Creality/Ender-4/Configuration.h b/Marlin/src/config/examples/Creality/Ender-4/Configuration.h index ca2fb58c52..62a8b52bba 100644 --- a/Marlin/src/config/examples/Creality/Ender-4/Configuration.h +++ b/Marlin/src/config/examples/Creality/Ender-4/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -403,7 +399,7 @@ #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_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 @@ -415,9 +411,9 @@ // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it // Ender-4 - #define DEFAULT_Kp 22.57 - #define DEFAULT_Ki 1.72 - #define DEFAULT_Kd 73.96 + #define DEFAULT_Kp 16.67 + #define DEFAULT_Ki 1.12 + #define DEFAULT_Kd 62.14 // Ultimaker // #define DEFAULT_Kp 22.2 @@ -453,7 +449,7 @@ * 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 PIDTEMPBED //#define BED_LIMIT_SWITCHING @@ -506,7 +502,7 @@ * Note: For Bowden Extruders make this large enough to allow load/unload. */ #define PREVENT_LENGTHY_EXTRUDE -#define EXTRUDE_MAXLENGTH 500 +#define EXTRUDE_MAXLENGTH 750 //=========================================================================== //======================== Thermal Runaway Protection ======================= @@ -586,7 +582,7 @@ #endif // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup). -#define X_MIN_ENDSTOP_INVERTING true//false // set to true to invert the logic of the endstop. +#define X_MIN_ENDSTOP_INVERTING true // 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. @@ -665,14 +661,14 @@ * Override with M92 * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 110 } +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 100 } /** * Default Max Feed Rate (mm/s) * Override with M203 * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] */ -#define DEFAULT_MAX_FEEDRATE { 300, 300, 10, 25 } +#define DEFAULT_MAX_FEEDRATE { 500, 500, 15, 25 } /** * Default Max Acceleration (change/s) change = mm/s @@ -680,7 +676,7 @@ * Override with M201 * X, Y, Z, E0 [, E1[, E2[, E3[, E4[, E5]]]]] */ -#define DEFAULT_MAX_ACCELERATION { 500, 500, 100, 5000 } +#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } /** * Default Acceleration (change/s) change = mm/s @@ -715,7 +711,7 @@ * * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained */ -//#define S_CURVE_ACCELERATION +#define S_CURVE_ACCELERATION //=========================================================================== //============================= Z Probe Options ============================= @@ -796,6 +792,13 @@ //#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. // @@ -953,6 +956,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 310 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -979,7 +985,7 @@ #endif #if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - //#define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD + #define SOFT_ENDSTOPS_MENU_ITEM // Enable/Disable software endstops from the LCD #endif /** @@ -997,6 +1003,18 @@ #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 //=========================================================================== @@ -1039,15 +1057,15 @@ */ //#define AUTO_BED_LEVELING_3POINT //#define AUTO_BED_LEVELING_LINEAR -#define AUTO_BED_LEVELING_BILINEAR +//#define AUTO_BED_LEVELING_BILINEAR //#define AUTO_BED_LEVELING_UBL -//#define MESH_BED_LEVELING +#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 +#define RESTORE_LEVELING_AFTER_G28 /** * Enable detailed logging of G28, G29, M48, etc. @@ -1142,7 +1160,7 @@ #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 + #define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS #endif // BED_LEVELING @@ -1214,7 +1232,7 @@ // Homing speeds (mm/m) #define HOMING_FEEDRATE_XY (50*60) -#define HOMING_FEEDRATE_Z (4*60) +#define HOMING_FEEDRATE_Z (7*60) // Validate that endstops are triggered on homing moves #define VALIDATE_HOMING_ENDSTOPS @@ -1322,10 +1340,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 60 #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 @@ -1341,7 +1361,7 @@ * 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 +#define NOZZLE_PARK_FEATURE #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z } @@ -1388,7 +1408,7 @@ * Attention: EXPERIMENTAL. G-code arguments may change. * */ -#define NOZZLE_CLEAN_FEATURE +//#define NOZZLE_CLEAN_FEATURE #if ENABLED(NOZZLE_CLEAN_FEATURE) // Default number of pattern repetitions @@ -1485,6 +1505,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 4a5119296d..15bb2fd157 100644 --- a/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h @@ -90,7 +90,7 @@ * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set * below 2. */ - #define WATCH_TEMP_PERIOD 20 // Seconds + #define WATCH_TEMP_PERIOD 30 // Seconds #define WATCH_TEMP_INCREASE 2 // Degrees Celsius #endif @@ -263,7 +263,7 @@ */ #define CASE_LIGHT_ENABLE #if ENABLED(CASE_LIGHT_ENABLE) - #define CASE_LIGHT_PIN ENDER4_FAN_PIN // Override the default pin if needed + #define CASE_LIGHT_PIN ENDER4_FAN_PIN // 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 false // Set default power-up state on #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 // Set default power-up brightness (0-255, requires PWM pin) @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1074,28 +1081,28 @@ * Requires NOZZLE_PARK_FEATURE. * This feature is required for the default FILAMENT_RUNOUT_SCRIPT. */ -//#define ADVANCED_PAUSE_FEATURE +#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) #define PAUSE_PARK_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_FEEDRATE 35 // (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. + #define FILAMENT_CHANGE_UNLOAD_LENGTH 650 // (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_FEEDRATE 35 // (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. + #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 600 // (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_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. + #define ADVANCED_PAUSE_PURGE_LENGTH 60 // (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. @@ -1109,10 +1116,10 @@ #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 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_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 @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Einstart-S/Configuration.h b/Marlin/src/config/examples/Einstart-S/Configuration.h index f66fcd33c7..2ef239540e 100644 --- a/Marlin/src/config/examples/Einstart-S/Configuration.h +++ b/Marlin/src/config/examples/Einstart-S/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -797,6 +793,13 @@ //#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. // @@ -953,6 +956,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 165 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -997,6 +1003,18 @@ #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 //=========================================================================== @@ -1322,10 +1340,12 @@ // @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 @@ -1485,6 +1505,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Einstart-S/Configuration_adv.h b/Marlin/src/config/examples/Einstart-S/Configuration_adv.h index 0769a7aa6b..39a2a48808 100644 --- a/Marlin/src/config/examples/Einstart-S/Configuration_adv.h +++ b/Marlin/src/config/examples/Einstart-S/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Einstart-S/readme.md b/Marlin/src/config/examples/Einstart-S/readme.md index fbcb5f7668..22e7d8e662 100644 --- a/Marlin/src/config/examples/Einstart-S/readme.md +++ b/Marlin/src/config/examples/Einstart-S/readme.md @@ -10,7 +10,7 @@ The Einstart S is a commercial machine that ships with a proprietary firmware an - Genuine Minebea NEMA17 motors (200 steps/rev) - THC7128 3A Stepper Drivers (configured for 16 microsteps, loud) - 160x160 magnetically coupled non-heated bed - - PLA Only Direct Drive extruder + - PLA-only, Direct Drive extruder - SH1106 OLED Display w/ Cardinal navigation - 9533 I2C PWM RGB LED Chassis illumination - Onboard SD-Card Support diff --git a/Marlin/src/config/examples/Felix/Configuration.h b/Marlin/src/config/examples/Felix/Configuration.h index 1b7f26ee1d..7b8c25364b 100644 --- a/Marlin/src/config/examples/Felix/Configuration.h +++ b/Marlin/src/config/examples/Felix/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -768,6 +764,13 @@ //#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. // @@ -925,6 +928,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 235 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -969,6 +975,18 @@ #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 //=========================================================================== @@ -1294,10 +1312,12 @@ // @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 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1457,6 +1477,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Felix/Configuration_adv.h b/Marlin/src/config/examples/Felix/Configuration_adv.h index 8f2210a1ef..414f0c52fe 100644 --- a/Marlin/src/config/examples/Felix/Configuration_adv.h +++ b/Marlin/src/config/examples/Felix/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Felix/DUAL/Configuration.h b/Marlin/src/config/examples/Felix/DUAL/Configuration.h index 46b46d51e5..7e117341c9 100644 --- a/Marlin/src/config/examples/Felix/DUAL/Configuration.h +++ b/Marlin/src/config/examples/Felix/DUAL/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -768,6 +764,13 @@ //#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. // @@ -925,6 +928,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 235 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -969,6 +975,18 @@ #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 //=========================================================================== @@ -1294,10 +1312,12 @@ // @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 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1457,6 +1477,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h index c875ee7895..2bd893b991 100644 --- a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h +++ b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -792,6 +788,13 @@ //#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. // @@ -949,6 +952,9 @@ #define Y_MAX_POS 182 #define Z_MAX_POS 175 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -993,6 +999,18 @@ #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 //=========================================================================== @@ -1318,10 +1336,12 @@ // @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 @@ -1481,6 +1501,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 52827b25cd..c0b69d6acd 100644 --- a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Formbot/Raptor/Configuration.h b/Marlin/src/config/examples/Formbot/Raptor/Configuration.h index fce1932cfb..a6fe6e6e4b 100644 --- a/Marlin/src/config/examples/Formbot/Raptor/Configuration.h +++ b/Marlin/src/config/examples/Formbot/Raptor/Configuration.h @@ -203,10 +203,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -257,7 +255,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -275,7 +272,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -870,6 +866,13 @@ //#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. // @@ -1039,6 +1042,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 500 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1086,6 +1092,18 @@ #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 //=========================================================================== @@ -1418,10 +1436,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 60 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 220 #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1581,6 +1601,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h b/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h index 0a0c934164..0161e47397 100644 --- a/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h +++ b/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage #define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar #define DOGM_SD_PERCENT @@ -1022,6 +1029,15 @@ // @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 * @@ -1047,7 +1063,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1057,15 +1073,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1614,10 +1621,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ 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 b7374171dc..236c283030 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration.h @@ -165,10 +165,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -219,7 +217,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -237,7 +234,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -824,6 +820,13 @@ //#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. // @@ -985,6 +988,9 @@ #define Z_MAX_POS 500 #endif +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1029,6 +1035,18 @@ #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 //=========================================================================== @@ -1359,10 +1377,12 @@ // @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 @@ -1522,6 +1542,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 b596907785..7131368f44 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 @@ -389,10 +389,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 200 @@ -486,6 +482,17 @@ */ //#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] @@ -563,7 +570,7 @@ // Add an 'M73' G-code to set the current percentage #define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -735,7 +742,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1024,6 +1031,15 @@ // @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 * @@ -1049,7 +1065,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1059,15 +1075,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1616,10 +1623,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Formbot/T_Rex_2+/_Bootscreen.h b/Marlin/src/config/examples/Formbot/T_Rex_2+/_Bootscreen.h index 42d92efef8..c2333ed4cf 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_2+/_Bootscreen.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_2+/_Bootscreen.h @@ -32,9 +32,7 @@ #include #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 - #define CUSTOM_BOOTSCREEN_BMPWIDTH 128 -#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64 const unsigned char custom_start_bmp[] PROGMEM = { B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111, diff --git a/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration.h b/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration.h index f083fd1b95..eb510ed5ef 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration.h @@ -166,10 +166,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -220,7 +218,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -238,7 +235,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -807,6 +803,13 @@ //#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. // @@ -968,6 +971,9 @@ #define Z_MAX_POS 500 #endif +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1017,6 +1023,18 @@ #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 //=========================================================================== @@ -1342,10 +1360,12 @@ // @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 @@ -1505,6 +1525,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 6c82a2476f..159cce83d3 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 @@ -390,10 +390,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 200 @@ -487,6 +483,17 @@ */ //#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] @@ -564,7 +571,7 @@ // Add an 'M73' G-code to set the current percentage #define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -736,7 +743,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1025,6 +1032,15 @@ // @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 * @@ -1050,7 +1066,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1060,15 +1076,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1617,10 +1624,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ diff --git a/Marlin/src/config/examples/Formbot/T_Rex_3/_Bootscreen.h b/Marlin/src/config/examples/Formbot/T_Rex_3/_Bootscreen.h index 02ef485d53..ad09d3523b 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_3/_Bootscreen.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_3/_Bootscreen.h @@ -32,9 +32,7 @@ #include #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 - #define CUSTOM_BOOTSCREEN_BMPWIDTH 128 -#define CUSTOM_BOOTSCREEN_BMPHEIGHT 64 const unsigned char custom_start_bmp[] PROGMEM = { B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111, diff --git a/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h b/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h index 62d68c3f41..92aabe9700 100644 --- a/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -801,6 +797,13 @@ //#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. // @@ -958,6 +961,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1002,6 +1008,18 @@ #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 //=========================================================================== @@ -1327,10 +1345,12 @@ // @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 @@ -1490,6 +1510,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h b/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h index 4c63045943..bbda67400a 100644 --- a/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 170 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @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 215 #define PREHEAT_2_TEMP_BED 105 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration.h b/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration.h index 8d35bf5892..36d8f2ea1f 100644 --- a/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -793,6 +789,13 @@ //#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. // @@ -950,6 +953,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 162 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -994,6 +1000,18 @@ #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 //=========================================================================== @@ -1319,10 +1337,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 190 #define PREHEAT_1_TEMP_BED 60 #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 100 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1482,6 +1502,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h b/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h index d94a6871ac..c58aaf028e 100644 --- a/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h +++ b/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1021,6 +1028,15 @@ // @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 * @@ -1046,7 +1062,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1056,15 +1072,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1623,10 +1630,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h index 5eac4fbd48..4a286650d3 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -802,6 +798,13 @@ //#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. // @@ -959,6 +962,9 @@ #define Y_MAX_POS (-Y_MIN_POS+Y_BED_SIZE) #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1003,6 +1009,18 @@ #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 //=========================================================================== @@ -1328,10 +1346,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 60 #define PREHEAT_1_FAN_SPEED 170 // 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 170 // Value from 0 to 255 @@ -1491,6 +1511,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h index dd06dee917..0380868f19 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -801,6 +797,13 @@ //#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. // @@ -958,6 +961,9 @@ #define Y_MAX_POS (-Y_MIN_POS+Y_BED_SIZE) #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1002,6 +1008,18 @@ #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 //=========================================================================== @@ -1327,10 +1345,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 60 #define PREHEAT_1_FAN_SPEED 170 // 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 170 // Value from 0 to 255 @@ -1490,6 +1510,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h index 57f3596503..9841568eeb 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 180 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 65 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 235 #define PREHEAT_2_TEMP_BED 95 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 dd0617d7bf..f86b428c02 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 @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h index c472fbd6ff..4bc3f80f56 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 180 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 65 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 235 #define PREHEAT_2_TEMP_BED 95 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 dd0617d7bf..f86b428c02 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 @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h index 72a0db10b5..48218e701d 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -790,6 +786,13 @@ //#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. // @@ -947,6 +950,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 185 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -991,6 +997,18 @@ #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 //=========================================================================== @@ -1316,10 +1334,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 50 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 245 #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1479,6 +1499,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 76c0e02b5c..ec9248761c 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/JGAurora/A5/Configuration.h b/Marlin/src/config/examples/JGAurora/A5/Configuration.h index 44434e23ff..f303f6d0d4 100644 --- a/Marlin/src/config/examples/JGAurora/A5/Configuration.h +++ b/Marlin/src/config/examples/JGAurora/A5/Configuration.h @@ -167,10 +167,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -221,7 +219,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -239,7 +236,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -798,6 +794,13 @@ //#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. // @@ -955,6 +958,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 320 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -999,6 +1005,18 @@ #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 //=========================================================================== @@ -1323,10 +1341,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 205 #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 0 // Value from 0 to 255 @@ -1486,6 +1506,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h b/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h index 41d2e2f736..8258cb449b 100644 --- a/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h +++ b/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/MakerParts/Configuration.h b/Marlin/src/config/examples/MakerParts/Configuration.h index 97bd910996..a84996c3c5 100644 --- a/Marlin/src/config/examples/MakerParts/Configuration.h +++ b/Marlin/src/config/examples/MakerParts/Configuration.h @@ -182,10 +182,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -236,7 +234,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -254,7 +251,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -806,6 +802,13 @@ //#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. // @@ -963,6 +966,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1007,6 +1013,18 @@ #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 //=========================================================================== @@ -1332,10 +1350,12 @@ // @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 @@ -1495,6 +1515,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/MakerParts/Configuration_adv.h b/Marlin/src/config/examples/MakerParts/Configuration_adv.h index 664a4c114e..d3d46efed8 100644 --- a/Marlin/src/config/examples/MakerParts/Configuration_adv.h +++ b/Marlin/src/config/examples/MakerParts/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration.h b/Marlin/src/config/examples/Malyan/M150/Configuration.h index b65d723ab4..93a4571cd0 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration.h @@ -167,10 +167,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -221,7 +219,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -239,7 +236,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -806,6 +802,13 @@ //#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. // @@ -967,6 +970,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 180 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1011,6 +1017,18 @@ #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 //=========================================================================== @@ -1340,10 +1358,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 205 #define PREHEAT_1_TEMP_BED 60 #define PREHEAT_1_FAN_SPEED 128 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 230 #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1503,6 +1523,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h index 67e5f56d9e..ed75f9530b 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Malyan/M200/Configuration.h b/Marlin/src/config/examples/Malyan/M200/Configuration.h index c3887c6b68..edaa8cb9a2 100644 --- a/Marlin/src/config/examples/Malyan/M200/Configuration.h +++ b/Marlin/src/config/examples/Malyan/M200/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -785,6 +781,13 @@ //#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. // @@ -942,6 +945,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -986,6 +992,18 @@ #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 //=========================================================================== @@ -1311,10 +1329,12 @@ // @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 @@ -1474,6 +1494,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h index b06a06ca3c..43c59b9054 100644 --- a/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h b/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h index d9bde36378..53bfad521c 100644 --- a/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h +++ b/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -790,6 +786,13 @@ //#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. // @@ -947,6 +950,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 260 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -991,6 +997,18 @@ #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 //=========================================================================== @@ -1316,10 +1334,12 @@ // @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 @@ -1479,6 +1499,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h index 50e44abf14..b585577925 100644 --- a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h +++ b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -790,6 +786,13 @@ //#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. // @@ -947,6 +950,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 260 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -991,6 +997,18 @@ #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 //=========================================================================== @@ -1316,10 +1334,12 @@ // @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 @@ -1479,6 +1499,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 1de3daa1c2..5fd51f776a 100644 --- a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Mks/Sbase/Configuration.h b/Marlin/src/config/examples/Mks/Sbase/Configuration.h index f9b59a4379..2f54478c42 100644 --- a/Marlin/src/config/examples/Mks/Sbase/Configuration.h +++ b/Marlin/src/config/examples/Mks/Sbase/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @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 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h index a2aead390a..a983d1f7f7 100644 --- a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h +++ b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -560,7 +567,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -732,7 +739,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1028,6 +1035,15 @@ // @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 * @@ -1053,7 +1069,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1063,15 +1079,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1620,10 +1627,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1637,10 +1652,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h b/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h index ecfc4169ba..cda7035f0d 100644 --- a/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h +++ b/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -826,6 +822,13 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley //#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. // @@ -992,6 +995,9 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 80 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1036,6 +1042,18 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley #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 //=========================================================================== @@ -1361,10 +1379,12 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley // @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 @@ -1524,6 +1544,13 @@ Black rubber belt(MXL), 18 - tooth aluminium pulley : 87.489 step per mm (Huxley */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h b/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h index bd03d85ba4..9c088b3486 100644 --- a/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @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 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/RigidBot/Configuration.h b/Marlin/src/config/examples/RigidBot/Configuration.h index 1f424210c3..7f398a1b4a 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration.h +++ b/Marlin/src/config/examples/RigidBot/Configuration.h @@ -165,10 +165,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -219,7 +217,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -237,7 +234,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -784,6 +780,13 @@ //#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. // @@ -941,6 +944,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 254 // RigidBot regular and Big are 254mm +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -985,6 +991,18 @@ #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 //=========================================================================== @@ -1310,10 +1328,12 @@ // @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 @@ -1473,6 +1493,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/RigidBot/Configuration_adv.h b/Marlin/src/config/examples/RigidBot/Configuration_adv.h index fe5bea5431..8d86f88dda 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration_adv.h +++ b/Marlin/src/config/examples/RigidBot/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/SCARA/Configuration.h b/Marlin/src/config/examples/SCARA/Configuration.h index 9636ce618b..0480368611 100644 --- a/Marlin/src/config/examples/SCARA/Configuration.h +++ b/Marlin/src/config/examples/SCARA/Configuration.h @@ -193,10 +193,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -247,7 +245,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -265,7 +262,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -799,6 +795,13 @@ //#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. // @@ -956,6 +959,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 225 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1000,6 +1006,18 @@ #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 //=========================================================================== @@ -1325,10 +1343,12 @@ // @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 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1488,6 +1508,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/SCARA/Configuration_adv.h b/Marlin/src/config/examples/SCARA/Configuration_adv.h index 79b1eac2b4..41eeb218e3 100644 --- a/Marlin/src/config/examples/SCARA/Configuration_adv.h +++ b/Marlin/src/config/examples/SCARA/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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 35 // Default feedrate for retracting (mm/s) - #define RETRACT_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/STM32F10/Configuration.h b/Marlin/src/config/examples/STM32F10/Configuration.h index ebf9692437..c8a7b44230 100644 --- a/Marlin/src/config/examples/STM32F10/Configuration.h +++ b/Marlin/src/config/examples/STM32F10/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -788,6 +784,13 @@ //#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. // @@ -945,6 +948,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 180 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -989,6 +995,18 @@ #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 //=========================================================================== @@ -1314,10 +1332,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 60 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 220 #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1477,6 +1497,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/STM32F4/Configuration.h b/Marlin/src/config/examples/STM32F4/Configuration.h index bc854532d6..87c56d5b61 100644 --- a/Marlin/src/config/examples/STM32F4/Configuration.h +++ b/Marlin/src/config/examples/STM32F4/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @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 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration.h b/Marlin/src/config/examples/Sanguinololu/Configuration.h index 65a7fd9c15..9ea18b9f10 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -817,6 +813,13 @@ //#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. // @@ -974,6 +977,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 170 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1018,6 +1024,18 @@ #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 //=========================================================================== @@ -1343,10 +1361,12 @@ // @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 @@ -1506,6 +1526,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h index 5c1cf8531c..b348823c0e 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/TheBorg/Configuration.h b/Marlin/src/config/examples/TheBorg/Configuration.h index 8bcb9b8f9f..d1994ef824 100644 --- a/Marlin/src/config/examples/TheBorg/Configuration.h +++ b/Marlin/src/config/examples/TheBorg/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @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 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/TheBorg/Configuration_adv.h b/Marlin/src/config/examples/TheBorg/Configuration_adv.h index 53632ab191..ec225d4957 100644 --- a/Marlin/src/config/examples/TheBorg/Configuration_adv.h +++ b/Marlin/src/config/examples/TheBorg/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration.h b/Marlin/src/config/examples/TinyBoy2/Configuration.h index 9176de6f4f..bbce97460b 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration.h @@ -184,10 +184,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -238,7 +236,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -256,7 +253,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -837,6 +833,13 @@ //#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. // @@ -999,6 +1002,9 @@ #define Z_MAX_POS 158 #endif +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1043,6 +1049,18 @@ #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 //=========================================================================== @@ -1368,10 +1386,12 @@ // @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 90 // TB2: ABS default 110, 90 is the maximum temp at 12V supply #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1531,6 +1551,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h index 97e8d2a709..273f8aec87 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Tronxy/X1/Configuration.h b/Marlin/src/config/examples/Tronxy/X1/Configuration.h index 554bb2d8d1..1565768a9b 100644 --- a/Marlin/src/config/examples/Tronxy/X1/Configuration.h +++ b/Marlin/src/config/examples/Tronxy/X1/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 150 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @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 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Tronxy/X3A/Configuration.h b/Marlin/src/config/examples/Tronxy/X3A/Configuration.h index e1895fe2d8..533671e26f 100644 --- a/Marlin/src/config/examples/Tronxy/X3A/Configuration.h +++ b/Marlin/src/config/examples/Tronxy/X3A/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -947,6 +950,9 @@ #define Y_MAX_POS Y_BED_SIZE - (TRONXY_Y_BED_OFFSET + 5) #define Z_MAX_POS 316 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -991,6 +997,18 @@ #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 //=========================================================================== @@ -1316,10 +1334,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 210 #define PREHEAT_1_TEMP_BED 60 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 225 #define PREHEAT_2_TEMP_BED 85 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1479,6 +1499,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h b/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h index 5a5e6b11f8..940dd96575 100644 --- a/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h +++ b/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Tronxy/X5S/Configuration.h b/Marlin/src/config/examples/Tronxy/X5S/Configuration.h index 3064d10f3e..e60d79bc56 100644 --- a/Marlin/src/config/examples/Tronxy/X5S/Configuration.h +++ b/Marlin/src/config/examples/Tronxy/X5S/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 400 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 180 #define PREHEAT_1_TEMP_BED 50 #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 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Tronxy/XY100/Configuration.h b/Marlin/src/config/examples/Tronxy/XY100/Configuration.h index b5b18ccdd3..bc6aa0fee2 100644 --- a/Marlin/src/config/examples/Tronxy/XY100/Configuration.h +++ b/Marlin/src/config/examples/Tronxy/XY100/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -797,6 +793,13 @@ //#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. // @@ -954,6 +957,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 130 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -998,6 +1004,18 @@ #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 //=========================================================================== @@ -1323,10 +1341,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #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 @@ -1486,6 +1506,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h index fe2cac4b7d..0d8c5607aa 100644 --- a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h +++ b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @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 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h index af755263ad..f608bce3ca 100644 --- a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration.h b/Marlin/src/config/examples/Velleman/K8200/Configuration.h index 519b346a1c..77d6be4538 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration.h @@ -182,10 +182,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -236,7 +234,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -254,7 +251,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -815,6 +811,13 @@ //#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. // @@ -973,6 +976,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1017,6 +1023,18 @@ #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 //=========================================================================== @@ -1342,10 +1360,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 180 #define PREHEAT_1_TEMP_BED 50 // K8200: PLA / set back to 70 if you have an upgraded heatbed power supply #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 60 // K8200: ABS / set back to 110 if you have an upgraded heatbed power supply #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1508,6 +1528,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE // K8200: for Display VM8201 // this is the most common hardware +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h index fa03df008e..c90e75e905 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h @@ -398,10 +398,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -495,6 +491,17 @@ */ //#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] @@ -572,7 +579,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -744,7 +751,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1033,6 +1040,15 @@ // @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 * @@ -1058,7 +1074,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1068,15 +1084,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1625,10 +1632,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1642,10 +1657,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration.h b/Marlin/src/config/examples/Velleman/K8400/Configuration.h index cc56b0eb16..6f07b2da11 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 190 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 210 #define PREHEAT_1_TEMP_BED 0 #define PREHEAT_1_FAN_SPEED 165 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 245 #define PREHEAT_2_TEMP_BED 0 #define PREHEAT_2_FAN_SPEED 165 // Value from 0 to 255 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h index 234f0a7725..f5c4445d63 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h b/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h index 2b86351e53..cd0aac771c 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 190 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 210 #define PREHEAT_1_TEMP_BED 0 #define PREHEAT_1_FAN_SPEED 165 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 245 #define PREHEAT_2_TEMP_BED 0 #define PREHEAT_2_FAN_SPEED 165 // Value from 0 to 255 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h index 5e42fc387e..937476adad 100644 --- a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h +++ b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -796,6 +792,13 @@ //#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. // @@ -953,6 +956,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 170 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -997,6 +1003,18 @@ #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 //=========================================================================== @@ -1322,10 +1340,12 @@ // @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 @@ -1485,6 +1505,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 cb6a534cf9..276ff73bc4 100644 --- a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -561,7 +568,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -733,7 +740,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1022,6 +1029,15 @@ // @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 * @@ -1047,7 +1063,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1057,15 +1073,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1614,10 +1621,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1631,10 +1646,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/adafruit/ST7565/Configuration.h b/Marlin/src/config/examples/adafruit/ST7565/Configuration.h index b9bc8afa40..efd2bc2349 100644 --- a/Marlin/src/config/examples/adafruit/ST7565/Configuration.h +++ b/Marlin/src/config/examples/adafruit/ST7565/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -786,6 +782,13 @@ //#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. // @@ -943,6 +946,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 200 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -987,6 +993,18 @@ #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 //=========================================================================== @@ -1312,10 +1330,12 @@ // @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 @@ -1475,6 +1495,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration.h b/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration.h index 01ef6667db..5a9b711674 100644 --- a/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration.h +++ b/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration.h @@ -25,8 +25,10 @@ */ // normal size or plus? //#define ANYCUBIC_KOSSEL_PLUS + // Anycubic Probe version 1 or 2 see README.md; 0 for no probe #define ANYCUBIC_PROBE_VERSION 0 + // Heated Bed: // 0 ... no heated bed // 1 ... aluminium heated bed with "BuildTak-like" sticker @@ -175,10 +177,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -229,7 +229,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -247,7 +246,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -585,9 +583,6 @@ // and processor overload (too many expensive sqrt calls). #define DELTA_SEGMENTS_PER_SECOND 80 - // Convert feedrates to apply to the Effector instead of the Carriages - //#define DELTA_FEEDRATE_SCALING - // After homing move down to a height where XY movement is unconstrained #define DELTA_HOME_TO_SAFE_ZONE @@ -700,7 +695,7 @@ // 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 (ANYCUBIC_PROBE_VERSION + 0 == 2) // V1 is NC, V2 is NO +#define Z_MIN_ENDSTOP_INVERTING (ANYCUBIC_PROBE_VERSION + 0 == 1) // V1 is NO, V2 is NC #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. @@ -923,6 +918,13 @@ //#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. @@ -993,11 +995,11 @@ #define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // Y offset: -front +behind [the nozzle] #if ANYCUBIC_PROBE_VERSION == 2 - #define Z_PROBE_OFFSET_FROM_EXTRUDER -16.8 // Z offset: -below +above [the nozzle] + #define Z_PROBE_OFFSET_FROM_EXTRUDER -16.8 // Z offset: -below +above [the nozzle] #elif ANYCUBIC_PROBE_VERSION == 1 - #define Z_PROBE_OFFSET_FROM_EXTRUDER -19.0 // Z offset: -below +above [the nozzle] + #define Z_PROBE_OFFSET_FROM_EXTRUDER -19.0 // Z offset: -below +above [the nozzle] #else - #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] + #define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle] #endif // Certain types of probes need to stay away from edges @@ -1132,6 +1134,9 @@ #define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1176,6 +1181,18 @@ #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 //=========================================================================== @@ -1503,10 +1520,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 190 #define PREHEAT_1_TEMP_BED 60 #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 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1666,6 +1685,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 d338155c5c..c1f5c62422 100644 --- a/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -484,6 +480,17 @@ */ //#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] @@ -561,7 +568,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -733,7 +740,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1022,6 +1029,15 @@ // @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 * @@ -1047,7 +1063,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1057,15 +1073,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1614,10 +1621,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1631,10 +1646,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h index 4ca4c430e6..22d04ea5e5 100644 --- a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h +++ b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -868,6 +864,13 @@ //#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. @@ -1028,7 +1031,7 @@ // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. -#define INVERT_X_DIR true // DELTA does not invert +#define INVERT_X_DIR true #define INVERT_Y_DIR true #define INVERT_Z_DIR true @@ -1071,6 +1074,9 @@ #define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1115,6 +1121,18 @@ #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 //=========================================================================== @@ -1440,10 +1458,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 195 #define PREHEAT_1_TEMP_BED 60 #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 100 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1603,6 +1623,13 @@ */ #define DISPLAY_CHARSET_HD44780 WESTERN +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 b0c792eeb7..edba6cedcd 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 @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -484,6 +480,17 @@ */ //#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] @@ -561,7 +568,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -733,7 +740,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1022,6 +1029,15 @@ // @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 * @@ -1047,7 +1063,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1057,15 +1073,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1614,10 +1621,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1631,10 +1646,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h index 3c68ba523c..b8f645c35b 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -868,6 +864,13 @@ //#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. @@ -1027,7 +1030,7 @@ // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. -#define INVERT_X_DIR true // DELTA does not invert +#define INVERT_X_DIR true #define INVERT_Y_DIR true #define INVERT_Z_DIR true @@ -1070,6 +1073,9 @@ #define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1114,6 +1120,18 @@ #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 //=========================================================================== @@ -1439,10 +1457,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 195 #define PREHEAT_1_TEMP_BED 60 #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 100 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1602,6 +1622,13 @@ */ #define DISPLAY_CHARSET_HD44780 WESTERN +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 b0c792eeb7..edba6cedcd 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -484,6 +480,17 @@ */ //#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] @@ -561,7 +568,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -733,7 +740,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1022,6 +1029,15 @@ // @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 * @@ -1047,7 +1063,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1057,15 +1073,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1614,10 +1621,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1631,10 +1646,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h index 32a85329d3..b0aef7d826 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -868,6 +864,13 @@ //#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. @@ -1027,7 +1030,7 @@ // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. -#define INVERT_X_DIR true // DELTA does not invert +#define INVERT_X_DIR true #define INVERT_Y_DIR true #define INVERT_Z_DIR true @@ -1070,6 +1073,9 @@ #define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1114,6 +1120,18 @@ #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 //=========================================================================== @@ -1439,10 +1457,12 @@ // @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 100 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1602,6 +1622,13 @@ */ #define DISPLAY_CHARSET_HD44780 WESTERN +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 de8490e3c7..aa7f0ff2dc 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 @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -484,6 +480,17 @@ */ //#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] @@ -561,7 +568,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -733,7 +740,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1022,6 +1029,15 @@ // @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 * @@ -1047,7 +1063,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1057,15 +1073,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1614,10 +1621,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1631,10 +1646,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h b/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h index b66318b25d..0b98a579b2 100644 --- a/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h +++ b/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h @@ -167,10 +167,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -221,7 +219,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -239,7 +236,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -873,6 +869,13 @@ //#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. @@ -1030,7 +1033,7 @@ // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. -#define INVERT_X_DIR false // DELTA does not invert +#define INVERT_X_DIR false #define INVERT_Y_DIR false #define INVERT_Z_DIR false @@ -1073,6 +1076,9 @@ #define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1117,6 +1123,18 @@ #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 //=========================================================================== @@ -1442,10 +1460,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 210 #define PREHEAT_1_TEMP_BED 60 #define PREHEAT_1_FAN_SPEED 255 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 230 #define PREHEAT_2_TEMP_BED 105 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1605,6 +1625,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/delta/generic/Configuration.h b/Marlin/src/config/examples/delta/generic/Configuration.h index 4a48398b1d..38e9997844 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration.h +++ b/Marlin/src/config/examples/delta/generic/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -858,6 +854,13 @@ //#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. @@ -1015,7 +1018,7 @@ // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. -#define INVERT_X_DIR false // DELTA does not invert +#define INVERT_X_DIR false #define INVERT_Y_DIR false #define INVERT_Z_DIR false @@ -1058,6 +1061,9 @@ #define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1102,6 +1108,18 @@ #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 //=========================================================================== @@ -1427,10 +1445,12 @@ // @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 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1590,6 +1610,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/delta/generic/Configuration_adv.h b/Marlin/src/config/examples/delta/generic/Configuration_adv.h index de8490e3c7..aa7f0ff2dc 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/generic/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -484,6 +480,17 @@ */ //#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] @@ -561,7 +568,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -733,7 +740,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1022,6 +1029,15 @@ // @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 * @@ -1047,7 +1063,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1057,15 +1073,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1614,10 +1621,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1631,10 +1646,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration.h index 8a41a79e5b..ff219222ee 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -858,6 +854,13 @@ //#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. @@ -1017,7 +1020,7 @@ // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. -#define INVERT_X_DIR false // DELTA does not invert +#define INVERT_X_DIR false #define INVERT_Y_DIR false #define INVERT_Z_DIR false @@ -1060,6 +1063,9 @@ #define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1104,6 +1110,18 @@ #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 //=========================================================================== @@ -1429,10 +1447,12 @@ // @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 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1592,6 +1612,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 de8490e3c7..aa7f0ff2dc 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -484,6 +480,17 @@ */ //#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] @@ -561,7 +568,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -733,7 +740,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1022,6 +1029,15 @@ // @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 * @@ -1047,7 +1063,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1057,15 +1073,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1614,10 +1621,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1631,10 +1646,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/delta/kossel_pro/Configuration.h b/Marlin/src/config/examples/delta/kossel_pro/Configuration.h index 22aec04913..cda63c102f 100644 --- a/Marlin/src/config/examples/delta/kossel_pro/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_pro/Configuration.h @@ -166,10 +166,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -220,7 +218,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -238,7 +235,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -851,6 +847,13 @@ //#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. @@ -1061,6 +1064,9 @@ #define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1105,6 +1111,18 @@ #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 //=========================================================================== @@ -1430,10 +1448,12 @@ // @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 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1593,6 +1613,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration.h index 1f45169d37..e53e543534 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -861,6 +857,13 @@ //#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. @@ -1018,7 +1021,7 @@ // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. -#define INVERT_X_DIR false // DELTA does not invert +#define INVERT_X_DIR false #define INVERT_Y_DIR false #define INVERT_Z_DIR false @@ -1061,6 +1064,9 @@ #define Y_MAX_POS DELTA_PRINTABLE_RADIUS #define Z_MAX_POS MANUAL_Z_HOME_POS +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1105,6 +1111,18 @@ #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 //=========================================================================== @@ -1430,10 +1448,12 @@ // @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 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1593,6 +1613,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 af6ed44c36..0f8f9bb221 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -484,6 +480,17 @@ */ //#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] @@ -561,7 +568,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -733,7 +740,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1022,6 +1029,15 @@ // @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 * @@ -1047,7 +1063,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1057,15 +1073,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1614,10 +1621,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1631,10 +1646,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h index 6faf4d2544..8abd767c9f 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h @@ -167,10 +167,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -221,7 +219,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -239,7 +236,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -799,6 +795,13 @@ //#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. // @@ -957,6 +960,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 500 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -1001,6 +1007,18 @@ #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 //=========================================================================== @@ -1326,10 +1344,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #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 @@ -1489,6 +1509,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * 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 1da5c9a4e6..e438ac5095 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/makibox/Configuration.h b/Marlin/src/config/examples/makibox/Configuration.h index e18b1dcea0..6a77c44de1 100644 --- a/Marlin/src/config/examples/makibox/Configuration.h +++ b/Marlin/src/config/examples/makibox/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -789,6 +785,13 @@ //#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. // @@ -946,6 +949,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 86 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -990,6 +996,18 @@ #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 //=========================================================================== @@ -1315,10 +1333,12 @@ // @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 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1478,6 +1498,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/makibox/Configuration_adv.h b/Marlin/src/config/examples/makibox/Configuration_adv.h index c9c66bcd3f..5ceea6a7e5 100644 --- a/Marlin/src/config/examples/makibox/Configuration_adv.h +++ b/Marlin/src/config/examples/makibox/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/stm32f103ret6/Configuration.h b/Marlin/src/config/examples/stm32f103ret6/Configuration.h index 2c9a83495a..60d4a6d166 100644 --- a/Marlin/src/config/examples/stm32f103ret6/Configuration.h +++ b/Marlin/src/config/examples/stm32f103ret6/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -788,6 +784,13 @@ //#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. // @@ -945,6 +948,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 180 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -989,6 +995,18 @@ #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 //=========================================================================== @@ -1314,10 +1332,12 @@ // @section temperature // Preheat Constants +#define PREHEAT_1_LABEL "PLA" #define PREHEAT_1_TEMP_HOTEND 200 #define PREHEAT_1_TEMP_BED 60 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 +#define PREHEAT_2_LABEL "ABS" #define PREHEAT_2_TEMP_HOTEND 220 #define PREHEAT_2_TEMP_BED 100 #define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 @@ -1477,6 +1497,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration.h index 764177ccc7..3b59bcc974 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -781,6 +777,13 @@ //#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. // @@ -938,6 +941,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 120 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -982,6 +988,18 @@ #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 //=========================================================================== @@ -1307,10 +1325,12 @@ // @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 100 #define PREHEAT_2_FAN_SPEED 255 // Value from 0 to 255 @@ -1470,6 +1490,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h index de725f09c1..7a6ce41ba8 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -559,7 +566,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -731,7 +738,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1020,6 +1027,15 @@ // @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 * @@ -1045,7 +1061,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1055,15 +1071,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1612,10 +1619,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1629,10 +1644,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/config/examples/wt150/Configuration.h b/Marlin/src/config/examples/wt150/Configuration.h index e3f7c8b0c5..eb35eef390 100644 --- a/Marlin/src/config/examples/wt150/Configuration.h +++ b/Marlin/src/config/examples/wt150/Configuration.h @@ -162,10 +162,8 @@ #define SINGLENOZZLE_SWAP_PRIME_SPEED 3600 // (mm/m) //#define SINGLENOZZLE_SWAP_PARK #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #define SINGLENOZZLE_TOOLCHANGE_POSITION { (X_MIN_POS + 10), (Y_MIN_POS + 10), 5 } - #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) - #else - #define SINGLENOZZLE_TOOLCHANGE_ZRAISE 2.0 + #define SINGLENOZZLE_TOOLCHANGE_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } + #define SINGLENOZZLE_PARK_XY_FEEDRATE 6000 // (mm/m) #endif #endif @@ -216,7 +214,6 @@ #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 PARKING_EXTRUDER_SECURITY_RAISE 5 // Z-raise before parking //#define MANUAL_SOLENOID_CONTROL // Manual control of docking solenoids with M380 S / M381 #endif @@ -234,7 +231,6 @@ #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 - #define SWITCHING_TOOLHEAD_SECURITY_RAISE 5 // (mm) Z-raise before parking #endif /** @@ -791,6 +787,13 @@ //#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. // @@ -948,6 +951,9 @@ #define Y_MAX_POS Y_BED_SIZE #define Z_MAX_POS 143.0 +// Z raise distance for tool-change, as needed for some extruders +#define TOOLCHANGE_ZRAISE 2 // (mm) + /** * Software Endstops * @@ -992,6 +998,18 @@ #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 //=========================================================================== @@ -1317,10 +1335,12 @@ // @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 @@ -1480,6 +1500,13 @@ */ #define DISPLAY_CHARSET_HD44780 JAPANESE +/** + * Info Screen Style (0:Classic, 1:Prusa) + * + * :[0:'Classic', 1:'Prusa'] + */ +#define LCD_INFO_SCREEN_STYLE 0 + /** * SD CARD * diff --git a/Marlin/src/config/examples/wt150/Configuration_adv.h b/Marlin/src/config/examples/wt150/Configuration_adv.h index ea83c84315..3195fe78b3 100644 --- a/Marlin/src/config/examples/wt150/Configuration_adv.h +++ b/Marlin/src/config/examples/wt150/Configuration_adv.h @@ -385,10 +385,6 @@ // This is the default power-up mode which can be later using M605. #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE - // Default settings in "Auto-park Mode" - #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder - #define TOOLCHANGE_UNPARK_ZLIFT 1 // the distance to raise Z axis when unparking an extruder - // Default x offset in duplication mode (typically set to half print bed width) #define DEFAULT_DUPLICATION_X_OFFSET 100 @@ -482,6 +478,17 @@ */ //#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] @@ -560,7 +567,7 @@ // Add an 'M73' G-code to set the current percentage //#define LCD_SET_PROGRESS_MANUALLY -#if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) +#if 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 @@ -732,7 +739,7 @@ * controller events, as there is a trade-off between reliable * printing performance versus fast display updates. */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD // Show SD percentage next to the progress bar //#define DOGM_SD_PERCENT @@ -1021,6 +1028,15 @@ // @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 * @@ -1046,7 +1062,7 @@ #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_ZLIFT 0 // Default retract Z-lift + #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) @@ -1056,15 +1072,6 @@ #endif #endif -/** - * 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 - /** * Advanced Pause * Experimental feature for filament change support and for parking the nozzle when paused. @@ -1613,10 +1620,18 @@ /** * 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 + /** * User-defined menu items that execute custom GCode */ @@ -1630,10 +1645,10 @@ #define USER_DESC_1 "Home & UBL Info" #define USER_GCODE_1 "G28\nG29 W" - #define USER_DESC_2 "Preheat for PLA" + #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 ABS" + #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" diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index dc00f2f26a..64d266114c 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -83,6 +83,7 @@ #define BOARD_TRIGORILLA_13 343 // TriGorilla Anycubic version 1.3 based on RAMPS EFB #define BOARD_TRIGORILLA_14 443 // TriGorilla Anycubic version 1.4 based on RAMPS EFB #define BOARD_RAMPS_ENDER_4 243 // Creality: Ender-4, CR-8 +#define BOARD_RAMPS_CREALITY 244 // Creality: CR10S, CR20, CR-X #define BOARD_FYSETC_F6_13 541 // Fysetc F6 // @@ -231,6 +232,7 @@ #define BOARD_TEENSY35_36 841 // Teensy3.5 and Teensy3.6 #define BOARD_BEAST 1802 // STM32FxxxVxT6 Libmaple based stm32f4 controller #define BOARD_STM32F4 1804 // STM32 STM32GENERIC based STM32F4 controller +#define BOARD_ARMED 1807 // Arm'ed STM32F4 based controller // // ARM Cortex M7 diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 78af20976b..b6bddd2b8f 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -131,6 +131,7 @@ #define MSG_M115_REPORT "FIRMWARE_NAME:Marlin " DETAILED_BUILD_VERSION " SOURCE_CODE_URL:" SOURCE_CODE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" MACHINE_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID #define MSG_COUNT_X " Count X:" #define MSG_COUNT_A " Count A:" +#define MSG_WATCHDOG_FIRED "Watchdog timeout. Reset required." #define MSG_ERR_KILLED "Printer halted. kill() called!" #define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)" #define MSG_BUSY_PROCESSING "busy: processing" @@ -199,7 +200,7 @@ #define MSG_ENDSTOPS_HIT "endstops hit: " #define MSG_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented" #define MSG_ERR_LONG_EXTRUDE_STOP " too long extrusion prevented" -#define MSG_HOTEND_TOO_COLD "Hotend too cold" +#define MSG_ERR_HOTEND_TOO_COLD "Hotend too cold" #define MSG_FILAMENT_CHANGE_HEAT "Press button (or M108) to heat nozzle" #define MSG_FILAMENT_CHANGE_INSERT "Insert filament and press button (or M108)" @@ -263,7 +264,7 @@ // LCD Menu Messages -#define LANGUAGE_DATA_INCL_(M) STRINGIFY_(../lcd/dogm/language_data_##M.h) +#define LANGUAGE_DATA_INCL_(M) STRINGIFY_(fontdata/language_data_##M.h) #define LANGUAGE_DATA_INCL(M) LANGUAGE_DATA_INCL_(M) #define INCLUDE_LANGUAGE_DATA LANGUAGE_DATA_INCL(LCD_LANGUAGE) diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 3f4e99ebb3..945e983e97 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -49,7 +49,7 @@ // Clock speed factors #if !defined(CYCLES_PER_MICROSECOND) && !defined(__STM32F1__) - #define CYCLES_PER_MICROSECOND (F_CPU / 1000000L) // 16 or 20 on AVR + #define CYCLES_PER_MICROSECOND (F_CPU / 1000000UL) // 16 or 20 on AVR #endif // Nanoseconds per cycle @@ -193,9 +193,6 @@ #define PIN_EXISTS(PN) (defined(PN ##_PIN) && PN ##_PIN >= 0) -#define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0) -#define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON)) - #define MMM_TO_MMS(MM_M) ((MM_M)/60.0f) #define MMS_TO_MMM(MM_S) ((MM_S)*60.0f) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/millis_t.h similarity index 52% rename from Marlin/src/core/types.h rename to Marlin/src/core/millis_t.h index 25bfb555de..97532374b5 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/millis_t.h @@ -22,25 +22,8 @@ #pragma once #include -#include typedef uint32_t millis_t; -#pragma pack(push, 1) // No padding between fields - -typedef struct { - float unload_length, load_length; -} fil_change_settings_t; - -typedef struct { - float retract_length, // M207 S - G10 Retract length - retract_feedrate_mm_s, // M207 F - G10 Retract feedrate - retract_zlift, // M207 Z - G10 Retract hop size - retract_recover_length, // M208 S - G11 Recover length - retract_recover_feedrate_mm_s, // M208 F - G11 Recover feedrate - swap_retract_length, // M207 W - G10 Swap Retract length - swap_retract_recover_length, // M208 W - G11 Swap Recover length - swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate -} fwretract_settings_t; - -#pragma pack(pop) +#define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0) +#define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON)) diff --git a/Marlin/src/core/utility.cpp b/Marlin/src/core/utility.cpp index ba374f7593..e10d8f6a58 100644 --- a/Marlin/src/core/utility.cpp +++ b/Marlin/src/core/utility.cpp @@ -48,7 +48,7 @@ void safe_delay(millis_t ms) { #endif // EEPROM_SETTINGS -#if ENABLED(ULTRA_LCD) || ENABLED(DEBUG_LEVELING_FEATURE) +#if ENABLED(ULTRA_LCD) || ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(EXTENSIBLE_UI) char conv[8] = { 0 }; @@ -231,7 +231,8 @@ void safe_delay(millis_t ms) { char* ftostr52sp(const float &f) { long i = (f * 1000 + (f < 0 ? -5: 5)) / 10; uint8_t dig; - conv[1] = MINUSOR(i, RJDIGIT(i, 10000)); + conv[0] = MINUSOR(i, ' '); + conv[1] = RJDIGIT(i, 10000); conv[2] = RJDIGIT(i, 1000); conv[3] = DIGIMOD(i, 100); @@ -249,7 +250,7 @@ void safe_delay(millis_t ms) { conv[4] = conv[5] = ' '; conv[6] = ' '; } - return &conv[1]; + return conv; } #endif // ULTRA_LCD diff --git a/Marlin/src/core/utility.h b/Marlin/src/core/utility.h index f4f2e7cf80..05ba721def 100644 --- a/Marlin/src/core/utility.h +++ b/Marlin/src/core/utility.h @@ -45,7 +45,7 @@ void safe_delay(millis_t ms); FORCE_INLINE bool is_bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { return TEST(bits[y], x); } #endif -#if ENABLED(ULTRA_LCD) || ENABLED(DEBUG_LEVELING_FEATURE) +#if ENABLED(ULTRA_LCD) || ENABLED(DEBUG_LEVELING_FEATURE) || ENABLED(EXTENSIBLE_UI) // Convert uint8_t to string with 123 format char* i8tostr3(const uint8_t x); diff --git a/Marlin/src/feature/I2CPositionEncoder.cpp b/Marlin/src/feature/I2CPositionEncoder.cpp index 4887b69399..5ac8b17eb5 100644 --- a/Marlin/src/feature/I2CPositionEncoder.cpp +++ b/Marlin/src/feature/I2CPositionEncoder.cpp @@ -164,7 +164,7 @@ void I2CPositionEncoder::update() { #ifdef I2CPE_ERR_THRESH_ABORT if (ABS(error) > I2CPE_ERR_THRESH_ABORT * planner.settings.axis_steps_per_mm[encoderAxis]) { - //kill("Significant Error"); + //kill(PSTR("Significant Error")); SERIAL_ECHOPGM("Axis error greater than set threshold, aborting!"); SERIAL_ECHOLN(error); safe_delay(5000); diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 99b91bf5a7..438c41b6a2 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -628,7 +628,7 @@ LEAVE: - #if ENABLED(NEWPANEL) + #if ENABLED(ULTIPANEL) lcd_reset_alert_level(); lcd_quick_feedback(true); lcd_reset_status(); diff --git a/Marlin/src/feature/fwretract.cpp b/Marlin/src/feature/fwretract.cpp index 7cb29a970b..3fc37e3aa3 100644 --- a/Marlin/src/feature/fwretract.cpp +++ b/Marlin/src/feature/fwretract.cpp @@ -65,7 +65,7 @@ void FWRetract::reset() { #endif settings.retract_length = RETRACT_LENGTH; settings.retract_feedrate_mm_s = RETRACT_FEEDRATE; - settings.retract_zlift = RETRACT_ZLIFT; + settings.retract_zraise = RETRACT_ZRAISE; settings.retract_recover_length = RETRACT_RECOVER_LENGTH; settings.retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE; settings.swap_retract_length = RETRACT_LENGTH_SWAP; @@ -142,11 +142,8 @@ void FWRetract::retract(const bool retracting set_destination_from_current(); #if ENABLED(RETRACT_SYNC_MIXING) - float old_mixing_factor[MIXING_STEPPERS]; - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) { - old_mixing_factor[i] = mixing_factor[i]; - mixing_factor[i] = RECIPROCAL(MIXING_STEPPERS); - } + uint8_t old_mixing_tool = mixer.get_current_v_tool(); + mixer.T(MIXER_AUTORETRACT_TOOL); #endif if (retracting) { @@ -162,8 +159,8 @@ void FWRetract::retract(const bool retracting planner.synchronize(); // Wait for move to complete // Is a Z hop set, and has the hop not yet been done? - if (settings.retract_zlift > 0.01 && !current_hop) { // Apply hop only once - current_hop += settings.retract_zlift; // Add to the hop total (again, only once) + if (settings.retract_zraise > 0.01 && !current_hop) { // Apply hop only once + current_hop += settings.retract_zraise; // Add to the hop total (again, only once) feedrate_mm_s = planner.settings.max_feedrate_mm_s[Z_AXIS] * unscale_fr; // Maximum Z feedrate prepare_move_to_destination(); // Raise up, set_current_to_destination planner.synchronize(); // Wait for move to complete @@ -196,7 +193,7 @@ void FWRetract::retract(const bool retracting } #if ENABLED(RETRACT_SYNC_MIXING) - COPY(mixing_factor, old_mixing_factor); // Restore original mixing factor + mixer.T(old_mixing_tool); // Restore original mixing tool #endif feedrate_mm_s = old_feedrate_mm_s; // Restore original feedrate diff --git a/Marlin/src/feature/fwretract.h b/Marlin/src/feature/fwretract.h index bcc44cf83f..9da737465b 100644 --- a/Marlin/src/feature/fwretract.h +++ b/Marlin/src/feature/fwretract.h @@ -27,6 +27,23 @@ #include "../inc/MarlinConfigPre.h" +#pragma pack(push, 1) // No padding between fields + +typedef struct { + float retract_length, // M207 S - G10 Retract length + retract_feedrate_mm_s, // M207 F - G10 Retract feedrate + retract_zraise, // M207 Z - G10 Retract hop size + retract_recover_length, // M208 S - G11 Recover length + retract_recover_feedrate_mm_s, // M208 F - G11 Recover feedrate + swap_retract_length, // M207 W - G10 Swap Retract length + swap_retract_recover_length, // M208 W - G11 Swap Recover length + swap_retract_recover_feedrate_mm_s; // M208 R - G11 Swap Recover feedrate +} fwretract_settings_t; + +#pragma pack(pop) + +#if ENABLED(FWRETRACT) + class FWRetract { private: #if EXTRUDERS > 1 @@ -69,3 +86,5 @@ public: }; extern FWRetract fwretract; + +#endif // FWRETRACT diff --git a/Marlin/src/feature/leds/leds.h b/Marlin/src/feature/leds/leds.h index 220de6d15d..a59a655fb8 100644 --- a/Marlin/src/feature/leds/leds.h +++ b/Marlin/src/feature/leds/leds.h @@ -27,6 +27,8 @@ #include "../../inc/MarlinConfigPre.h" +#include + #if ENABLED(NEOPIXEL_LED) #include "neopixel.h" #endif @@ -45,6 +47,7 @@ typedef struct LEDColor { #endif #endif ; + LEDColor() : r(255), g(255), b(255) #if HAS_WHITE_LED , w(255) @@ -53,6 +56,7 @@ typedef struct LEDColor { #endif #endif {} + LEDColor(uint8_t r, uint8_t g, uint8_t b #if HAS_WHITE_LED , uint8_t w=0 @@ -68,6 +72,7 @@ typedef struct LEDColor { #endif #endif {} + LEDColor(const uint8_t (&rgbw)[4]) : r(rgbw[0]), g(rgbw[1]), b(rgbw[2]) #if HAS_WHITE_LED , w(rgbw[3]) @@ -76,6 +81,7 @@ typedef struct LEDColor { #endif #endif {} + LEDColor& operator=(const uint8_t (&rgbw)[4]) { r = rgbw[0]; g = rgbw[1]; b = rgbw[2]; #if HAS_WHITE_LED @@ -83,15 +89,19 @@ typedef struct LEDColor { #endif return *this; } + LEDColor& operator=(const LEDColor &right) { if (this != &right) memcpy(this, &right, sizeof(LEDColor)); return *this; } + bool operator==(const LEDColor &right) { if (this == &right) return true; return 0 == memcmp(this, &right, sizeof(LEDColor)); } + bool operator!=(const LEDColor &right) { return !operator==(right); } + bool is_off() const { return 3 > r + g + b #if HAS_WHITE_LED diff --git a/Marlin/src/feature/mixing.cpp b/Marlin/src/feature/mixing.cpp index 37a6bdc5e7..0713dca56f 100644 --- a/Marlin/src/feature/mixing.cpp +++ b/Marlin/src/feature/mixing.cpp @@ -24,81 +24,90 @@ #if ENABLED(MIXING_EXTRUDER) -#if ENABLED(DIRECT_MIXING_IN_G1) - #include "../gcode/parser.h" +//#define MIXER_NORMALIZER_DEBUG +#ifdef MIXER_NORMALIZER_DEBUG + #include "../core/serial.h" #endif -float mixing_factor[MIXING_STEPPERS]; // Reciprocal of mix proportion. 0.0 = off, otherwise <= 1.0. (Array must sum to 1.0.) +#include "mixing.h" -#if MIXING_VIRTUAL_TOOLS > 1 +Mixer mixer; - float mixing_virtual_tool_mix[MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS]; +// Used up to Planner level +uint_fast8_t Mixer::selected_v_tool = 0; +float Mixer::M163_collector[MIXING_STEPPERS]; // mix proportion. 0.0 = off, otherwise <= COLOR_A_MASK. +mixer_color_t Mixer::color[NR_MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS]; - void mixing_tools_init() { - // Virtual Tools 0, 1, 2, 3 = Filament 1, 2, 3, 4, etc. - for (uint8_t t = 0; t < MIXING_VIRTUAL_TOOLS && t < MIXING_STEPPERS; t++) - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - mixing_virtual_tool_mix[t][i] = (t == i) ? 1.0 : 0.0; +// Used in Stepper +int_fast8_t Mixer::runner = 0; +mixer_color_t Mixer::s_color[MIXING_STEPPERS]; +mixer_accu_t Mixer::accu[MIXING_STEPPERS] = { 0 }; - // Remaining virtual tools are 100% filament 1 - #if MIXING_STEPPERS < MIXING_VIRTUAL_TOOLS - for (uint8_t t = MIXING_STEPPERS; t < MIXING_VIRTUAL_TOOLS; t++) - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - mixing_virtual_tool_mix[t][i] = (i == 0) ? 1.0 : 0.0; +void Mixer::normalize(const uint8_t tool_index) { + float cmax = 0; + #ifdef MIXER_NORMALIZER_DEBUG + float csum = 0; + #endif + MIXER_STEPPER_LOOP(i) { + cmax = max(cmax, M163_collector[i]); + #ifdef MIXER_NORMALIZER_DEBUG + csum += M163_collector[i]; #endif - - // Initialize mixing to tool 0 color - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - mixing_factor[i] = mixing_virtual_tool_mix[0][i]; } + #ifdef MIXER_NORMALIZER_DEBUG + SERIAL_ECHOPGM("Mixer: Relation before normalizing: [ "); + MIXER_STEPPER_LOOP(i) { + SERIAL_ECHO_F(M163_collector[i] / csum, 3); + SERIAL_CHAR(' '); + } + SERIAL_ECHOPGM("]\n"); + #endif -#endif // MIXING_VIRTUAL_TOOLS > 1 + // Scale all values so their maximum is COLOR_A_MASK + const float inverse_max = RECIPROCAL(cmax); + MIXER_STEPPER_LOOP(i) + color[tool_index][i] = M163_collector[i] * COLOR_A_MASK * inverse_max; -void normalize_mix() { - float mix_total = 0.0; - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) mix_total += mixing_factor[i]; - // Scale all values if they don't add up to ~1.0 - if (!NEAR(mix_total, 1.0)) { - SERIAL_PROTOCOLLNPGM("Warning: Mix factors must add up to 1.0. Scaling."); - const float inverse_sum = RECIPROCAL(mix_total); - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) mixing_factor[i] *= inverse_sum; - } + #ifdef MIXER_NORMALIZER_DEBUG + csum = 0; + SERIAL_ECHOPGM("Mixer: Normalizing to : [ "); + MIXER_STEPPER_LOOP(i) { + SERIAL_ECHO(uint16_t(color[tool_index][i])); + SERIAL_CHAR(' '); + csum += color[tool_index][i]; + } + SERIAL_ECHOLNPGM("]"); + SERIAL_ECHOPGM("Mixer: Relation after normalizing: [ "); + MIXER_STEPPER_LOOP(i) { + SERIAL_ECHO_F(uint16_t(color[tool_index][i]) / csum, 3); + SERIAL_CHAR(' '); + } + SERIAL_ECHOLNPGM("]"); + #endif } -#if ENABLED(DIRECT_MIXING_IN_G1) - // Get mixing parameters from the GCode - // The total "must" be 1.0 (but it will be normalized) - // If no mix factors are given, the old mix is preserved - void gcode_get_mix() { - const char mixing_codes[] = { 'A', 'B' - #if MIXING_STEPPERS > 2 - , 'C' - #if MIXING_STEPPERS > 3 - , 'D' - #if MIXING_STEPPERS > 4 - , 'H' - #if MIXING_STEPPERS > 5 - , 'I' - #endif // MIXING_STEPPERS > 5 - #endif // MIXING_STEPPERS > 4 - #endif // MIXING_STEPPERS > 3 - #endif // MIXING_STEPPERS > 2 - }; - byte mix_bits = 0; - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) { - if (parser.seenval(mixing_codes[i])) { - SBI(mix_bits, i); - mixing_factor[i] = MAX(parser.value_float(), 0.0); - } - } - // If any mixing factors were included, clear the rest - // If none were included, preserve the last mix - if (mix_bits) { - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - if (!TEST(mix_bits, i)) mixing_factor[i] = 0.0; - normalize_mix(); - } - } -#endif +// called at boot +void Mixer::init( void ) { + // Virtual Tools 0, 1, 2, 3 = Filament 1, 2, 3, 4, etc. + // Every virtual tool gets a pure filament + for (uint8_t t = 0; t < MIXING_VIRTUAL_TOOLS && t < MIXING_STEPPERS; t++) + MIXER_STEPPER_LOOP(i) + color[t][i] = (t == i) ? COLOR_A_MASK : 0; + + // Remaining virtual tools are 100% filament 1 + #if MIXING_STEPPERS < MIXING_VIRTUAL_TOOLS + for (uint8_t t = MIXING_STEPPERS; t < MIXING_VIRTUAL_TOOLS; t++) + MIXER_STEPPER_LOOP(i) + color[t][i] = (i == 0) ? COLOR_A_MASK : 0; + #endif + + #if ENABLED(RETRACT_SYNC_MIXING) + // AUTORETRACT_TOOL gets the same amount of all filaments + MIXER_STEPPER_LOOP(i) + color[MIXER_AUTORETRACT_TOOL][i] = COLOR_A_MASK; + #endif + + ZERO(M163_collector); +} #endif // MIXING_EXTRUDER diff --git a/Marlin/src/feature/mixing.h b/Marlin/src/feature/mixing.h index fff240c0e0..1a675e4d79 100644 --- a/Marlin/src/feature/mixing.h +++ b/Marlin/src/feature/mixing.h @@ -19,23 +19,88 @@ * along with this program. If not, see . * */ - -#ifndef __MIXING_H__ -#define __MIXING_H__ +#pragma once #include "../inc/MarlinConfig.h" -extern float mixing_factor[MIXING_STEPPERS]; // Reciprocal of mix proportion. 0.0 = off, otherwise >= 1.0. - -#if MIXING_VIRTUAL_TOOLS > 1 - extern float mixing_virtual_tool_mix[MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS]; - void mixing_tools_init(); +#ifdef __AVR__ + #define MIXER_ACCU_SIGNED + typedef uint8_t mixer_color_t; + typedef int8_t mixer_accu_t; +#else + typedef uint_fast16_t mixer_color_t; + typedef uint_fast16_t mixer_accu_t; #endif -void normalize_mix(); +#define COLOR_A_MASK _BV(sizeof(mixer_color_t) * 8 - 1) // 0x80 or 0x8000 +#define COLOR_MASK (COLOR_A_MASK - 1) // 0x7F or 0x7FFF -#if ENABLED(DIRECT_MIXING_IN_G1) - void gcode_get_mix(); +#ifndef MIXING_VIRTUAL_TOOLS + #define MIXING_VIRTUAL_TOOLS 1 #endif -#endif // __MIXING_H__ +#ifdef RETRACT_SYNC_MIXING + #define NR_MIXING_VIRTUAL_TOOLS (MIXING_VIRTUAL_TOOLS + 1) + #define MIXER_AUTORETRACT_TOOL MIXING_VIRTUAL_TOOLS +#else + #define NR_MIXING_VIRTUAL_TOOLS (MIXING_VIRTUAL_TOOLS) +#endif + +#define MIXER_STEPPER_LOOP(VAR) \ + for (uint_fast8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++) + +#define MIXER_BLOCK_DEFINITION mixer_color_t b_color[MIXING_STEPPERS] +#define MIXER_POPULATE_BLOCK() mixer.populate_block(block->b_color) +#define MIXER_STEPPER_SETUP() mixer.stepper_setup(current_block->b_color) + +class Mixer { + public: + + static void init(void); // Populate colors at boot time + + // Used up to Planner level + static void normalize(const uint8_t tool_index); + FORCE_INLINE static uint8_t get_current_v_tool(void) { return selected_v_tool; } + FORCE_INLINE static void T(const uint_fast8_t c) { selected_v_tool = c; } + FORCE_INLINE static void set_M163_collector(const uint8_t c, const float f) { M163_collector[c] = f; } + + // Used when dealing with blocks + FORCE_INLINE static void populate_block(mixer_color_t b_color[]) { + uint_fast8_t j = get_current_v_tool(); + MIXER_STEPPER_LOOP(i) b_color[i] = color[j][i]; + } + FORCE_INLINE static void stepper_setup(mixer_color_t b_color[]) { MIXER_STEPPER_LOOP(i) s_color[i] = b_color[i]; } + + // Used in Stepper + FORCE_INLINE static uint8_t get_stepper(void) { return runner; } + FORCE_INLINE static uint8_t get_next_stepper(void) { + do { + if (--runner < 0) runner = MIXING_STEPPERS - 1; + accu[runner] += s_color[runner]; + if ( + #ifdef MIXER_ACCU_SIGNED + accu[runner] < 0 + #else + accu[runner] & COLOR_A_MASK + #endif + ) { + accu[runner] &= COLOR_MASK; + return runner; + } + } while( true ); + } + + private: + + // Used up to Planner level + static uint_fast8_t selected_v_tool; + static float M163_collector[MIXING_STEPPERS]; + static mixer_color_t color[NR_MIXING_VIRTUAL_TOOLS][MIXING_STEPPERS]; + + // Used in Stepper + static int_fast8_t runner; + static mixer_color_t s_color[MIXING_STEPPERS]; + static mixer_accu_t accu[MIXING_STEPPERS]; +}; + +extern Mixer mixer; diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index d7fe9c7e05..6c232b5db8 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -97,7 +97,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_HOTEND_TOO_COLD); + SERIAL_ERRORLNPGM(MSG_ERR_HOTEND_TOO_COLD); return false; } #endif @@ -349,7 +349,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) { SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_HOTEND_TOO_COLD); + SERIAL_ERRORLNPGM(MSG_ERR_HOTEND_TOO_COLD); #if ENABLED(ULTIPANEL) if (show_lcd) { // Show status screen @@ -595,6 +595,10 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le --did_pause_print; } #endif + + #if ENABLED(ULTRA_LCD) + lcd_reset_status(); + #endif } #endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/feature/pause.h b/Marlin/src/feature/pause.h index 7c60bdecbb..d5c39846ab 100644 --- a/Marlin/src/feature/pause.h +++ b/Marlin/src/feature/pause.h @@ -26,10 +26,16 @@ * This may be combined with related G-codes if features are consolidated. */ -#include "../libs/nozzle.h" +typedef struct { + float unload_length, load_length; +} fil_change_settings_t; #include "../inc/MarlinConfigPre.h" +#if ENABLED(ADVANCED_PAUSE_FEATURE) + +#include "../libs/nozzle.h" + enum AdvancedPauseMode : char { ADVANCED_PAUSE_MODE_PAUSE_PRINT, ADVANCED_PAUSE_MODE_LOAD_FILAMENT, @@ -86,3 +92,5 @@ bool load_filament(const float &slow_load_length=0, const float &fast_load_lengt const bool pause_for_user=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT DXC_PARAMS); bool unload_filament(const float &unload_length, const bool show_lcd=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT); + +#endif //ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/feature/power.h b/Marlin/src/feature/power.h index 225e4dc6f3..101ccb4a52 100644 --- a/Marlin/src/feature/power.h +++ b/Marlin/src/feature/power.h @@ -19,15 +19,13 @@ * along with this program. If not, see . * */ +#pragma once /** * power.h - power control */ -#ifndef POWER_H -#define POWER_H - -#include "../core/types.h" +#include "../core/millis_t.h" class Power { public: @@ -40,5 +38,3 @@ class Power { }; extern Power powerManager; - -#endif // POWER_H diff --git a/Marlin/src/feature/power_loss_recovery.h b/Marlin/src/feature/power_loss_recovery.h index 04b011be15..d5a0aea69d 100644 --- a/Marlin/src/feature/power_loss_recovery.h +++ b/Marlin/src/feature/power_loss_recovery.h @@ -19,16 +19,14 @@ * along with this program. If not, see . * */ +#pragma once /** * power_loss_recovery.h - Resume an SD print after power-loss */ -#ifndef _POWER_LOSS_RECOVERY_H_ -#define _POWER_LOSS_RECOVERY_H_ - #include "../sd/cardreader.h" -#include "../core/types.h" +#include "../core/millis_t.h" #include "../inc/MarlinConfigPre.h" #define SAVE_INFO_INTERVAL_MS 0 @@ -99,5 +97,3 @@ extern uint8_t job_recovery_commands_count; void check_print_job_recovery(); void save_job_recovery_info(); - -#endif // _POWER_LOSS_RECOVERY_H_ diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp index 7e3301e5bd..a51cf5b9e8 100644 --- a/Marlin/src/feature/runout.cpp +++ b/Marlin/src/feature/runout.cpp @@ -32,36 +32,21 @@ FilamentRunoutSensor runout; -bool FilamentRunoutSensor::enabled = true, - FilamentRunoutSensor::filament_ran_out; // = false -uint8_t FilamentRunoutSensor::runout_count; // = 0 +bool FilamentSensorBase::enabled = true, + FilamentSensorBase::filament_ran_out; // = false -void FilamentRunoutSensor::setup() { - - #if ENABLED(FIL_RUNOUT_PULLUP) - #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLUP(P) - #elif ENABLED(FIL_RUNOUT_PULLDOWN) - #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLDOWN(P) - #else - #define INIT_RUNOUT_PIN(P) SET_INPUT(P) - #endif - - INIT_RUNOUT_PIN(FIL_RUNOUT_PIN); - #if NUM_RUNOUT_SENSORS > 1 - INIT_RUNOUT_PIN(FIL_RUNOUT2_PIN); - #if NUM_RUNOUT_SENSORS > 2 - INIT_RUNOUT_PIN(FIL_RUNOUT3_PIN); - #if NUM_RUNOUT_SENSORS > 3 - INIT_RUNOUT_PIN(FIL_RUNOUT4_PIN); - #if NUM_RUNOUT_SENSORS > 4 - INIT_RUNOUT_PIN(FIL_RUNOUT5_PIN); - #if NUM_RUNOUT_SENSORS > 5 - INIT_RUNOUT_PIN(FIL_RUNOUT6_PIN); - #endif - #endif - #endif - #endif - #endif +void FilamentSensorTypeBase::filament_present(const uint8_t extruder) { + runout.filament_present(extruder); } +uint8_t FilamentSensorTypeEncoder::motion_detected, + FilamentSensorTypeEncoder::old_state; // = 0 + +#if FILAMENT_RUNOUT_DISTANCE_MM > 0 + float RunoutResponseDelayed::runout_distance_mm = FILAMENT_RUNOUT_DISTANCE_MM; + int32_t RunoutResponseDelayed::steps_since_detection[EXTRUDERS]; +#else + uint8_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 500013c9c7..6e84742b87 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -19,14 +19,12 @@ * along with this program. If not, see . * */ +#pragma once /** * feature/runout.h - Runout sensor support */ -#ifndef _RUNOUT_H_ -#define _RUNOUT_H_ - #include "../sd/cardreader.h" #include "../module/printcounter.h" #include "../module/stepper.h" @@ -38,70 +36,272 @@ #include "../lcd/extensible_ui/ui_api.h" #endif -#define FIL_RUNOUT_THRESHOLD 5 +//#define FILAMENT_RUNOUT_SENSOR_DEBUG -class FilamentRunoutSensor { +class FilamentSensorBase { public: static bool enabled; - FilamentRunoutSensor() {} - - static void setup(); - - FORCE_INLINE static void reset() { runout_count = 0; filament_ran_out = false; } - - FORCE_INLINE static void run() { - if ((IS_SD_PRINTING || print_job_timer.isRunning()) && check() && !filament_ran_out) { - filament_ran_out = true; - #if ENABLED(EXTENSIBLE_UI) - UI::onFilamentRunout(); - #endif - enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT)); - planner.synchronize(); - } - } - private: + protected: static bool filament_ran_out; - static uint8_t runout_count; +}; - FORCE_INLINE static bool check() { - if (!enabled) return false; - #if NUM_RUNOUT_SENSORS < 2 - // A single sensor applying to all extruders - const bool is_out = READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING; - #else - // Read the sensor for the active extruder - bool is_out; - #if ENABLED(DUAL_X_CARRIAGE) - const bool out1 = READ(FIL_RUNOUT_PIN ) == FIL_RUNOUT_INVERTING, - out2 = READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_INVERTING; - if (extruder_duplication_enabled) - is_out = out1 || out2; - else - is_out = active_extruder ? out2 : out1; - #else - switch (active_extruder) { - case 0: is_out = READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_INVERTING; break; - case 1: is_out = READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT_INVERTING; break; - #if NUM_RUNOUT_SENSORS > 2 - case 2: is_out = READ(FIL_RUNOUT3_PIN) == FIL_RUNOUT_INVERTING; break; - #if NUM_RUNOUT_SENSORS > 3 - case 3: is_out = READ(FIL_RUNOUT4_PIN) == FIL_RUNOUT_INVERTING; break; - #if NUM_RUNOUT_SENSORS > 4 - case 4: is_out = READ(FIL_RUNOUT5_PIN) == FIL_RUNOUT_INVERTING; break; - #if NUM_RUNOUT_SENSORS > 5 - case 5: is_out = READ(FIL_RUNOUT6_PIN) == FIL_RUNOUT_INVERTING; break; - #endif // > 5 - #endif // > 4 - #endif // > 3 - #endif // > 2 +template +class TFilamentSensor : public FilamentSensorBase { + private: + typedef RESPONSE_T response_t; + typedef SENSOR_T sensor_t; + static response_t response; + static sensor_t sensor; + + public: + static void setup() { + sensor.setup(); + } + + inline static void reset() { + filament_ran_out = false; + response.reset(); + } + + // The sensor calls this method when filament is present + inline static void filament_present(const uint8_t extruder) { + response.filament_present(extruder); + } + + inline static void block_complete(const block_t *b) { + response.block_complete(b); + sensor.block_complete(b); + } + + static void run() { + if (enabled && !filament_ran_out && (IS_SD_PRINTING() || print_job_timer.isRunning())) { + response.run(); + sensor.run(); + if (response.has_runout()) { + filament_ran_out = true; + #if ENABLED(EXTENSIBLE_UI) + UI::onFilamentRunout(); + #endif + enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT)); + planner.synchronize(); } - #endif - #endif - return (is_out ? ++runout_count : (runout_count = 0)) > FIL_RUNOUT_THRESHOLD; + } } }; -extern FilamentRunoutSensor runout; +/*************************** FILAMENT PRESENCE SENSORS ***************************/ -#endif // _RUNOUT_H_ +class FilamentSensorTypeBase { + protected: + static void filament_present(const uint8_t extruder); + + public: + static void setup() { + #if ENABLED(FIL_RUNOUT_PULLUP) + #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLUP(P) + #elif ENABLED(FIL_RUNOUT_PULLDOWN) + #define INIT_RUNOUT_PIN(P) SET_INPUT_PULLDOWN(P) + #else + #define INIT_RUNOUT_PIN(P) SET_INPUT(P) + #endif + + INIT_RUNOUT_PIN(FIL_RUNOUT_PIN); + #if NUM_RUNOUT_SENSORS > 1 + INIT_RUNOUT_PIN(FIL_RUNOUT2_PIN); + #if NUM_RUNOUT_SENSORS > 2 + INIT_RUNOUT_PIN(FIL_RUNOUT3_PIN); + #if NUM_RUNOUT_SENSORS > 3 + INIT_RUNOUT_PIN(FIL_RUNOUT4_PIN); + #if NUM_RUNOUT_SENSORS > 4 + INIT_RUNOUT_PIN(FIL_RUNOUT5_PIN); + #if NUM_RUNOUT_SENSORS > 5 + INIT_RUNOUT_PIN(FIL_RUNOUT6_PIN); + #endif + #endif + #endif + #endif + #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 ( + (READ(FIL_RUNOUT_PIN ) ? _BV(0) : 0) + #if NUM_RUNOUT_SENSORS > 1 + | (READ(FIL_RUNOUT2_PIN) ? _BV(1) : 0) + #if NUM_RUNOUT_SENSORS > 2 + | (READ(FIL_RUNOUT3_PIN) ? _BV(2) : 0) + #if NUM_RUNOUT_SENSORS > 3 + | (READ(FIL_RUNOUT4_PIN) ? _BV(3) : 0) + #if NUM_RUNOUT_SENSORS > 4 + | (READ(FIL_RUNOUT5_PIN) ? _BV(4) : 0) + #if NUM_RUNOUT_SENSORS > 5 + | (READ(FIL_RUNOUT6_PIN) ? _BV(5) : 0) + #endif + #endif + #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 + #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. + +class FilamentSensorTypeEncoder : public FilamentSensorTypeBase { + private: + static uint8_t motion_detected, old_state; + + static void poll_motion_sensor() { + 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 + + 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); + + // Clear motion triggers for next block + motion_detected = 0; + } + + FORCE_INLINE static void run() { poll_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. + 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)]); + } + + 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 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)); + } + SERIAL_EOL(); + } + #endif + } + + static void reset() { + LOOP_L_N(i, NUM_RUNOUT_SENSORS) steps_since_detection[i] = 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]; + } + }; + +#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. + + class RunoutResponseDebounced { + private: + static constexpr uint8_t FIL_RUNOUT_THRESHOLD = 5; + static uint8_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; } + }; + +#endif // !FILAMENT_RUNOUT_DISTANCE_MM + +/********************************* TEMPLATE SPECIALIZATION *********************************/ + +typedef TFilamentSensor< + #if FILAMENT_RUNOUT_DISTANCE_MM > 0 + #if ENABLED(FILAMENT_MOTION_SENSOR) + RunoutResponseDelayed, FilamentSensorTypeEncoder + #else + RunoutResponseDelayed, FilamentSensorTypeSwitch + #endif + #else + RunoutResponseDebounced, FilamentSensorTypeSwitch + #endif +> FilamentRunoutSensor; + +extern FilamentRunoutSensor runout; diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index 41bbd049bc..1b14172ca7 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -138,7 +138,7 @@ // Report if a warning was triggered if (data.is_otpw && st.otpw_count == 0) { - char timestamp[10]; + char timestamp[14]; duration_t elapsed = print_job_timer.duration(); const bool has_days = (elapsed.value > 60*60*24L); (void)elapsed.toDigital(timestamp, has_days); diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 6f4a2a5635..4455a440b2 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -103,6 +103,10 @@ * * S Set the XY travel speed between probe points (in units/min) * + * H Set bounds to a centered square H x H units in size + * + * -or- + * * F Set the Front limit of the probing grid * B Set the Back limit of the probing grid * L Set the Left limit of the probing grid @@ -381,10 +385,19 @@ G29_TYPE GcodeSuite::G29() { xy_probe_feedrate_mm_s = MMM_TO_MMS(parser.linearval('S', XY_PROBE_SPEED)); - left_probe_bed_position = parser.seenval('L') ? (int)RAW_X_POSITION(parser.value_linear_units()) : LEFT_PROBE_BED_POSITION; - right_probe_bed_position = parser.seenval('R') ? (int)RAW_X_POSITION(parser.value_linear_units()) : RIGHT_PROBE_BED_POSITION; - front_probe_bed_position = parser.seenval('F') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : FRONT_PROBE_BED_POSITION; - back_probe_bed_position = parser.seenval('B') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : BACK_PROBE_BED_POSITION; + if (parser.seen('H')) { + const int16_t size = (int16_t)parser.value_linear_units(); + left_probe_bed_position = MAX((MIN_PROBE_X + MAX_PROBE_X - size) / 2, MIN_PROBE_X); + right_probe_bed_position = MIN(left_probe_bed_position + size, MAX_PROBE_X); + front_probe_bed_position = MAX((MIN_PROBE_Y + MAX_PROBE_Y - size) / 2, MIN_PROBE_Y); + back_probe_bed_position = MIN(front_probe_bed_position + size, MAX_PROBE_Y); + } + else { + left_probe_bed_position = parser.seenval('L') ? (int)RAW_X_POSITION(parser.value_linear_units()) : LEFT_PROBE_BED_POSITION; + right_probe_bed_position = parser.seenval('R') ? (int)RAW_X_POSITION(parser.value_linear_units()) : RIGHT_PROBE_BED_POSITION; + front_probe_bed_position = parser.seenval('F') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : FRONT_PROBE_BED_POSITION; + back_probe_bed_position = parser.seenval('B') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : BACK_PROBE_BED_POSITION; + } if ( #if IS_SCARA || ENABLED(DELTA) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 6553fc5cfc..6f6ea3393a 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -210,7 +210,6 @@ void GcodeSuite::G28(const bool always_home_all) { // Cancel the active G29 session #if ENABLED(PROBE_MANUALLY) - extern bool g29_in_progress; g29_in_progress = false; #endif diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 047874a9f9..7ec76c1126 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -643,7 +643,7 @@ void GcodeSuite::G33() { if (verbose_level != 0) { // !dry run - // normalise angles to least squares + // Normalize angles to least-squares if (_angle_results) { float a_sum = 0.0; LOOP_XYZ(axis) a_sum += delta_tower_angle_trim[axis]; diff --git a/Marlin/src/gcode/config/M217.cpp b/Marlin/src/gcode/config/M217.cpp index e0abbc4240..f928e42b57 100644 --- a/Marlin/src/gcode/config/M217.cpp +++ b/Marlin/src/gcode/config/M217.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfigPre.h" -#if ENABLED(SINGLENOZZLE) +#if EXTRUDERS > 1 #include "../gcode.h" #include "../../module/tool_change.h" @@ -32,32 +32,59 @@ #endif void M217_report(const bool eeprom=false) { + #if NUM_SERIAL > 1 const int16_t port = command_queue_port[cmd_queue_index_r]; #endif - serialprintPGM_P(port, eeprom ? PSTR(" M217") : PSTR("Singlenozzle:")); - SERIAL_ECHOPAIR_P(port, " S", sn_settings.swap_length); - SERIAL_ECHOPAIR_P(port, " P", sn_settings.prime_speed); - SERIAL_ECHOLNPAIR_P(port, " R", sn_settings.retract_speed); + + #if ENABLED(SINGLENOZZLE) + serialprintPGM_P(port, eeprom ? PSTR(" M217") : PSTR("Singlenozzle:")); + SERIAL_ECHOPAIR_P(port, " S", LINEAR_UNIT(toolchange_settings.swap_length)); + SERIAL_ECHOPAIR_P(port, " P", LINEAR_UNIT(toolchange_settings.prime_speed)); + SERIAL_ECHOPAIR_P(port, " R", LINEAR_UNIT(toolchange_settings.retract_speed)); + + #if ENABLED(SINGLENOZZLE_SWAP_PARK) + SERIAL_ECHOPAIR_P(port, " X", LINEAR_UNIT(toolchange_settings.change_point.x)); + SERIAL_ECHOPAIR_P(port, " Y", LINEAR_UNIT(toolchange_settings.change_point.y)); + #endif + + #endif + + SERIAL_ECHOPAIR_P(port, " Z", LINEAR_UNIT(toolchange_settings.z_raise)); + SERIAL_EOL(); } /** * M217 - Set SINGLENOZZLE toolchange parameters * - * S[mm] Swap length - * P[mm/m] Prime speed - * R[mm/m] Retract speed + * S[linear] Swap length + * P[linear/m] Prime speed + * R[linear/m] Retract speed + * X[linear] Park X (Requires SINGLENOZZLE_SWAP_PARK) + * Y[linear] Park Y (Requires SINGLENOZZLE_SWAP_PARK) + * Z[linear] Z Raise */ void GcodeSuite::M217() { bool report = true; - if (parser.seenval('S')) { report = false; const float v = parser.value_float(); sn_settings.swap_length = constrain(v, 0, 500); } - if (parser.seenval('P')) { report = false; const int16_t v = parser.value_int(); sn_settings.prime_speed = constrain(v, 10, 5400); } - if (parser.seenval('R')) { report = false; const int16_t v = parser.value_int(); sn_settings.retract_speed = constrain(v, 10, 5400); } + #if ENABLED(SINGLENOZZLE) + + if (parser.seenval('S')) { report = false; const float v = parser.value_linear_units(); toolchange_settings.swap_length = constrain(v, 0, 500); } + if (parser.seenval('P')) { report = false; const int16_t v = parser.value_linear_units(); toolchange_settings.prime_speed = constrain(v, 10, 5400); } + if (parser.seenval('R')) { report = false; const int16_t v = parser.value_linear_units(); toolchange_settings.retract_speed = constrain(v, 10, 5400); } + + #if ENABLED(SINGLENOZZLE_SWAP_PARK) + if (parser.seenval('X')) { report = false; toolchange_settings.change_point.x = parser.value_linear_units(); } + if (parser.seenval('Y')) { report = false; toolchange_settings.change_point.y = parser.value_linear_units(); } + #endif + + #endif + + if (parser.seenval('Z')) { report = false; toolchange_settings.z_raise = parser.value_linear_units(); } if (report) M217_report(); } -#endif // SINGLENOZZLE +#endif // EXTRUDERS > 1 diff --git a/Marlin/src/gcode/config/M92.cpp b/Marlin/src/gcode/config/M92.cpp index e3423a2a60..e0dd1eb26e 100644 --- a/Marlin/src/gcode/config/M92.cpp +++ b/Marlin/src/gcode/config/M92.cpp @@ -36,7 +36,7 @@ void GcodeSuite::M92() { LOOP_XYZE(i) { if (parser.seen(axis_codes[i])) { if (i == E_AXIS) { - const float value = parser.value_per_axis_unit((AxisEnum)(E_AXIS + TARGET_EXTRUDER)); + const float value = parser.value_per_axis_units((AxisEnum)(E_AXIS + 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. #if HAS_CLASSIC_JERK && (DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE)) @@ -48,7 +48,7 @@ void GcodeSuite::M92() { planner.settings.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] = value; } else { - planner.settings.axis_steps_per_mm[i] = parser.value_per_axis_unit((AxisEnum)i); + planner.settings.axis_steps_per_mm[i] = parser.value_per_axis_units((AxisEnum)i); } } } diff --git a/Marlin/src/gcode/control/M108_M112_M410.cpp b/Marlin/src/gcode/control/M108_M112_M410.cpp index e2646a1743..6e376bcc24 100644 --- a/Marlin/src/gcode/control/M108_M112_M410.cpp +++ b/Marlin/src/gcode/control/M108_M112_M410.cpp @@ -41,7 +41,7 @@ void GcodeSuite::M108() { * M112: Emergency Stop */ void GcodeSuite::M112() { - kill(PSTR(MSG_KILLED)); + kill(); } /** diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index cb93712344..213d17450a 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -138,25 +138,3 @@ void GcodeSuite::M5() { } #endif // SPINDLE_LASER_ENABLE - -#if ENABLED(FAN_AS_LASER) -#include "../gcode.h" -#include "../../module/stepper.h" - - /** - * M3, M4: Laser On - */ - void GcodeSuite::M3_M4(bool is_M3) { - planner.synchronize(); - const uint16_t s = parser.ushortval('S', 255); - fan_speed[FAN_NUM_AS_LASER] = MIN(s, 255U); - } - - /** - * M5: Laser Off - */ - void GcodeSuite::M5() { - planner.synchronize(); - if (FAN_NUM_AS_LASER < FAN_COUNT) fan_speed[FAN_NUM_AS_LASER] = 0; - } -#endif diff --git a/Marlin/src/gcode/control/M605.cpp b/Marlin/src/gcode/control/M605.cpp index 0bb2798983..3530881f50 100644 --- a/Marlin/src/gcode/control/M605.cpp +++ b/Marlin/src/gcode/control/M605.cpp @@ -22,10 +22,10 @@ #include "../../inc/MarlinConfig.h" -#define DEBUG_DXC_MODE - #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) +//#define DEBUG_DXC_MODE + #include "../gcode.h" #include "../../module/motion.h" #include "../../module/stepper.h" @@ -99,49 +99,52 @@ else if (!parser.seen('W')) // if no S or W parameter, the DXC mode gets reset to the user's default dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; - if (parser.seen('W')) { - SERIAL_ECHO_START(); - SERIAL_ECHOPGM("IDEX mode: "); - switch (dual_x_carriage_mode) { - case DXC_FULL_CONTROL_MODE: SERIAL_ECHOPGM("DXC_FULL_CONTROL_MODE"); break; - case DXC_AUTO_PARK_MODE: SERIAL_ECHOPGM("DXC_AUTO_PARK_MODE"); break; - case DXC_DUPLICATION_MODE: SERIAL_ECHOPGM("DXC_DUPLICATION_MODE"); break; - case DXC_SCALED_DUPLICATION_MODE: SERIAL_ECHOPGM("DXC_SCALED_DUPLICATION_MODE"); break; - } - SERIAL_ECHOPAIR("\nActive Ext: ", int(active_extruder)); - if (!active_extruder_parked) SERIAL_ECHOPGM(" NOT "); - SERIAL_ECHOPGM(" parked."); - SERIAL_ECHOPAIR("\nactive_extruder_x_pos: ", current_position[X_AXIS]); - SERIAL_ECHOPAIR("\ninactive_extruder_x_pos: ", inactive_extruder_x_pos); - SERIAL_ECHOPAIR("\nextruder_duplication_enabled: ", int(extruder_duplication_enabled)); - SERIAL_ECHOPAIR("\nduplicate_extruder_x_offset: ", duplicate_extruder_x_offset); - SERIAL_ECHOPAIR("\nduplicate_extruder_temp_offset: ", duplicate_extruder_temp_offset); - SERIAL_ECHOPAIR("\ndelayed_move_time: ", delayed_move_time); - SERIAL_ECHOPAIR("\nX1 Home X: ", x_home_pos(0)); - SERIAL_ECHOPAIR("\nX1_MIN_POS=", int(X1_MIN_POS)); - SERIAL_ECHOPAIR("\nX1_MAX_POS=", int(X1_MAX_POS)); - SERIAL_ECHOPAIR("\nX2 Home X: ", x_home_pos(1)); - SERIAL_ECHOPAIR("\nX2_MIN_POS=", int(X2_MIN_POS)); - SERIAL_ECHOPAIR("\nX2_MAX_POS=", int(X2_MAX_POS)); - SERIAL_ECHOPAIR("\nX2_HOME_DIR=", int(X2_HOME_DIR)); - SERIAL_ECHOPAIR("\nX2_HOME_POS=", int(X2_HOME_POS)); - SERIAL_ECHOPAIR("\nDEFAULT_DUAL_X_CARRIAGE_MODE=", STRINGIFY(DEFAULT_DUAL_X_CARRIAGE_MODE)); - SERIAL_ECHOPAIR("\nTOOLCHANGE_PARK_ZLIFT=", float(TOOLCHANGE_PARK_ZLIFT)); - SERIAL_ECHOPAIR("\nDEFAULT_DUPLICATION_X_OFFSET=", int(DEFAULT_DUPLICATION_X_OFFSET)); + #ifdef DEBUG_DXC_MODE - SERIAL_EOL(); - for (uint8_t i = 0; i < 2; i++) { - SERIAL_ECHOPAIR(" nozzle:", int(i)); - LOOP_XYZ(j) { - SERIAL_ECHOPGM(" hotend_offset["); - SERIAL_CHAR(axis_codes[j]); - SERIAL_ECHOPAIR("_AXIS][", int(i)); - SERIAL_ECHOPAIR("]=", hotend_offset[j][i]); + if (parser.seen('W')) { + SERIAL_ECHO_START(); + SERIAL_ECHOPGM("IDEX mode: "); + switch (dual_x_carriage_mode) { + case DXC_FULL_CONTROL_MODE: SERIAL_ECHOPGM("DXC_FULL_CONTROL_MODE"); break; + case DXC_AUTO_PARK_MODE: SERIAL_ECHOPGM("DXC_AUTO_PARK_MODE"); break; + case DXC_DUPLICATION_MODE: SERIAL_ECHOPGM("DXC_DUPLICATION_MODE"); break; + case DXC_SCALED_DUPLICATION_MODE: SERIAL_ECHOPGM("DXC_SCALED_DUPLICATION_MODE"); break; + } + SERIAL_ECHOPAIR("\nActive Ext: ", int(active_extruder)); + if (!active_extruder_parked) SERIAL_ECHOPGM(" NOT "); + SERIAL_ECHOPGM(" parked."); + SERIAL_ECHOPAIR("\nactive_extruder_x_pos: ", current_position[X_AXIS]); + SERIAL_ECHOPAIR("\ninactive_extruder_x_pos: ", inactive_extruder_x_pos); + SERIAL_ECHOPAIR("\nextruder_duplication_enabled: ", int(extruder_duplication_enabled)); + SERIAL_ECHOPAIR("\nduplicate_extruder_x_offset: ", duplicate_extruder_x_offset); + SERIAL_ECHOPAIR("\nduplicate_extruder_temp_offset: ", duplicate_extruder_temp_offset); + SERIAL_ECHOPAIR("\ndelayed_move_time: ", delayed_move_time); + SERIAL_ECHOPAIR("\nX1 Home X: ", x_home_pos(0)); + SERIAL_ECHOPAIR("\nX1_MIN_POS=", int(X1_MIN_POS)); + SERIAL_ECHOPAIR("\nX1_MAX_POS=", int(X1_MAX_POS)); + SERIAL_ECHOPAIR("\nX2 Home X: ", x_home_pos(1)); + SERIAL_ECHOPAIR("\nX2_MIN_POS=", int(X2_MIN_POS)); + SERIAL_ECHOPAIR("\nX2_MAX_POS=", int(X2_MAX_POS)); + SERIAL_ECHOPAIR("\nX2_HOME_DIR=", int(X2_HOME_DIR)); + SERIAL_ECHOPAIR("\nX2_HOME_POS=", int(X2_HOME_POS)); + SERIAL_ECHOPAIR("\nDEFAULT_DUAL_X_CARRIAGE_MODE=", STRINGIFY(DEFAULT_DUAL_X_CARRIAGE_MODE)); + SERIAL_ECHOPAIR("\nTOOLCHANGE_ZRAISE=", float(TOOLCHANGE_ZRAISE)); + SERIAL_ECHOPAIR("\nDEFAULT_DUPLICATION_X_OFFSET=", int(DEFAULT_DUPLICATION_X_OFFSET)); + SERIAL_EOL(); + + for (uint8_t i = 0; i < 2; i++) { + SERIAL_ECHOPAIR(" nozzle:", int(i)); + LOOP_XYZ(j) { + SERIAL_ECHOPGM(" hotend_offset["); + SERIAL_CHAR(axis_codes[j]); + SERIAL_ECHOPAIR("_AXIS][", int(i)); + SERIAL_ECHOPAIR("]=", hotend_offset[j][i]); + } + SERIAL_EOL(); } SERIAL_EOL(); } - SERIAL_EOL(); - } + #endif // DEBUG_DXC_MODE } #elif ENABLED(DUAL_NOZZLE_DUPLICATION_MODE) diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index eeda53bfdd..155fb59c21 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -23,6 +23,7 @@ #include "../gcode.h" #include "../../module/temperature.h" #include "../../module/stepper.h" +#include "../../module/printcounter.h" // for print_job_timer #include "../../inc/MarlinConfig.h" @@ -95,10 +96,11 @@ */ void GcodeSuite::M81() { thermalManager.disable_all_heaters(); + print_job_timer.stop(); planner.finish_and_disable(); #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) fan_speed[i] = 0; + zero_fan_speeds(); #if ENABLED(PROBING_FANS_OFF) fans_paused = false; ZERO(paused_fan_speed); diff --git a/Marlin/src/gcode/eeprom/M500-M504.cpp b/Marlin/src/gcode/eeprom/M500-M504.cpp index 07099c3149..e37b4d47d8 100644 --- a/Marlin/src/gcode/eeprom/M500-M504.cpp +++ b/Marlin/src/gcode/eeprom/M500-M504.cpp @@ -58,6 +58,9 @@ void GcodeSuite::M501() { CHAT_PORT #endif ); + #if ENABLED(EXTENSIBLE_UI) + UI::onLoadSettings(); + #endif } /** diff --git a/Marlin/src/gcode/feature/fwretract/M207-M209.cpp b/Marlin/src/gcode/feature/fwretract/M207-M209.cpp index 81c5ca5977..b6f94f2edf 100644 --- a/Marlin/src/gcode/feature/fwretract/M207-M209.cpp +++ b/Marlin/src/gcode/feature/fwretract/M207-M209.cpp @@ -33,12 +33,12 @@ * S[+units] retract_length * W[+units] swap_retract_length (multi-extruder) * F[units/min] retract_feedrate_mm_s - * Z[units] retract_zlift + * Z[units] retract_zraise */ void GcodeSuite::M207() { if (parser.seen('S')) fwretract.settings.retract_length = parser.value_axis_units(E_AXIS); if (parser.seen('F')) fwretract.settings.retract_feedrate_mm_s = MMM_TO_MMS(parser.value_axis_units(E_AXIS)); - if (parser.seen('Z')) fwretract.settings.retract_zlift = parser.value_linear_units(); + if (parser.seen('Z')) fwretract.settings.retract_zraise = parser.value_linear_units(); if (parser.seen('W')) fwretract.settings.swap_retract_length = parser.value_axis_units(E_AXIS); } diff --git a/Marlin/src/gcode/feature/mixing/M163-M165.cpp b/Marlin/src/gcode/feature/mixing/M163-M165.cpp index 3fa478b834..2e744d70f1 100644 --- a/Marlin/src/gcode/feature/mixing/M163-M165.cpp +++ b/Marlin/src/gcode/feature/mixing/M163-M165.cpp @@ -30,7 +30,7 @@ /** * M163: Set a single mix factor for a mixing extruder * This is called "weight" by some systems. - * The 'P' values must sum to 1.0 or must be followed by M164 to normalize them. + * Must be followed by M164 to normalize and commit them. * * S[index] The channel index to set * P[float] The mix value @@ -38,32 +38,33 @@ void GcodeSuite::M163() { const int mix_index = parser.intval('S'); if (mix_index < MIXING_STEPPERS) - mixing_factor[mix_index] = MAX(parser.floatval('P'), 0.0); + mixer.set_M163_collector(mix_index, MAX(parser.floatval('P'), 0.0)); } /** * M164: Normalize and commit the mix. - * If 'S' is given store as a virtual tool. (Requires MIXING_VIRTUAL_TOOLS > 1) * * S[index] The virtual tool to store + * If 'S' is omitted update the active virtual tool. */ void GcodeSuite::M164() { - normalize_mix(); #if MIXING_VIRTUAL_TOOLS > 1 const int tool_index = parser.intval('S', -1); - if (WITHIN(tool_index, 0, MIXING_VIRTUAL_TOOLS - 1)) { - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - mixing_virtual_tool_mix[tool_index][i] = mixing_factor[i]; - } + #else + constexpr int tool_index = 0; #endif + if (WITHIN(tool_index, 0, MIXING_VIRTUAL_TOOLS - 1)) + mixer.normalize(tool_index); + else + mixer.normalize(mixer.get_current_v_tool()); } #if ENABLED(DIRECT_MIXING_IN_G1) /** * M165: Set multiple mix factors for a mixing extruder. - * Factors that are left out will be set to 0. - * All factors should sum to 1.0, but they will be normalized regardless. + * Omitted factors will be set to 0. + * The mix is normalized and stored in the current virtual tool. * * A[factor] Mix factor for extruder stepper 1 * B[factor] Mix factor for extruder stepper 2 @@ -72,7 +73,39 @@ void GcodeSuite::M164() { * H[factor] Mix factor for extruder stepper 5 * I[factor] Mix factor for extruder stepper 6 */ - void GcodeSuite::M165() { gcode_get_mix(); } + void GcodeSuite::M165() { + // Get mixing parameters from the GCode + // The total "must" be 1.0 (but it will be normalized) + // If no mix factors are given, the old mix is preserved + const char mixing_codes[] = { 'A', 'B' + #if MIXING_STEPPERS > 2 + , 'C' + #if MIXING_STEPPERS > 3 + , 'D' + #if MIXING_STEPPERS > 4 + , 'H' + #if MIXING_STEPPERS > 5 + , 'I' + #endif // MIXING_STEPPERS > 5 + #endif // MIXING_STEPPERS > 4 + #endif // MIXING_STEPPERS > 3 + #endif // MIXING_STEPPERS > 2 + }; + uint8_t mix_bits = 0; + MIXER_STEPPER_LOOP(i) { + if (parser.seenval(mixing_codes[i])) { + SBI(mix_bits, i); + mixer.set_M163_collector(i, MAX(parser.value_float(), 0.0f)); + } + } + // If any mixing factors were included, clear the rest + // If none were included, preserve the last mix + if (mix_bits) { + MIXER_STEPPER_LOOP(i) + if (!TEST(mix_bits, i)) mixer.set_M163_collector(i, 0.0f); + mixer.normalize(mixer.get_current_v_tool()); + } + } #endif // DIRECT_MIXING_IN_G1 diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 5ca499bf18..d2426bc46f 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -36,10 +36,6 @@ GcodeSuite gcode; #include "../module/printcounter.h" #endif -#if ENABLED(DIRECT_MIXING_IN_G1) - #include "../feature/mixing.h" -#endif - #include "../Marlin.h" // for idle() and suspend_auto_report uint8_t GcodeSuite::target_extruder; @@ -113,7 +109,7 @@ void GcodeSuite::get_destination_from_command() { // Get ABCDHI mixing factors #if ENABLED(MIXING_EXTRUDER) && ENABLED(DIRECT_MIXING_IN_G1) - gcode_get_mix(); + M165(); #endif } @@ -188,7 +184,7 @@ void GcodeSuite::process_parsed_command( case 'G': switch (parser.codenum) { case 0: case 1: G0_G1( // G0: Fast Move, G1: Linear Move - #if IS_SCARA + #if IS_SCARA || defined(G0_FEEDRATE) parser.codenum == 0 #endif ); @@ -296,11 +292,6 @@ void GcodeSuite::process_parsed_command( case 5: M5(); break; // M5 - turn spindle/laser off #endif - #if ENABLED(FAN_AS_LASER) - case 3: M3_M4(true); break; // M3: Laser Power On - case 5: M5(); break; - #endif - #if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER) case 12: M12(); break; // M12: Synchronize and optionally force a CLC set #endif @@ -446,9 +437,7 @@ void GcodeSuite::process_parsed_command( #if ENABLED(MIXING_EXTRUDER) case 163: M163(); break; // M163: Set a component weight for mixing extruder - #if MIXING_VIRTUAL_TOOLS > 1 - case 164: M164(); break; // M164: Save current mix as a virtual extruder - #endif + case 164: M164(); break; // M164: Save current mix as a virtual extruder #if ENABLED(DIRECT_MIXING_IN_G1) case 165: M165(); break; // M165: Set multiple mix weights #endif @@ -492,7 +481,7 @@ void GcodeSuite::process_parsed_command( case 211: M211(); break; // M211: Enable, Disable, and/or Report software endstops - #if ENABLED(SINGLENOZZLE) + #if EXTRUDERS > 1 case 217: M217(); break; // M217: Set filament swap parameters #endif @@ -595,6 +584,10 @@ void GcodeSuite::process_parsed_command( case 504: M504(); break; // M504: Validate EEPROM contents #endif + #if ENABLED(SDSUPPORT) + case 524: M524(); break; // M524: Abort the current SD print job + #endif + #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) case 540: M540(); break; // M540: Set abort on endstop hit for SD printing #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 5af9e7cb22..e6975fc821 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -146,8 +146,8 @@ * M150 - Set Status LED Color as R U B P. Values 0-255. (Requires BLINKM, RGB_LED, RGBW_LED, NEOPIXEL_LED, or PCA9632). * M155 - Auto-report temperatures with interval of S. (Requires AUTO_REPORT_TEMPERATURES) * M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER) - * M164 - Commit the mix (Req. MIXING_EXTRUDER) and optionally save as a virtual tool (Req. MIXING_VIRTUAL_TOOLS > 1) - * M165 - Set the mix for a mixing extruder wuth parameters ABCDHI. (Requires MIXING_EXTRUDER and DIRECT_MIXING_IN_G1) + * M164 - Commit the mix and save to a virtual tool (current, or as specified by 'S'). (Requires MIXING_EXTRUDER) + * M165 - Set the mix for the mixing extruder (and current virtual tool) with parameters ABCDHI. (Requires MIXING_EXTRUDER and DIRECT_MIXING_IN_G1) * M190 - Sxxx Wait for bed current temp to reach target temp. ** Waits only when heating! ** * Rxxx Wait for bed current temp to reach target temp. ** Waits for heating or cooling. ** * M200 - Set filament diameter, D, setting E axis units to cubic. (Use S0 to revert to linear units.) @@ -202,6 +202,7 @@ * M501 - Restore parameters from EEPROM. (Requires EEPROM_SETTINGS) * M502 - Revert to the default "factory settings". ** Does not write them to EEPROM! ** * M503 - Print the current settings (in memory): "M503 S". S0 specifies compact output. + * M524 - Abort the current SD print job (started with M24) * M540 - Enable/disable SD card abort on endstop hit: "M540 S". (Requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) * M600 - Pause for filament change: "M600 X Y Z E L". (Requires ADVANCED_PAUSE_FEATURE) * M603 - Configure filament change: "M603 T U L". (Requires ADVANCED_PAUSE_FEATURE) @@ -341,7 +342,7 @@ public: private: static void G0_G1( - #if IS_SCARA + #if IS_SCARA || defined(G0_FEEDRATE) bool fast_move=false #endif ); @@ -436,7 +437,7 @@ private: static void M0_M1(); #endif - #if (ENABLED(SPINDLE_LASER_ENABLE) || ENABLED(FAN_AS_LASER)) + #if ENABLED(SPINDLE_LASER_ENABLE) static void M3_M4(bool is_M3); static void M5(); #endif @@ -581,9 +582,7 @@ private: #if ENABLED(MIXING_EXTRUDER) static void M163(); - #if MIXING_VIRTUAL_TOOLS > 1 - static void M164(); - #endif + static void M164(); #if ENABLED(DIRECT_MIXING_IN_G1) static void M165(); #endif @@ -614,7 +613,7 @@ private: static void M211(); - #if ENABLED(SINGLENOZZLE) + #if EXTRUDERS > 1 static void M217(); #endif @@ -721,6 +720,10 @@ private: static void M504(); #endif + #if ENABLED(SDSUPPORT) + static void M524(); + #endif + #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) static void M540(); #endif diff --git a/Marlin/src/gcode/lcd/M145.cpp b/Marlin/src/gcode/lcd/M145.cpp index c65a281b81..410d014474 100644 --- a/Marlin/src/gcode/lcd/M145.cpp +++ b/Marlin/src/gcode/lcd/M145.cpp @@ -30,7 +30,7 @@ /** * M145: Set the heatup state for a material in the LCD menu * - * S (0=PLA, 1=ABS) + * S * H * B * F diff --git a/Marlin/src/gcode/lcd/M73.cpp b/Marlin/src/gcode/lcd/M73.cpp index 1c1deee9f9..c721d5b363 100644 --- a/Marlin/src/gcode/lcd/M73.cpp +++ b/Marlin/src/gcode/lcd/M73.cpp @@ -38,7 +38,7 @@ * This has no effect during an SD print job */ void GcodeSuite::M73() { - if (!IS_SD_PRINTING && parser.seen('P')) { + if (!IS_SD_PRINTING() && parser.seen('P')) { progress_bar_percent = parser.value_byte(); NOMORE(progress_bar_percent, 100); } diff --git a/Marlin/src/gcode/motion/G0_G1.cpp b/Marlin/src/gcode/motion/G0_G1.cpp index 223bd87fb7..32e9e6f6a5 100644 --- a/Marlin/src/gcode/motion/G0_G1.cpp +++ b/Marlin/src/gcode/motion/G0_G1.cpp @@ -37,23 +37,48 @@ extern float destination[XYZE]; -#if ENABLED(NO_MOTION_BEFORE_HOMING) - #define G0_G1_CONDITION !axis_unhomed_error(parser.seen('X'), parser.seen('Y'), parser.seen('Z')) -#else - #define G0_G1_CONDITION true +#if ENABLED(VARIABLE_G0_FEEDRATE) + float saved_g0_feedrate_mm_s = MMM_TO_MMS(G0_FEEDRATE); #endif /** * G0, G1: Coordinated movement of X Y Z E axes */ void GcodeSuite::G0_G1( - #if IS_SCARA + #if IS_SCARA || defined(G0_FEEDRATE) bool fast_move/*=false*/ #endif ) { - if (IsRunning() && G0_G1_CONDITION) { + + if (IsRunning() + #if ENABLED(NO_MOTION_BEFORE_HOMING) + && !axis_unhomed_error(parser.seen('X'), parser.seen('Y'), parser.seen('Z')) + #endif + ) { + + #ifdef G0_FEEDRATE + float saved_feedrate_mm_s; + #if ENABLED(VARIABLE_G0_FEEDRATE) + if (fast_move) { + saved_feedrate_mm_s = feedrate_mm_s; // Back up the (old) motion mode feedrate + feedrate_mm_s = saved_g0_feedrate_mm_s; // Get G0 feedrate from last usage + } + #endif + #endif + get_destination_from_command(); // For X Y Z E F + #ifdef G0_FEEDRATE + if (fast_move) { + #if ENABLED(VARIABLE_G0_FEEDRATE) + saved_g0_feedrate_mm_s = feedrate_mm_s; // Save feedrate for the next G0 + #else + saved_feedrate_mm_s = feedrate_mm_s; // Back up the (new) motion mode feedrate + feedrate_mm_s = MMM_TO_MMS(G0_FEEDRATE); // Get the fixed G0 feedrate + #endif + } + #endif + #if ENABLED(FWRETRACT) && ENABLED(FWRETRACT_AUTORETRACT) if (MIN_AUTORETRACT <= MAX_AUTORETRACT) { @@ -77,6 +102,11 @@ void GcodeSuite::G0_G1( prepare_move_to_destination(); #endif + #ifdef G0_FEEDRATE + // Restore the motion mode feedrate + if (fast_move) feedrate_mm_s = saved_feedrate_mm_s; + #endif + #if ENABLED(NANODLP_Z_SYNC) #if ENABLED(NANODLP_ALL_AXIS) #define _MOVE_SYNC parser.seenval('X') || parser.seenval('Y') || parser.seenval('Z') // For any move wait and output sync message diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index d70c286204..6123bc90fc 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -224,6 +224,9 @@ public: #if ENABLED(INCH_MODE_SUPPORT) + static inline float mm_to_linear_unit(const float mm) { return mm / linear_unit_factor; } + static inline float mm_to_volumetric_unit(const float mm) { return mm / (volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); } + // Init linear units by constructor GCodeParser() { set_input_linear_units(LINEARUNIT_MM); } @@ -244,18 +247,28 @@ public: return (axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); } - static inline float value_linear_units() { return value_float() * linear_unit_factor; } - static inline float value_axis_units(const AxisEnum axis) { return value_float() * axis_unit_factor(axis); } - static inline float value_per_axis_unit(const AxisEnum axis) { return value_float() / axis_unit_factor(axis); } + 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); } #else - FORCE_INLINE static float value_linear_units() { return value_float(); } - FORCE_INLINE static float value_axis_units(const AxisEnum a) { UNUSED(a); return value_float(); } - FORCE_INLINE static float value_per_axis_unit(const AxisEnum a) { UNUSED(a); return value_float(); } + 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; } + + 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; } #endif + #define LINEAR_UNIT(V) parser.mm_to_linear_unit(V) + #define VOLUMETRIC_UNIT(V) parser.mm_to_volumetric_unit(V) + + static inline float value_linear_units() { return linear_value_to_mm(value_float()); } + static inline float value_axis_units(const AxisEnum axis) { return axis_value_to_mm(axis, value_float()); } + static inline float value_per_axis_units(const AxisEnum axis) { return per_axis_value(axis, value_float()); } + #if ENABLED(TEMPERATURE_UNITS_SUPPORT) static inline void set_input_temp_units(TempUnit units) { input_temp_units = units; } @@ -306,11 +319,15 @@ public: } } + #define TEMP_UNIT(N) parser.to_temp_units(N) + #else // !TEMPERATURE_UNITS_SUPPORT FORCE_INLINE static float value_celsius() { return value_float(); } FORCE_INLINE static 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(); } diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 0c1b406f32..7de38442dc 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -391,7 +391,7 @@ inline void get_serial_commands() { wait_for_user = false; #endif } - if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED)); + if (strcmp(command, "M112") == 0) kill(); if (strcmp(command, "M410") == 0) quickstop_stepper(); #endif @@ -450,7 +450,7 @@ inline void get_serial_commands() { #endif ; - if (!IS_SD_PRINTING) return; + if (!IS_SD_PRINTING()) return; /** * '#' stops reading from SD to the buffer prematurely, so procedural diff --git a/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp b/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp similarity index 97% rename from Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp rename to Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp index 6a982b74b0..81cca4c0d3 100644 --- a/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp +++ b/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp @@ -244,6 +244,13 @@ void GcodeSuite::M32() { #endif // SDCARD_SORT_ALPHA && SDSORT_GCODE +/** + * M524: Abort the current SD print job (started with M24) + */ +void GcodeSuite::M524() { + if (IS_SD_PRINTING()) card.abort_sd_printing = true; +} + /** * M928: Start SD Write */ diff --git a/Marlin/src/gcode/temperature/M106_M107.cpp b/Marlin/src/gcode/temperature/M106_M107.cpp index 748446fc3f..12e2dc4f26 100644 --- a/Marlin/src/gcode/temperature/M106_M107.cpp +++ b/Marlin/src/gcode/temperature/M106_M107.cpp @@ -47,10 +47,6 @@ */ void GcodeSuite::M106() { const uint8_t p = parser.byteval('P'); - #if(ENABLED(LASER_PIN_DEDICATED) && ENABLED(FAN_AS_LASER)) - if(FAN_NUM_AS_LASER==p) - return; - #endif const uint16_t s = parser.ushortval('S', 255); #if ENABLED(SINGLENOZZLE) @@ -88,10 +84,6 @@ void GcodeSuite::M106() { */ void GcodeSuite::M107() { const uint16_t p = parser.ushortval('P'); - #if(ENABLED(LASER_PIN_DEDICATED) && ENABLED(FAN_AS_LASER)) - if(FAN_NUM_AS_LASER==p) - return; - #endif #if ENABLED(SINGLENOZZLE) if (p != active_extruder) { if (p < EXTRUDERS) singlenozzle_fan_speed[p] = 0; diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index f5c086fed9..dd17605a1d 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -298,7 +298,13 @@ #define ULTIPANEL #endif -#if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display +#if ENABLED(NO_LCD_MENUS) + #undef 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 @@ -311,10 +317,6 @@ #endif #endif -#if ENABLED(NO_LCD_MENUS) - #undef ULTIPANEL -#endif - #if ENABLED(ULTIPANEL) #define NEWPANEL // Disable this if you actually have no click-encoder panel #define ULTRA_LCD @@ -333,7 +335,14 @@ #endif #endif -#if ENABLED(DOGLCD) +// Aliases for LCD features +#define HAS_SPI_LCD ENABLED(ULTRA_LCD) +#define HAS_CHARACTER_LCD (ENABLED(ULTRA_LCD) && DISABLED(DOGLCD)) +#define HAS_DIGITAL_ENCODER (HAS_SPI_LCD && ENABLED(NEWPANEL)) +#define HAS_LCD_MENU ENABLED(ULTIPANEL) +#define HAS_DEBUG_MENU (HAS_LCD_MENU && ENABLED(LCD_PROGRESS_BAR_TEST)) + +#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" @@ -369,7 +378,7 @@ /** * Default LCD contrast for dogm-like LCD displays */ -#if ENABLED(DOGLCD) +#if HAS_GRAPHICAL_LCD #define HAS_LCD_CONTRAST ( \ ENABLED(MAKRPANEL) \ @@ -394,14 +403,12 @@ #endif // Boot screens -#if DISABLED(ULTRA_LCD) +#if !HAS_SPI_LCD #undef SHOW_BOOTSCREEN #elif !defined(BOOTSCREEN_TIMEOUT) #define BOOTSCREEN_TIMEOUT 2500 #endif -#define HAS_DEBUG_MENU (ENABLED(ULTIPANEL) && ENABLED(LCD_PROGRESS_BAR_TEST)) - /** * Extruders have some combination of stepper motors and hotends * so we separate these concepts into the defines: @@ -520,6 +527,14 @@ #endif #endif +#ifndef PREHEAT_1_LABEL + #define PREHEAT_1_LABEL "PLA" +#endif + +#ifndef PREHEAT_2_LABEL + #define PREHEAT_2_LABEL "ABS" +#endif + /** * Set a flag for a servo probe */ @@ -528,7 +543,7 @@ /** * Set flags for enabled probes */ -#define HAS_BED_PROBE (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_PROBE || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE) || ENABLED(SENSORLESS_PROBING)) +#define HAS_BED_PROBE (ENABLED(FIX_MOUNTED_PROBE) || ENABLED(Z_PROBE_ALLEN_KEY) || HAS_Z_SERVO_PROBE || ENABLED(Z_PROBE_SLED) || ENABLED(SOLENOID_PROBE) || ENABLED(SENSORLESS_PROBING) || ENABLED(RACK_AND_PINION_PROBE)) #define PROBE_SELECTED (HAS_BED_PROBE || ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING)) #if !HAS_BED_PROBE @@ -537,7 +552,7 @@ #undef Z_MIN_PROBE_ENDSTOP #elif ENABLED(Z_PROBE_ALLEN_KEY) // Extra test for Allen Key Probe - #define PROBE_IS_TRIGGERED_WHEN_STOWED_TEST + #define PROBE_TRIGGERED_WHEN_STOWED_TEST #endif #define HOMING_Z_WITH_PROBE (HAS_BED_PROBE && Z_HOME_DIR < 0 && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)) @@ -546,6 +561,7 @@ #define HAS_RESUME_CONTINUE (ENABLED(EXTENSIBLE_UI) || ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER)) #define HAS_COLOR_LEDS (ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED)) #define HAS_LEDS_OFF_FLAG (ENABLED(PRINTER_EVENT_LEDS) && ENABLED(SDSUPPORT) && HAS_RESUME_CONTINUE) +#define HAS_PRINT_PROGRESS (ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY)) #define Z_MULTI_STEPPER_DRIVERS (ENABLED(Z_DUAL_STEPPER_DRIVERS) || ENABLED(Z_TRIPLE_STEPPER_DRIVERS)) #define Z_MULTI_ENDSTOPS (ENABLED(Z_DUAL_ENDSTOPS) || ENABLED(Z_TRIPLE_ENDSTOPS)) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 969a7021c0..c9e80abd9e 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -236,37 +236,6 @@ #define MAX_AUTORETRACT 99 #endif -// MS1 MS2 MS3 Stepper Driver Microstepping mode table -#if DISABLED(MICROSTEP_CUSTOM) - #define MICROSTEP1 LOW,LOW,LOW - #if ENABLED(HEROIC_STEPPER_DRIVERS) - #define MICROSTEP128 LOW,HIGH,LOW - #else - #define MICROSTEP2 HIGH,LOW,LOW - #define MICROSTEP4 LOW,HIGH,LOW - #endif - #define MICROSTEP8 HIGH,HIGH,LOW - #ifdef __SAM3X8E__ - #if MB(ALLIGATOR) - #define MICROSTEP16 LOW,LOW,LOW - #define MICROSTEP32 HIGH,HIGH,LOW - #else - #define MICROSTEP16 HIGH,HIGH,LOW - #endif - #else - #define MICROSTEP16 HIGH,HIGH,LOW - #endif -#endif - -#define HAS_MICROSTEP1 defined(MICROSTEP1) -#define HAS_MICROSTEP2 defined(MICROSTEP2) -#define HAS_MICROSTEP4 defined(MICROSTEP4) -#define HAS_MICROSTEP8 defined(MICROSTEP8) -#define HAS_MICROSTEP16 defined(MICROSTEP16) -#define HAS_MICROSTEP32 defined(MICROSTEP32) -#define HAS_MICROSTEP64 defined(MICROSTEP64) -#define HAS_MICROSTEP128 defined(MICROSTEP128) - /** * Override here because this is set in Configuration_adv.h */ @@ -1015,11 +984,63 @@ #define HAS_CASE_LIGHT (PIN_EXISTS(CASE_LIGHT) && ENABLED(CASE_LIGHT_ENABLE)) // Digital control -#define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS || HAS_E5_MICROSTEPS) #define HAS_STEPPER_RESET (PIN_EXISTS(STEPPER_RESET)) #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) #define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E)) +#define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS || HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS || HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS || HAS_E5_MICROSTEPS) + +#if HAS_MICROSTEPS + + // MS1 MS2 MS3 Stepper Driver Microstepping mode table + #ifndef MICROSTEP1 + #define MICROSTEP1 LOW,LOW,LOW + #endif + #if ENABLED(HEROIC_STEPPER_DRIVERS) + #ifndef MICROSTEP128 + #define MICROSTEP128 LOW,HIGH,LOW + #endif + #else + #ifndef MICROSTEP2 + #define MICROSTEP2 HIGH,LOW,LOW + #endif + #ifndef MICROSTEP4 + #define MICROSTEP4 LOW,HIGH,LOW + #endif + #endif + #ifndef MICROSTEP8 + #define MICROSTEP8 HIGH,HIGH,LOW + #endif + #ifdef __SAM3X8E__ + #if MB(ALLIGATOR) + #ifndef MICROSTEP16 + #define MICROSTEP16 LOW,LOW,LOW + #endif + #ifndef MICROSTEP32 + #define MICROSTEP32 HIGH,HIGH,LOW + #endif + #else + #ifndef MICROSTEP16 + #define MICROSTEP16 HIGH,HIGH,LOW + #endif + #endif + #else + #ifndef MICROSTEP16 + #define MICROSTEP16 HIGH,HIGH,LOW + #endif + #endif + + #define HAS_MICROSTEP1 defined(MICROSTEP1) + #define HAS_MICROSTEP2 defined(MICROSTEP2) + #define HAS_MICROSTEP4 defined(MICROSTEP4) + #define HAS_MICROSTEP8 defined(MICROSTEP8) + #define HAS_MICROSTEP16 defined(MICROSTEP16) + #define HAS_MICROSTEP32 defined(MICROSTEP32) + #define HAS_MICROSTEP64 defined(MICROSTEP64) + #define HAS_MICROSTEP128 defined(MICROSTEP128) + +#endif // HAS_MICROSTEPS + #if !HAS_TEMP_SENSOR #undef AUTO_REPORT_TEMPERATURES #endif diff --git a/Marlin/src/inc/MarlinConfigPre.h b/Marlin/src/inc/MarlinConfigPre.h index ae36a1efcd..3bca46ed09 100644 --- a/Marlin/src/inc/MarlinConfigPre.h +++ b/Marlin/src/inc/MarlinConfigPre.h @@ -30,7 +30,7 @@ #include "../HAL/platforms.h" #include "../core/boards.h" #include "../core/macros.h" -#include "../core/types.h" +#include "../core/millis_t.h" #include "Version.h" #include "../../Configuration.h" #include "Conditionals_LCD.h" diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index ff0159c0d5..709c8b2888 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -309,6 +309,18 @@ #error "MAX7219_DEBUG_STEPPER_QUEUE is now MAX7219_DEBUG_PLANNER_QUEUE. Please update your configuration." #elif defined(ENDSTOP_NOISE_FILTER) #error "ENDSTOP_NOISE_FILTER is now ENDSTOP_NOISE_THRESHOLD [2-7]. Please update your configuration." +#elif defined(RETRACT_ZLIFT) + #error "RETRACT_ZLIFT is now RETRACT_ZRAISE. Please update your Configuration_adv.h." +#elif defined(TOOLCHANGE_PARK_ZLIFT) || defined(TOOLCHANGE_UNPARK_ZLIFT) + #error "TOOLCHANGE_PARK_ZLIFT and TOOLCHANGE_UNPARK_ZLIFT are now TOOLCHANGE_ZRAISE. Please update your configuration." +#elif defined(SINGLENOZZLE_TOOLCHANGE_ZRAISE) + #error "SINGLENOZZLE_TOOLCHANGE_ZRAISE is now TOOLCHANGE_ZRAISE. Please update your configuration." +#elif defined(PARKING_EXTRUDER_SECURITY_RAISE) + #error "PARKING_EXTRUDER_SECURITY_RAISE is now TOOLCHANGE_ZRAISE. Please update your configuration." +#elif defined(SWITCHING_TOOLHEAD_SECURITY_RAISE) + #error "SWITCHING_TOOLHEAD_SECURITY_RAISE is now TOOLCHANGE_ZRAISE. Please update your configuration." +#elif defined(G0_FEEDRATE) && G0_FEEDRATE == 0 + #error "G0_FEEDRATE is now used to set the G0 feedrate. Please update your configuration." #endif #define BOARD_MKS_13 -47 @@ -442,20 +454,31 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "Enable only one of ENDSTOPPULLUP_Z_MIN or ENDSTOPPULLDOWN_Z_MIN." #endif +/** + * LCD Info Screen Style + */ +#if LCD_INFO_SCREEN_STYLE > 0 + #if HAS_GRAPHICAL_LCD || LCD_WIDTH < 20 || LCD_HEIGHT < 4 + #error "Alternative LCD_INFO_SCREEN_STYLE requires 20x4 Character LCD." + #elif LCD_INFO_SCREEN_STYLE > 1 + #error "LCD_INFO_SCREEN_STYLE only has options 0 and 1 at this time." + #endif +#endif + /** * Progress Bar */ #if ENABLED(LCD_PROGRESS_BAR) #if DISABLED(SDSUPPORT) && DISABLED(LCD_SET_PROGRESS_MANUALLY) #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY." - #elif DISABLED(ULTRA_LCD) + #elif !HAS_CHARACTER_LCD #error "LCD_PROGRESS_BAR requires a character LCD." - #elif ENABLED(DOGLCD) + #elif HAS_GRAPHICAL_LCD #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." #endif -#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && DISABLED(DOGLCD) +#elif ENABLED(LCD_SET_PROGRESS_MANUALLY) && !HAS_GRAPHICAL_LCD #error "LCD_SET_PROGRESS_MANUALLY requires LCD_PROGRESS_BAR or Graphical LCD." #endif @@ -611,14 +634,14 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "SINGLENOZZLE requires SINGLENOZZLE_SWAP_PRIME_SPEED. Please update your Configuration." #endif #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #ifndef SINGLENOZZLE_TOOLCHANGE_POSITION - #error "SINGLENOZZLE_SWAP_PARK requires SINGLENOZZLE_TOOLCHANGE_POSITION. Please update your Configuration." + #ifndef SINGLENOZZLE_TOOLCHANGE_XY + #error "SINGLENOZZLE_SWAP_PARK requires SINGLENOZZLE_TOOLCHANGE_XY. Please update your Configuration." #elif !defined(SINGLENOZZLE_PARK_XY_FEEDRATE) #error "SINGLENOZZLE_SWAP_PARK requires SINGLENOZZLE_PARK_XY_FEEDRATE. Please update your Configuration." #endif #else - #ifndef SINGLENOZZLE_TOOLCHANGE_ZRAISE - #error "SINGLENOZZLE requires SINGLENOZZLE_TOOLCHANGE_ZRAISE. Please update your Configuration." + #ifndef TOOLCHANGE_ZRAISE + #error "SINGLENOZZLE requires TOOLCHANGE_ZRAISE. Please update your Configuration." #endif #endif #endif @@ -705,8 +728,6 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "Please select either MIXING_EXTRUDER or SWITCHING_EXTRUDER, not both." #elif ENABLED(SINGLENOZZLE) #error "MIXING_EXTRUDER is incompatible with SINGLENOZZLE." - #elif ENABLED(LIN_ADVANCE) - #error "MIXING_EXTRUDER is incompatible with LIN_ADVANCE." #endif #endif @@ -736,10 +757,10 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #error "PARKING_EXTRUDER requires SOL0_PIN and SOL1_PIN." #elif !defined(PARKING_EXTRUDER_PARKING_X) #error "PARKING_EXTRUDER requires PARKING_EXTRUDER_PARKING_X." - #elif !defined(PARKING_EXTRUDER_SECURITY_RAISE) - #error "PARKING_EXTRUDER requires PARKING_EXTRUDER_SECURITY_RAISE." - #elif PARKING_EXTRUDER_SECURITY_RAISE < 0 - #error "PARKING_EXTRUDER_SECURITY_RAISE must be 0 or higher." + #elif !defined(TOOLCHANGE_ZRAISE) + #error "PARKING_EXTRUDER requires TOOLCHANGE_ZRAISE." + #elif TOOLCHANGE_ZRAISE < 0 + #error "TOOLCHANGE_ZRAISE must be 0 or higher." #elif !defined(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE, LOW, HIGH) #error "PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE must be defined as HIGH or LOW." #elif !defined(PARKING_EXTRUDER_SOLENOIDS_DELAY) || !WITHIN(PARKING_EXTRUDER_SOLENOIDS_DELAY, 0, 2000) @@ -771,10 +792,10 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #elif SWITCHING_TOOLHEAD_SERVO_NR == 3 #error "A SWITCHING_TOOLHEAD_SERVO_NR of 3 requires NUM_SERVOS >= 4." #endif - #elif !defined(SWITCHING_TOOLHEAD_SECURITY_RAISE) - #error "SWITCHING_TOOLHEAD requires SWITCHING_TOOLHEAD_SECURITY_RAISE." - #elif SWITCHING_TOOLHEAD_SECURITY_RAISE < 0 - #error "SWITCHING_TOOLHEAD _SECURITY_RAISE must be 0 or higher." + #elif !defined(TOOLCHANGE_ZRAISE) + #error "SWITCHING_TOOLHEAD requires TOOLCHANGE_ZRAISE." + #elif TOOLCHANGE_ZRAISE < 0 + #error "TOOLCHANGE_ZRAISE must be 0 or higher." #endif #endif @@ -870,7 +891,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, + ENABLED(BLTOUCH) \ + ENABLED(SOLENOID_PROBE) \ + ENABLED(Z_PROBE_ALLEN_KEY) \ - + ENABLED(Z_PROBE_SLED) + + ENABLED(Z_PROBE_SLED) \ + + ENABLED(RACK_AND_PINION_PROBE) #error "Please enable only one probe option: PROBE_MANUALLY, FIX_MOUNTED_PROBE, BLTOUCH, SOLENOID_PROBE, Z_PROBE_ALLEN_KEY, Z_PROBE_SLED, or Z Servo." #endif @@ -913,6 +935,10 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #endif #endif + #if ENABLED(RACK_AND_PINION_PROBE) && !(defined(Z_PROBE_DEPLOY_X) && defined(Z_PROBE_RETRACT_X)) + #error "RACK_AND_PINION_PROBE requires Z_PROBE_DEPLOY_X and Z_PROBE_RETRACT_X." + #endif + /** * Require pin options and pins to be defined */ @@ -1226,6 +1252,13 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, #endif #endif +/** + * Test case light not using the same pin as the fan + */ +#if ENABLED(CASE_LIGHT_ENABLE) && CASE_LIGHT_PIN == FAN_PIN + #error "You cannot set CASE_LIGHT_PIN equal to FAN_PIN." +#endif + /** * Test Heater, Temp Sensor, and Extruder Pins; Sensor Type must also be set. */ @@ -1747,17 +1780,17 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE, // clearing the stallGuard activated status is found. #if ENABLED(DELTA) && DISABLED(STEALTHCHOP) #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP." - #elif X_SENSORLESS && X_HOME_DIR == -1 && (DISABLED(X_MIN_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_XMIN)) + #elif X_SENSORLESS && X_HOME_DIR == -1 && (!X_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMIN)) #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMIN when homing to X_MIN." - #elif X_SENSORLESS && X_HOME_DIR == 1 && (DISABLED(X_MAX_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_XMAX)) + #elif X_SENSORLESS && X_HOME_DIR == 1 && (!X_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_XMAX)) #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMAX when homing to X_MAX." - #elif Y_SENSORLESS && Y_HOME_DIR == -1 && (DISABLED(Y_MIN_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_YMIN)) + #elif Y_SENSORLESS && Y_HOME_DIR == -1 && (!Y_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_YMIN)) #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMIN when homing to Y_MIN." - #elif Y_SENSORLESS && Y_HOME_DIR == 1 && (DISABLED(Y_MAX_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_YMAX)) + #elif Y_SENSORLESS && Y_HOME_DIR == 1 && (!Y_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_YMAX)) #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMAX when homing to Y_MAX." - #elif Z_SENSORLESS && Z_HOME_DIR == -1 && (DISABLED(Z_MIN_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_ZMIN)) + #elif Z_SENSORLESS && Z_HOME_DIR == -1 && (!Z_MIN_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMIN)) #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMIN when homing to Z_MIN." - #elif Z_SENSORLESS && Z_HOME_DIR == 1 && (DISABLED(Z_MAX_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_ZMAX)) + #elif Z_SENSORLESS && Z_HOME_DIR == 1 && (!Z_MAX_ENDSTOP_INVERTING || DISABLED(ENDSTOPPULLUP_ZMAX)) #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMAX when homing to Z_MAX." #elif ENDSTOP_NOISE_THRESHOLD #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_THRESHOLD." diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 31ee7989a5..5b023079fc 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -19,9 +19,7 @@ * along with this program. If not, see . * */ - -#ifndef _VERSION_H_ -#define _VERSION_H_ +#pragma once #include "../core/macros.h" // for ENABLED @@ -40,7 +38,7 @@ /** * Marlin release version identifier */ - #define SHORT_BUILD_VERSION "2.0.x_TR4" + #define SHORT_BUILD_VERSION "bugfix-2.0.x" /** * Verbose version identifier which should contain a reference to the location @@ -53,7 +51,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ - #define STRING_DISTRIBUTION_DATE "2018-10-08" + #define STRING_DISTRIBUTION_DATE "2018-01-20" /** * Required minimum Configuration.h and Configuration_adv.h file versions. @@ -75,7 +73,7 @@ /** * Defines a generic printer name to be output to the LCD after booting Marlin. */ - #define MACHINE_NAME "TM3D Trex2+" + #define MACHINE_NAME "3D Printer" /** * The SOURCE_CODE_URL is the location where users will find the Marlin Source @@ -83,7 +81,7 @@ * has a distinct Github fork— the Source Code URL should just be the main * Marlin repository. */ - #define SOURCE_CODE_URL "https://github.com/InsanityAutomation/Marlin/tree/TM_Trex2+_2.0.x" + #define SOURCE_CODE_URL "https://github.com/MarlinFirmware/Marlin" /** * Default generic printer UUID. @@ -94,8 +92,6 @@ * The WEBSITE_URL is the location where users can get more information such as * documentation about a specific Marlin release. */ - #define WEBSITE_URL "tinymachines3d.com" + #define WEBSITE_URL "http://marlinfw.org" #endif // USE_AUTOMATIC_VERSIONING - -#endif // _VERSION_H_ diff --git a/Marlin/src/lcd/lcdprint_hd44780.cpp b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp similarity index 98% rename from Marlin/src/lcd/lcdprint_hd44780.cpp rename to Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp index fbbb748b3d..b5793d0743 100644 --- a/Marlin/src/lcd/lcdprint_hd44780.cpp +++ b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp @@ -12,17 +12,16 @@ * Western(English), Cyrillic(Russian), Kana(Japanese) charsets. */ -#include "../inc/MarlinConfigPre.h" -#include "../inc/MarlinConfig.h" +#include "../../inc/MarlinConfigPre.h" -#if ENABLED(ULTRA_LCD) -#include "ultralcd.h" -#include "../Marlin.h" +#if ENABLED(ULTRA_LCD) && DISABLED(DOGLCD) + +#include "../ultralcd.h" +#include "../../Marlin.h" -#if DISABLED(DOGLCD) #include -#include "fontutils.h" -#include "lcdprint.h" +#include "../fontutils.h" +#include "../lcdprint.h" #include "ultralcd_common_HD44780.h" #ifndef LCD_CLASS @@ -1010,16 +1009,16 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) { } /** -* @brief Draw a UTF-8 string -* -* @param utf8_str : the UTF-8 string -* @param cb_read_byte : the callback function to read one byte from the utf8_str (from RAM or ROM) -* @param max_length : the pixel length of the string allowed (or number of slots in HD44780) -* -* @return the number of pixels advanced -* -* Draw a UTF-8 string -*/ + * @brief Draw a UTF-8 string + * + * @param utf8_str : the UTF-8 string + * @param cb_read_byte : the callback function to read one byte from the utf8_str (from RAM or ROM) + * @param max_length : the pixel length of the string allowed (or number of slots in HD44780) + * + * @return the number of pixels advanced + * + * Draw a UTF-8 string + */ static int lcd_put_u8str_max_cb(const char * utf8_str, uint8_t (*cb_read_byte)(uint8_t * str), pixel_len_t max_length) { pixel_len_t ret = 0; uint8_t *p = (uint8_t *)utf8_str; @@ -1040,5 +1039,4 @@ 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); } -#endif // DOGLCD -#endif // ULTRA_LCD +#endif // ULTRA_LCD && !DOGLCD diff --git a/Marlin/src/lcd/ultralcd_common_HD44780.h b/Marlin/src/lcd/HD44780/ultralcd_common_HD44780.h similarity index 92% rename from Marlin/src/lcd/ultralcd_common_HD44780.h rename to Marlin/src/lcd/HD44780/ultralcd_common_HD44780.h index 970dbbf35a..d4dd2afae5 100644 --- a/Marlin/src/lcd/ultralcd_common_HD44780.h +++ b/Marlin/src/lcd/HD44780/ultralcd_common_HD44780.h @@ -19,23 +19,21 @@ * along with this program. If not, see . * */ - -#ifndef ULTRALCD_COMMON_HD44780_H -#define ULTRALCD_COMMON_HD44780_H +#pragma once /** * Implementation of the LCD display routines for a Hitachi HD44780 display. * These are the most common LCD character displays. */ -#include "../inc/MarlinConfig.h" +#include "../../inc/MarlinConfig.h" #if LCD_HEIGHT > 3 - #include "../libs/duration_t.h" + #include "../../libs/duration_t.h" #endif #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "../feature/bedlevel/ubl/ubl.h" + #include "../../feature/bedlevel/ubl/ubl.h" #if ENABLED(ULTIPANEL) #define ULTRA_X_PIXELS_PER_CHAR 5 @@ -52,8 +50,6 @@ #endif #endif -extern volatile uint8_t buttons; //an extended version of the last checked buttons in a bit array. - //////////////////////////////////// // Setup button and encode mappings for each panel (into 'buttons' variable // @@ -63,6 +59,8 @@ extern volatile uint8_t buttons; //an extended version of the last checked butt #if ENABLED(ULTIPANEL) + extern volatile uint8_t buttons; + // // Setup other button mappings of each panel // @@ -183,17 +181,9 @@ extern volatile uint8_t buttons; //an extended version of the last checked butt #endif -#include "fontutils.h" -#include "lcdprint.h" +#include "../fontutils.h" +#include "../lcdprint.h" #if ENABLED(LCD_PROGRESS_BAR) #define LCD_STR_PROGRESS "\x03\x04\x05" #endif - -enum HD44780CharSet : char { - CHARSET_MENU, - CHARSET_INFO, - CHARSET_BOOT -}; - -#endif // ULTRALCD_COMMON_HD44780_H diff --git a/Marlin/src/lcd/ultralcd_impl_HD44780.h b/Marlin/src/lcd/HD44780/ultralcd_impl_HD44780.cpp similarity index 85% rename from Marlin/src/lcd/ultralcd_impl_HD44780.h rename to Marlin/src/lcd/HD44780/ultralcd_impl_HD44780.cpp index eccda7446d..6528d69a03 100644 --- a/Marlin/src/lcd/ultralcd_impl_HD44780.h +++ b/Marlin/src/lcd/HD44780/ultralcd_impl_HD44780.cpp @@ -20,15 +20,25 @@ * */ -#ifndef ULTRALCD_IMPL_HD44780_H -#define ULTRALCD_IMPL_HD44780_H +#include "../../inc/MarlinConfigPre.h" + +#if ENABLED(ULTRA_LCD) && DISABLED(DOGLCD) /** + * ultralcd_impl_HD44780.cpp + * * Implementation of the LCD display routines for a Hitachi HD44780 display. * These are the most common LCD character displays. */ #include "ultralcd_common_HD44780.h" +#include "../ultralcd.h" + +#include "../../sd/cardreader.h" +#include "../../module/temperature.h" +#include "../../module/printcounter.h" +#include "../../module/planner.h" +#include "../../module/motion.h" //////////////////////////////////// // Create LCD class instance and chipset-specific information @@ -69,8 +79,8 @@ LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5, LCD_PINS_D6, LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7 #endif -#include "fontutils.h" -#include "lcdprint.h" +#include "../fontutils.h" +#include "../lcdprint.h" #if ENABLED(LCD_PROGRESS_BAR) static millis_t progress_bar_ms = 0; // Start millis of the current progress bar cycle @@ -90,7 +100,7 @@ static void createChar_P(const char c, const byte * const ptr) { lcd.createChar(c, temp); } -static void lcd_set_custom_characters( +void lcd_set_custom_characters( #if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN) const uint8_t screen_charset=CHARSET_INFO #endif @@ -182,14 +192,25 @@ static void lcd_set_custom_characters( }; const static PROGMEM byte feedrate[8] = { - B11100, - B10000, - B11000, - B10111, - B00101, - B00110, - B00101, - B00000 + #if LCD_INFO_SCREEN_STYLE == 1 + B00000, + B00100, + B10010, + B01001, + B10010, + B00100, + B00000, + B00000 + #else + B11100, + B10000, + B11000, + B10111, + B00101, + B00110, + B00101, + B00000 + #endif }; const static PROGMEM byte clock[8] = { @@ -297,7 +318,7 @@ static void lcd_set_custom_characters( } -static void lcd_implementation_init( +void lcd_implementation_init( #if ENABLED(LCD_PROGRESS_BAR) const uint8_t screen_charset=CHARSET_INFO #endif @@ -546,6 +567,41 @@ FORCE_INLINE void _draw_heater_status(const int8_t heater, const char prefix, co } } +FORCE_INLINE void _draw_bed_status(const bool blink) { + _draw_heater_status(-1, ( + #if HAS_LEVELING + planner.leveling_active && blink ? '_' : + #endif + LCD_BEDTEMP_CHAR + ), 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 + ); + lcd_put_u8str_P(PSTR( + #if ENABLED(SDSUPPORT) + "SD" + #elif ENABLED(LCD_SET_PROGRESS_MANUALLY) + "P:" + #endif + )); + if (percent) + lcd_put_u8str(itostr3(percent)); + else + lcd_put_u8str_P(PSTR("---")); + lcd_put_wchar('%'); + } + +#endif + #if ENABLED(LCD_PROGRESS_BAR) inline void lcd_draw_progress_bar(const uint8_t percent) { @@ -567,185 +623,7 @@ FORCE_INLINE void _draw_heater_status(const int8_t heater, const char prefix, co #endif // LCD_PROGRESS_BAR -/** -Possible status screens: -16x2 |000/000 B000/000| - |0123456789012345| - -16x4 |000/000 B000/000| - |SD100% Z 000.00| - |F100% T--:--| - |0123456789012345| - -20x2 |T000/000D B000/000D | - |01234567890123456789| - -20x4 |T000/000D B000/000D | - |X 000 Y 000 Z 000.00| - |F100% SD100% T--:--| - |01234567890123456789| - -20x4 |T000/000D B000/000D | - |T000/000D Z 000.00| - |F100% SD100% T--:--| - |01234567890123456789| -*/ -static void lcd_implementation_status_screen() { - const bool blink = lcd_blink(); - - // - // Line 1 - // - - lcd_moveto(0, 0); - - #if LCD_WIDTH < 20 - - // - // Hotend 0 Temperature - // - _draw_heater_status(0, -1, blink); - - // - // Hotend 1 or Bed Temperature - // - #if HOTENDS > 1 || HAS_HEATED_BED - - lcd_moveto(8, 0); - #if HOTENDS > 1 - lcd_put_wchar((char)LCD_STR_THERMOMETER[0]); - _draw_heater_status(1, -1, blink); - #else - lcd_put_wchar((char)LCD_BEDTEMP_CHAR); - _draw_heater_status(-1, -1, blink); - #endif - - #endif // HOTENDS > 1 || HAS_HEATED_BED - - #else // LCD_WIDTH >= 20 - - // - // Hotend 0 Temperature - // - _draw_heater_status(0, LCD_STR_THERMOMETER[0], blink); - - // - // Hotend 1 or Bed Temperature - // - #if HOTENDS > 1 || HAS_HEATED_BED - lcd_moveto(10, 0); - #if HOTENDS > 1 - _draw_heater_status(1, LCD_STR_THERMOMETER[0], blink); - #else - _draw_heater_status(-1, ( - #if HAS_LEVELING - planner.leveling_active && blink ? '_' : - #endif - LCD_BEDTEMP_CHAR - ), blink); - #endif - - #endif // HOTENDS > 1 || HAS_HEATED_BED - - #endif // LCD_WIDTH >= 20 - - // - // Line 2 - // - - #if LCD_HEIGHT > 2 - - #if LCD_WIDTH < 20 - - #if ENABLED(SDSUPPORT) - lcd_moveto(0, 2); - lcd_put_u8str_P(PSTR("SD")); - if (IS_SD_PRINTING) - lcd_put_u8str(itostr3(card.percentDone())); - else - lcd_put_u8str_P(PSTR("---")); - lcd_put_wchar('%'); - #endif // SDSUPPORT - - #else // LCD_WIDTH >= 20 - - lcd_moveto(0, 1); - - // If the first line has two extruder temps, - // show more temperatures on the next line - - #if HOTENDS > 2 || (HOTENDS > 1 && HAS_HEATED_BED) - - #if HOTENDS > 2 - _draw_heater_status(2, LCD_STR_THERMOMETER[0], blink); - lcd_moveto(10, 1); - #endif - - _draw_heater_status(-1, ( - #if HAS_LEVELING - planner.leveling_active && blink ? '_' : - #endif - LCD_BEDTEMP_CHAR - ), blink); - - #else // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) - - _draw_axis_value(X_AXIS, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])), blink); - - lcd_put_wchar(' '); - - _draw_axis_value(Y_AXIS, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])), blink); - - #endif // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) - - #endif // LCD_WIDTH >= 20 - - lcd_moveto(LCD_WIDTH - 8, 1); - _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS])), blink); - - #if HAS_LEVELING && !HAS_HEATED_BED - lcd_put_wchar(planner.leveling_active || blink ? '_' : ' '); - #endif - - #endif // LCD_HEIGHT > 2 - - // - // Line 3 - // - - #if LCD_HEIGHT > 3 - - lcd_moveto(0, 2); - lcd_put_wchar(LCD_FEEDRATE_CHAR); - lcd_put_u8str(itostr3(feedrate_percentage)); - lcd_put_wchar('%'); - - #if LCD_WIDTH >= 20 && ENABLED(SDSUPPORT) - - lcd_moveto(7, 2); - lcd_put_u8str_P(PSTR("SD")); - if (IS_SD_PRINTING) - lcd_put_u8str(itostr3(card.percentDone())); - else - lcd_put_u8str_P(PSTR("---")); - lcd_put_wchar('%'); - - #endif // LCD_WIDTH >= 20 && SDSUPPORT - - char buffer[10]; - duration_t elapsed = print_job_timer.duration(); - uint8_t len = elapsed.toDigital(buffer); - - lcd_moveto(LCD_WIDTH - len - 1, 2); - lcd_put_wchar(LCD_CLOCK_CHAR); - lcd_put_u8str(buffer); - - #endif // LCD_HEIGHT > 3 - - // - // Last Line - // Status Message (which may be a Progress Bar or Filament display) - // +FORCE_INLINE void _draw_status_message(const bool blink) { lcd_moveto(0, LCD_HEIGHT - 1); @@ -854,11 +732,254 @@ static void lcd_implementation_status_screen() { #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| + */ + + void lcd_impl_status_screen_0() { + const bool blink = lcd_blink(); + + // ========== Line 1 ========== + + lcd_moveto(0, 0); + + #if LCD_WIDTH < 20 + + // + // Hotend 0 Temperature + // + _draw_heater_status(0, -1, blink); + + // + // Hotend 1 or Bed Temperature + // + #if HOTENDS > 1 + lcd_moveto(8, 0); + lcd_put_wchar((char)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); + _draw_heater_status(-1, -1, blink); + #endif + + #else // LCD_WIDTH >= 20 + + // + // Hotend 0 Temperature + // + _draw_heater_status(0, LCD_STR_THERMOMETER[0], blink); + + // + // Hotend 1 or Bed Temperature + // + #if HOTENDS > 1 + lcd_moveto(10, 0); + _draw_heater_status(1, LCD_STR_THERMOMETER[0], blink); + #elif HAS_HEATED_BED + lcd_moveto(10, 0); + _draw_bed_status(blink); + #endif + + #endif // LCD_WIDTH >= 20 + + // ========== Line 2 ========== + + #if LCD_HEIGHT > 2 + + #if LCD_WIDTH < 20 + + #if HAS_PRINT_PROGRESS + lcd_moveto(0, 2); + _draw_print_progress(); + #endif + + #else // LCD_WIDTH >= 20 + + lcd_moveto(0, 1); + + // If the first line has two extruder temps, + // show more temperatures on the next line + + #if HOTENDS > 2 || (HOTENDS > 1 && HAS_HEATED_BED) + + #if HOTENDS > 2 + _draw_heater_status(2, LCD_STR_THERMOMETER[0], blink); + lcd_moveto(10, 1); + #endif + + _draw_bed_status(blink); + + #else // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) + + _draw_axis_value(X_AXIS, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])), blink); + + lcd_put_wchar(' '); + + _draw_axis_value(Y_AXIS, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])), blink); + + #endif // HOTENDS <= 2 && (HOTENDS <= 1 || !HAS_HEATED_BED) + + #endif // LCD_WIDTH >= 20 + + lcd_moveto(LCD_WIDTH - 8, 1); + _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS])), blink); + + #if HAS_LEVELING && !HAS_HEATED_BED + lcd_put_wchar(planner.leveling_active || blink ? '_' : ' '); + #endif + + #endif // LCD_HEIGHT > 2 + + // ========== Line 3 ========== + + #if LCD_HEIGHT > 3 + + lcd_moveto(0, 2); + lcd_put_wchar(LCD_FEEDRATE_CHAR); + lcd_put_u8str(itostr3(feedrate_percentage)); + lcd_put_wchar('%'); + + #if LCD_WIDTH >= 20 && HAS_PRINT_PROGRESS + lcd_moveto(7, 2); + _draw_print_progress(); + #endif + + char buffer[14]; + duration_t elapsed = print_job_timer.duration(); + uint8_t len = elapsed.toDigital(buffer); + + lcd_moveto(LCD_WIDTH - len - 1, 2); + lcd_put_wchar(LCD_CLOCK_CHAR); + lcd_put_u8str(buffer); + + #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| + */ + + static void lcd_impl_status_screen_1() { + const bool blink = lcd_blink(); + + // ========== Line 1 ========== + + // + // Hotend 0 Temperature + // + lcd_moveto(0, 0); + _draw_heater_status(0, LCD_STR_THERMOMETER[0], blink); + + // + // Z Coordinate + // + lcd_moveto(LCD_WIDTH - 9, 0); + _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS])), blink); + + #if HAS_LEVELING && (HOTENDS > 1 || !HAS_HEATED_BED) + lcd_moveto(LCD_WIDTH - 1, 0); + lcd_put_wchar(planner.leveling_active || blink ? '_' : ' '); + #endif + + // ========== Line 2 ========== + + // + // Hotend 1 or Bed Temperature + // + lcd_moveto(0, 1); + #if HOTENDS > 1 + _draw_heater_status(1, LCD_STR_THERMOMETER[0], blink); + #elif HAS_HEATED_BED + _draw_bed_status(blink); + #endif + + lcd_moveto(LCD_WIDTH - 9, 1); + lcd_put_wchar(LCD_FEEDRATE_CHAR); + lcd_put_u8str(itostr3(feedrate_percentage)); + lcd_put_wchar('%'); + + // ========== Line 3 ========== + + // + // SD Percent, Hotend 2, or Bed + // + lcd_moveto(0, 2); + #if HOTENDS > 2 + _draw_heater_status(2, LCD_STR_THERMOMETER[0], blink); + #elif HOTENDS > 1 && HAS_HEATED_BED + _draw_bed_status(blink); + #elif HAS_PRINT_PROGRESS + #define DREW_PRINT_PROGRESS + _draw_print_progress(); + #endif + + // + // Elapsed Time or SD Percent + // + lcd_moveto(LCD_WIDTH - 9, 2); + #if HAS_PRINT_PROGRESS && !defined(DREW_PRINT_PROGRESS) + _draw_print_progress(); + #else + duration_t elapsed = print_job_timer.duration(); + char buffer[14]; + (void)elapsed.toDigital(buffer); + lcd_put_wchar(LCD_CLOCK_CHAR); + lcd_put_u8str(buffer); + #endif + + // ========== Line 4 ========== + + // + // Status Message (which may be a Progress Bar or Filament display) + // + _draw_status_message(blink); + } + +#endif + #if ENABLED(ULTIPANEL) #if ENABLED(ADVANCED_PAUSE_FEATURE) - static void lcd_implementation_hotend_status(const uint8_t row, const uint8_t extruder=active_extruder) { + void lcd_implementation_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()); @@ -867,7 +988,7 @@ static void lcd_implementation_status_screen() { #endif // ADVANCED_PAUSE_FEATURE - static 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 lcd_implementation_drawmenu_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); @@ -880,7 +1001,7 @@ static void lcd_implementation_status_screen() { for (; n > 0; --n) lcd_put_wchar(' '); } - static void lcd_implementation_drawmenu_generic(const bool sel, const uint8_t row, PGM_P pstr, const char pre_char, const char post_char) { + void lcd_implementation_drawmenu_generic(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 : ' '); @@ -889,7 +1010,7 @@ static void lcd_implementation_status_screen() { lcd_put_wchar(post_char); } - static 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) { + 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); lcd_moveto(0, row); lcd_put_wchar(sel ? pre_char : ' '); @@ -898,7 +1019,7 @@ static void lcd_implementation_status_screen() { while (n--) lcd_put_wchar(' '); lcd_put_u8str(data); } - static 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) { + 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 : ' '); @@ -908,10 +1029,7 @@ static void lcd_implementation_status_screen() { lcd_put_u8str_P(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)) - - void lcd_implementation_drawedit(PGM_P pstr, const char* const value=NULL) { + void lcd_implementation_drawedit(PGM_P pstr, const char* const value/*=NULL*/) { lcd_moveto(1, 1); lcd_put_u8str_P(pstr); if (value != NULL) { @@ -935,6 +1053,7 @@ static void lcd_implementation_status_screen() { 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--;) @@ -960,21 +1079,16 @@ static void lcd_implementation_status_screen() { lcd_put_wchar(post_char); } - static void lcd_implementation_drawmenu_sdfile(const bool sel, const uint8_t row, PGM_P pstr, CardReader &theCard) { + 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, ' '); } - static void lcd_implementation_drawmenu_sddirectory(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) { lcd_implementation_drawmenu_sd(sel, row, pstr, theCard, 2, LCD_STR_FOLDER[0]); } #endif // SDSUPPORT - #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_UPLEVEL_CHAR, LCD_UPLEVEL_CHAR) - #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(LCD_HAS_SLOW_BUTTONS) extern millis_t next_button_update_ms; @@ -1469,4 +1583,4 @@ static void lcd_implementation_status_screen() { #endif // ULTIPANEL -#endif // ULTRALCD_IMPL_HD44780_H +#endif // ULTRA_LCD && !DOGLCD diff --git a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h index 4b860a1f6e..93d57bb792 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h +++ b/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h @@ -19,7 +19,7 @@ * along with this program. If not, see . * */ - +#pragma once // use this file to create the public interface for device drivers that are NOT in the U8G library @@ -36,7 +36,6 @@ class U8GLIB_64128N_2X_HAL : public U8GLIB { } }; - 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 @@ -50,7 +49,6 @@ class U8GLIB_ST7920_128X64_4X_HAL : public U8GLIB { } }; - // 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 @@ -61,7 +59,6 @@ class U8GLIB_ST7920_128X64_RRD : public U8GLIB { } }; - extern u8g_dev_t u8g_dev_sh1106_128x64_2x_i2c_2_wire; class U8GLIB_SH1106_128X64_2X_I2C_2_WIRE : public U8GLIB { public: @@ -70,8 +67,6 @@ class U8GLIB_SH1106_128X64_2X_I2C_2_WIRE : public U8GLIB { { } }; - - extern u8g_dev_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire; class U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE : public U8GLIB { public: diff --git a/Marlin/src/lcd/dogm/dogm_Bootscreen.h b/Marlin/src/lcd/dogm/dogm_Bootscreen.h new file mode 100644 index 0000000000..efb299b359 --- /dev/null +++ b/Marlin/src/lcd/dogm/dogm_Bootscreen.h @@ -0,0 +1,137 @@ +/** + * 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 . + * + */ + +/** + * Standard Marlin Boot Screen bitmaps + * + * Use the Marlin Bitmap Converter to make your own: + * http://marlinfw.org/tools/u8glib/converter.html + */ + +#include + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(SHOW_BOOTSCREEN) + + //#define START_BMPHIGH // Costs 399 bytes more flash + + #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) + + #include "../../../_Bootscreen.h" + + #ifndef CUSTOM_BOOTSCREEN_TIMEOUT + #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 + #endif + + #endif + + #if ENABLED(START_BMPHIGH) + + #define START_BMPWIDTH 112 + + const unsigned char start_bmp[] PROGMEM = { + B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, + B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111, + B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111, + B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00111111,B11111111, + B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00011000,B00000000,B00011111,B11111111, + B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00001111,B11111111, + B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000111,B11111111, + B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000011,B11111111, + B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000001,B11111111, + B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000,B11111111, + B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000011,B11100000,B01111000,B00111100,B00000011,B11110000,B01111111, + B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B01111000,B00111100,B00000111,B11111100,B00111111, + B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B01111000,B00111100,B00001111,B11111110,B00011111, + B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B01111000,B00111100,B00011111,B11111110,B00001111, + B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B01111000,B00111100,B00111111,B00111111,B00000111, + B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B01111000,B00111100,B00111110,B00011111,B00000111, + B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B01111000,B00111100,B00111100,B00001111,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B01111000,B00111100,B00111100,B00001111,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B01111100,B00111100,B00111100,B00001111,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B01111111,B10111100,B00111100,B00001111,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00111111,B10111111,B11111100,B00001111,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00011111,B10111111,B11111100,B00001111,B00000011, + B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00001111,B10111111,B11111100,B00001111,B00000011, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110, + B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100, + B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000, + B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000, + B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000 + }; + + #else + + #define START_BMPWIDTH 56 + + const unsigned char start_bmp[] PROGMEM = { + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, + B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, + B10000011,B11001111,B00000000,B00000000,B00001100,B00110000,B00111111, + B10000111,B11111111,B10000000,B00000000,B00001100,B00110000,B00011111, + B10000110,B01111001,B10000000,B00000000,B00001100,B00000000,B00001111, + B10001100,B00110000,B11000111,B10000011,B10001100,B00110000,B11100111, + B10001100,B00110000,B11001111,B11000111,B11001100,B00110001,B11110011, + B10001100,B00110000,B11011100,B11101100,B11101100,B00110011,B10111001, + B10001100,B00110000,B11011000,B01101100,B01101100,B00110011,B00011001, + B10001100,B00110000,B11010000,B01101100,B00001100,B00110011,B00011001, + B10001100,B00110000,B11011000,B01101100,B00001100,B00110011,B00011001, + B10001100,B00110000,B11011100,B01101100,B00001110,B00111011,B00011001, + B10001100,B00110000,B11001111,B01111100,B00000111,B10011111,B00011001, + B10001100,B00110000,B11000111,B01111100,B00000011,B10001111,B00011001, + B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, + B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, + B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 + }; + + #endif + + #ifndef START_BMP_BYTEWIDTH + #define START_BMP_BYTEWIDTH ((START_BMPWIDTH + 7) / 8) + #endif + #ifndef START_BMPHEIGHT + #define START_BMPHEIGHT (sizeof(start_bmp) / (START_BMP_BYTEWIDTH)) + #endif + + static_assert(sizeof(start_bmp) == (START_BMP_BYTEWIDTH) * (START_BMPHEIGHT), "Bootscreen (start_bmp) dimensions don't match data."); + +#endif + +#ifndef CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH + #define CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH ((CUSTOM_BOOTSCREEN_BMPWIDTH + 7) / 8) +#endif +#ifndef CUSTOM_BOOTSCREEN_BMPHEIGHT + #define CUSTOM_BOOTSCREEN_BMPHEIGHT (sizeof(custom_start_bmp) / (CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH)) +#endif diff --git a/Marlin/src/lcd/dogm/dogm_bitmaps.h b/Marlin/src/lcd/dogm/dogm_Statusscreen.h similarity index 91% rename from Marlin/src/lcd/dogm/dogm_bitmaps.h rename to Marlin/src/lcd/dogm/dogm_Statusscreen.h index c610ce4a36..2618965061 100644 --- a/Marlin/src/lcd/dogm/dogm_bitmaps.h +++ b/Marlin/src/lcd/dogm/dogm_Statusscreen.h @@ -21,7 +21,7 @@ */ /** - * Standard Marlin Boot and Status Screen bitmaps + * Standard Marlin Status Screen bitmaps * * Use the Marlin Bitmap Converter to make your own: * http://marlinfw.org/tools/u8glib/converter.html @@ -31,109 +31,18 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(SHOW_BOOTSCREEN) - - //#define START_BMPHIGH // Costs 399 bytes more flash - - #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - - #include "../../../_Bootscreen.h" - - #ifndef CUSTOM_BOOTSCREEN_TIMEOUT - #define CUSTOM_BOOTSCREEN_TIMEOUT 2500 - #endif - - #endif - - #if ENABLED(START_BMPHIGH) - - #define START_BMPWIDTH 112 - - const unsigned char start_bmp[] PROGMEM = { - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111111,B11111111, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11111111,B11111111, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111111, - B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00111111,B11111111, - B11000000,B00001111,B11000000,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00011000,B00000000,B00011111,B11111111, - B11000000,B00111111,B11100001,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00001111,B11111111, - B11000000,B01111111,B11110011,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000111,B11111111, - B11000000,B11111111,B11111111,B11111111,B11000000,B00000000,B00000000,B00000000,B00000000,B01111000,B00111100,B00000000,B00000011,B11111111, - B11000001,B11111000,B01111111,B10000111,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000001,B11111111, - B11000001,B11110000,B00111111,B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000,B11111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B00011111,B00000000,B00000011,B11100000,B01111000,B00111100,B00000011,B11110000,B01111111, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B11000000,B00001111,B11111000,B01111000,B00111100,B00000111,B11111100,B00111111, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B11100000,B00011111,B11111100,B01111000,B00111100,B00001111,B11111110,B00011111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B11110000,B00111111,B11111110,B01111000,B00111100,B00011111,B11111110,B00001111, - B11000001,B11100000,B00011110,B00000001,B11100011,B11110011,B11111000,B00111111,B00111110,B01111000,B00111100,B00111111,B00111111,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11100000,B11111100,B01111100,B00011111,B01111000,B00111100,B00111110,B00011111,B00000111, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B01111100,B01111100,B00001111,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B01111100,B01111000,B00001111,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B10000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100111,B11000000,B00111100,B01111000,B00000000,B01111000,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11100000,B00111100,B01111000,B00000000,B01111100,B00111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100011,B11111111,B00111111,B11111000,B00000000,B01111111,B10111100,B00111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100001,B11111111,B00111111,B11111000,B00000000,B00111111,B10111111,B11111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B11111111,B00111111,B11111000,B00000000,B00011111,B10111111,B11111100,B00001111,B00000011, - B11000001,B11100000,B00011110,B00000001,B11100000,B01111111,B00111111,B11111000,B00000000,B00001111,B10111111,B11111100,B00001111,B00000011, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, - B01110000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001110, - B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00011100, - B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111000, - B00001111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11110000, - B00000001,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B10000000 - }; - - #else - - #define START_BMPWIDTH 56 - - const unsigned char start_bmp[] PROGMEM = { - B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000001,B11111111, - B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11111111, - B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01111111, - B10000011,B11001111,B00000000,B00000000,B00001100,B00110000,B00111111, - B10000111,B11111111,B10000000,B00000000,B00001100,B00110000,B00011111, - B10000110,B01111001,B10000000,B00000000,B00001100,B00000000,B00001111, - B10001100,B00110000,B11000111,B10000011,B10001100,B00110000,B11100111, - B10001100,B00110000,B11001111,B11000111,B11001100,B00110001,B11110011, - B10001100,B00110000,B11011100,B11101100,B11101100,B00110011,B10111001, - B10001100,B00110000,B11011000,B01101100,B01101100,B00110011,B00011001, - B10001100,B00110000,B11010000,B01101100,B00001100,B00110011,B00011001, - B10001100,B00110000,B11011000,B01101100,B00001100,B00110011,B00011001, - B10001100,B00110000,B11011100,B01101100,B00001110,B00111011,B00011001, - B10001100,B00110000,B11001111,B01111100,B00000111,B10011111,B00011001, - B10001100,B00110000,B11000111,B01111100,B00000011,B10001111,B00011001, - B01000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000010, - B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000110, - B00011111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111000 - }; - - #endif - - #ifndef START_BMP_BYTEWIDTH - #define START_BMP_BYTEWIDTH ((START_BMPWIDTH + 7) / 8) - #endif - #ifndef START_BMPHEIGHT - #define START_BMPHEIGHT (sizeof(start_bmp) / (START_BMP_BYTEWIDTH)) - #endif - - static_assert(sizeof(start_bmp) == (START_BMP_BYTEWIDTH) * (START_BMPHEIGHT), "Bootscreen (start_bmp) dimensions don't match data."); - -#endif - #if ENABLED(CUSTOM_STATUS_SCREEN_IMAGE) - // This file must define STATUS_SCREENWIDTH and status_screen[012]_bmp. - // It can also define STATUS_SCREEN_X, STATUS_SCREEN_{BED,FAN}_TEXT_X and - // STATUS_SCREEN_HOTEND_TEXT_X(i) to modify draw locations. + /** + * 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: + * + * - STATUS_SCREEN_X + * - STATUS_SCREEN_{BED,FAN}_TEXT_X + * - STATUS_SCREEN_HOTEND_TEXT_X(i) + * - FAN_ANIM_FRAMES + */ #include "../../../_Statusscreen.h" #else // !CUSTOM_STATUS_SCREEN_IMAGE @@ -1161,106 +1070,6 @@ #endif // !CUSTOM_STATUS_SCREEN_IMAGE -#if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) || ENABLED(MESH_EDIT_GFX_OVERLAY) - - const unsigned char cw_bmp[] PROGMEM = { - B00000011,B11111000,B00000000, - B00001111,B11111110,B00000000, - B00011110,B00001111,B00000000, - B00111000,B00000111,B00000000, - B00111000,B00000011,B10000000, - B01110000,B00000011,B10000000, - B01110000,B00001111,B11100000, - B01110000,B00000111,B11000000, - B01110000,B00000011,B10000000, - B01110000,B00000001,B00000000, - B01110000,B00000000,B00000000, - B00111000,B00000000,B00000000, - B00111000,B00000111,B00000000, - B00011110,B00001111,B00000000, - B00001111,B11111110,B00000000, - B00000011,B11111000,B00000000 - }; - - const unsigned char ccw_bmp[] PROGMEM = { - B00000000,B11111110,B00000000, - B00000011,B11111111,B10000000, - B00000111,B10000011,B11000000, - B00001110,B00000001,B11000000, - B00001110,B00000000,B11100000, - B00011100,B00000000,B11100000, - B01111111,B00000000,B11100000, - B00111110,B00000000,B11100000, - B00011100,B00000000,B11100000, - B00001000,B00000000,B11100000, - B00000000,B00000000,B11100000, - B00000000,B00000001,B11000000, - B00001110,B00000001,B11000000, - B00001111,B00000111,B10000000, - B00000111,B11111111,B00000000, - B00000001,B11111100,B00000000 - }; - - const unsigned char up_arrow_bmp[] PROGMEM = { - B00000100,B00000000, - B00001110,B00000000, - B00011111,B00000000, - B00111111,B10000000, - B01111111,B11000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000 - }; - - const unsigned char down_arrow_bmp[] PROGMEM = { - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B00001110,B00000000, - B01111111,B11000000, - B00111111,B10000000, - B00011111,B00000000, - B00001110,B00000000, - B00000100,B00000000 - }; - - const unsigned char offset_bedline_bmp[] PROGMEM = { - B11111111,B11111111,B11111111 - }; - - const unsigned char nozzle_bmp[] PROGMEM = { - B01111111,B10000000, - B11111111,B11000000, - B11111111,B11000000, - B11111111,B11000000, - B01111111,B10000000, - B01111111,B10000000, - B11111111,B11000000, - B11111111,B11000000, - B11111111,B11000000, - B00111111,B00000000, - B00011110,B00000000, - B00001100,B00000000 - }; - -#endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY - -#ifndef CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH - #define CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH ((CUSTOM_BOOTSCREEN_BMPWIDTH + 7) / 8) -#endif -#ifndef CUSTOM_BOOTSCREEN_BMPHEIGHT - #define CUSTOM_BOOTSCREEN_BMPHEIGHT (sizeof(custom_start_bmp) / (CUSTOM_BOOTSCREEN_BMP_BYTEWIDTH)) -#endif - #ifndef FAN_ANIM_FRAMES #define FAN_ANIM_FRAMES 2 #elif FAN_ANIM_FRAMES > 3 diff --git a/Marlin/src/lcd/dogm/dogm_font_data_6x9_marlin.h b/Marlin/src/lcd/dogm/fontdata/fontdata_6x9_marlin.h similarity index 100% rename from Marlin/src/lcd/dogm/dogm_font_data_6x9_marlin.h rename to Marlin/src/lcd/dogm/fontdata/fontdata_6x9_marlin.h diff --git a/Marlin/src/lcd/dogm/dogm_font_data_ISO10646_1.h b/Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h similarity index 100% rename from Marlin/src/lcd/dogm/dogm_font_data_ISO10646_1.h rename to Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h diff --git a/Marlin/src/lcd/dogm/language_data_an.h b/Marlin/src/lcd/dogm/fontdata/language_data_an.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_an.h rename to Marlin/src/lcd/dogm/fontdata/language_data_an.h diff --git a/Marlin/src/lcd/dogm/language_data_bg.h b/Marlin/src/lcd/dogm/fontdata/language_data_bg.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_bg.h rename to Marlin/src/lcd/dogm/fontdata/language_data_bg.h diff --git a/Marlin/src/lcd/dogm/language_data_ca.h b/Marlin/src/lcd/dogm/fontdata/language_data_ca.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_ca.h rename to Marlin/src/lcd/dogm/fontdata/language_data_ca.h diff --git a/Marlin/src/lcd/dogm/language_data_cz.h b/Marlin/src/lcd/dogm/fontdata/language_data_cz.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_cz.h rename to Marlin/src/lcd/dogm/fontdata/language_data_cz.h diff --git a/Marlin/src/lcd/dogm/language_data_da.h b/Marlin/src/lcd/dogm/fontdata/language_data_da.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_da.h rename to Marlin/src/lcd/dogm/fontdata/language_data_da.h diff --git a/Marlin/src/lcd/dogm/language_data_de.h b/Marlin/src/lcd/dogm/fontdata/language_data_de.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_de.h rename to Marlin/src/lcd/dogm/fontdata/language_data_de.h diff --git a/Marlin/src/lcd/dogm/language_data_el-gr.h b/Marlin/src/lcd/dogm/fontdata/language_data_el-gr.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_el-gr.h rename to Marlin/src/lcd/dogm/fontdata/language_data_el-gr.h diff --git a/Marlin/src/lcd/dogm/language_data_el.h b/Marlin/src/lcd/dogm/fontdata/language_data_el.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_el.h rename to Marlin/src/lcd/dogm/fontdata/language_data_el.h diff --git a/Marlin/src/lcd/dogm/language_data_en.h b/Marlin/src/lcd/dogm/fontdata/language_data_en.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_en.h rename to Marlin/src/lcd/dogm/fontdata/language_data_en.h diff --git a/Marlin/src/lcd/dogm/language_data_es.h b/Marlin/src/lcd/dogm/fontdata/language_data_es.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_es.h rename to Marlin/src/lcd/dogm/fontdata/language_data_es.h diff --git a/Marlin/src/lcd/dogm/language_data_eu.h b/Marlin/src/lcd/dogm/fontdata/language_data_eu.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_eu.h rename to Marlin/src/lcd/dogm/fontdata/language_data_eu.h diff --git a/Marlin/src/lcd/dogm/language_data_fi.h b/Marlin/src/lcd/dogm/fontdata/language_data_fi.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_fi.h rename to Marlin/src/lcd/dogm/fontdata/language_data_fi.h diff --git a/Marlin/src/lcd/dogm/language_data_fr.h b/Marlin/src/lcd/dogm/fontdata/language_data_fr.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_fr.h rename to Marlin/src/lcd/dogm/fontdata/language_data_fr.h diff --git a/Marlin/src/lcd/dogm/language_data_gl.h b/Marlin/src/lcd/dogm/fontdata/language_data_gl.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_gl.h rename to Marlin/src/lcd/dogm/fontdata/language_data_gl.h diff --git a/Marlin/src/lcd/dogm/language_data_hr.h b/Marlin/src/lcd/dogm/fontdata/language_data_hr.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_hr.h rename to Marlin/src/lcd/dogm/fontdata/language_data_hr.h diff --git a/Marlin/src/lcd/dogm/language_data_it.h b/Marlin/src/lcd/dogm/fontdata/language_data_it.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_it.h rename to Marlin/src/lcd/dogm/fontdata/language_data_it.h diff --git a/Marlin/src/lcd/dogm/language_data_jp-kana.h b/Marlin/src/lcd/dogm/fontdata/language_data_jp-kana.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_jp-kana.h rename to Marlin/src/lcd/dogm/fontdata/language_data_jp-kana.h diff --git a/Marlin/src/lcd/dogm/language_data_ko_KR.h b/Marlin/src/lcd/dogm/fontdata/language_data_ko_KR.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_ko_KR.h rename to Marlin/src/lcd/dogm/fontdata/language_data_ko_KR.h diff --git a/Marlin/src/lcd/dogm/language_data_nl.h b/Marlin/src/lcd/dogm/fontdata/language_data_nl.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_nl.h rename to Marlin/src/lcd/dogm/fontdata/language_data_nl.h diff --git a/Marlin/src/lcd/dogm/language_data_pl.h b/Marlin/src/lcd/dogm/fontdata/language_data_pl.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_pl.h rename to Marlin/src/lcd/dogm/fontdata/language_data_pl.h diff --git a/Marlin/src/lcd/dogm/language_data_pt-br.h b/Marlin/src/lcd/dogm/fontdata/language_data_pt-br.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_pt-br.h rename to Marlin/src/lcd/dogm/fontdata/language_data_pt-br.h diff --git a/Marlin/src/lcd/dogm/language_data_pt.h b/Marlin/src/lcd/dogm/fontdata/language_data_pt.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_pt.h rename to Marlin/src/lcd/dogm/fontdata/language_data_pt.h diff --git a/Marlin/src/lcd/dogm/language_data_ru.h b/Marlin/src/lcd/dogm/fontdata/language_data_ru.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_ru.h rename to Marlin/src/lcd/dogm/fontdata/language_data_ru.h diff --git a/Marlin/src/lcd/dogm/language_data_sk.h b/Marlin/src/lcd/dogm/fontdata/language_data_sk.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_sk.h rename to Marlin/src/lcd/dogm/fontdata/language_data_sk.h diff --git a/Marlin/src/lcd/dogm/language_data_test.h b/Marlin/src/lcd/dogm/fontdata/language_data_test.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_test.h rename to Marlin/src/lcd/dogm/fontdata/language_data_test.h diff --git a/Marlin/src/lcd/dogm/language_data_tr.h b/Marlin/src/lcd/dogm/fontdata/language_data_tr.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_tr.h rename to Marlin/src/lcd/dogm/fontdata/language_data_tr.h diff --git a/Marlin/src/lcd/dogm/language_data_uk.h b/Marlin/src/lcd/dogm/fontdata/language_data_uk.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_uk.h rename to Marlin/src/lcd/dogm/fontdata/language_data_uk.h diff --git a/Marlin/src/lcd/dogm/language_data_zh_CN.h b/Marlin/src/lcd/dogm/fontdata/language_data_zh_CN.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_zh_CN.h rename to Marlin/src/lcd/dogm/fontdata/language_data_zh_CN.h diff --git a/Marlin/src/lcd/dogm/language_data_zh_TW.h b/Marlin/src/lcd/dogm/fontdata/language_data_zh_TW.h similarity index 100% rename from Marlin/src/lcd/dogm/language_data_zh_TW.h rename to Marlin/src/lcd/dogm/fontdata/language_data_zh_TW.h diff --git a/Marlin/src/lcd/lcdprint_u8g.cpp b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp similarity index 91% rename from Marlin/src/lcd/lcdprint_u8g.cpp rename to Marlin/src/lcd/dogm/lcdprint_u8g.cpp index 3c827c6963..b19f32c54a 100644 --- a/Marlin/src/lcd/lcdprint_u8g.cpp +++ b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp @@ -7,7 +7,7 @@ * @copyright GPL/BSD */ -#include "../inc/MarlinConfigPre.h" +#include "../../inc/MarlinConfigPre.h" #if ENABLED(DOGLCD) @@ -16,12 +16,12 @@ extern U8GLIB *pu8g; #define _lcd_write(a) pu8g->print(a) #define _lcd_setcursor(col, row) pu8g->setPrintPos((col), (row)); -#include "ultralcd.h" -#include "../Marlin.h" +#include "../ultralcd.h" +#include "../../Marlin.h" -#include "fontutils.h" +#include "../fontutils.h" #include "u8g_fontutf8.h" -#include "lcdprint.h" +#include "../lcdprint.h" int lcd_glyph_height(void) { return u8g_GetFontBBXHeight(pu8g->getU8g()); diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.h b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp similarity index 88% rename from Marlin/src/lcd/dogm/status_screen_DOGM.h rename to Marlin/src/lcd/dogm/status_screen_DOGM.cpp index c80c2da4be..65408c6ab8 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.h +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -20,14 +20,28 @@ * */ -/** - * status_screen_DOGM.h - * - * Standard Status Screen for Graphical Display - */ +// +// status_screen_DOGM.cpp +// Standard Status Screen for Graphical Display +// -#ifndef _STATUS_SCREEN_DOGM_H_ -#define _STATUS_SCREEN_DOGM_H_ +#include "../../inc/MarlinConfigPre.h" + +#if HAS_GRAPHICAL_LCD && DISABLED(LIGHTWEIGHT_UI) + +#include "dogm_Statusscreen.h" +#include "../ultralcd.h" +#include "../lcdprint.h" +#include "../../module/motion.h" +#include "../../module/temperature.h" + +#if ENABLED(SDSUPPORT) + #include "../../sd/cardreader.h" +#endif + +#if HAS_PRINT_PROGRESS + #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); @@ -121,7 +135,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const } } -inline void lcd_implementation_status_message(const bool blink) { +FORCE_INLINE void lcd_implementation_status_message(const bool blink) { #if ENABLED(STATUS_MESSAGE_SCROLLING) static bool last_blink = false; @@ -198,10 +212,33 @@ inline void lcd_implementation_status_message(const bool blink) { #endif } -static void lcd_implementation_status_screen() { +// The current graphical page being rendered +u8g_page_t &page = ((u8g_pb_t *)((u8g.getU8g())->dev->dev_mem))->p; + +void lcd_impl_status_screen_0() { const bool blink = lcd_blink(); + // Status Menu Font + lcd_setFont(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; @@ -211,29 +248,7 @@ static void lcd_implementation_status_screen() { } #endif - // Status Menu Font - lcd_setFont(FONT_STATUSMENU); - - // - // Fan Animation - // - // Draws the whole heading image as a B/W bitmap rather than - // drawing the elements separately. - // This was done as an optimization, as it was slower to draw - // multiple parts compared to 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 (PAGE_UNDER(STATUS_SCREENHEIGHT + 1)) { - + if (PAGE_UNDER(STATUS_SCREENHEIGHT + 1)) u8g.drawBitmapP( STATUS_SCREEN_X, STATUS_SCREEN_Y, (STATUS_SCREENWIDTH + 7) / 8, STATUS_SCREENHEIGHT, @@ -251,8 +266,6 @@ static void lcd_implementation_status_screen() { status_screen0_bmp ); - } - // // Temperature Graphics and Info // @@ -283,29 +296,29 @@ static void lcd_implementation_status_screen() { // // SD Card Symbol // - if (card.isFileOpen() && PAGE_CONTAINS(42 - (TALL_FONT_CORRECTION), 51 - (TALL_FONT_CORRECTION))) { + if (card.isFileOpen() && PAGE_CONTAINS(42, 51)) { // Upper box - u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7); // 42-48 (or 41-47) + u8g.drawBox(42, 42, 8, 7); // 42-48 (or 41-47) // Right edge - u8g.drawBox(50, 44 - (TALL_FONT_CORRECTION), 2, 5); // 44-48 (or 43-47) + u8g.drawBox(50, 44, 2, 5); // 44-48 (or 43-47) // Bottom hollow box - u8g.drawFrame(42, 49 - (TALL_FONT_CORRECTION), 10, 4); // 49-52 (or 48-51) + u8g.drawFrame(42, 49, 10, 4); // 49-52 (or 48-51) // Corner pixel - u8g.drawPixel(50, 43 - (TALL_FONT_CORRECTION)); // 43 (or 42) + u8g.drawPixel(50, 43); // 43 (or 42) } #endif // SDSUPPORT - #if ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY) + #if HAS_PRINT_PROGRESS // // Progress bar frame // #define PROGRESS_BAR_X 54 #define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X) - if (PAGE_CONTAINS(49, 52 - (TALL_FONT_CORRECTION))) // 49-52 (or 49-51) + if (PAGE_CONTAINS(49, 52)) // 49-52 (or 49-51) u8g.drawFrame( PROGRESS_BAR_X, 49, - PROGRESS_BAR_WIDTH, 4 - (TALL_FONT_CORRECTION) + PROGRESS_BAR_WIDTH, 4 ); #if DISABLED(LCD_SET_PROGRESS_MANUALLY) @@ -318,10 +331,10 @@ static void lcd_implementation_status_screen() { // Progress bar solid part // - if (PAGE_CONTAINS(50, 51 - (TALL_FONT_CORRECTION))) // 50-51 (or just 50) + 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 - (TALL_FONT_CORRECTION) + (uint16_t)((PROGRESS_BAR_WIDTH - 2) * progress_bar_percent * 0.01), 2 ); // @@ -357,7 +370,7 @@ static void lcd_implementation_status_screen() { lcd_put_u8str(buffer); } - #endif // SDSUPPORT || LCD_SET_PROGRESS_MANUALLY + #endif // HAS_PRINT_PROGRESS // // XYZ Coordinates @@ -377,7 +390,7 @@ static void lcd_implementation_status_screen() { #define XYZ_FRAME_HEIGHT INFO_FONT_HEIGHT + 1 #endif - static char xstring[5], ystring[5], zstring[7]; + static char xstring[5], ystring[5], zstring[8]; #if ENABLED(FILAMENT_LCD_DISPLAY) static char wstring[5], mstring[4]; #endif @@ -492,4 +505,4 @@ static void lcd_implementation_status_screen() { } } -#endif // _STATUS_SCREEN_DOGM_H_ +#endif // HAS_GRAPHICAL_LCD && !LIGHTWEIGHT_UI diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp similarity index 97% rename from Marlin/src/lcd/dogm/status_screen_lite_ST7920.h rename to Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index 08133d2786..73851ecefb 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.h +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -36,9 +36,28 @@ * bar, so updates are sporadic. */ +// +// status_screen_lite_ST7920.cpp +// Lightweight Status Screen for Graphical Display +// + +#include "../../inc/MarlinConfigPre.h" + +#if ENABLED(LIGHTWEIGHT_UI) + #include "status_screen_lite_ST7920_class.h" +#include "../ultralcd.h" +#include "../fontutils.h" +#include "../lcdprint.h" #include "../../libs/duration_t.h" +#include "../../module/motion.h" +#include "../../module/printcounter.h" +#include "../../module/temperature.h" + +#if ENABLED(SDSUPPORT) + #include "../../sd/cardreader.h" +#endif #define BUFFER_WIDTH 256 #define BUFFER_HEIGHT 32 @@ -880,12 +899,12 @@ 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 + 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(); + if (IS_SD_PRINTING()) progress_bar_percent = card.percentDone(); #endif // Since the progress bar involves writing @@ -947,7 +966,7 @@ void ST7920_Lite_Status_Screen::clear_text_buffer() { ncs(); } -static void lcd_implementation_status_screen() { +void lcd_impl_status_screen_0() { ST7920_Lite_Status_Screen::update(false); } @@ -963,7 +982,7 @@ static void lcd_implementation_status_screen() { * entered the Status Screen and calls the on_entry() * and on_exit() methods for cleanup. */ -static void lcd_in_status(const bool inStatus) { +void lcd_in_status(const bool inStatus) { static bool lastInStatus = false; if (lastInStatus == inStatus) return; if ((lastInStatus = inStatus)) @@ -971,3 +990,5 @@ static void lcd_in_status(const bool inStatus) { else ST7920_Lite_Status_Screen::on_exit(); } + +#endif // LIGHTWEIGHT_UI diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920_class.h b/Marlin/src/lcd/dogm/status_screen_lite_ST7920_class.h index 3bbbd31d6a..323d951c36 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920_class.h +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920_class.h @@ -13,9 +13,7 @@ * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. * */ - -#ifndef STATUS_SCREEN_LITE_ST7920_CLASS_H -#define STATUS_SCREEN_LITE_ST7920_CLASS_H +#pragma once #include "../../core/macros.h" #include "../../libs/duration_t.h" @@ -107,5 +105,3 @@ class ST7920_Lite_Status_Screen { static void on_exit(); static void clear_text_buffer(); }; - -#endif // STATUS_SCREEN_LITE_ST7920_CLASS_H diff --git a/Marlin/src/lcd/u8g_fontutf8.cpp b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp similarity index 99% rename from Marlin/src/lcd/u8g_fontutf8.cpp rename to Marlin/src/lcd/dogm/u8g_fontutf8.cpp index f3944be2a1..1f5f5de506 100644 --- a/Marlin/src/lcd/u8g_fontutf8.cpp +++ b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp @@ -7,12 +7,12 @@ * @copyright GPL/BSD */ -#include "../inc/MarlinConfigPre.h" +#include "../../inc/MarlinConfigPre.h" #if ENABLED(DOGLCD) #include -#include "fontutils.h" +#include "../fontutils.h" #include "u8g_fontutf8.h" //////////////////////////////////////////////////////////// diff --git a/Marlin/src/lcd/u8g_fontutf8.h b/Marlin/src/lcd/dogm/u8g_fontutf8.h similarity index 58% rename from Marlin/src/lcd/u8g_fontutf8.h rename to Marlin/src/lcd/dogm/u8g_fontutf8.h index 883b24ca6b..34e365cf95 100644 --- a/Marlin/src/lcd/u8g_fontutf8.h +++ b/Marlin/src/lcd/dogm/u8g_fontutf8.h @@ -6,11 +6,10 @@ * @date 2015-02-19 * @copyright GPL/BSD */ -#ifndef _UXG_FONTUTF8_H -#define _UXG_FONTUTF8_H 1 +#pragma once #include -#include "fontutils.h" +#include "../fontutils.h" // the macro to indicate a UTF-8 string // You should to save the C/C++ source in UTF-8 encoding! @@ -25,16 +24,14 @@ typedef struct _uxg_fontinfo_t { const u8g_fntpgm_uint8_t *fntdata; } uxg_fontinfo_t; -int uxg_SetUtf8Fonts (const uxg_fontinfo_t * fntinfo, int number); // fntinfo is type of PROGMEM +int uxg_SetUtf8Fonts(const uxg_fontinfo_t * fntinfo, int number); // fntinfo is type of PROGMEM -unsigned int uxg_DrawWchar (u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t ch, pixel_len_t max_length); +unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t ch, pixel_len_t max_length); -unsigned int uxg_DrawUtf8Str (u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, pixel_len_t max_length); -unsigned int uxg_DrawUtf8StrP (u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, pixel_len_t max_length); +unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, pixel_len_t max_length); +unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, pixel_len_t max_length); int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char *utf8_msg); int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P utf8_msg); #define uxg_GetFont(puxg) ((puxg)->font) - -#endif // _UXG_FONTUTF8_H diff --git a/Marlin/src/lcd/ultralcd_impl_DOGM.h b/Marlin/src/lcd/dogm/ultralcd_impl_DOGM.cpp similarity index 59% rename from Marlin/src/lcd/ultralcd_impl_DOGM.h rename to Marlin/src/lcd/dogm/ultralcd_impl_DOGM.cpp index 973283da0b..c6547c4655 100644 --- a/Marlin/src/lcd/ultralcd_impl_DOGM.h +++ b/Marlin/src/lcd/dogm/ultralcd_impl_DOGM.cpp @@ -21,9 +21,11 @@ */ /** - * ultralcd_impl_DOGM.h + * ultralcd_impl_DOGM.cpp + * + * Implementation of the LCD display routines for a DOGM128 graphic display. + * by STB for ErikZalm/Marlin. Common LCD 128x64 pixel graphic displays. * - * Graphics LCD implementation for 128x64 pixel LCDs by STB for ErikZalm/Marlin * Demonstrator: http://www.reprap.org/wiki/STB_Electronics * License: http://opensource.org/licenses/BSD-3-Clause * @@ -33,191 +35,69 @@ * License: http://opensource.org/licenses/BSD-3-Clause */ -#ifndef ULTRALCD_IMPL_DOGM_H -#define ULTRALCD_IMPL_DOGM_H +#include "../../inc/MarlinConfigPre.h" -#include "../inc/MarlinConfig.h" +#if HAS_GRAPHICAL_LCD -/** - * Implementation of the LCD display routines for a DOGM128 graphic display. - * These are common LCD 128x64 pixel graphic displays. - */ -#include "ultralcd.h" - -/* -#if ENABLED(U8GLIB_ST7565_64128N) - #include "dogm/ultralcd_st7565_u8glib_VIKI.h" -#elif ENABLED(U8GLIB_ST7920) - #include "dogm/ultralcd_st7920_u8glib_rrd.h" -#endif -*/ - -#include "dogm/dogm_bitmaps.h" - -#if ENABLED(SDSUPPORT) - #include "../libs/duration_t.h" -#endif +#include "../ultralcd.h" #include - -#include "fontutils.h" +#include "HAL_LCD_class_defines.h" #include "u8g_fontutf8.h" +#include "../lcdprint.h" +#include "../fontutils.h" +#include "dogm_Bootscreen.h" -#include "dogm/HAL_LCD_class_defines.h" +#include "../../sd/cardreader.h" +#include "../../module/temperature.h" +#include "../../module/printcounter.h" + +#if ENABLED(SDSUPPORT) + #include "../../libs/duration_t.h" +#endif #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "../feature/bedlevel/ubl/ubl.h" -#endif - -// Only Western languages support big / small fonts -#if DISABLED(DISPLAY_CHARSET_ISO10646_1) - #undef USE_BIG_EDIT_FONT - #undef USE_SMALL_INFOFONT + #include "../../feature/bedlevel/ubl/ubl.h" #endif +#define FONT_SPECIAL_NAME ISO10646_1_5x7 +#define FONT_MENU_NAME ISO10646_1_5x7 +#include "fontdata/fontdata_ISO10646_1.h" #if ENABLED(USE_SMALL_INFOFONT) - #include "dogm/dogm_font_data_6x9_marlin.h" + #include "fontdata/fontdata_6x9_marlin.h" #define FONT_STATUSMENU_NAME u8g_font_6x9 - #define INFO_FONT_HEIGHT 7 #else #define FONT_STATUSMENU_NAME FONT_MENU_NAME - #define INFO_FONT_HEIGHT 8 #endif -// The Marlin special symbols is now in the dogm_font_data_ISO10646_1.h -#define FONT_SPECIAL_NAME ISO10646_1_5x7 +#define START_COL 0 + +U8G_CLASS u8g(U8G_PARAM); +U8GLIB *pu8g = &u8g; #include LANGUAGE_DATA_INCL(LCD_LANGUAGE) -#include "dogm/dogm_font_data_ISO10646_1.h" -#define FONT_MENU_NAME ISO10646_1_5x7 +#if HAS_LCD_CONTRAST -//#define FONT_STATUSMENU_NAME FONT_MENU_NAME + int16_t lcd_contrast; // Initialized by settings.load() -#define FONT_STATUSMENU 1 -#define FONT_SPECIAL 2 -#define FONT_MENU_EDIT 3 -#define FONT_MENU 4 + void set_lcd_contrast(const int16_t value) { + lcd_contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); + u8g.setContrast(lcd_contrast); + } -// DOGM parameters (size in pixels) -#define DOG_CHAR_WIDTH 6 -#define DOG_CHAR_HEIGHT 12 -#if ENABLED(USE_BIG_EDIT_FONT) - #define FONT_MENU_EDIT_NAME u8g_font_9x18 - #define DOG_CHAR_WIDTH_EDIT 9 - #define DOG_CHAR_HEIGHT_EDIT 18 -#else - #define FONT_MENU_EDIT_NAME FONT_MENU_NAME - #define DOG_CHAR_WIDTH_EDIT DOG_CHAR_WIDTH - #define DOG_CHAR_HEIGHT_EDIT DOG_CHAR_HEIGHT #endif -#ifndef TALL_FONT_CORRECTION - #define TALL_FONT_CORRECTION 0 -#endif - -#define START_COL 0 - -// LCD selection -#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN) - U8GLIB_ST7920_128X64_4X u8g(LCD_PINS_RS); // 2 stripes, HW SPI (shared with SD card) - #else - U8GLIB_ST7920_128X64_4X u8g(LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS); // Original u8glib device. 2 stripes, SW SPI - #endif - -#elif ENABLED(U8GLIB_ST7920) - // RepRap Discount Full Graphics Smart Controller - #if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN) && (LCD_PINS_ENABLE == MOSI_PIN) - U8GLIB_ST7920_128X64_4X_HAL u8g(LCD_PINS_RS); // 2 stripes, HW SPI (shared with SD card, on AVR does not use standard LCD adapter) - #else - //U8GLIB_ST7920_128X64_4X u8g(LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS); // Original u8glib device. 2 stripes, SW SPI - U8GLIB_ST7920_128X64_RRD u8g(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 - //U8GLIB_DOGM128_2X u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 4 stripes - U8GLIB_DOGM128_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes - -#elif ENABLED(U8GLIB_LM6059_AF) - // Based on the Adafruit ST7565 (http://www.adafruit.com/products/250) - //U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0); // 8 stripes - U8GLIB_LM6059_2X u8g(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 - U8GLIB_64128N_2X_HAL u8g(DOGLCD_CS, DOGLCD_A0); // using HW-SPI - #else - U8GLIB_64128N_2X_HAL u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // using SW-SPI - #endif - -#elif ENABLED(MKS_12864OLED_SSD1306) - // MKS 128x64 (SSD1306) OLED I2C LCD - U8GLIB_SSD1306_128X64 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 8 stripes - //U8GLIB_SSD1306_128X64_2X u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 4 stripes - -#elif ENABLED(U8GLIB_SSD1306) - // Generic support for SSD1306 OLED I2C LCDs - //U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 4 stripes - U8GLIB_SSD1306_128X64_2X u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 4 stripes - -#elif ENABLED(MKS_12864OLED) - // MKS 128x64 (SH1106) OLED I2C LCD - U8GLIB_SH1106_128X64 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 8 stripes - //U8GLIB_SH1106_128X64_2X u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 4 stripes -#elif ENABLED(U8GLIB_SH1106) - // Generic support for SH1106 OLED I2C LCDs - //U8GLIB_SH1106_128X64_2X_I2C_2_WIRE u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 4 stripes - U8GLIB_SH1106_128X64_2X u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 4 stripes -#elif ENABLED(U8GLIB_SSD1309) - // Generic support for SSD1309 OLED I2C LCDs - U8GLIB_SSD1309_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); -#elif ENABLED(MINIPANEL) - // The MINIPanel display - //U8GLIB_MINI12864 u8g(DOGLCD_CS, DOGLCD_A0); // 8 stripes - U8GLIB_MINI12864_2X u8g(DOGLCD_CS, DOGLCD_A0); // 4 stripes -#elif ENABLED(U8GLIB_SH1106_EINSTART) - // Connected via motherboard header - U8GLIB_SH1106_128X64 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, LCD_PINS_DC, LCD_PINS_RS); -#else - // for regular DOGM128 display with HW-SPI - //U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 // 8 stripes - U8GLIB_DOGM128_2X u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0 // 4 stripes -#endif - -U8GLIB *pu8g = &u8g; - -#ifndef LCD_PIXEL_WIDTH - #define LCD_PIXEL_WIDTH 128 -#endif -#ifndef LCD_PIXEL_HEIGHT - #define LCD_PIXEL_HEIGHT 64 -#endif - -#include "lcdprint.h" - -int16_t lcd_contrast; // Initialized by settings.load() -static char currentfont = 0; - -// The current graphical page being rendered -u8g_page_t &page = ((u8g_pb_t *)((u8g.getU8g())->dev->dev_mem))->p; - -// 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)) - -static void lcd_setFont(const char font_nr) { - switch (font_nr) { - case FONT_STATUSMENU : {u8g.setFont(FONT_STATUSMENU_NAME); currentfont = FONT_STATUSMENU;}; break; - default: - case FONT_MENU : {u8g.setFont(FONT_MENU_NAME); currentfont = FONT_MENU;}; break; - case FONT_SPECIAL : {u8g.setFont(FONT_SPECIAL_NAME); currentfont = FONT_SPECIAL;}; break; - case FONT_MENU_EDIT : {u8g.setFont(FONT_MENU_EDIT_NAME); currentfont = FONT_MENU_EDIT;}; break; +void lcd_setFont(const MarlinFont font_nr) { + static char currentfont = 0; + if (font_nr != currentfont) { + switch ((currentfont = font_nr)) { + case FONT_STATUSMENU : u8g.setFont(FONT_STATUSMENU_NAME); break; + default: + case FONT_MENU : u8g.setFont(FONT_MENU_NAME); break; + case FONT_SPECIAL : u8g.setFont(FONT_SPECIAL_NAME); break; + case FONT_MENU_EDIT : u8g.setFont(FONT_MENU_EDIT_NAME); break; + } } } @@ -225,7 +105,7 @@ static void lcd_setFont(const char font_nr) { #if ENABLED(SHOW_CUSTOM_BOOTSCREEN) - void lcd_custom_bootscreen() { + FORCE_INLINE void draw_custom_bootscreen(const u8g_pgm_uint8_t * const bmp, const bool erase=true) { constexpr u8g_uint_t left = (LCD_PIXEL_WIDTH - (CUSTOM_BOOTSCREEN_BMPWIDTH)) / 2, top = (LCD_PIXEL_HEIGHT - (CUSTOM_BOOTSCREEN_BMPHEIGHT)) / 2; #if ENABLED(CUSTOM_BOOTSCREEN_INVERTED) @@ -236,16 +116,31 @@ static void lcd_setFont(const char font_nr) { do { u8g.drawBitmapP( left, top, - CEILING(CUSTOM_BOOTSCREEN_BMPWIDTH, 8), CUSTOM_BOOTSCREEN_BMPHEIGHT, custom_start_bmp + CEILING(CUSTOM_BOOTSCREEN_BMPWIDTH, 8), CUSTOM_BOOTSCREEN_BMPHEIGHT, bmp ); #if ENABLED(CUSTOM_BOOTSCREEN_INVERTED) - u8g.setColorIndex(1); - if (top) u8g.drawBox(0, 0, LCD_PIXEL_WIDTH, top); - if (left) u8g.drawBox(0, top, left, CUSTOM_BOOTSCREEN_BMPHEIGHT); - if (right < LCD_PIXEL_WIDTH) u8g.drawBox(right, top, LCD_PIXEL_WIDTH - right, CUSTOM_BOOTSCREEN_BMPHEIGHT); - if (bottom < LCD_PIXEL_HEIGHT) u8g.drawBox(0, bottom, LCD_PIXEL_WIDTH, LCD_PIXEL_HEIGHT - bottom); + if (erase) { + u8g.setColorIndex(1); + if (top) u8g.drawBox(0, 0, LCD_PIXEL_WIDTH, top); + if (left) u8g.drawBox(0, top, left, CUSTOM_BOOTSCREEN_BMPHEIGHT); + if (right < LCD_PIXEL_WIDTH) u8g.drawBox(right, top, LCD_PIXEL_WIDTH - right, CUSTOM_BOOTSCREEN_BMPHEIGHT); + if (bottom < LCD_PIXEL_HEIGHT) u8g.drawBox(0, bottom, LCD_PIXEL_WIDTH, LCD_PIXEL_HEIGHT - bottom); + } + #else + UNUSED(erase); #endif } while (u8g.nextPage()); + } + + void lcd_custom_bootscreen() { + #if ENABLED(ANIMATED_BOOTSCREEN) + LOOP_L_N(f, COUNT(custom_bootscreen_animation)) { + if (f) safe_delay(CUSTOM_BOOTSCREEN_FRAME_TIME); + draw_custom_bootscreen((u8g_pgm_uint8_t*)pgm_read_ptr(&custom_bootscreen_animation[f]), f == 0); + } + #else + draw_custom_bootscreen(custom_start_bmp); + #endif safe_delay(CUSTOM_BOOTSCREEN_TIMEOUT); } @@ -287,13 +182,11 @@ static void lcd_setFont(const char font_nr) { #endif // SHOW_BOOTSCREEN #if ENABLED(LIGHTWEIGHT_UI) - #include "dogm/status_screen_lite_ST7920.h" -#else - #include "dogm/status_screen_DOGM.h" + #include "status_screen_lite_ST7920_class.h" #endif // Initialize or re-initialize the LCD -static void lcd_implementation_init() { +void lcd_implementation_init() { #if PIN_EXISTS(LCD_BACKLIGHT) // Enable LCD backlight OUT_WRITE(LCD_BACKLIGHT_PIN, HIGH); @@ -317,8 +210,8 @@ static void lcd_implementation_init() { u8g.begin(); #endif - #if DISABLED(MINIPANEL) // setContrast not working for Mini Panel - u8g.setContrast(lcd_contrast); + #if HAS_LCD_CONTRAST + set_lcd_contrast(lcd_contrast); #endif #if ENABLED(LCD_SCREEN_ROT_90) @@ -329,7 +222,7 @@ static void lcd_implementation_init() { u8g.setRot270(); // Rotate screen by 270° #endif - uxg_SetUtf8Fonts (g_fontinfo, NUM_ARRAY(g_fontinfo)); + uxg_SetUtf8Fonts(g_fontinfo, NUM_ARRAY(g_fontinfo)); } // The kill screen is displayed for unrecoverable conditions @@ -355,13 +248,12 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop #if ENABLED(ULTIPANEL) uint8_t row_y1, row_y2; - uint8_t constexpr row_height = DOG_CHAR_HEIGHT + 2 * (TALL_FONT_CORRECTION); #if ENABLED(ADVANCED_PAUSE_FEATURE) - static void lcd_implementation_hotend_status(const uint8_t row, const uint8_t extruder=active_extruder) { - row_y1 = row * row_height + 1; - row_y2 = row_y1 + row_height - 1; + void lcd_implementation_hotend_status(const uint8_t row, const uint8_t extruder) { + row_y1 = row * (DOG_CHAR_HEIGHT) + 1; + row_y2 = row_y1 + DOG_CHAR_HEIGHT - 1; if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return; @@ -379,9 +271,9 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop #endif // ADVANCED_PAUSE_FEATURE // Set the colors for a menu item based on whether it is selected - static bool lcd_implementation_mark_as_selected(const uint8_t row, const bool isSelected) { - row_y1 = row * row_height + 1; - row_y2 = row_y1 + row_height - 1; + static bool mark_as_selected(const uint8_t row, const bool isSelected) { + row_y1 = row * (DOG_CHAR_HEIGHT) + 1; + row_y2 = row_y1 + DOG_CHAR_HEIGHT - 1; if (!PAGE_CONTAINS(row_y1 + 1, row_y2 + 2)) return false; @@ -391,7 +283,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop u8g.drawHLine(0, row_y2 + 2, LCD_PIXEL_WIDTH); #else u8g.setColorIndex(1); // black on white - u8g.drawBox(0, row_y1 + 2, LCD_PIXEL_WIDTH, row_height - 1); + u8g.drawBox(0, row_y1 + 2, LCD_PIXEL_WIDTH, DOG_CHAR_HEIGHT - 1); u8g.setColorIndex(0); // white on black #endif } @@ -408,9 +300,9 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop } // Draw a static line of text in the same idiom as a menu item - static 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 lcd_implementation_drawmenu_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char* valstr/*=NULL*/) { - if (lcd_implementation_mark_as_selected(row, invert)) { + if (mark_as_selected(row, invert)) { uint8_t n = LCD_PIXEL_WIDTH - (DOG_CHAR_WIDTH) * (START_COL); // pixel width of string allowed @@ -428,10 +320,10 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop } // Draw a generic menu item - static void lcd_implementation_drawmenu_generic(const bool isSelected, const uint8_t row, PGM_P pstr, const char pre_char, const char post_char) { + void lcd_implementation_drawmenu_generic(const bool isSelected, const uint8_t row, PGM_P pstr, const char pre_char, const char post_char) { UNUSED(pre_char); - if (lcd_implementation_mark_as_selected(row, isSelected)) { + if (mark_as_selected(row, isSelected)) { uint8_t n = LCD_WIDTH - (START_COL) - 2; n *= DOG_CHAR_WIDTH; n -= lcd_put_u8str_max_P(pstr, n); @@ -442,15 +334,9 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop } } - // Macros for specific types of menu items - #define lcd_implementation_drawmenu_back(sel, row, pstr, dummy) lcd_implementation_drawmenu_generic(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]) - #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, '>', ' ') - // Draw a menu item with an editable value - static void _drawmenu_setting_edit_generic(const bool isSelected, const uint8_t row, PGM_P pstr, const char* const data, const bool pgm) { - if (lcd_implementation_mark_as_selected(row, isSelected)) { + 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)) { const uint8_t vallen = (pgm ? utf8_strlen_P(data) : utf8_strlen((char*)data)); uint8_t n = LCD_WIDTH - (START_COL) - 2 - vallen; n *= DOG_CHAR_WIDTH; @@ -462,14 +348,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop } } - // Macros for edit items - #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)) - - void lcd_implementation_drawedit(PGM_P const pstr, const char* const value=NULL) { + void lcd_implementation_drawedit(PGM_P const pstr, const char* const value/*=NULL*/) { const uint8_t labellen = utf8_strlen_P(pstr), vallen = utf8_strlen(value); @@ -521,10 +400,10 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop #if ENABLED(SDSUPPORT) - static void _drawmenu_sd(const bool isSelected, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir) { + void _drawmenu_sd(const bool isSelected, const uint8_t row, PGM_P const pstr, CardReader &theCard, const bool isDir) { UNUSED(pstr); - lcd_implementation_mark_as_selected(row, isSelected); + mark_as_selected(row, isSelected); if (!PAGE_CONTAINS(row_y1, row_y2)) return; @@ -532,6 +411,7 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop 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--;) @@ -557,9 +437,6 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop while (n - DOG_CHAR_WIDTH > 0) { n -= lcd_put_wchar(' '); } } - #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 // SDSUPPORT #if ENABLED(AUTO_BED_LEVELING_UBL) @@ -651,6 +528,133 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop #endif // AUTO_BED_LEVELING_UBL + #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) || ENABLED(MESH_EDIT_GFX_OVERLAY) + + const unsigned char cw_bmp[] PROGMEM = { + B00000011,B11111000,B00000000, + B00001111,B11111110,B00000000, + B00011110,B00001111,B00000000, + B00111000,B00000111,B00000000, + B00111000,B00000011,B10000000, + B01110000,B00000011,B10000000, + B01110000,B00001111,B11100000, + B01110000,B00000111,B11000000, + B01110000,B00000011,B10000000, + B01110000,B00000001,B00000000, + B01110000,B00000000,B00000000, + B00111000,B00000000,B00000000, + B00111000,B00000111,B00000000, + B00011110,B00001111,B00000000, + B00001111,B11111110,B00000000, + B00000011,B11111000,B00000000 + }; + + const unsigned char ccw_bmp[] PROGMEM = { + B00000000,B11111110,B00000000, + B00000011,B11111111,B10000000, + B00000111,B10000011,B11000000, + B00001110,B00000001,B11000000, + B00001110,B00000000,B11100000, + B00011100,B00000000,B11100000, + B01111111,B00000000,B11100000, + B00111110,B00000000,B11100000, + B00011100,B00000000,B11100000, + B00001000,B00000000,B11100000, + B00000000,B00000000,B11100000, + B00000000,B00000001,B11000000, + B00001110,B00000001,B11000000, + B00001111,B00000111,B10000000, + B00000111,B11111111,B00000000, + B00000001,B11111100,B00000000 + }; + + const unsigned char up_arrow_bmp[] PROGMEM = { + B00000100,B00000000, + B00001110,B00000000, + B00011111,B00000000, + B00111111,B10000000, + B01111111,B11000000, + B00001110,B00000000, + B00001110,B00000000, + B00001110,B00000000, + B00001110,B00000000, + B00001110,B00000000, + B00001110,B00000000, + B00001110,B00000000, + B00001110,B00000000 + }; + + const unsigned char down_arrow_bmp[] PROGMEM = { + B00001110,B00000000, + B00001110,B00000000, + B00001110,B00000000, + B00001110,B00000000, + B00001110,B00000000, + B00001110,B00000000, + B00001110,B00000000, + B00001110,B00000000, + B01111111,B11000000, + B00111111,B10000000, + B00011111,B00000000, + B00001110,B00000000, + B00000100,B00000000 + }; + + const unsigned char offset_bedline_bmp[] PROGMEM = { + B11111111,B11111111,B11111111 + }; + + const unsigned char nozzle_bmp[] PROGMEM = { + B01111111,B10000000, + B11111111,B11000000, + B11111111,B11000000, + B11111111,B11000000, + B01111111,B10000000, + B01111111,B10000000, + B11111111,B11000000, + B11111111,B11000000, + B11111111,B11000000, + B00111111,B00000000, + B00011110,B00000000, + B00001100,B00000000 + }; + + void _lcd_zoffset_overlay_gfx(const float zvalue) { + // Determine whether the user is raising or lowering the nozzle. + static int8_t dir; + static float old_zvalue; + if (zvalue != old_zvalue) { + dir = zvalue ? zvalue < old_zvalue ? -1 : 1 : 0; + old_zvalue = zvalue; + } + + #if ENABLED(OVERLAY_GFX_REVERSE) + const unsigned char *rot_up = ccw_bmp, *rot_down = cw_bmp; + #else + const unsigned char *rot_up = cw_bmp, *rot_down = ccw_bmp; + #endif + + #if ENABLED(USE_BIG_EDIT_FONT) + const int left = 0, right = 45, nozzle = 95; + #else + const int left = 5, right = 90, nozzle = 60; + #endif + + // Draw a representation of the nozzle + if (PAGE_CONTAINS(3, 16)) u8g.drawBitmapP(nozzle + 6, 4 - dir, 2, 12, nozzle_bmp); + if (PAGE_CONTAINS(20, 20)) u8g.drawBitmapP(nozzle + 0, 20, 3, 1, offset_bedline_bmp); + + // Draw cw/ccw indicator and up/down arrows. + if (PAGE_CONTAINS(47, 62)) { + u8g.drawBitmapP(left + 0, 47, 3, 16, rot_down); + u8g.drawBitmapP(right + 0, 47, 3, 16, rot_up); + u8g.drawBitmapP(right + 20, 48 - dir, 2, 13, up_arrow_bmp); + u8g.drawBitmapP(left + 20, 49 - dir, 2, 13, down_arrow_bmp); + } + } + + #endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY + #endif // ULTIPANEL -#endif // __ULTRALCD_IMPL_DOGM_H +#endif // HAS_GRAPHICAL_LCD 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 b7e5a23810..76c488fa5a 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp +++ b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp @@ -72,7 +72,7 @@ #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 MB(REMRAM_V1) +#elif defined(ARDUINO_ARCH_STM32) #define CPU_ST7920_DELAY_1 DELAY_NS(0) #define CPU_ST7920_DELAY_2 DELAY_NS(0) #define CPU_ST7920_DELAY_3 DELAY_NS(0) @@ -81,7 +81,7 @@ #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.h'" + #error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd_AVR.h'" #endif #ifndef ST7920_DELAY_1 diff --git a/Marlin/src/lcd/extensible_ui/lib/dummy.cpp b/Marlin/src/lcd/extensible_ui/lib/example.cpp similarity index 72% rename from Marlin/src/lcd/extensible_ui/lib/dummy.cpp rename to Marlin/src/lcd/extensible_ui/lib/example.cpp index 9a71290791..6b8a27db66 100644 --- a/Marlin/src/lcd/extensible_ui/lib/dummy.cpp +++ b/Marlin/src/lcd/extensible_ui/lib/example.cpp @@ -28,22 +28,37 @@ // 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" +// +// Although it may be possible to access other state +// variables from Marlin, using the API here possibly +// helps ensure future compatibility. namespace UI { - void onStartup() {} - void onUpdate() {} - void onPrinterKilled(const char* lcd_msg) {} - void onMediaInserted(); - void onMediaError(); - void onMediaRemoved(); + void onStartup() { + /* Initialize the display module here. The following + * routines are available for access to the GPIO pins: + * + * SET_OUTPUT(pin) + * SET_INPUT_PULLUP(pin) + * SET_INPUT(pin) + * WRITE(pin,value) + * READ(pin) + */ + } + void onIdle() {} + void onPrinterKilled(const char* msg) {} + void onMediaInserted() {}; + void onMediaError() {}; + void onMediaRemoved() {}; void onPlayTone(const uint16_t frequency, const uint16_t duration) {} void onPrintTimerStarted() {} void onPrintTimerPaused() {} void onPrintTimerStopped() {} void onFilamentRunout() {} - void onStatusChanged(const char* lcd_msg) {} - void onStatusChanged(progmem_str lcd_msg) {} + void onStatusChanged(const char* msg) {} + void onStatusChanged(progmem_str 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 61eff88480..b11e5f8ef2 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.cpp +++ b/Marlin/src/lcd/extensible_ui/ui_api.cpp @@ -1,3 +1,25 @@ +/** + * 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 . + * + */ + /************** * ui_api.cpp * **************/ @@ -27,21 +49,28 @@ #include "../../module/motion.h" #include "../../module/planner.h" #include "../../module/probe.h" -#include "../../module/printcounter.h" #include "../../module/temperature.h" -#include "../../sd/cardreader.h" #include "../../libs/duration_t.h" +#include "../../HAL/shared/Delay.h" #if DO_SWITCH_EXTRUDER || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER) #include "../../module/tool_change.h" #endif #if ENABLED(SDSUPPORT) + #include "../../sd/cardreader.h" #include "../../feature/emergency_parser.h" - - bool abort_sd_printing; // =false + #define IFSD(A,B) (A) #else - constexpr bool abort_sd_printing = false; + #define IFSD(A,B) (B) +#endif + +#if ENABLED(PRINTCOUNTER) + #include "../../core/utility.h" + #include "../../module/printcounter.h" + #define IFPC(A,B) (A) +#else + #define IFPC(A,B) (B) #endif #include "ui_api.h" @@ -53,18 +82,78 @@ #endif #endif +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #include "../../feature/runout.h" +#endif + inline float clamp(const float value, const float minimum, const float maximum) { return MAX(MIN(value, maximum), minimum); } +static bool printer_killed = false; + namespace UI { + #ifdef __SAM3X8E__ + /** + * Implement a special millis() to allow time measurement + * within an ISR (such as when the printer is killed). + * + * To keep proper time, must be called at least every 1s. + */ + uint32_t safe_millis() { + // Not killed? Just call millis() + if (!printer_killed) return millis(); + + static uint32_t currTimeHI = 0; /* Current time */ + + // Machine was killed, reinit SysTick so we are able to compute time without ISRs + if (currTimeHI == 0) { + // Get the last time the Arduino time computed (from CMSIS) and convert it to SysTick + currTimeHI = (uint32_t)((GetTickCount() * (uint64_t)(F_CPU/8000)) >> 24); + + // Reinit the SysTick timer to maximize its period + SysTick->LOAD = SysTick_LOAD_RELOAD_Msk; // get the full range for the systick timer + SysTick->VAL = 0; // Load the SysTick Counter Value + SysTick->CTRL = // MCLK/8 as source + // No interrupts + SysTick_CTRL_ENABLE_Msk; // Enable SysTick Timer + } + + // Check if there was a timer overflow from the last read + if (SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) { + // There was. This means (SysTick_LOAD_RELOAD_Msk * 1000 * 8)/F_CPU ms has elapsed + currTimeHI++; + } + + // Calculate current time in milliseconds + uint32_t currTimeLO = SysTick_LOAD_RELOAD_Msk - SysTick->VAL; // (in MCLK/8) + uint64_t currTime = ((uint64_t)currTimeLO) | (((uint64_t)currTimeHI) << 24); + + // The ms count is + return (uint32_t)(currTime / (F_CPU / 8000)); + } + + #else + + // TODO: Implement for AVR + uint32_t safe_millis() { return millis(); } + + #endif + + void delay_us(unsigned long us) { + DELAY_US(us); + } void delay_ms(unsigned long ms) { - safe_delay(ms); + if (printer_killed) + DELAY_US(ms * 1000); + else + safe_delay(ms); } void yield() { - thermalManager.manage_heater(); + if (!printer_killed) + thermalManager.manage_heater(); } float getActualTemp_celsius(const uint8_t extruder) { @@ -108,7 +197,9 @@ namespace UI { switch (axis) { case X: case Y: case Z: break; case E0: case E1: case E2: case E3: case E4: case E5: - active_extruder = axis - E0; + #if EXTRUDERS > 1 + active_extruder = axis - E0; + #endif break; default: return; } @@ -137,7 +228,9 @@ namespace UI { if (extruder != active_extruder) tool_change(extruder, 0, no_move); #endif - active_extruder = extruder; + #if EXTRUDERS > 1 + active_extruder = extruder; + #endif } uint8_t getActiveTool() { return active_extruder + 1; } @@ -209,6 +302,21 @@ namespace UI { } } + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + bool isFilamentRunoutEnabled() { return runout.enabled; } + void toggleFilamentRunout(const bool state) { runout.enabled = state; } + + #if FILAMENT_RUNOUT_DISTANCE_MM > 0 + float getFilamentRunoutDistance_mm() { + return RunoutResponseDelayed::runout_distance_mm; + } + + void setFilamentRunoutDistance_mm(const float distance) { + RunoutResponseDelayed::runout_distance_mm = clamp(distance, 0, 999); + } + #endif + #endif + #if ENABLED(LIN_ADVANCE) float getLinearAdvance_mm_mm_s(const uint8_t extruder) { return (extruder < EXTRUDERS) ? planner.extruder_advance_K[extruder] : 0; @@ -253,16 +361,16 @@ namespace UI { } #endif - float getMinFeedrate_mm_s() { return planner.settings.min_feedrate_mm_s; } - float getMinTravelFeedrate_mm_s() { return planner.settings.min_travel_feedrate_mm_s; } - float getPrintingAcceleration_mm_s2() { return planner.settings.acceleration; } - float getRetractAcceleration_mm_s2() { return planner.settings.retract_acceleration; } - float getTravelAcceleration_mm_s2() { return planner.settings.travel_acceleration; } - void setMinFeedrate_mm_s(const float fr) { planner.settings.min_feedrate_mm_s = fr; } - void setMinTravelFeedrate_mm_s(const float fr) { planner.settings.min_travel_feedrate_mm_s = fr; } - void setPrintingAcceleration_mm_per_s2(const float acc) { planner.settings.acceleration = acc; } - void setRetractAcceleration_mm_s2(const float acc) { planner.settings.retract_acceleration = acc; } - void setTravelAcceleration_mm_s2(const float acc) { planner.settings.travel_acceleration = acc; } + float getMinFeedrate_mm_s() { return planner.settings.min_feedrate_mm_s; } + float getMinTravelFeedrate_mm_s() { return planner.settings.min_travel_feedrate_mm_s; } + float getPrintingAcceleration_mm_s2() { return planner.settings.acceleration; } + float getRetractAcceleration_mm_s2() { return planner.settings.retract_acceleration; } + float getTravelAcceleration_mm_s2() { return planner.settings.travel_acceleration; } + void setMinFeedrate_mm_s(const float fr) { planner.settings.min_feedrate_mm_s = fr; } + void setMinTravelFeedrate_mm_s(const float fr) { planner.settings.min_travel_feedrate_mm_s = fr; } + void setPrintingAcceleration_mm_s2(const float acc) { planner.settings.acceleration = acc; } + void setRetractAcceleration_mm_s2(const float acc) { planner.settings.retract_acceleration = acc; } + void setTravelAcceleration_mm_s2(const float acc) { planner.settings.travel_acceleration = acc; } #if ENABLED(BABYSTEP_ZPROBE_OFFSET) float getZOffset_mm() { @@ -333,18 +441,25 @@ namespace UI { #endif uint8_t getProgress_percent() { - #if ENABLED(SDSUPPORT) - return card.percentDone(); - #else - return 0; - #endif + return IFSD(card.percentDone(), 0); } uint32_t getProgress_seconds_elapsed() { - const duration_t elapsed = print_job_timer.duration(); - return elapsed.value; + return IFPC(print_job_timer.duration() / 1000UL, 0); } + #if ENABLED(PRINTCOUNTER) + char* getTotalPrints_str(char buffer[21]) { strcpy(buffer,itostr3left(print_job_timer.getStats().totalPrints)); return buffer; } + char* getFinishedPrints_str(char buffer[21]) { strcpy(buffer,itostr3left(print_job_timer.getStats().finishedPrints)); return buffer; } + char* getTotalPrintTime_str(char buffer[21]) { duration_t(print_job_timer.getStats().printTime).toString(buffer); return buffer; } + char* getLongestPrint_str(char buffer[21]) { duration_t(print_job_timer.getStats().printTime).toString(buffer); return buffer; } + char* getFilamentUsed_str(char buffer[21]) { + printStatistics stats = print_job_timer.getStats(); + sprintf_P(buffer, PSTR("%ld.%im"), long(stats.filamentUsed / 1000), int16_t(stats.filamentUsed / 100) % 10); + return buffer; + } + #endif + float getFeedRate_percent() { return feedrate_percentage; } @@ -384,41 +499,31 @@ namespace UI { } void printFile(const char *filename) { - #if ENABLED(SDSUPPORT) - card.openAndPrintFile(filename); - #endif + IFSD(card.openAndPrintFile(filename), 0); + } + + bool isPrintingFromMediaPaused() { + return IFSD(isPrintingFromMedia() && !card.sdprinting, false); } bool isPrintingFromMedia() { - #if ENABLED(SDSUPPORT) - return card.cardOK && card.isFileOpen() && card.sdprinting; - #else - return false; - #endif + return IFSD(card.cardOK && card.isFileOpen(), false); } bool isPrinting() { - return (planner.movesplanned() || IS_SD_PRINTING || - #if ENABLED(SDSUPPORT) - (card.cardOK && card.isFileOpen()) - #else - false - #endif - ); + return (planner.movesplanned() || IFSD(IS_SD_PRINTING(), false) || isPrintingFromMedia()); } bool isMediaInserted() { - #if ENABLED(SDSUPPORT) - return IS_SD_INSERTED && card.cardOK; - #else - return false; - #endif + return IFSD(IS_SD_INSERTED() && card.cardOK, false); } void pausePrint() { #if ENABLED(SDSUPPORT) card.pauseSDPrint(); - print_job_timer.pause(); + #if ENABLED(PRINTCOUNTER) + print_job_timer.pause(); + #endif #if ENABLED(PARK_HEAD_ON_PAUSE) enqueue_and_echo_commands_P(PSTR("M125")); #endif @@ -432,7 +537,9 @@ namespace UI { enqueue_and_echo_commands_P(PSTR("M24")); #else card.startFileprint(); - print_job_timer.start(); + #if ENABLED(PRINTCOUNTER) + print_job_timer.start(); + #endif #endif UI::onStatusChanged(PSTR(MSG_PRINTING)); #endif @@ -441,7 +548,7 @@ namespace UI { void stopPrint() { #if ENABLED(SDSUPPORT) wait_for_heatup = wait_for_user = false; - abort_sd_printing = true; + card.abort_sd_printing = true; UI::onStatusChanged(PSTR(MSG_PRINT_ABORTED)); #endif } @@ -473,42 +580,23 @@ namespace UI { } const char* FileList::filename() { - #if ENABLED(SDSUPPORT) - return (card.longFilename && card.longFilename[0]) ? card.longFilename : card.filename; - #else - return ""; - #endif + return IFSD(card.longFilename && card.longFilename[0] ? card.longFilename : card.filename, ""); } const char* FileList::shortFilename() { - #if ENABLED(SDSUPPORT) - return card.filename; - #else - return ""; - #endif + return IFSD(card.filename, ""); } const char* FileList::longFilename() { - #if ENABLED(SDSUPPORT) - return card.longFilename; - #else - return ""; - #endif + return IFSD(card.longFilename, ""); } bool FileList::isDir() { - #if ENABLED(SDSUPPORT) - return card.filenameIsDir; - #else - return false; - #endif + return IFSD(card.filenameIsDir, false); } uint16_t FileList::count() { - #if ENABLED(SDSUPPORT) - if (num_files == 0xFFFF) num_files = card.get_num_Files(); - return num_files; - #endif + return IFSD((num_files = (num_files == 0xFFFF ? card.get_num_Files() : num_files)), 0); } bool FileList::isAtRootDir() { @@ -545,10 +633,10 @@ void lcd_init() { UI::onStartup(); } -void lcd_update() { +void lcd_update() { #if ENABLED(SDSUPPORT) static bool last_sd_status; - const bool sd_status = IS_SD_INSERTED; + const bool sd_status = IS_SD_INSERTED(); if (sd_status != last_sd_status) { last_sd_status = sd_status; if (sd_status) { @@ -566,7 +654,7 @@ void lcd_update() } } #endif // SDSUPPORT - UI::onUpdate(); + UI::onIdle(); } bool lcd_hasstatus() { return true; } @@ -575,8 +663,25 @@ 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_reset_status() {} 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 (IFPC(print_job_timer.isPaused(), false)) + msg = paused; + #if ENABLED(SDSUPPORT) + else if (card.sdprinting) + return lcd_setstatus(card.longest_filename(), true); + #endif + else if (IFPC(print_job_timer.isRunning(), false)) + 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; @@ -587,4 +692,11 @@ void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) { UI::onStatusChanged(buff); } +void kill_screen(PGM_P msg) { + if (!printer_killed) { + printer_killed = true; + UI::onPrinterKilled(msg); + } +} + #endif // EXTENSIBLE_UI diff --git a/Marlin/src/lcd/extensible_ui/ui_api.h b/Marlin/src/lcd/extensible_ui/ui_api.h index 482c6df1e0..7f72cd523f 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.h +++ b/Marlin/src/lcd/extensible_ui/ui_api.h @@ -1,3 +1,25 @@ +/** + * 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 . + * + */ + /************ * ui_api.h * ************/ @@ -49,13 +71,21 @@ namespace UI { float getAxisMaxAcceleration_mm_s2(const axis_t axis); float getMinFeedrate_mm_s(); float getMinTravelFeedrate_mm_s(); - float getPrintingAcceleration_mm_per_s2(); - float getRetractAcceleration_mm_per_s2(); - float getTravelAcceleration_mm_per_s2(); + float getPrintingAcceleration_mm_s2(); + float getRetractAcceleration_mm_s2(); + float getTravelAcceleration_mm_s2(); float getFeedRate_percent(); uint8_t getProgress_percent(); uint32_t getProgress_seconds_elapsed(); + #if ENABLED(PRINTCOUNTER) + char *getTotalPrints_str(char buffer[21]); + char *getFinishedPrints_str(char buffer[21]); + char *getTotalPrintTime_str(char buffer[21]); + char *getLongestPrint_str(char buffer[21]); + char *getFilamentUsed_str(char buffer[21]); + #endif + void setTargetTemp_celsius(const uint8_t extruder, float temp); void setFan_percent(const uint8_t fan, const float percent); void setAxisPosition_mm(const axis_t axis, float position, float _feedrate_mm_s); @@ -109,12 +139,26 @@ namespace UI { #endif #endif + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + bool isFilamentRunoutEnabled(); + void toggleFilamentRunout(const bool state); + + #if FILAMENT_RUNOUT_DISTANCE_MM > 0 + float getFilamentRunoutDistance_mm(); + void setFilamentRunoutDistance_mm(const float distance); + #endif + #endif + + // This safe_millis is safe to use even when printer is killed (as long as called at least every 1 second) + uint32_t safe_millis(); + void delay_us(unsigned long us); void delay_ms(unsigned long ms); void yield(); // Within lengthy loop, call this periodically void enqueueCommands(progmem_str gcode); void printFile(const char *filename); + bool isPrintingFromMediaPaused(); bool isPrintingFromMedia(); bool isPrinting(); void stopPrint(); @@ -147,7 +191,7 @@ namespace UI { // module and will be called by Marlin. void onStartup(); - void onUpdate(); + void onIdle(); void onMediaInserted(); void onMediaError(); void onMediaRemoved(); @@ -161,4 +205,5 @@ namespace UI { void onStatusChanged(progmem_str msg); void onFactoryReset(); void onStoreSettings(); + void onLoadSettings(); }; diff --git a/Marlin/src/lcd/fontutils.h b/Marlin/src/lcd/fontutils.h index 62c1471d8d..183c8ed399 100644 --- a/Marlin/src/lcd/fontutils.h +++ b/Marlin/src/lcd/fontutils.h @@ -6,8 +6,7 @@ * @date 2016-08-19 * @copyright GPL/BSD */ -#ifndef _FONT_UTILS_H -#define _FONT_UTILS_H +#pragma once #include #include @@ -45,5 +44,3 @@ uint8_t* get_utf8_value_cb(uint8_t *pstart, read_byte_cb_t cb_read_byte, wchar_t /* Returns lenght of string in CHARACTERS, NOT BYTES */ uint8_t utf8_strlen(const char *pstart); uint8_t utf8_strlen_P(PGM_P pstart); - -#endif // _FONT_UTILS_H diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index 41bd272510..12a7ba9ae2 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -52,12 +52,12 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Achustar desfases") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Desfase aplicau") #define MSG_SET_ORIGIN _UxGT("Establir orichen") -#define MSG_PREHEAT_1 _UxGT("Precalentar PLA") +#define MSG_PREHEAT_1 _UxGT("Precalentar " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Tot") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Base") #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Conf") -#define MSG_PREHEAT_2 _UxGT("Precalentar ABS") +#define MSG_PREHEAT_2 _UxGT("Precalentar " PREHEAT_2_LABEL) #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Tot") #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Base") @@ -158,14 +158,14 @@ #define MSG_CONTROL_RETRACT _UxGT("Retraer mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Retraer mm") #define MSG_CONTROL_RETRACTF _UxGT("Retraer F") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Devantar mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Devantar mm") #define MSG_CONTROL_RETRACT_RECOVER _UxGT("DesRet mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Swap DesRet mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("DesRet F") #define MSG_AUTORETRACT _UxGT("Retraccion auto.") #define MSG_FILAMENTCHANGE _UxGT("Cambear filamento") #define MSG_INIT_SDCARD _UxGT("Encetan. tarcheta") -#define MSG_CNG_SDCARD _UxGT("Cambiar tarcheta") +#define MSG_CHANGE_SDCARD _UxGT("Cambiar tarcheta") #define MSG_ZPROBE_OUT _UxGT("Sonda Z fuera") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Auto-Test") #define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") diff --git a/Marlin/src/lcd/language/language_bg.h b/Marlin/src/lcd/language/language_bg.h index 558a98e351..ddce04a60e 100644 --- a/Marlin/src/lcd/language/language_bg.h +++ b/Marlin/src/lcd/language/language_bg.h @@ -43,16 +43,16 @@ #define MSG_TMC_Z_CALIBRATION _UxGT("Калибровка Z") #define MSG_SET_HOME_OFFSETS _UxGT("Задай Начало") #define MSG_SET_ORIGIN _UxGT("Изходна точка") -#define MSG_PREHEAT_1 _UxGT("Подгряване PLA") -#define MSG_PREHEAT_1_N _UxGT("Подгряване PLA") -#define MSG_PREHEAT_1_ALL _UxGT("Подгр. PLA Всички") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Подгр. PLA Легло") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Настройки PLA") -#define MSG_PREHEAT_2 _UxGT("Подгряване ABS") -#define MSG_PREHEAT_2_N _UxGT("Подгряване ABS") -#define MSG_PREHEAT_2_ALL _UxGT("Подгр. ABS Всички") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Подгр. ABS Легло") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Настройки ABS") +#define MSG_PREHEAT_1 _UxGT("Подгряване " PREHEAT_1_LABEL) +#define MSG_PREHEAT_1_N _UxGT("Подгряване " PREHEAT_1_LABEL) +#define MSG_PREHEAT_1_ALL _UxGT("Подгр. " PREHEAT_1_LABEL " Всички") +#define MSG_PREHEAT_1_BEDONLY _UxGT("Подгр. " PREHEAT_1_LABEL " Легло") +#define MSG_PREHEAT_1_SETTINGS _UxGT("Настройки " PREHEAT_1_LABEL) +#define MSG_PREHEAT_2 _UxGT("Подгряване " PREHEAT_2_LABEL) +#define MSG_PREHEAT_2_N _UxGT("Подгряване " PREHEAT_2_LABEL) +#define MSG_PREHEAT_2_ALL _UxGT("Подгр. " PREHEAT_2_LABEL " Всички") +#define MSG_PREHEAT_2_BEDONLY _UxGT("Подгр. " PREHEAT_2_LABEL " Легло") +#define MSG_PREHEAT_2_SETTINGS _UxGT("Настройки " PREHEAT_2_LABEL) #define MSG_COOLDOWN _UxGT("Охлаждане") #define MSG_SWITCH_PS_ON _UxGT("Вкл. захранване") #define MSG_SWITCH_PS_OFF _UxGT("Изкл. захранване") @@ -127,14 +127,14 @@ #define MSG_CONTROL_RETRACT _UxGT("Откат mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Смяна Откат mm") #define MSG_CONTROL_RETRACTF _UxGT("Откат V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Скок mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Скок mm") #define MSG_CONTROL_RETRACT_RECOVER _UxGT("Възврат mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Смяна Възврат mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Възврат V") #define MSG_AUTORETRACT _UxGT("Автоoткат") #define MSG_FILAMENTCHANGE _UxGT("Смяна нишка") #define MSG_INIT_SDCARD _UxGT("Иниц. SD-Карта") -#define MSG_CNG_SDCARD _UxGT("Смяна SD-Карта") +#define MSG_CHANGE_SDCARD _UxGT("Смяна SD-Карта") #define MSG_ZPROBE_OUT _UxGT("Z-сондата е извадена") #define MSG_ZPROBE_ZOFFSET _UxGT("Z Отстояние") #define MSG_BABYSTEP_X _UxGT("Министъпка X") diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index d00fe3c768..a8e93aac77 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -53,12 +53,12 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Ajusta decalatge") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Decalatge aplicat") #define MSG_SET_ORIGIN _UxGT("Estableix origen") -#define MSG_PREHEAT_1 _UxGT("Preescalfa PLA") +#define MSG_PREHEAT_1 _UxGT("Preescalfa " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Tot") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Llit") #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Conf.") -#define MSG_PREHEAT_2 _UxGT("Preescalfa ABS") +#define MSG_PREHEAT_2 _UxGT("Preescalfa " PREHEAT_2_LABEL) #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Tot") #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Llit") @@ -161,14 +161,14 @@ #define MSG_CONTROL_RETRACT _UxGT("Retreu mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Retreure mm") #define MSG_CONTROL_RETRACTF _UxGT("Retreu V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Aixeca mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Aixeca mm") #define MSG_CONTROL_RETRACT_RECOVER _UxGT("DesRet +mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Swap DesRet +mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("DesRet V") #define MSG_AUTORETRACT _UxGT("Auto retraccio") #define MSG_FILAMENTCHANGE _UxGT("Canvia filament") #define MSG_INIT_SDCARD _UxGT("Inicialitza SD") -#define MSG_CNG_SDCARD _UxGT("Canvia SD") +#define MSG_CHANGE_SDCARD _UxGT("Canvia SD") #define MSG_ZPROBE_OUT _UxGT("Sonda Z fora") #define MSG_BLTOUCH_RESET _UxGT("Reinicia BLTouch") #define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 5980f61ba9..dbde4b406c 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -62,13 +62,13 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Nastavit ofsety") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Ofsety nastaveny") #define MSG_SET_ORIGIN _UxGT("Nastavit počátek") -#define MSG_PREHEAT_1 _UxGT("Zahřát PLA") +#define MSG_PREHEAT_1 _UxGT("Zahřát " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" vše") #define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" hotend") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" podlož") #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" nast") -#define MSG_PREHEAT_2 _UxGT("Zahřát ABS") +#define MSG_PREHEAT_2 _UxGT("Zahřát " PREHEAT_2_LABEL) #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" vše") #define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" hotend") @@ -97,24 +97,24 @@ #define MSG_UBL_MOVING_TO_NEXT _UxGT("Přesun na další") #define MSG_UBL_ACTIVATE_MESH _UxGT("Aktivovat UBL") #define MSG_UBL_DEACTIVATE_MESH _UxGT("Deaktivovat UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Teplota podložky") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Teplota hotendu") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP +#define MSG_UBL_SET_TEMP_BED _UxGT("Teplota podložky") +#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED +#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Teplota hotendu") +#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND #define MSG_UBL_MESH_EDIT _UxGT("Úprava sítě bodů") #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Upravit vlastní síť") #define MSG_UBL_FINE_TUNE_MESH _UxGT("Doladit síť bodů") #define MSG_UBL_DONE_EDITING_MESH _UxGT("Konec úprav sítě") #define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Vlastní síť") #define MSG_UBL_BUILD_MESH_MENU _UxGT("Vytvořit síť") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Síť bodu PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Síť bodu ABS") +#define MSG_UBL_BUILD_MESH_M1 _UxGT("Síť bodu " PREHEAT_1_LABEL) +#define MSG_UBL_BUILD_MESH_M2 _UxGT("Síť bodu " PREHEAT_2_LABEL) #define MSG_UBL_BUILD_COLD_MESH _UxGT("Studená síť bodů") #define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Upravit výšku sítě") #define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Výška") #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Zkontrolovat síť") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Kontrola sítě PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Kontrola sítě ABS") +#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Kontrola sítě " PREHEAT_1_LABEL) +#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Kontrola sítě " PREHEAT_2_LABEL) #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Kontrola vlast. sítě") #define MSG_UBL_CONTINUE_MESH _UxGT("Pokračovat v síťi") #define MSG_UBL_MESH_LEVELING _UxGT("Síťové rovnání") @@ -268,7 +268,7 @@ #define MSG_CONTROL_RETRACT _UxGT("Retrakt mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Výměna Re.mm") #define MSG_CONTROL_RETRACTF _UxGT("Retraktovat V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Zvednuti Z mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Zvednuti Z 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") @@ -280,7 +280,7 @@ #define MSG_FILAMENTUNLOAD_ALL _UxGT("Vysunout vše") #define MSG_INIT_SDCARD _UxGT("Načíst SD kartu") -#define MSG_CNG_SDCARD _UxGT("Vyměnit SD kartu") +#define MSG_CHANGE_SDCARD _UxGT("Vyměnit SD kartu") #define MSG_ZPROBE_OUT _UxGT("Sonda Z mimo podl") #define MSG_SKEW_FACTOR _UxGT("Faktor zkosení") #define MSG_BLTOUCH _UxGT("BLTouch") diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 1bd78c332c..aa0a8262fb 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -52,16 +52,16 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Sæt forsk. af home") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Forsk. er nu aktiv") #define MSG_SET_ORIGIN _UxGT("Sæt origin") -#define MSG_PREHEAT_1 _UxGT("Forvarm PLA") -#define MSG_PREHEAT_1_N _UxGT("Forvarm PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Forvarm PLA Alle") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Forvarm PLA Bed") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Forvarm PLA conf") -#define MSG_PREHEAT_2 _UxGT("Forvarm ABS") -#define MSG_PREHEAT_2_N _UxGT("Forvarm ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Forvarm ABS Alle") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Forvarm ABS Bed") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Forvarm ABS conf") +#define MSG_PREHEAT_1 _UxGT("Forvarm " PREHEAT_1_LABEL) +#define MSG_PREHEAT_1_N _UxGT("Forvarm " PREHEAT_1_LABEL " ") +#define MSG_PREHEAT_1_ALL _UxGT("Forvarm " PREHEAT_1_LABEL " Alle") +#define MSG_PREHEAT_1_BEDONLY _UxGT("Forvarm " PREHEAT_1_LABEL " Bed") +#define MSG_PREHEAT_1_SETTINGS _UxGT("Forvarm " PREHEAT_1_LABEL " conf") +#define MSG_PREHEAT_2 _UxGT("Forvarm " PREHEAT_2_LABEL) +#define MSG_PREHEAT_2_N _UxGT("Forvarm " PREHEAT_2_LABEL " ") +#define MSG_PREHEAT_2_ALL _UxGT("Forvarm " PREHEAT_2_LABEL " Alle") +#define MSG_PREHEAT_2_BEDONLY _UxGT("Forvarm " PREHEAT_2_LABEL " Bed") +#define MSG_PREHEAT_2_SETTINGS _UxGT("Forvarm " PREHEAT_2_LABEL " conf") #define MSG_COOLDOWN _UxGT("Afkøl") #define MSG_SWITCH_PS_ON _UxGT("Slå strøm til") #define MSG_SWITCH_PS_OFF _UxGT("Slå strøm fra") @@ -158,14 +158,14 @@ #define MSG_CONTROL_RETRACT _UxGT("Tilbagetræk mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Skift Re.mm") #define MSG_CONTROL_RETRACTF _UxGT("Tilbagetræk V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") #define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Skift UnRet mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") #define MSG_AUTORETRACT _UxGT("AutoRetr.") #define MSG_FILAMENTCHANGE _UxGT("Skift filament") #define MSG_INIT_SDCARD _UxGT("Init. SD card") -#define MSG_CNG_SDCARD _UxGT("Skift SD kort") +#define MSG_CHANGE_SDCARD _UxGT("Skift SD kort") #define MSG_ZPROBE_OUT _UxGT("Probe udenfor plade") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Selv-Test") #define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index ce0bf408ff..ab11767254 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -39,55 +39,148 @@ #define MSG_SD_INSERTED _UxGT("SD-Karte erkannt") #define MSG_SD_REMOVED _UxGT("SD-Karte entfernt") #define MSG_LCD_ENDSTOPS _UxGT("Endstopp") // Max length 8 characters +#define MSG_LCD_SOFT_ENDSTOPS _UxGT("Soft-Endstopp") #define MSG_MAIN _UxGT("Hauptmenü") +#define MSG_ADVANCED_SETTINGS _UxGT("Erw. Einstellungen") +#define MSG_CONFIGURATION _UxGT("Konfiguration") #define MSG_AUTOSTART _UxGT("Autostart") #define MSG_DISABLE_STEPPERS _UxGT("Motoren deaktivieren") // M84 -#define MSG_DEBUG_MENU _UxGT("Debug Menü") -#define MSG_PROGRESS_BAR_TEST _UxGT("Fortschrittsb. Test") -#define MSG_AUTO_HOME _UxGT("Home") // G28 +#define MSG_DEBUG_MENU _UxGT("Debug-Menü") +#define MSG_PROGRESS_BAR_TEST _UxGT("Fortschrittsb.-Test") +#define MSG_AUTO_HOME _UxGT("Home XYZ") // G28 #define MSG_AUTO_HOME_X _UxGT("Home X") #define MSG_AUTO_HOME_Y _UxGT("Home Y") #define MSG_AUTO_HOME_Z _UxGT("Home Z") #define MSG_TMC_Z_CALIBRATION _UxGT("Kalibriere Z") #define MSG_LEVEL_BED_HOMING _UxGT("Home XYZ") -#define MSG_LEVEL_BED_WAITING _UxGT("Klick für Start") +#define MSG_LEVEL_BED_WAITING _UxGT("Klick zum Starten") #define MSG_LEVEL_BED_NEXT_POINT _UxGT("Nächste Koordinate") -#define MSG_LEVEL_BED_DONE _UxGT("Fertig") +#define MSG_LEVEL_BED_DONE _UxGT("Nivellieren fertig!") #define MSG_Z_FADE_HEIGHT _UxGT("Ausblendhöhe") #define MSG_SET_HOME_OFFSETS _UxGT("Setze Homeversatz") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Homeversatz aktiv") -#define MSG_SET_ORIGIN _UxGT("Setze Nullpunkt") //"G92 X0 Y0 Z0" commented out in ultralcd.cpp -#define MSG_PREHEAT_1 _UxGT("Vorwärmen PLA") -#define MSG_PREHEAT_1_N _UxGT("Vorwärmen PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Vorw. PLA Alle") -#define MSG_PREHEAT_1_END _UxGT("Vorw. PLA Extr.") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Vorw. PLA Bett") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Vorw. PLA Einst.") -#define MSG_PREHEAT_2 _UxGT("Vorwärmen ABS") -#define MSG_PREHEAT_2_N _UxGT("Vorwärmen ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Vorw. ABS Alle") -#define MSG_PREHEAT_2_END _UxGT("Vorw. ABS Extr.") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Vorw. ABS Bett") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Vorw. ABS Einst.") +#define MSG_SET_ORIGIN _UxGT("Setze Nullpunkte") //"G92 X0 Y0 Z0" commented out in ultralcd.cpp +#define MSG_PREHEAT_1 _UxGT("Vorwärmen " PREHEAT_1_LABEL) +#define MSG_PREHEAT_1_N _UxGT("Vorwärmen " PREHEAT_1_LABEL " ") +#define MSG_PREHEAT_1_ALL _UxGT("Vorw. " PREHEAT_1_LABEL " Alles") +#define MSG_PREHEAT_1_END _UxGT("Vorw. " PREHEAT_1_LABEL " Extr.") +#define MSG_PREHEAT_1_BEDONLY _UxGT("Vorw. " PREHEAT_1_LABEL " Bett") +#define MSG_PREHEAT_1_SETTINGS _UxGT("Vorw. " PREHEAT_1_LABEL " Einst.") +#define MSG_PREHEAT_2 _UxGT("Vorwärmen " PREHEAT_2_LABEL) +#define MSG_PREHEAT_2_N _UxGT("Vorwärmen " PREHEAT_2_LABEL " ") +#define MSG_PREHEAT_2_ALL _UxGT("Vorw. " PREHEAT_2_LABEL " Alles") +#define MSG_PREHEAT_2_END _UxGT("Vorw. " PREHEAT_2_LABEL " Extr.") +#define MSG_PREHEAT_2_BEDONLY _UxGT("Vorw. " PREHEAT_2_LABEL " Bett") +#define MSG_PREHEAT_2_SETTINGS _UxGT("Vorw. " PREHEAT_2_LABEL " Einst.") +#define MSG_PREHEAT_CUSTOM _UxGT("benutzerdef. Heizen") #define MSG_COOLDOWN _UxGT("Abkühlen") #define MSG_SWITCH_PS_ON _UxGT("Netzteil ein") #define MSG_SWITCH_PS_OFF _UxGT("Netzteil aus") #define MSG_EXTRUDE _UxGT("Extrudieren") -#define MSG_RETRACT _UxGT("Retract") -#define MSG_MOVE_AXIS _UxGT("Bewegen") -#define MSG_BED_LEVELING _UxGT("Bett Nivellierung") +#define MSG_RETRACT _UxGT("Rückzug") +#define MSG_MOVE_AXIS _UxGT("Achse Bewegen") +#define MSG_BED_LEVELING _UxGT("Bett-Nivellierung") #define MSG_LEVEL_BED _UxGT("Bett nivellieren") #define MSG_LEVEL_CORNERS _UxGT("Ecken nivellieren") #define MSG_NEXT_CORNER _UxGT("Nächste Ecke") #define MSG_EDITING_STOPPED _UxGT("Netzbearb. angeh.") -#define MSG_USER_MENU _UxGT("Benutzer Menü") - +#define MSG_USER_MENU _UxGT("Benutzer-Menü") +#define MSG_UBL_DOING_G29 _UxGT("G29 ausführen") +#define MSG_UBL_UNHOMED _UxGT("Home XYZ zuerst") +#define MSG_UBL_TOOLS _UxGT("UBL-Werkzeuge") +#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") +#define MSG_IDEX_MENU _UxGT("IDEX-Modus") +#define MSG_IDEX_MODE_AUTOPARK _UxGT("Autom. Parken") +#define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplizieren") +#define MSG_IDEX_MODE_SCALED_COPY _UxGT("Skalierung kopieren") +#define MSG_IDEX_MODE_FULL_CTRL _UxGT("vollstä. Kontrolle") +#define MSG_IDEX_X_OFFSET _UxGT("2. Düse X") +#define MSG_IDEX_Y_OFFSET _UxGT("2. Düse Y") +#define MSG_IDEX_Z_OFFSET _UxGT("2. Düse Z") +#define MSG_IDEX_SAVE_OFFSETS _UxGT("Versätze speichern") +#define MSG_UBL_MANUAL_MESH _UxGT("Netz manuell erst.") +#define MSG_UBL_BC_INSERT _UxGT("Unterlegen & messen") +#define MSG_UBL_BC_INSERT2 _UxGT("Messen") +#define MSG_UBL_BC_REMOVE _UxGT("Entfernen & messen") +#define MSG_UBL_MOVING_TO_NEXT _UxGT("Nächster Punkt...") +#define MSG_UBL_ACTIVATE_MESH _UxGT("UBL aktivieren") +#define MSG_UBL_DEACTIVATE_MESH _UxGT("UBL deaktivieren") +#define MSG_UBL_SET_TEMP_BED _UxGT("Betttemperatur") +#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED +#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Hotend-Temp.") +#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND +#define MSG_UBL_MESH_EDIT _UxGT("Netz bearbeiten") +#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Eigenes Netz bearb.") +#define MSG_UBL_FINE_TUNE_MESH _UxGT("Feineinstellung...") +#define MSG_UBL_DONE_EDITING_MESH _UxGT("Bearbeitung beendet") +#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Eigenes Netz erst.") +#define MSG_UBL_BUILD_MESH_MENU _UxGT("Netz erstellen") +#define MSG_UBL_BUILD_MESH_M1 _UxGT("Netz erstellen " PREHEAT_1_LABEL) +#define MSG_UBL_BUILD_MESH_M2 _UxGT("Netz erstellen " PREHEAT_2_LABEL) +#define MSG_UBL_BUILD_COLD_MESH _UxGT("Netz erstellen kalt") +#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Netzhöhe einst.") +#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Höhe") +#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Netz validieren") +#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Netz validieren " PREHEAT_1_LABEL) +#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Netz validieren " PREHEAT_2_LABEL) +#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Eig. Netz validieren") +#define MSG_UBL_CONTINUE_MESH _UxGT("Netzerst. forts.") +#define MSG_UBL_MESH_LEVELING _UxGT("Netz-Nivellierung") +#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-Punkt-Nivell.") +#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Gitternetz-Nivell.") +#define MSG_UBL_MESH_LEVEL _UxGT("Netz nivellieren") +#define MSG_UBL_SIDE_POINTS _UxGT("Eckpunkte") +#define MSG_UBL_MAP_TYPE _UxGT("Kartentyp") +#define MSG_UBL_OUTPUT_MAP _UxGT("Karte ausgeben") +#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Ausgabe für Host") +#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Ausgabe für CSV") +#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Externe Sicherung") +#define MSG_UBL_INFO_UBL _UxGT("UBL-Info ausgeben") +#define MSG_UBL_EDIT_MESH_MENU _UxGT("Netz bearbeiten") +#define MSG_UBL_FILLIN_AMOUNT _UxGT("Menge an Füllung") +#define MSG_UBL_MANUAL_FILLIN _UxGT("Manuelles Füllen") +#define MSG_UBL_SMART_FILLIN _UxGT("Cleveres Füllen") +#define MSG_UBL_FILLIN_MESH _UxGT("Netz Füllen") +#define MSG_UBL_INVALIDATE_ALL _UxGT("Alles annullieren") +#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Nächstlieg. ann.") +#define MSG_UBL_FINE_TUNE_ALL _UxGT("Feineinst. Alles") +#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Feineinst. Nächstl.") +#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Netz-Speicherplatz") +#define MSG_UBL_STORAGE_SLOT _UxGT("Speicherort") +#define MSG_UBL_LOAD_MESH _UxGT("Bettnetz laden") +#define MSG_UBL_SAVE_MESH _UxGT("Bettnetz speichern") +#define MSG_MESH_LOADED _UxGT("Netz %i geladen") +#define MSG_MESH_SAVED _UxGT("Netz %i gespeichert") +#define MSG_NO_STORAGE _UxGT("Kein Speicher") +#define MSG_UBL_SAVE_ERROR _UxGT("ERR:UBL speichern") +#define MSG_UBL_RESTORE_ERROR _UxGT("ERR:UBL wiederherst.") +#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Versatz angehalten") +#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Schrittweises UBL") +#define MSG_LED_CONTROL _UxGT("LED-Steuerung") +#define MSG_LEDS _UxGT("Licht") +#define MSG_LED_PRESETS _UxGT("Licht-Einstellungen") +#define MSG_SET_LEDS_RED _UxGT("Rot") +#define MSG_SET_LEDS_ORANGE _UxGT("Orange") +#define MSG_SET_LEDS_YELLOW _UxGT("Gelb") +#define MSG_SET_LEDS_GREEN _UxGT("Grün") +#define MSG_SET_LEDS_BLUE _UxGT("Blau") +#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") +#define MSG_SET_LEDS_VIOLET _UxGT("Violett") +#define MSG_SET_LEDS_WHITE _UxGT("Weiß") +#define MSG_SET_LEDS_DEFAULT _UxGT("Standard") +#define MSG_CUSTOM_LEDS _UxGT("Benutzerdef.") +#define MSG_INTENSITY_R _UxGT("Intensität Rot") +#define MSG_INTENSITY_G _UxGT("Intensität Grün") +#define MSG_INTENSITY_B _UxGT("Intensität Blau") +#define MSG_INTENSITY_W _UxGT("Intensität Weiß") +#define MSG_LED_BRIGHTNESS _UxGT("Helligkeit") #define MSG_MOVING _UxGT("In Bewegung...") #define MSG_FREE_XY _UxGT("Abstand XY") -#define MSG_MOVE_X _UxGT("X") -#define MSG_MOVE_Y _UxGT("Y") -#define MSG_MOVE_Z _UxGT("Z") -#define MSG_MOVE_E _UxGT("Extruder ") +#define MSG_MOVE_X _UxGT("Bewege X") +#define MSG_MOVE_Y _UxGT("Bewege Y") +#define MSG_MOVE_Z _UxGT("Bewege Z") +#define MSG_MOVE_E _UxGT("Bewege Extruder") +#define MSG_HOTEND_TOO_COLD _UxGT("Hotend zu kalt") #define MSG_MOVE_01MM _UxGT(" 0,1 mm") #define MSG_MOVE_1MM _UxGT(" 1,0 mm") #define MSG_MOVE_10MM _UxGT("10,0 mm") @@ -102,7 +195,7 @@ #define MSG_MIN LCD_STR_THERMOMETER _UxGT(" min") #define MSG_MAX LCD_STR_THERMOMETER _UxGT(" max") #define MSG_FACTOR LCD_STR_THERMOMETER _UxGT(" Faktor") -#define MSG_AUTOTEMP _UxGT("AutoTemp") +#define MSG_AUTOTEMP _UxGT("Auto Temperatur") #define MSG_ON _UxGT("Ein") #define MSG_OFF _UxGT("Aus") #define MSG_PID_P _UxGT("PID P") @@ -110,7 +203,7 @@ #define MSG_PID_D _UxGT("PID D") #define MSG_PID_C _UxGT("PID C") #define MSG_SELECT _UxGT("Auswählen") -#define MSG_ACC _UxGT("A") +#define MSG_ACC _UxGT("Beschleunigung") #define MSG_JERK _UxGT("Jerk") #if IS_KINEMATIC #define MSG_VA_JERK _UxGT("V A Jerk") @@ -123,12 +216,12 @@ #endif #define MSG_VE_JERK _UxGT("V E Jerk") #define MSG_VELOCITY _UxGT("Geschwindigkeit") -#define MSG_VMAX _UxGT("V max ") // space by purpose +#define MSG_VMAX _UxGT("V max ") // space intentional #define MSG_VMIN _UxGT("V min") #define MSG_VTRAV_MIN _UxGT("V min Leerfahrt") #define MSG_ACCELERATION _UxGT("Beschleunigung") -#define MSG_AMAX _UxGT("A max ") // space by purpose -#define MSG_A_RETRACT _UxGT("A Retract") +#define MSG_AMAX _UxGT("A max ") // space intentional +#define MSG_A_RETRACT _UxGT("A Rückzug") #define MSG_A_TRAVEL _UxGT("A Leerfahrt") #define MSG_STEPS_PER_MM _UxGT("Steps/mm") #if IS_KINEMATIC @@ -151,66 +244,76 @@ #define MSG_MOTION _UxGT("Bewegung") #define MSG_FILAMENT _UxGT("Filament") #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm³") -#define MSG_FILAMENT_DIAM _UxGT("D Fil.") +#define MSG_FILAMENT_DIAM _UxGT("Durchm. Filament") #define MSG_FILAMENT_UNLOAD _UxGT("Entladen mm") #define MSG_FILAMENT_LOAD _UxGT("Laden mm") -#define MSG_ADVANCE_K _UxGT("Advance Faktor") +#define MSG_ADVANCE_K _UxGT("Vorschubfaktor") #define MSG_CONTRAST _UxGT("LCD Kontrast") #define MSG_STORE_EEPROM _UxGT("Konfig. speichern") #define MSG_LOAD_EEPROM _UxGT("Konfig. laden") #define MSG_RESTORE_FAILSAFE _UxGT("Standardwerte laden") #define MSG_INIT_EEPROM _UxGT("Werkseinstellungen") -#define MSG_SD_UPDATE _UxGT("SD Update") + +#define MSG_SD_UPDATE _UxGT("SD Firmware-Update") #define MSG_RESET_PRINTER _UxGT("Drucker neustarten") + #define MSG_REFRESH _UxGT("Aktualisieren") #define MSG_WATCH _UxGT("Info") #define MSG_PREPARE _UxGT("Vorbereitung") #define MSG_TUNE _UxGT("Justierung") -#define MSG_PAUSE_PRINT _UxGT("SD-Druck Pause") -#define MSG_RESUME_PRINT _UxGT("SD-Druck Fortsetzung") -#define MSG_STOP_PRINT _UxGT("SD-Druck Abbruch") -#define MSG_CARD_MENU _UxGT("SD-Karte") +#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_CARD_MENU _UxGT("Druck v. SD-Karte") #define MSG_NO_CARD _UxGT("Keine SD-Karte") #define MSG_DWELL _UxGT("Warten...") -#define MSG_USERWAIT _UxGT("Warte auf Nutzer") +#define MSG_USERWAIT _UxGT("Klick zum Fortsetzen") #define MSG_PRINT_PAUSED _UxGT("Druck pausiert") +#define MSG_PRINTING _UxGT("Druckt...") #define MSG_PRINT_ABORTED _UxGT("Druck abgebrochen") -#define MSG_NO_MOVE _UxGT("Motoren eingeschaltet") +#define MSG_NO_MOVE _UxGT("Motoren angeschaltet") #define MSG_KILLED _UxGT("ABGEBROCHEN") #define MSG_STOPPED _UxGT("ANGEHALTEN") -#define MSG_CONTROL_RETRACT _UxGT("Retract mm") -#define MSG_CONTROL_RETRACT_SWAP _UxGT("Wechs. Retract mm") -#define MSG_CONTROL_RETRACTF _UxGT("Retract V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Z-Hop mm") +#define MSG_CONTROL_RETRACT _UxGT("Rückzug mm") +#define MSG_CONTROL_RETRACT_SWAP _UxGT("Wechs. Rückzug mm") +#define MSG_CONTROL_RETRACTF _UxGT("Rückzug V") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Z-Sprung mm") #define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Wechs. UnRet mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") #define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") -#define MSG_AUTORETRACT _UxGT("Autom. Retract") +#define MSG_AUTORETRACT _UxGT("Autom. Rückzug") +#define MSG_FILAMENT_SWAP_LENGTH _UxGT("Rückzug Länge") +#define MSG_TOOL_CHANGE _UxGT("Werkzeugwechsel") +#define MSG_TOOL_CHANGE_ZLIFT _UxGT("Z anheben") +#define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Prime-Geschwin.") +#define MSG_SINGLENOZZLE_RETRACT_SPD _UxGT("Rückzug-Geschwin.") #define MSG_FILAMENTCHANGE _UxGT("Filament wechseln") #define MSG_FILAMENTLOAD _UxGT("Filament laden") #define MSG_FILAMENTUNLOAD _UxGT("Filament entladen") #define MSG_FILAMENTUNLOAD_ALL _UxGT("Alles entladen") #define MSG_INIT_SDCARD _UxGT("SD-Karte erkennen") // Manually initialize the SD-card via user interface -#define MSG_CNG_SDCARD _UxGT("SD-Karte getauscht") // SD-card changed by user. For machines with no autocarddetect. Both send "M21" -#define MSG_ZPROBE_OUT _UxGT("Sensor ausserhalb") -#define MSG_SKEW_FACTOR _UxGT("Skew Faktor") +#define MSG_CHANGE_SDCARD _UxGT("SD-Karte getauscht") // SD-card changed by user. For machines with no autocarddetect. Both send "M21" +#define MSG_ZPROBE_OUT _UxGT("Z-Sonde außerhalb") +#define MSG_SKEW_FACTOR _UxGT("Korrekturfaktor") #define MSG_BLTOUCH _UxGT("BLTouch") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Test") -#define MSG_BLTOUCH_RESET _UxGT("BLTouch Reset") +#define MSG_BLTOUCH_RESET _UxGT("BLTouch zurücks.") #define MSG_BLTOUCH_DEPLOY _UxGT("BLTouch ausfahren") #define MSG_BLTOUCH_STOW _UxGT("BLTouch einfahren") -#define MSG_MANUAL_DEPLOY _UxGT("Z-Sensor anbringen") -#define MSG_MANUAL_STOW _UxGT("Z-Sensor entfernen") +#define MSG_MANUAL_DEPLOY _UxGT("Z-Sonde ausfahren") +#define MSG_MANUAL_STOW _UxGT("Z-Sonde einfahren") #define MSG_HOME _UxGT("Vorher") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST #define MSG_FIRST _UxGT("homen") -#define MSG_ZPROBE_ZOFFSET _UxGT("Z Versatz") +#define MSG_ZPROBE_ZOFFSET _UxGT("Sondenversatz Z") #define MSG_BABYSTEP_X _UxGT("Babystep X") #define MSG_BABYSTEP_Y _UxGT("Babystep Y") #define MSG_BABYSTEP_Z _UxGT("Babystep Z") -#define MSG_ENDSTOP_ABORT _UxGT("Endstopp-Abbr.") -#define MSG_HEATING_FAILED_LCD _UxGT("HEIZEN FEHLGESCHLAGEN") -#define MSG_ERR_REDUNDANT_TEMP _UxGT("REDUND. TEMPERATURABWEICHUNG") +#define MSG_ENDSTOP_ABORT _UxGT("Endstopp Abbr.") +#define MSG_HEATING_FAILED_LCD _UxGT("HEIZEN ERFOLGLOS") +#define MSG_HEATING_FAILED_LCD_BED _UxGT("Bett heizen fehlge.") +#define MSG_ERR_REDUNDANT_TEMP _UxGT("REDUND. TEMP-ABWEI.") #define MSG_THERMAL_RUNAWAY LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT") #define MSG_THERMAL_RUNAWAY_BED _UxGT("BETT") MSG_THERMAL_RUNAWAY #define MSG_ERR_MAXTEMP LCD_STR_THERMOMETER _UxGT(" ÜBERSCHRITTEN") @@ -219,12 +322,14 @@ #define MSG_ERR_MINTEMP_BED _UxGT("BETT ") LCD_STR_THERMOMETER _UxGT(" UNTERSCHRITTEN") #define MSG_ERR_Z_HOMING MSG_HOME _UxGT(" ") MSG_X MSG_Y _UxGT(" ") MSG_FIRST #define MSG_HALTED _UxGT("DRUCKER STOPP") -#define MSG_PLEASE_RESET _UxGT("Bitte Resetten") +#define MSG_PLEASE_RESET _UxGT("Bitte neustarten") #define MSG_SHORT_DAY _UxGT("t") // One character only #define MSG_SHORT_HOUR _UxGT("h") // One character only #define MSG_SHORT_MINUTE _UxGT("m") // One character only #define MSG_HEATING _UxGT("Extr. heizt...") +#define MSG_COOLING _UxGT("Extr. kühlt...") #define MSG_BED_HEATING _UxGT("Bett heizt...") +#define MSG_BED_COOLING _UxGT("Bett kühlt...") #define MSG_DELTA_CALIBRATE _UxGT("Delta kalibrieren") #define MSG_DELTA_CALIBRATE_X _UxGT("Kalibriere X") #define MSG_DELTA_CALIBRATE_Y _UxGT("Kalibriere Y") @@ -233,18 +338,19 @@ #define MSG_DELTA_SETTINGS _UxGT("Delta Einst. anzeig.") #define MSG_DELTA_AUTO_CALIBRATE _UxGT("Autom. Kalibrierung") #define MSG_DELTA_HEIGHT_CALIBRATE _UxGT("Delta Höhe setzen") +#define MSG_DELTA_Z_OFFSET_CALIBRATE _UxGT("Sondenversatz Z") #define MSG_DELTA_DIAG_ROD _UxGT("Diag Rod") #define MSG_DELTA_HEIGHT _UxGT("Höhe") #define MSG_DELTA_RADIUS _UxGT("Radius") #define MSG_INFO_MENU _UxGT("Über den Drucker") -#define MSG_INFO_PRINTER_MENU _UxGT("Drucker Info") -#define MSG_3POINT_LEVELING _UxGT("3-Punkt Nivellierung") +#define MSG_INFO_PRINTER_MENU _UxGT("Drucker-Info") +#define MSG_3POINT_LEVELING _UxGT("3-Punkt-Nivellierung") #define MSG_LINEAR_LEVELING _UxGT("Lineare Nivellierung") #define MSG_BILINEAR_LEVELING _UxGT("Bilineare Nivell.") #define MSG_UBL_LEVELING _UxGT("Unified Bed Leveling") -#define MSG_MESH_LEVELING _UxGT("Netz Nivellierung") -#define MSG_INFO_STATS_MENU _UxGT("Drucker Statistik") -#define MSG_INFO_BOARD_MENU _UxGT("Board Info") +#define MSG_MESH_LEVELING _UxGT("Netz-Nivellierung") +#define MSG_INFO_STATS_MENU _UxGT("Drucker-Statistik") +#define MSG_INFO_BOARD_MENU _UxGT("Board-Info") #define MSG_INFO_THERMISTOR_MENU _UxGT("Thermistoren") #define MSG_INFO_EXTRUDERS _UxGT("Extruder") #define MSG_INFO_BAUDRATE _UxGT("Baud") @@ -252,99 +358,17 @@ #define MSG_CASE_LIGHT _UxGT("Beleuchtung") #define MSG_CASE_LIGHT_BRIGHTNESS _UxGT("Helligkeit") -#define MSG_UBL_DOING_G29 _UxGT("G29 UBL läuft!") -#define MSG_UBL_UNHOMED _UxGT("Erst XYZ homen") -#define MSG_UBL_TOOLS _UxGT("UBL Werkzeuge") -#define MSG_UBL_LEVEL_BED _UxGT("Unified Bed Leveling") -#define MSG_UBL_MANUAL_MESH _UxGT("Netz manuell erst.") -#define MSG_UBL_BC_INSERT _UxGT("Unterlegen & messen") -#define MSG_UBL_BC_INSERT2 _UxGT("Messen") -#define MSG_UBL_BC_REMOVE _UxGT("Entfernen & messen") -#define MSG_UBL_MOVING_TO_NEXT _UxGT("Nächster Punkt...") -#define MSG_UBL_ACTIVATE_MESH _UxGT("UBL aktivieren") -#define MSG_UBL_DEACTIVATE_MESH _UxGT("UBL deaktivieren") -#define MSG_UBL_SET_BED_TEMP _UxGT("Bett Temp.") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Hotend Temp.") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP -#define MSG_UBL_MESH_EDIT _UxGT("Netz bearbeiten") -#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Eigenes Netz bearb.") -#define MSG_UBL_FINE_TUNE_MESH _UxGT("Feineinstellung...") -#define MSG_UBL_DONE_EDITING_MESH _UxGT("Bearbeitung beendet") -#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Eigenes Netz erst.") -#define MSG_UBL_BUILD_MESH_MENU _UxGT("Netz erstellen") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Netz erstellen PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Netz erstellen ABS") -#define MSG_UBL_BUILD_COLD_MESH _UxGT("Netz erstellen kalt") -#define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Netz Höhe einst.") -#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Höhe") -#define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Netz validieren") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Netz validieren PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Netz validieren ABS") -#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Eig. Netz validieren") -#define MSG_UBL_CONTINUE_MESH _UxGT("Netzerst. forts.") -#define MSG_UBL_MESH_LEVELING _UxGT("Netz Nivellierung") -#define MSG_UBL_3POINT_MESH_LEVELING _UxGT("3-Punkt Nivellierung") -#define MSG_UBL_GRID_MESH_LEVELING _UxGT("Gitternetz Nivell.") -#define MSG_UBL_MESH_LEVEL _UxGT("Netz nivellieren") -#define MSG_UBL_SIDE_POINTS _UxGT("Eckpunkte") -#define MSG_UBL_MAP_TYPE _UxGT("Kartentyp") -#define MSG_UBL_OUTPUT_MAP _UxGT("Karte ausgeben") -#define MSG_UBL_OUTPUT_MAP_HOST _UxGT("Ausgabe für Host") -#define MSG_UBL_OUTPUT_MAP_CSV _UxGT("Ausgabe für CSV") -#define MSG_UBL_OUTPUT_MAP_BACKUP _UxGT("Externe Sicherung") -#define MSG_UBL_INFO_UBL _UxGT("UBL Info ausgeben") -#define MSG_UBL_EDIT_MESH_MENU _UxGT("Netz bearbeiten") -#define MSG_UBL_FILLIN_AMOUNT _UxGT("Menge an Fill-in") -#define MSG_UBL_MANUAL_FILLIN _UxGT("Manuelles Fill-in") -#define MSG_UBL_SMART_FILLIN _UxGT("Kluges Fill-in") -#define MSG_UBL_FILLIN_MESH _UxGT("Fill-in Netz") -#define MSG_UBL_INVALIDATE_ALL _UxGT("Alles annullieren") -#define MSG_UBL_INVALIDATE_CLOSEST _UxGT("Nächstlieg. ann.") -#define MSG_UBL_FINE_TUNE_ALL _UxGT("Feineinstellung Alle") -#define MSG_UBL_FINE_TUNE_CLOSEST _UxGT("Feineinst. Nächstl.") -#define MSG_UBL_STORAGE_MESH_MENU _UxGT("Netz Speicherplatz") -#define MSG_UBL_STORAGE_SLOT _UxGT("Memory Slot") -#define MSG_UBL_LOAD_MESH _UxGT("Bett Netz laden") -#define MSG_UBL_SAVE_MESH _UxGT("Bett Netz speichern") -#define MSG_MESH_LOADED _UxGT("Netz %i geladen") -#define MSG_MESH_SAVED _UxGT("Netz %i gespeichert") -#define MSG_NO_STORAGE _UxGT("Kein Speicher") -#define MSG_UBL_SAVE_ERROR _UxGT("ERR:UBL speichern") -#define MSG_UBL_RESTORE_ERROR _UxGT("ERR:UBL wiederherst.") -#define MSG_UBL_Z_OFFSET_STOPPED _UxGT("Z-Versatz angehalten") -#define MSG_UBL_STEP_BY_STEP_MENU _UxGT("Schrittweises UBL") - -#define MSG_LED_CONTROL _UxGT("LED Kontrolle") -#define MSG_LEDS _UxGT("Licht") -#define MSG_LED_PRESETS _UxGT("Licht Einstellungen") -#define MSG_SET_LEDS_RED _UxGT("Rot") -#define MSG_SET_LEDS_ORANGE _UxGT("Orange") -#define MSG_SET_LEDS_YELLOW _UxGT("Gelb") -#define MSG_SET_LEDS_GREEN _UxGT("Grün") -#define MSG_SET_LEDS_BLUE _UxGT("Blau") -#define MSG_SET_LEDS_INDIGO _UxGT("Indigo") -#define MSG_SET_LEDS_VIOLET _UxGT("Violett") -#define MSG_SET_LEDS_WHITE _UxGT("Weiß") -#define MSG_SET_LEDS_DEFAULT _UxGT("Standard") -#define MSG_CUSTOM_LEDS _UxGT("Benutzerdef.") -#define MSG_INTENSITY_R _UxGT("Intensität Rot") -#define MSG_INTENSITY_G _UxGT("Intensität Grün") -#define MSG_INTENSITY_B _UxGT("Intensität Blau") -#define MSG_INTENSITY_W _UxGT("Intensität Weiß") -#define MSG_LED_BRIGHTNESS _UxGT("Helligkeit") - #if LCD_WIDTH >= 20 #define MSG_INFO_PRINT_COUNT _UxGT("Gesamte Drucke") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Beendete Drucke") + #define MSG_INFO_COMPLETED_PRINTS _UxGT("Komplette Drucke") #define MSG_INFO_PRINT_TIME _UxGT("Gesamte Druckzeit") - #define MSG_INFO_PRINT_LONGEST _UxGT("Längster Druckjob") + #define MSG_INFO_PRINT_LONGEST _UxGT("Längste Druckzeit") #define MSG_INFO_PRINT_FILAMENT _UxGT("Gesamt Extrudiert") #else #define MSG_INFO_PRINT_COUNT _UxGT("Drucke") - #define MSG_INFO_COMPLETED_PRINTS _UxGT("Komplett") - #define MSG_INFO_PRINT_TIME _UxGT("Gesamt ") - #define MSG_INFO_PRINT_LONGEST _UxGT("Längster") + #define MSG_INFO_COMPLETED_PRINTS _UxGT("Komplette") + #define MSG_INFO_PRINT_TIME _UxGT("Gesamte") + #define MSG_INFO_PRINT_LONGEST _UxGT("Längste") #define MSG_INFO_PRINT_FILAMENT _UxGT("Extrud.") #endif @@ -352,7 +376,7 @@ #define MSG_INFO_MAX_TEMP _UxGT("Max Temp") #define MSG_INFO_PSU _UxGT("Netzteil") -#define MSG_DRIVE_STRENGTH _UxGT("Motorströme") +#define MSG_DRIVE_STRENGTH _UxGT("Treiberstärke") #define MSG_DAC_PERCENT _UxGT("Treiber %") #define MSG_DAC_EEPROM_WRITE _UxGT("Werte speichern") #define MSG_FILAMENT_CHANGE_HEADER_PAUSE _UxGT("DRUCK PAUSIERT") @@ -362,9 +386,11 @@ #define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Mehr entleeren") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Drucke weiter") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Düse: ") +#define MSG_RUNOUT_SENSOR_ENABLE _UxGT("Auslaufsensor") #define MSG_ERR_HOMING_FAILED _UxGT("Homing gescheitert") #define MSG_ERR_PROBING_FAILED _UxGT("Probing gescheitert") -#define MSG_M600_TOO_COLD _UxGT("M600: Zu kalt") +#define MSG_M600_TOO_COLD _UxGT("M600: zu kalt") + #if LCD_HEIGHT >= 4 // Up to 3 lines allowed #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Warte auf den") @@ -378,7 +404,7 @@ #define MSG_FILAMENT_CHANGE_INSERT_3 _UxGT("drücken...") #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Knopf drücken um") #define MSG_FILAMENT_CHANGE_HEAT_2 _UxGT("Düse aufzuheizen.") - #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Düse heizt auf...") + #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Düse heizt auf") #define MSG_FILAMENT_CHANGE_HEATING_2 _UxGT("Bitte warten...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Warte auf") #define MSG_FILAMENT_CHANGE_LOAD_2 _UxGT("Laden des") @@ -394,6 +420,7 @@ #define MSG_FILAMENT_CHANGE_INIT_1 _UxGT("Bitte warten...") #define MSG_FILAMENT_CHANGE_UNLOAD_1 _UxGT("Auswerfen...") #define MSG_FILAMENT_CHANGE_INSERT_1 _UxGT("Laden und Klick") + #define MSG_FILAMENT_CHANGE_HEAT_1 _UxGT("Klick zum Heizen") #define MSG_FILAMENT_CHANGE_HEATING_1 _UxGT("Heizen...") #define MSG_FILAMENT_CHANGE_LOAD_1 _UxGT("Laden...") #define MSG_FILAMENT_CHANGE_PURGE_1 _UxGT("Entleeren...") diff --git a/Marlin/src/lcd/language/language_el-gr.h b/Marlin/src/lcd/language/language_el-gr.h index 04a1198f32..e5838e9f9d 100644 --- a/Marlin/src/lcd/language/language_el-gr.h +++ b/Marlin/src/lcd/language/language_el-gr.h @@ -52,12 +52,12 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Ορισμός βασικών μετατοπίσεων") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Εφαρμόστηκαν οι μετατοπίσεις") #define MSG_SET_ORIGIN _UxGT("Ορισμός προέλευσης") -#define MSG_PREHEAT_1 _UxGT("Προθέρμανση PLA") +#define MSG_PREHEAT_1 _UxGT("Προθέρμανση " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" όλα") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" κλίνη") #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" επιβεβαίωση") -#define MSG_PREHEAT_2 _UxGT("Προθέρμανση ABS") +#define MSG_PREHEAT_2 _UxGT("Προθέρμανση " PREHEAT_2_LABEL) #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" όλα") #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Bed") @@ -156,14 +156,14 @@ #define MSG_CONTROL_RETRACT _UxGT("Ανάσυρση μμ") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Εναλλαγή ανάσυρσης μμ") #define MSG_CONTROL_RETRACTF _UxGT("Ανάσυρση V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Μεταπήδηση μμ") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Μεταπήδηση μμ") #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_AUTORETRACT _UxGT("Αυτόματη ανάσυρση") #define MSG_FILAMENTCHANGE _UxGT("Αλλαγή νήματος") #define MSG_INIT_SDCARD _UxGT("Προετοιμασία κάρτας SD") -#define MSG_CNG_SDCARD _UxGT("Αλλαγή κάρτας SD") +#define MSG_CHANGE_SDCARD _UxGT("Αλλαγή κάρτας SD") #define MSG_ZPROBE_OUT _UxGT("Διερεύνηση Z εκτός κλίνης") #define MSG_YX_UNHOMED _UxGT("Επαναφορά Χ/Υ πριν από Ζ") #define MSG_XYZ_UNHOMED _UxGT("Επαναφορά ΧΥΖ πρώτα") diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index 2a90098308..2e2ed7e1dd 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -52,12 +52,12 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Ορισμός βασικών μετατοπίσεων") //SHORTEN #define MSG_HOME_OFFSETS_APPLIED _UxGT("Εφαρμόστηκαν οι μετατοπίσεις") //SHORTEN #define MSG_SET_ORIGIN _UxGT("Ορισμός προέλευσης") -#define MSG_PREHEAT_1 _UxGT("Προθέρμανση PLA") +#define MSG_PREHEAT_1 _UxGT("Προθέρμανση " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" όλα") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" bed") //SHORTEN #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" επιβεβαίωση") //SHORTEN -#define MSG_PREHEAT_2 _UxGT("Προθέρμανση ABS") +#define MSG_PREHEAT_2 _UxGT("Προθέρμανση " PREHEAT_2_LABEL) #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" όλα") #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" bed") //SHORTEN @@ -156,14 +156,14 @@ #define MSG_CONTROL_RETRACT _UxGT("Ανάσυρση μμ") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Εναλλαγή ανάσυρσης μμ") //SHORTEN #define MSG_CONTROL_RETRACTF _UxGT("Ανάσυρση V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Μεταπήδηση μμ") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Μεταπήδηση μμ") #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_AUTORETRACT _UxGT("Αυτόματη ανάσυρση") #define MSG_FILAMENTCHANGE _UxGT("Αλλαγή νήματος") #define MSG_INIT_SDCARD _UxGT("Προετοιμασία κάρτας SD") //SHORTEN -#define MSG_CNG_SDCARD _UxGT("Αλλαγή κάρτας SD") +#define MSG_CHANGE_SDCARD _UxGT("Αλλαγή κάρτας SD") #define MSG_ZPROBE_OUT _UxGT("Διερεύνηση Z εκτός Επ.Εκτύπωσης") //SHORTEN #define MSG_YX_UNHOMED _UxGT("Επαναφορά Χ/Υ πριν από Ζ") //SHORTEN #define MSG_XYZ_UNHOMED _UxGT("Επαναφορά ΧΥΖ πρώτα") diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 9c416188b6..f7b4902789 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -119,7 +119,7 @@ #define MSG_SET_ORIGIN _UxGT("Set origin") #endif #ifndef MSG_PREHEAT_1 - #define MSG_PREHEAT_1 _UxGT("Preheat PLA") + #define MSG_PREHEAT_1 _UxGT("Preheat " PREHEAT_1_LABEL) #endif #ifndef MSG_PREHEAT_1_N #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") @@ -137,7 +137,7 @@ #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" conf") #endif #ifndef MSG_PREHEAT_2 - #define MSG_PREHEAT_2 _UxGT("Preheat ABS") + #define MSG_PREHEAT_2 _UxGT("Preheat " PREHEAT_2_LABEL) #endif #ifndef MSG_PREHEAT_2_N #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") @@ -253,17 +253,17 @@ #ifndef MSG_UBL_DEACTIVATE_MESH #define MSG_UBL_DEACTIVATE_MESH _UxGT("Deactivate UBL") #endif -#ifndef MSG_UBL_SET_BED_TEMP - #define MSG_UBL_SET_BED_TEMP _UxGT("Bed Temp") +#ifndef MSG_UBL_SET_TEMP_BED + #define MSG_UBL_SET_TEMP_BED _UxGT("Bed Temp") #endif -#ifndef MSG_UBL_CUSTOM_BED_TEMP - #define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP +#ifndef MSG_UBL_BED_TEMP_CUSTOM + #define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED #endif -#ifndef MSG_UBL_SET_HOTEND_TEMP - #define MSG_UBL_SET_HOTEND_TEMP _UxGT("Hotend Temp") +#ifndef MSG_UBL_SET_TEMP_HOTEND + #define MSG_UBL_SET_TEMP_HOTEND _UxGT("Hotend Temp") #endif -#ifndef MSG_UBL_CUSTOM_HOTEND_TEMP - #define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP +#ifndef MSG_UBL_HOTEND_TEMP_CUSTOM + #define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND #endif #ifndef MSG_UBL_MESH_EDIT #define MSG_UBL_MESH_EDIT _UxGT("Mesh Edit") @@ -283,11 +283,11 @@ #ifndef MSG_UBL_BUILD_MESH_MENU #define MSG_UBL_BUILD_MESH_MENU _UxGT("Build Mesh") #endif -#ifndef MSG_UBL_BUILD_PLA_MESH - #define MSG_UBL_BUILD_PLA_MESH _UxGT("Build PLA Mesh") +#ifndef MSG_UBL_BUILD_MESH_M1 + #define MSG_UBL_BUILD_MESH_M1 _UxGT("Build Mesh (" PREHEAT_1_LABEL ")") #endif -#ifndef MSG_UBL_BUILD_ABS_MESH - #define MSG_UBL_BUILD_ABS_MESH _UxGT("Build ABS Mesh") +#ifndef MSG_UBL_BUILD_MESH_M2 + #define MSG_UBL_BUILD_MESH_M2 _UxGT("Build Mesh (" PREHEAT_2_LABEL ")") #endif #ifndef MSG_UBL_BUILD_COLD_MESH #define MSG_UBL_BUILD_COLD_MESH _UxGT("Build Cold Mesh") @@ -301,11 +301,11 @@ #ifndef MSG_UBL_VALIDATE_MESH_MENU #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validate Mesh") #endif -#ifndef MSG_UBL_VALIDATE_PLA_MESH - #define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Validate PLA Mesh") +#ifndef MSG_UBL_VALIDATE_MESH_M1 + #define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Validate Mesh (" PREHEAT_1_LABEL ")") #endif -#ifndef MSG_UBL_VALIDATE_ABS_MESH - #define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Validate ABS Mesh") +#ifndef MSG_UBL_VALIDATE_MESH_M2 + #define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Validate Mesh (" PREHEAT_2_LABEL ")") #endif #ifndef MSG_UBL_VALIDATE_CUSTOM_MESH #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validate Custom Mesh") @@ -480,6 +480,9 @@ #ifndef MSG_MOVE_E #define MSG_MOVE_E _UxGT("Extruder") #endif +#ifndef MSG_HOTEND_TOO_COLD + #define MSG_HOTEND_TOO_COLD _UxGT("Hotend too cold") +#endif #ifndef MSG_MOVE_01MM #define MSG_MOVE_01MM _UxGT("Move 0.1mm") #endif @@ -507,12 +510,6 @@ #ifndef MSG_EXTRA_FAN_SPEED #define MSG_EXTRA_FAN_SPEED _UxGT("Extra fan speed") #endif -#ifndef MSG_LASER_ON - #define MSG_LASER_ON _UxGT("Laser On") -#endif -#ifndef MSG_LASER_OFF - #define MSG_LASER_OFF _UxGT("Laser Off") -#endif #ifndef MSG_FLOW #define MSG_FLOW _UxGT("Flow") #endif @@ -762,8 +759,8 @@ #ifndef MSG_CONTROL_RETRACTF #define MSG_CONTROL_RETRACTF _UxGT("Retract V") #endif -#ifndef MSG_CONTROL_RETRACT_ZLIFT - #define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") +#ifndef MSG_CONTROL_RETRACT_ZHOP + #define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") #endif #ifndef MSG_CONTROL_RETRACT_RECOVER #define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") @@ -783,8 +780,11 @@ #ifndef MSG_FILAMENT_SWAP_LENGTH #define MSG_FILAMENT_SWAP_LENGTH _UxGT("Retract Distance") #endif -#ifndef MSG_SINGLENOZZLE_TOOL_CHANGE - #define MSG_SINGLENOZZLE_TOOL_CHANGE _UxGT("Tool Change") +#ifndef MSG_TOOL_CHANGE + #define MSG_TOOL_CHANGE _UxGT("Tool Change") +#endif +#ifndef MSG_TOOL_CHANGE_ZLIFT + #define MSG_TOOL_CHANGE_ZLIFT _UxGT("Z Raise") #endif #ifndef MSG_SINGLENOZZLE_PRIME_SPD #define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Prime Speed") @@ -807,8 +807,8 @@ #ifndef MSG_INIT_SDCARD #define MSG_INIT_SDCARD _UxGT("Init. SD card") #endif -#ifndef MSG_CNG_SDCARD - #define MSG_CNG_SDCARD _UxGT("Change SD card") +#ifndef MSG_CHANGE_SDCARD + #define MSG_CHANGE_SDCARD _UxGT("Change SD card") #endif #ifndef MSG_ZPROBE_OUT #define MSG_ZPROBE_OUT _UxGT("Z Probe past bed") diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index f2626ea8cd..7c5c3b593e 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -55,13 +55,13 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Ajustar desfases") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Desfase aplicado") #define MSG_SET_ORIGIN _UxGT("Establecer origen") -#define MSG_PREHEAT_1 _UxGT("Precalentar PLA") +#define MSG_PREHEAT_1 _UxGT("Precalentar " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Todo") #define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" End") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Cama") #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Config") -#define MSG_PREHEAT_2 _UxGT("Precalentar ABS") +#define MSG_PREHEAT_2 _UxGT("Precalentar " PREHEAT_2_LABEL) #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Todo") #define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" End") @@ -155,14 +155,14 @@ #define MSG_CONTROL_RETRACT _UxGT("Retraer mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Interc. Retraer mm") #define MSG_CONTROL_RETRACTF _UxGT("Retraer V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Levantar mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Levantar mm") #define MSG_CONTROL_RETRACT_RECOVER _UxGT("DesRet mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Interc. DesRet mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("DesRet V") #define MSG_AUTORETRACT _UxGT("Retracción Auto.") #define MSG_FILAMENTCHANGE _UxGT("Cambiar filamento") #define MSG_INIT_SDCARD _UxGT("Iniciando tarjeta") -#define MSG_CNG_SDCARD _UxGT("Cambiar tarjeta") +#define MSG_CHANGE_SDCARD _UxGT("Cambiar tarjeta") #define MSG_ZPROBE_OUT _UxGT("Sonda Z fuera") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Auto-Prueba") #define MSG_BLTOUCH_RESET _UxGT("Reiniciar BLTouch") diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index 4a8d0e2f49..11ee846904 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -56,13 +56,13 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Etxe. offset eza.") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsetak ezarrita") #define MSG_SET_ORIGIN _UxGT("Hasiera ipini") -#define MSG_PREHEAT_1 _UxGT("Berotu PLA") +#define MSG_PREHEAT_1 _UxGT("Berotu " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Guztia") #define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Amaia") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Ohea") #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" Ezarp.") -#define MSG_PREHEAT_2 _UxGT("Berotu ABS") +#define MSG_PREHEAT_2 _UxGT("Berotu " PREHEAT_2_LABEL) #define MSG_PREHEAT_2_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_1 _UxGT(" Guztia") #define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Amaia") @@ -92,24 +92,24 @@ //#define MSG_UBL_MOVING_TO_NEXT _UxGT("Moving to next") #define MSG_UBL_ACTIVATE_MESH _UxGT("UBL aktibatu") #define MSG_UBL_DEACTIVATE_MESH _UxGT("UBL desaktibatu") -#define MSG_UBL_SET_BED_TEMP _UxGT("Ohearen tenperatura") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Mutur beroaren tenp.") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP +#define MSG_UBL_SET_TEMP_BED _UxGT("Ohearen tenperatura") +#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED +#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Mutur beroaren tenp.") +#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND #define MSG_UBL_MESH_EDIT _UxGT("Sarea editatu") //#define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Edit Custom Mesh") //#define MSG_UBL_FINE_TUNE_MESH _UxGT("Fine Tuning Mesh") #define MSG_UBL_DONE_EDITING_MESH _UxGT("Sarea editatzea eginda") //#define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Build Custom Mesh") #define MSG_UBL_BUILD_MESH_MENU _UxGT("Sarea sortu") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("PLA sarea sortu") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("ABS sarea sortu") +#define MSG_UBL_BUILD_MESH_M1 _UxGT(PREHEAT_1_LABEL " sarea sortu") +#define MSG_UBL_BUILD_MESH_M2 _UxGT(PREHEAT_2_LABEL " sarea sortu") #define MSG_UBL_BUILD_COLD_MESH _UxGT("Sare hotza sortu") #define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Sarearen altuera doitu") //#define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Height Amount") #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Sarea balioetsi") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("PLA sarea balioetsi") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("ABS sarea balioetsi") +#define MSG_UBL_VALIDATE_MESH_M1 _UxGT(PREHEAT_1_LABEL " sarea balioetsi") +#define MSG_UBL_VALIDATE_MESH_M2 _UxGT(PREHEAT_2_LABEL " sarea balioetsi") //#define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validate Custom Mesh") #define MSG_UBL_CONTINUE_MESH _UxGT("Ohe sarea balioetsi") #define MSG_UBL_MESH_LEVELING _UxGT("Sare berdinketa") @@ -259,7 +259,7 @@ #define MSG_CONTROL_RETRACT _UxGT("Atzera egin mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Atzera mm") #define MSG_CONTROL_RETRACTF _UxGT("Atzera egin V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Igo mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Igo mm") #define MSG_CONTROL_RETRACT_RECOVER _UxGT("Atzera egin mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Swap Atzera mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Atzera egin V") @@ -270,7 +270,7 @@ #define MSG_FILAMENTUNLOAD _UxGT("Harizpia deskargatu") #define MSG_FILAMENTUNLOAD_ALL _UxGT("Erabat deskargatu") #define MSG_INIT_SDCARD _UxGT("Hasieratu SD-a") -#define MSG_CNG_SDCARD _UxGT("Aldatu txartela") +#define MSG_CHANGE_SDCARD _UxGT("Aldatu txartela") #define MSG_ZPROBE_OUT _UxGT("Z zunda kanpora") #define MSG_SKEW_FACTOR _UxGT("Okertze faktorea") #define MSG_BLTOUCH _UxGT("BLTouch") diff --git a/Marlin/src/lcd/language/language_fi.h b/Marlin/src/lcd/language/language_fi.h index 318d310459..12f67d4452 100644 --- a/Marlin/src/lcd/language/language_fi.h +++ b/Marlin/src/lcd/language/language_fi.h @@ -47,16 +47,16 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Set home offsets") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets applied") #define MSG_SET_ORIGIN _UxGT("Aseta origo") -#define MSG_PREHEAT_1 _UxGT("Esilämmitä PLA") -#define MSG_PREHEAT_1_N _UxGT("Esilämmitä PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Esilä. PLA Kaikki") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Esilä. PLA Alusta") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Esilämm. PLA konf") -#define MSG_PREHEAT_2 _UxGT("Esilämmitä ABS") -#define MSG_PREHEAT_2_N _UxGT("Esilämmitä ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Esilä. ABS Kaikki") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Esilä. ABS Alusta") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Esilämm. ABS konf") +#define MSG_PREHEAT_1 _UxGT("Esilämmitä " PREHEAT_1_LABEL) +#define MSG_PREHEAT_1_N _UxGT("Esilämmitä " PREHEAT_1_LABEL " ") +#define MSG_PREHEAT_1_ALL _UxGT("Esilä. " PREHEAT_1_LABEL " Kaikki") +#define MSG_PREHEAT_1_BEDONLY _UxGT("Esilä. " PREHEAT_1_LABEL " Alusta") +#define MSG_PREHEAT_1_SETTINGS _UxGT("Esilämm. " PREHEAT_1_LABEL " konf") +#define MSG_PREHEAT_2 _UxGT("Esilämmitä " PREHEAT_2_LABEL) +#define MSG_PREHEAT_2_N _UxGT("Esilämmitä " PREHEAT_2_LABEL " ") +#define MSG_PREHEAT_2_ALL _UxGT("Esilä. " PREHEAT_2_LABEL " Kaikki") +#define MSG_PREHEAT_2_BEDONLY _UxGT("Esilä. " PREHEAT_2_LABEL " Alusta") +#define MSG_PREHEAT_2_SETTINGS _UxGT("Esilämm. " PREHEAT_2_LABEL " konf") #define MSG_COOLDOWN _UxGT("Jäähdytä") #define MSG_SWITCH_PS_ON _UxGT("Virta päälle") #define MSG_SWITCH_PS_OFF _UxGT("Virta pois") @@ -148,14 +148,14 @@ #define MSG_CONTROL_RETRACT _UxGT("Vedä mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Va. Vedä mm") #define MSG_CONTROL_RETRACTF _UxGT("Vedä V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Z mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Z mm") #define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Va. UnRet mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") #define MSG_AUTORETRACT _UxGT("AutoVeto.") #define MSG_FILAMENTCHANGE _UxGT("Change filament") #define MSG_INIT_SDCARD _UxGT("Init. SD-Card") -#define MSG_CNG_SDCARD _UxGT("Change SD-Card") +#define MSG_CHANGE_SDCARD _UxGT("Change SD-Card") #define MSG_ZPROBE_OUT _UxGT("Z probe out. bed") #define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST #define MSG_FIRST _UxGT("first") diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index cf6d85e504..cd9ff69f77 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -56,18 +56,18 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Régl. décal. origine") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Décalages appliqués") #define MSG_SET_ORIGIN _UxGT("Régler origine") -#define MSG_PREHEAT_1 _UxGT("Préchauffage PLA") -#define MSG_PREHEAT_1_N _UxGT("Préchauff. PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Préch. PLA Tout") +#define MSG_PREHEAT_1 _UxGT("Préchauffage " PREHEAT_1_LABEL) +#define MSG_PREHEAT_1_N _UxGT("Préchauff. " PREHEAT_1_LABEL " ") +#define MSG_PREHEAT_1_ALL _UxGT("Préch. " PREHEAT_1_LABEL " Tout") #define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" buse") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Préch. PLA lit") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Régl. prech. PLA") -#define MSG_PREHEAT_2 _UxGT("Préchauffage ABS") -#define MSG_PREHEAT_2_N _UxGT("Préchauff. ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Préch. ABS Tout") +#define MSG_PREHEAT_1_BEDONLY _UxGT("Préch. " PREHEAT_1_LABEL " lit") +#define MSG_PREHEAT_1_SETTINGS _UxGT("Régl. prech. " PREHEAT_1_LABEL) +#define MSG_PREHEAT_2 _UxGT("Préchauffage " PREHEAT_2_LABEL) +#define MSG_PREHEAT_2_N _UxGT("Préchauff. " PREHEAT_2_LABEL " ") +#define MSG_PREHEAT_2_ALL _UxGT("Préch. " PREHEAT_2_LABEL " Tout") #define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" buse") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Préch. ABS lit") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Régl. prech. ABS") +#define MSG_PREHEAT_2_BEDONLY _UxGT("Préch. " PREHEAT_2_LABEL " lit") +#define MSG_PREHEAT_2_SETTINGS _UxGT("Régl. prech. " PREHEAT_2_LABEL) #define MSG_COOLDOWN _UxGT("Refroidir") #define MSG_SWITCH_PS_ON _UxGT("Allumer alim.") #define MSG_SWITCH_PS_OFF _UxGT("Eteindre alim.") @@ -92,24 +92,24 @@ #define MSG_UBL_MOVING_TO_NEXT _UxGT("Aller au suivant") #define MSG_UBL_ACTIVATE_MESH _UxGT("Activer l'UBL") #define MSG_UBL_DEACTIVATE_MESH _UxGT("Désactiver l'UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Température lit") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Température buse") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP +#define MSG_UBL_SET_TEMP_BED _UxGT("Température lit") +#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED +#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Température buse") +#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND #define MSG_UBL_MESH_EDIT _UxGT("Editer maille") #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Editer maille perso") #define MSG_UBL_FINE_TUNE_MESH _UxGT("Réglage fin maille") #define MSG_UBL_DONE_EDITING_MESH _UxGT("Terminer maille") #define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Créer maille perso") #define MSG_UBL_BUILD_MESH_MENU _UxGT("Créer maille") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Créer maille PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Créer maille ABS") +#define MSG_UBL_BUILD_MESH_M1 _UxGT("Créer maille " PREHEAT_1_LABEL) +#define MSG_UBL_BUILD_MESH_M2 _UxGT("Créer maille " PREHEAT_2_LABEL) #define MSG_UBL_BUILD_COLD_MESH _UxGT("Créer maille froide") #define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Ajuster haut. maille") #define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Hauteur") #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Valider maille") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Valider maille PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Valider maille ABS") +#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Valider maille " PREHEAT_1_LABEL) +#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Valider maille " PREHEAT_2_LABEL) #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Valider maille perso") #define MSG_UBL_CONTINUE_MESH _UxGT("Continuer maille") #define MSG_UBL_MESH_LEVELING _UxGT("Niveau par maille") @@ -261,7 +261,7 @@ #define MSG_CONTROL_RETRACT _UxGT("Retrait mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Ech. Retr. mm") #define MSG_CONTROL_RETRACTF _UxGT("Retrait V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Saut Z mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Saut Z mm") #define MSG_CONTROL_RETRACT_RECOVER _UxGT("Rappel mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Ech. Rappel mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Rappel V") @@ -272,7 +272,7 @@ #define MSG_FILAMENTUNLOAD _UxGT("Décharger fil.") #define MSG_FILAMENTUNLOAD_ALL _UxGT("Décharger tout") #define MSG_INIT_SDCARD _UxGT("Init. la carte SD") -#define MSG_CNG_SDCARD _UxGT("Changer de carte") +#define MSG_CHANGE_SDCARD _UxGT("Changer de carte") #define MSG_ZPROBE_OUT _UxGT("Z sonde hors lit") #define MSG_SKEW_FACTOR _UxGT("Facteur écart") #define MSG_BLTOUCH _UxGT("BLTouch") diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 892f8b4a98..42ec703e04 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -52,16 +52,16 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Offsets na orixe") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets fixados") #define MSG_SET_ORIGIN _UxGT("Fixar orixe") -#define MSG_PREHEAT_1 _UxGT("Prequentar PLA") -#define MSG_PREHEAT_1_N _UxGT("Prequentar PLA ") -#define MSG_PREHEAT_1_ALL _UxGT("Preque. PLA Todo") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Preque. PLA Cama") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Preque. PLA conf") -#define MSG_PREHEAT_2 _UxGT("Prequentar ABS") -#define MSG_PREHEAT_2_N _UxGT("Prequentar ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Preque. ABS Todo") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Preque. ABS Cama") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Preque. ABS conf") +#define MSG_PREHEAT_1 _UxGT("Prequentar " PREHEAT_1_LABEL) +#define MSG_PREHEAT_1_N _UxGT("Prequentar " PREHEAT_1_LABEL " ") +#define MSG_PREHEAT_1_ALL _UxGT("Preque. " PREHEAT_1_LABEL " Todo") +#define MSG_PREHEAT_1_BEDONLY _UxGT("Preque. " PREHEAT_1_LABEL " Cama") +#define MSG_PREHEAT_1_SETTINGS _UxGT("Preque. " PREHEAT_1_LABEL " conf") +#define MSG_PREHEAT_2 _UxGT("Prequentar " PREHEAT_2_LABEL) +#define MSG_PREHEAT_2_N _UxGT("Prequentar " PREHEAT_2_LABEL " ") +#define MSG_PREHEAT_2_ALL _UxGT("Preque. " PREHEAT_2_LABEL " Todo") +#define MSG_PREHEAT_2_BEDONLY _UxGT("Preque. " PREHEAT_2_LABEL " Cama") +#define MSG_PREHEAT_2_SETTINGS _UxGT("Preque. " PREHEAT_2_LABEL " conf") #define MSG_COOLDOWN _UxGT("Arrefriar") #define MSG_SWITCH_PS_ON _UxGT("Acender") #define MSG_SWITCH_PS_OFF _UxGT("Apagar") @@ -157,14 +157,14 @@ #define MSG_CONTROL_RETRACT _UxGT("Retraccion mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Cambio retra. mm") #define MSG_CONTROL_RETRACTF _UxGT("Retraccion V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Alzar Z mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Alzar Z mm") #define MSG_CONTROL_RETRACT_RECOVER _UxGT("Recup. retra. mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Cambio recup. mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Recuperacion V") #define MSG_AUTORETRACT _UxGT("Retraccion auto.") #define MSG_FILAMENTCHANGE _UxGT("Cambiar filamen.") #define MSG_INIT_SDCARD _UxGT("Iniciando SD") -#define MSG_CNG_SDCARD _UxGT("Cambiar SD") +#define MSG_CHANGE_SDCARD _UxGT("Cambiar SD") #define MSG_ZPROBE_OUT _UxGT("Sonda-Z sen cama") #define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST #define MSG_BLTOUCH_SELFTEST _UxGT("Comprobar BLTouch") diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index 1e972778de..57f6abc4be 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -52,12 +52,12 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Postavi home offsete") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets postavljeni") #define MSG_SET_ORIGIN _UxGT("Postavi ishodište") -#define MSG_PREHEAT_1 _UxGT("Predgrij PLA") +#define MSG_PREHEAT_1 _UxGT("Predgrij " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Sve") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Bed") #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" conf") -#define MSG_PREHEAT_2 _UxGT("Predgrij ABS") +#define MSG_PREHEAT_2 _UxGT("Predgrij " PREHEAT_2_LABEL) #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Sve") #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Bed") @@ -157,14 +157,14 @@ #define MSG_CONTROL_RETRACT _UxGT("Retract mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Re.mm") #define MSG_CONTROL_RETRACTF _UxGT("Retract V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop 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_AUTORETRACT _UxGT("AutoRetr.") #define MSG_FILAMENTCHANGE _UxGT("Promijeni filament") #define MSG_INIT_SDCARD _UxGT("Init. SD karticu") -#define MSG_CNG_SDCARD _UxGT("Promijeni SD karticu") +#define MSG_CHANGE_SDCARD _UxGT("Promijeni SD karticu") #define MSG_ZPROBE_OUT _UxGT("Z probe out. bed") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") #define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index b9a42bca32..f7b95ddad0 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -58,14 +58,14 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Imp. offset home") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Offset applicato") #define MSG_SET_ORIGIN _UxGT("Imposta Origine") -#define MSG_PREHEAT_1 _UxGT("Preriscalda PLA") -#define MSG_PREHEAT_1_N _UxGT("Preris.PLA ") +#define MSG_PREHEAT_1 _UxGT("Preriscalda " PREHEAT_1_LABEL) +#define MSG_PREHEAT_1_N _UxGT("Preris." PREHEAT_1_LABEL " ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1_N _UxGT("Tutto") #define MSG_PREHEAT_1_END MSG_PREHEAT_1_N _UxGT("Ugello") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1_N _UxGT("Piatto") #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1_N _UxGT("conf") -#define MSG_PREHEAT_2 _UxGT("Preriscalda ABS") -#define MSG_PREHEAT_2_N _UxGT("Preris.ABS ") +#define MSG_PREHEAT_2 _UxGT("Preriscalda " PREHEAT_2_LABEL) +#define MSG_PREHEAT_2_N _UxGT("Preris." PREHEAT_2_LABEL " ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2_N _UxGT("Tutto") #define MSG_PREHEAT_2_END MSG_PREHEAT_2_N _UxGT("Ugello") #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2_N _UxGT("Piatto") @@ -103,24 +103,24 @@ #define MSG_UBL_MOVING_TO_NEXT _UxGT("Spostamento succes.") #define MSG_UBL_ACTIVATE_MESH _UxGT("Attiva UBL") #define MSG_UBL_DEACTIVATE_MESH _UxGT("Disattiva UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Temp. Piatto") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Temp. Ugello") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP +#define MSG_UBL_SET_TEMP_BED _UxGT("Temp. Piatto") +#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED +#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Temp. Ugello") +#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND #define MSG_UBL_MESH_EDIT _UxGT("Modifica Mesh") #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Modif.Mesh personal.") #define MSG_UBL_FINE_TUNE_MESH _UxGT("Ritocca Mesh") #define MSG_UBL_DONE_EDITING_MESH _UxGT("Modif.Mesh fatta") #define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Crea Mesh personal.") #define MSG_UBL_BUILD_MESH_MENU _UxGT("Crea Mesh") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Crea Mesh PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Crea Mesh ABS") +#define MSG_UBL_BUILD_MESH_M1 _UxGT("Crea Mesh " PREHEAT_1_LABEL) +#define MSG_UBL_BUILD_MESH_M2 _UxGT("Crea Mesh " PREHEAT_2_LABEL) #define MSG_UBL_BUILD_COLD_MESH _UxGT("Crea Mesh a freddo") #define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Aggiusta Alt. Mesh") #define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Altezza") #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Valida Mesh") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Valida Mesh PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Valida Mesh ABS") +#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Valida Mesh " PREHEAT_1_LABEL) +#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Valida Mesh " PREHEAT_2_LABEL) #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Valida Mesh pers.") #define MSG_UBL_CONTINUE_MESH _UxGT("Continua Mesh") #define MSG_UBL_MESH_LEVELING _UxGT("Livell. Mesh") @@ -180,6 +180,7 @@ #define MSG_MOVE_Y _UxGT("Muovi Y") #define MSG_MOVE_Z _UxGT("Muovi Z") #define MSG_MOVE_E _UxGT("Estrusore") +#define MSG_HOTEND_TOO_COLD _UxGT("Ugello freddo") #define MSG_MOVE_01MM _UxGT("Muovi di 0.1mm") #define MSG_MOVE_1MM _UxGT("Muovi di 1mm") #define MSG_MOVE_10MM _UxGT("Muovi di 10mm") @@ -253,6 +254,8 @@ #define MSG_LOAD_EEPROM _UxGT("Carica impostazioni") #define MSG_RESTORE_FAILSAFE _UxGT("Ripristina imp.") #define MSG_INIT_EEPROM _UxGT("Inizializza EEPROM") +#define MSG_SD_UPDATE _UxGT("Aggiorna SD") +#define MSG_RESET_PRINTER _UxGT("Resetta stampante") #define MSG_REFRESH _UxGT("Aggiorna") #define MSG_WATCH _UxGT("Schermata info") #define MSG_PREPARE _UxGT("Prepara") @@ -274,14 +277,15 @@ #define MSG_CONTROL_RETRACT _UxGT("Ritrai mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Scamb. Ritrai mm") #define MSG_CONTROL_RETRACTF _UxGT("Ritrai V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Salta mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Salta mm") #define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Scamb. UnRet mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet V") #define MSG_CONTROL_RETRACT_RECOVER_SWAPF _UxGT("S UnRet V") #define MSG_AUTORETRACT _UxGT("AutoRitrai") #define MSG_FILAMENT_SWAP_LENGTH _UxGT("Dist. ritrazione") -#define MSG_SINGLENOZZLE_TOOL_CHANGE _UxGT("Cambio utensile") +#define MSG_TOOL_CHANGE _UxGT("Cambio utensile") +#define MSG_TOOL_CHANGE_ZLIFT _UxGT("Risalita Z") #define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Velocità innesco") #define MSG_SINGLENOZZLE_RETRACT_SPD _UxGT("Velocità retrazione") #define MSG_FILAMENTCHANGE _UxGT("Cambia filamento") @@ -289,7 +293,7 @@ #define MSG_FILAMENTUNLOAD _UxGT("Rimuovi filamento") #define MSG_FILAMENTUNLOAD_ALL _UxGT("Rimuovi tutto") #define MSG_INIT_SDCARD _UxGT("Iniz. SD-Card") -#define MSG_CNG_SDCARD _UxGT("Cambia SD-Card") +#define MSG_CHANGE_SDCARD _UxGT("Cambia SD-Card") #define MSG_ZPROBE_OUT _UxGT("Z probe fuori piatto") #define MSG_SKEW_FACTOR _UxGT("Fattore distorsione") #define MSG_BLTOUCH _UxGT("BLTouch") diff --git a/Marlin/src/lcd/language/language_jp-kana.h b/Marlin/src/lcd/language/language_jp-kana.h index 3bda84803a..ebe0bfbc1a 100644 --- a/Marlin/src/lcd/language/language_jp-kana.h +++ b/Marlin/src/lcd/language/language_jp-kana.h @@ -60,15 +60,15 @@ #define MSG_SET_HOME_OFFSETS _UxGT("キジュンオフセットセッテイ") // "Set home offsets" #define MSG_HOME_OFFSETS_APPLIED _UxGT("オフセットガテキヨウサレマシタ") // "Offsets applied" #define MSG_SET_ORIGIN _UxGT("キジュンセット") // "Set origin" -#define MSG_PREHEAT_1 _UxGT("PLA ヨネツ") // "Preheat PLA" +#define MSG_PREHEAT_1 _UxGT(PREHEAT_1_LABEL " ヨネツ") // "Preheat " PREHEAT_1_LABEL #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") -#define MSG_PREHEAT_1_ALL _UxGT("PLA スベテヨネツ") // " All" -#define MSG_PREHEAT_1_BEDONLY _UxGT("PLA ベッドヨネツ") // " Bed" +#define MSG_PREHEAT_1_ALL _UxGT(PREHEAT_1_LABEL " スベテヨネツ") // " All" +#define MSG_PREHEAT_1_BEDONLY _UxGT(PREHEAT_1_LABEL " ベッドヨネツ") // " Bed" #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT("セッテイ") // " conf" -#define MSG_PREHEAT_2 _UxGT("ABS ヨネツ") // "Preheat ABS" +#define MSG_PREHEAT_2 _UxGT(PREHEAT_2_LABEL " ヨネツ") // "Preheat " PREHEAT_2_LABEL #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") -#define MSG_PREHEAT_2_ALL _UxGT("ABS スベテヨネツ") // " All" -#define MSG_PREHEAT_2_BEDONLY _UxGT("ABS ベッドヨネツ") // " Bed" +#define MSG_PREHEAT_2_ALL _UxGT(PREHEAT_2_LABEL " スベテヨネツ") // " All" +#define MSG_PREHEAT_2_BEDONLY _UxGT(PREHEAT_2_LABEL " ベッドヨネツ") // " Bed" #define MSG_PREHEAT_2_SETTINGS MSG_PREHEAT_2 _UxGT("セッテイ") // " conf" #define MSG_COOLDOWN _UxGT("カネツテイシ") // "Cooldown" #define MSG_SWITCH_PS_ON _UxGT("デンゲン オン") // "Switch power on" @@ -152,14 +152,14 @@ #define MSG_CONTROL_RETRACT _UxGT("ヒキコミリョウ mm") // "Retract mm" #define MSG_CONTROL_RETRACT_SWAP _UxGT("ヒキコミリョウS mm") // "Swap Re.mm" #define MSG_CONTROL_RETRACTF _UxGT("ヒキコミソクド mm/s") // "Retract V" -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("ノズルタイヒ mm") // "Hop mm" +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("ノズルタイヒ mm") // "Hop mm" #define MSG_CONTROL_RETRACT_RECOVER _UxGT("ホショウリョウ mm") // "UnRet mm" #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("ホショウリョウS mm") // "S UnRet mm" #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("ホショウソクド mm/s") // "UnRet V" #define MSG_AUTORETRACT _UxGT("ジドウヒキコミ") // "AutoRetr." #define MSG_FILAMENTCHANGE _UxGT("フィラメントコウカン") // "Change filament" #define MSG_INIT_SDCARD _UxGT("SDカードサイヨミコミ") // "Init. SD card" -#define MSG_CNG_SDCARD _UxGT("SDカードコウカン") // "Change SD card" +#define MSG_CHANGE_SDCARD _UxGT("SDカードコウカン") // "Change SD card" #define MSG_ZPROBE_OUT _UxGT("Zプローブ ベッドガイ") // "Z probe out. bed" #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch ジコシンダン") // "BLTouch Self-Test" #define MSG_BLTOUCH_RESET _UxGT("BLTouch リセット") // "Reset BLTouch" diff --git a/Marlin/src/lcd/language/language_ko_KR.h b/Marlin/src/lcd/language/language_ko_KR.h index 13916e9ac5..f22f3615c8 100644 --- a/Marlin/src/lcd/language/language_ko_KR.h +++ b/Marlin/src/lcd/language/language_ko_KR.h @@ -58,13 +58,13 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Set home offsets") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets applied") #define MSG_SET_ORIGIN _UxGT("Set origin") -#define MSG_PREHEAT_1 _UxGT("예열하기 - PLA") +#define MSG_PREHEAT_1 _UxGT("예열하기 - " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" 모두") #define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" 노즐만") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" 베드만") #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" conf") -#define MSG_PREHEAT_2 _UxGT("예열하기 - ABS") +#define MSG_PREHEAT_2 _UxGT("예열하기 - " PREHEAT_2_LABEL) #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" 모두") #define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" 노즐만") @@ -103,24 +103,24 @@ #define MSG_UBL_MOVING_TO_NEXT _UxGT("Moving to next") #define MSG_UBL_ACTIVATE_MESH _UxGT("Activate UBL") #define MSG_UBL_DEACTIVATE_MESH _UxGT("Deactivate UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Bed Temp") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Hotend Temp") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP +#define MSG_UBL_SET_TEMP_BED _UxGT("Bed Temp") +#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED +#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Hotend Temp") +#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND #define MSG_UBL_MESH_EDIT _UxGT("Mesh Edit") #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Edit Custom Mesh") #define MSG_UBL_FINE_TUNE_MESH _UxGT("Fine Tuning Mesh") #define MSG_UBL_DONE_EDITING_MESH _UxGT("Done Editing Mesh") #define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Build Custom Mesh") #define MSG_UBL_BUILD_MESH_MENU _UxGT("Build Mesh") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Build PLA Mesh") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Build ABS Mesh") +#define MSG_UBL_BUILD_MESH_M1 _UxGT("Build Mesh (" PREHEAT_1_LABEL ")") +#define MSG_UBL_BUILD_MESH_M2 _UxGT("Build Mesh (" PREHEAT_2_LABEL ")") #define MSG_UBL_BUILD_COLD_MESH _UxGT("Build Cold Mesh") #define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Adjust Mesh Height") #define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Height Amount") #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validate Mesh") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Validate PLA Mesh") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Validate ABS Mesh") +#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Validate " PREHEAT_1_LABEL " Mesh") +#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Validate Mesh (" PREHEAT_2_LABEL ")") #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validate Custom Mesh") #define MSG_UBL_CONTINUE_MESH _UxGT("Continue Bed Mesh") #define MSG_UBL_MESH_LEVELING _UxGT("Mesh Leveling") @@ -274,7 +274,7 @@ #define MSG_CONTROL_RETRACT _UxGT("Retract mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Swap Re.mm") #define MSG_CONTROL_RETRACTF _UxGT("Retract V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop 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") @@ -285,7 +285,7 @@ #define MSG_FILAMENTUNLOAD _UxGT("Unload filament") #define MSG_FILAMENTUNLOAD_ALL _UxGT("Unload All") #define MSG_INIT_SDCARD _UxGT("Init. SD card") -#define MSG_CNG_SDCARD _UxGT("Change SD card") +#define MSG_CHANGE_SDCARD _UxGT("Change SD card") #define MSG_ZPROBE_OUT _UxGT("Z Probe past bed") #define MSG_SKEW_FACTOR _UxGT("Skew Factor") #define MSG_BLTOUCH _UxGT("BLTouch") diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 1def4b1060..6c2d383200 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -55,18 +55,18 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Zet home offsets") #define MSG_HOME_OFFSETS_APPLIED _UxGT("H offset toegep.") #define MSG_SET_ORIGIN _UxGT("Nulpunt instellen") -#define MSG_PREHEAT_1 _UxGT("PLA voorverwarmen") -#define MSG_PREHEAT_1_N _UxGT("PLA voorverw. ") +#define MSG_PREHEAT_1 _UxGT(PREHEAT_1_LABEL " voorverwarmen") +#define MSG_PREHEAT_1_N _UxGT(PREHEAT_1_LABEL " voorverw. ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1_N _UxGT("aan") #define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" Einde") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1_N _UxGT("Bed") -#define MSG_PREHEAT_1_SETTINGS _UxGT("PLA verw. conf") -#define MSG_PREHEAT_2 _UxGT("ABS voorverwarmen") -#define MSG_PREHEAT_2_N _UxGT("ABS voorverw. ") +#define MSG_PREHEAT_1_SETTINGS _UxGT(PREHEAT_1_LABEL " verw. conf") +#define MSG_PREHEAT_2 _UxGT(PREHEAT_2_LABEL " voorverwarmen") +#define MSG_PREHEAT_2_N _UxGT(PREHEAT_2_LABEL " voorverw. ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2_N _UxGT("aan") #define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" Einde") #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2_N _UxGT("Bed") -#define MSG_PREHEAT_2_SETTINGS _UxGT("ABS verw. conf") +#define MSG_PREHEAT_2_SETTINGS _UxGT(PREHEAT_2_LABEL " verw. conf") #define MSG_COOLDOWN _UxGT("Afkoelen") #define MSG_SWITCH_PS_ON _UxGT("Stroom aan") #define MSG_SWITCH_PS_OFF _UxGT("Stroom uit") @@ -166,14 +166,14 @@ #define MSG_CONTROL_RETRACT _UxGT("Retract mm") //accepted English term in Dutch #define MSG_CONTROL_RETRACT_SWAP _UxGT("Ruil Retract mm") #define MSG_CONTROL_RETRACTF _UxGT("Retract F") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") #define MSG_CONTROL_RETRACT_RECOVER _UxGT("UnRet mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Ruil UnRet mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("UnRet F") #define MSG_AUTORETRACT _UxGT("AutoRetr.") #define MSG_FILAMENTCHANGE _UxGT("Verv. Filament") #define MSG_INIT_SDCARD _UxGT("Init. SD kaart") -#define MSG_CNG_SDCARD _UxGT("Verv. SD Kaart") +#define MSG_CHANGE_SDCARD _UxGT("Verv. SD Kaart") #define MSG_ZPROBE_OUT _UxGT("Z probe uit. bed") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Zelf-Test") #define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 07fbc11954..478ece8987 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -52,16 +52,16 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Ust. poz. zer.") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Poz. zerowa ust.") #define MSG_SET_ORIGIN _UxGT("Ustaw punkt zero") -#define MSG_PREHEAT_1 _UxGT("Rozgrzej PLA") +#define MSG_PREHEAT_1 _UxGT("Rozgrzej " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" wsz.") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Rozgrzej stół PLA") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Ustaw. rozg. PLA") -#define MSG_PREHEAT_2 _UxGT("Rozgrzej ABS") +#define MSG_PREHEAT_1_BEDONLY _UxGT("Rozgrzej stół " PREHEAT_1_LABEL) +#define MSG_PREHEAT_1_SETTINGS _UxGT("Ustaw. rozg. " PREHEAT_1_LABEL) +#define MSG_PREHEAT_2 _UxGT("Rozgrzej " PREHEAT_2_LABEL) #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" wsz.") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Rozgrzej stół ABS") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Ustaw. rozg. ABS") +#define MSG_PREHEAT_2_BEDONLY _UxGT("Rozgrzej stół " PREHEAT_2_LABEL) +#define MSG_PREHEAT_2_SETTINGS _UxGT("Ustaw. rozg. " PREHEAT_2_LABEL) #define MSG_COOLDOWN _UxGT("Chłodzenie") #define MSG_SWITCH_PS_ON _UxGT("Włącz zasilacz") #define MSG_SWITCH_PS_OFF _UxGT("Wyłącz zasilacz") @@ -157,14 +157,14 @@ #define MSG_CONTROL_RETRACT _UxGT("Wycofaj mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Z Wycof. mm") #define MSG_CONTROL_RETRACTF _UxGT("Wycofaj V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Skok Z mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Skok Z mm") #define MSG_CONTROL_RETRACT_RECOVER _UxGT("Cof. wycof. mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Z Cof. wyc. mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Cof. wycof. V") #define MSG_AUTORETRACT _UxGT("Auto. wycofanie") #define MSG_FILAMENTCHANGE _UxGT("Zmień filament") #define MSG_INIT_SDCARD _UxGT("Inicjal. karty SD") -#define MSG_CNG_SDCARD _UxGT("Zmiana karty SD") +#define MSG_CHANGE_SDCARD _UxGT("Zmiana karty SD") #define MSG_ZPROBE_OUT _UxGT("Sonda Z za stołem") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Self-Test") #define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") diff --git a/Marlin/src/lcd/language/language_pt-br.h b/Marlin/src/lcd/language/language_pt-br.h index a6c1e53b4c..28b62a2888 100644 --- a/Marlin/src/lcd/language/language_pt-br.h +++ b/Marlin/src/lcd/language/language_pt-br.h @@ -60,18 +60,18 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Compensar origem") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Alteração feita") #define MSG_SET_ORIGIN _UxGT("Ajustar Origem") -#define MSG_PREHEAT_1 _UxGT("Pre-aquecer PLA") +#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 PLA") +#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_BEDONLY _UxGT("Pre-aq.Mesa PLA") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Ajustar PLA") -#define MSG_PREHEAT_2 _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_N _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_ALL _UxGT("Pre-aq.Todo ABS") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq.Mesa ABS") +#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_ALL _UxGT("Pre-aq.Todo " 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 ABS") +#define MSG_PREHEAT_2_SETTINGS _UxGT("Ajustar " PREHEAT_2_LABEL) #define MSG_COOLDOWN _UxGT("Esfriar") #define MSG_SWITCH_PS_ON _UxGT("Ligar") #define MSG_SWITCH_PS_OFF _UxGT("Desligar") @@ -97,24 +97,24 @@ #define MSG_UBL_MOVING_TO_NEXT _UxGT("Indo para o Próximo") #define MSG_UBL_ACTIVATE_MESH _UxGT("Ativar UBL") #define MSG_UBL_DEACTIVATE_MESH _UxGT("Desativar UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Temp. Mesa") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Temp. Extrusora") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP +#define MSG_UBL_SET_TEMP_BED _UxGT("Temp. Mesa") +#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED +#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Temp. Extrusora") +#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND #define MSG_UBL_MESH_EDIT _UxGT("Editar Malha") #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_MESH_MENU _UxGT("Montar ") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Montar PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Montar ABS") +#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_MESH_HEIGHT_ADJUST _UxGT("Ajustar Altura") #define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Tamanho da Elevação") #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Validar Malha") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Checar PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Checar ABS") +#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Checar " PREHEAT_1_LABEL) +#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Checar " PREHEAT_2_LABEL) #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Validar Malha Custom") #define MSG_UBL_CONTINUE_MESH _UxGT("Continuar Malha") #define MSG_UBL_MESH_LEVELING _UxGT("Nivelação da Malha") @@ -267,14 +267,14 @@ #define MSG_CONTROL_RETRACT _UxGT("Retrair mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Retrair Troca mm") #define MSG_CONTROL_RETRACTF _UxGT("Retrair V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Saltar mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Saltar mm") #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_AUTORETRACT _UxGT("Retração Automática") #define MSG_FILAMENTCHANGE _UxGT("Trocar Filamento") #define MSG_INIT_SDCARD _UxGT("Iniciar SD") -#define MSG_CNG_SDCARD _UxGT("Trocar SD") +#define MSG_CHANGE_SDCARD _UxGT("Trocar SD") #define MSG_ZPROBE_OUT _UxGT("Sonda fora da mesa") #define MSG_SKEW_FACTOR _UxGT("Fator de Cisalho") #define MSG_BLTOUCH _UxGT("BLTouch") diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index 67500a087f..a243d75d58 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -52,16 +52,16 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Definir desvio") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsets aplicados") #define MSG_SET_ORIGIN _UxGT("Definir origem") -#define MSG_PREHEAT_1 _UxGT("Pre-aquecer PLA") -#define MSG_PREHEAT_1_N _UxGT("Pre-aquecer PLA") -#define MSG_PREHEAT_1_ALL _UxGT("Pre-aq. PLA Tudo") -#define MSG_PREHEAT_1_BEDONLY _UxGT("Pre-aq. PLA ") LCD_STR_THERMOMETER _UxGT("Base") -#define MSG_PREHEAT_1_SETTINGS _UxGT("Definições PLA") -#define MSG_PREHEAT_2 _UxGT("Pre-aquecer ABS") -#define MSG_PREHEAT_2_N _UxGT("Pre-aquecer ABS ") -#define MSG_PREHEAT_2_ALL _UxGT("Pre-aq. ABS Tudo") -#define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq. ABS ") LCD_STR_THERMOMETER _UxGT("Base") -#define MSG_PREHEAT_2_SETTINGS _UxGT("Definições ABS") +#define MSG_PREHEAT_1 _UxGT("Pre-aquecer " PREHEAT_1_LABEL) +#define MSG_PREHEAT_1_N _UxGT("Pre-aquecer " PREHEAT_1_LABEL) +#define MSG_PREHEAT_1_ALL _UxGT("Pre-aq. " PREHEAT_1_LABEL " Tudo") +#define MSG_PREHEAT_1_BEDONLY _UxGT("Pre-aq. " PREHEAT_1_LABEL " ") LCD_STR_THERMOMETER _UxGT("Base") +#define MSG_PREHEAT_1_SETTINGS _UxGT("Definições " 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_ALL _UxGT("Pre-aq. " PREHEAT_2_LABEL " Tudo") +#define MSG_PREHEAT_2_BEDONLY _UxGT("Pre-aq. " PREHEAT_2_LABEL " ") LCD_STR_THERMOMETER _UxGT("Base") +#define MSG_PREHEAT_2_SETTINGS _UxGT("Definições " PREHEAT_2_LABEL) #define MSG_COOLDOWN _UxGT("Arrefecer") #define MSG_SWITCH_PS_ON _UxGT("Ligar") #define MSG_SWITCH_PS_OFF _UxGT("Desligar") @@ -154,14 +154,14 @@ #define MSG_CONTROL_RETRACT _UxGT(" Retrair mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Troca Retrair mm") #define MSG_CONTROL_RETRACTF _UxGT(" Retrair V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT(" Levantar mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT(" Levantar mm") #define MSG_CONTROL_RETRACT_RECOVER _UxGT(" DesRet mm") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Troca DesRet mm") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT(" DesRet V") #define MSG_AUTORETRACT _UxGT(" AutoRetr.") #define MSG_FILAMENTCHANGE _UxGT("Trocar filamento") #define MSG_INIT_SDCARD _UxGT("Inici. cartão SD") -#define MSG_CNG_SDCARD _UxGT("Trocar cartão SD") +#define MSG_CHANGE_SDCARD _UxGT("Trocar cartão SD") #define MSG_ZPROBE_OUT _UxGT("Sensor fora/base") #define MSG_HOME _UxGT("Home") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST #define MSG_FIRST _UxGT("first") diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 9e73e051d2..3bfb82d4d5 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -57,13 +57,13 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Запомнить парковку") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Коррекции применены") #define MSG_SET_ORIGIN _UxGT("Запомнить ноль") -#define MSG_PREHEAT_1 _UxGT("Преднагрев PLA") +#define MSG_PREHEAT_1 _UxGT("Преднагрев " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" всё") #define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" сопло") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" стол") #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" настр.") -#define MSG_PREHEAT_2 _UxGT("Преднагрев ABS") +#define MSG_PREHEAT_2 _UxGT("Преднагрев " PREHEAT_2_LABEL) #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" всё") #define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" сопло") @@ -93,24 +93,24 @@ #define MSG_UBL_MOVING_TO_NEXT _UxGT("Двигаемся дальше") #define MSG_UBL_ACTIVATE_MESH _UxGT("Активировать UBL") #define MSG_UBL_DEACTIVATE_MESH _UxGT("Деактивировать UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Температура стола") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Температура сопла") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP +#define MSG_UBL_SET_TEMP_BED _UxGT("Температура стола") +#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED +#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Температура сопла") +#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND #define MSG_UBL_MESH_EDIT _UxGT("Редактор сеток") #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Редакт. свою сетку") #define MSG_UBL_FINE_TUNE_MESH _UxGT("Точная настр. сетки") #define MSG_UBL_DONE_EDITING_MESH _UxGT("Ред. сетки завершено") #define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Построить свою сетку") #define MSG_UBL_BUILD_MESH_MENU _UxGT("Построить сетку") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Построить сетку PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Построить сетку ABS") +#define MSG_UBL_BUILD_MESH_M1 _UxGT("Построить сетку " PREHEAT_1_LABEL) +#define MSG_UBL_BUILD_MESH_M2 _UxGT("Построить сетку " PREHEAT_2_LABEL) #define MSG_UBL_BUILD_COLD_MESH _UxGT("Построить хол. сетку") #define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Устан. высоту сетки") #define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Высота") #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Проверить сетку") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Проверить сетку PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Проверить сетку ABS") +#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Проверить сетку " PREHEAT_1_LABEL) +#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Проверить сетку " PREHEAT_2_LABEL) #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Проверить свою сетку") #define MSG_UBL_CONTINUE_MESH _UxGT("Продолжить сетку") #define MSG_UBL_MESH_LEVELING _UxGT("Калибровка сетки") @@ -261,7 +261,7 @@ #define MSG_CONTROL_RETRACT _UxGT("Втягивание мм") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Втягивание смены мм") #define MSG_CONTROL_RETRACTF _UxGT("Втягивание V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Втяг. прыжка мм") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Втяг. прыжка мм") #define MSG_CONTROL_RETRACT_RECOVER _UxGT("Возврат мм") #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("Возврат смены мм") #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("Возврат V") @@ -272,7 +272,7 @@ #define MSG_FILAMENTUNLOAD _UxGT("Выгрузка филамента") #define MSG_FILAMENTUNLOAD_ALL _UxGT("Выгрузить всё") #define MSG_INIT_SDCARD _UxGT("Иниц. SD карту") -#define MSG_CNG_SDCARD _UxGT("Сменить SD карту") +#define MSG_CHANGE_SDCARD _UxGT("Сменить SD карту") #define MSG_ZPROBE_OUT _UxGT("Z датчик вне стола") #define MSG_SKEW_FACTOR _UxGT("Фактор наклона") #define MSG_BLTOUCH _UxGT("BLTouch") diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index fdcecab4ed..2f78581a7c 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -69,13 +69,13 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Nastaviť offsety") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Offsety nastavené") #define MSG_SET_ORIGIN _UxGT("Nastaviť začiatok") -#define MSG_PREHEAT_1 _UxGT("Zahriať PLA") +#define MSG_PREHEAT_1 _UxGT("Zahriať " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" všetko") #define MSG_PREHEAT_1_END MSG_PREHEAT_1 _UxGT(" hotend") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" podlož") #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" nast.") -#define MSG_PREHEAT_2 _UxGT("Zahriať ABS") +#define MSG_PREHEAT_2 _UxGT("Zahriať " PREHEAT_2_LABEL) #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" všetko") #define MSG_PREHEAT_2_END MSG_PREHEAT_2 _UxGT(" hotend") @@ -102,7 +102,12 @@ #define MSG_IDEX_MENU _UxGT("IDEX mód") #define MSG_IDEX_MODE_AUTOPARK _UxGT("Auto-parkovanie") #define MSG_IDEX_MODE_DUPLICATE _UxGT("Duplikácia") +#define MSG_IDEX_MODE_SCALED_COPY _UxGT("Zmenšená kópia") #define MSG_IDEX_MODE_FULL_CTRL _UxGT("Plná kontrola") +#define MSG_IDEX_X_OFFSET _UxGT("2. tryska X") +#define MSG_IDEX_Y_OFFSET _UxGT("2. tryska Y") +#define MSG_IDEX_Z_OFFSET _UxGT("2. tryska Z") +#define MSG_IDEX_SAVE_OFFSETS _UxGT("Uložiť offsety") #define MSG_UBL_MANUAL_MESH _UxGT("Manuálna sieť bodov") #define MSG_UBL_BC_INSERT _UxGT("Položte a zmerajte") #define MSG_UBL_BC_INSERT2 _UxGT("Zmerajte") @@ -110,24 +115,24 @@ #define MSG_UBL_MOVING_TO_NEXT _UxGT("Presun na ďalší") #define MSG_UBL_ACTIVATE_MESH _UxGT("Aktivovať UBL") #define MSG_UBL_DEACTIVATE_MESH _UxGT("Deaktivovať UBL") -#define MSG_UBL_SET_BED_TEMP _UxGT("Teplota podložky") -#define MSG_UBL_CUSTOM_BED_TEMP MSG_UBL_SET_BED_TEMP -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("Teplota hotendu") -#define MSG_UBL_CUSTOM_HOTEND_TEMP MSG_UBL_SET_HOTEND_TEMP +#define MSG_UBL_SET_TEMP_BED _UxGT("Teplota podložky") +#define MSG_UBL_BED_TEMP_CUSTOM MSG_UBL_SET_TEMP_BED +#define MSG_UBL_SET_TEMP_HOTEND _UxGT("Teplota hotendu") +#define MSG_UBL_HOTEND_TEMP_CUSTOM MSG_UBL_SET_TEMP_HOTEND #define MSG_UBL_MESH_EDIT _UxGT("Úprava siete bodov") #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("Upraviť vlastnú sieť") #define MSG_UBL_FINE_TUNE_MESH _UxGT("Doladiť sieť bodov") #define MSG_UBL_DONE_EDITING_MESH _UxGT("Koniec úprav siete") #define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("Vlastná sieť") #define MSG_UBL_BUILD_MESH_MENU _UxGT("Vytvoriť sieť") -#define MSG_UBL_BUILD_PLA_MESH _UxGT("Sieť bodov PLA") -#define MSG_UBL_BUILD_ABS_MESH _UxGT("Sieť bodov ABS") +#define MSG_UBL_BUILD_MESH_M1 _UxGT("Sieť bodov " PREHEAT_1_LABEL) +#define MSG_UBL_BUILD_MESH_M2 _UxGT("Sieť bodov " PREHEAT_2_LABEL) #define MSG_UBL_BUILD_COLD_MESH _UxGT("Studená sieť bodov") #define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("Upraviť výšku siete") #define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("Výška") #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("Skontrolovať sieť") -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("Kontrola siete PLA") -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("Kontrola siete ABS") +#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("Kontrola siete " PREHEAT_1_LABEL) +#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("Kontrola siete " PREHEAT_2_LABEL) #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("Kontrola vlast.siete") #define MSG_UBL_CONTINUE_MESH _UxGT("Pokračovať v sieti") #define MSG_UBL_MESH_LEVELING _UxGT("Sieťové rovnanie") @@ -187,6 +192,7 @@ #define MSG_MOVE_Y _UxGT("Posunúť Y") #define MSG_MOVE_Z _UxGT("Posunúť Z") #define MSG_MOVE_E _UxGT("Extrudér") +#define MSG_HOTEND_TOO_COLD _UxGT("Hotend je studený") #define MSG_MOVE_01MM _UxGT("Posunúť o 0,1mm") #define MSG_MOVE_1MM _UxGT("Posunúť o 1mm") #define MSG_MOVE_10MM _UxGT("Posunúť o 10mm") @@ -259,7 +265,9 @@ #define MSG_STORE_EEPROM _UxGT("Uložiť nastavenie") #define MSG_LOAD_EEPROM _UxGT("Načítať nastavenie") #define MSG_RESTORE_FAILSAFE _UxGT("Obnoviť nastavenie") -#define MSG_INIT_EEPROM _UxGT("Inicializácia EEPROM") +#define MSG_INIT_EEPROM _UxGT("Inicializ. EEPROM") +#define MSG_SD_UPDATE _UxGT("Aktualizovať z SD") +#define MSG_RESET_PRINTER _UxGT("Reštart. tlačiar.") #define MSG_REFRESH _UxGT("Obnoviť") #define MSG_WATCH _UxGT("Info. obrazovka") #define MSG_PREPARE _UxGT("Príprava tlače") @@ -281,19 +289,24 @@ #define MSG_CONTROL_RETRACT _UxGT("Retrakt mm") #define MSG_CONTROL_RETRACT_SWAP _UxGT("Výmena Re.mm") #define MSG_CONTROL_RETRACTF _UxGT("Retraktovať V") -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Zdvih Z mm") +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Zdvih Z 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("AutoRetr.") +#define MSG_FILAMENT_SWAP_LENGTH _UxGT("Dĺžka retrakcie") +#define MSG_TOOL_CHANGE _UxGT("Výmena nástroja") +#define MSG_TOOL_CHANGE_ZLIFT _UxGT("Zdvihnúť Z") +#define MSG_SINGLENOZZLE_PRIME_SPD _UxGT("Primárna rýchl.") +#define MSG_SINGLENOZZLE_RETRACT_SPD _UxGT("Rýchl. retrakcie") #define MSG_FILAMENTCHANGE _UxGT("Vymeniť filament") #define MSG_FILAMENTLOAD _UxGT("Zaviesť filament") #define MSG_FILAMENTUNLOAD _UxGT("Vysunúť filament") #define MSG_FILAMENTUNLOAD_ALL _UxGT("Vysunúť všetko") #define MSG_INIT_SDCARD _UxGT("Načítať SD kartu") -#define MSG_CNG_SDCARD _UxGT("Vymeniť SD kartu") +#define MSG_CHANGE_SDCARD _UxGT("Vymeniť SD kartu") #define MSG_ZPROBE_OUT _UxGT("Sonda Z mimo podl.") #define MSG_SKEW_FACTOR _UxGT("Faktor skosenia") #define MSG_BLTOUCH _UxGT("BLTouch") @@ -301,6 +314,8 @@ #define MSG_BLTOUCH_RESET _UxGT("Reset BLTouch") #define MSG_BLTOUCH_DEPLOY _UxGT("Vysunúť BLTouch") #define MSG_BLTOUCH_STOW _UxGT("Zasunúť BLTouch") +#define MSG_MANUAL_DEPLOY _UxGT("Inštalovať sondu Z") +#define MSG_MANUAL_STOW _UxGT("Odstrániť sondu Z") #define MSG_HOME _UxGT("Najskôr os") // Used as MSG_HOME " " MSG_X MSG_Y MSG_Z " " MSG_FIRST #define MSG_FIRST _UxGT("domov") #define MSG_ZPROBE_ZOFFSET _UxGT("Z offset sondy") @@ -383,6 +398,7 @@ #define MSG_FILAMENT_CHANGE_OPTION_PURGE _UxGT("Vytlačiť viacej") #define MSG_FILAMENT_CHANGE_OPTION_RESUME _UxGT("Obnoviť tlač") #define MSG_FILAMENT_CHANGE_NOZZLE _UxGT(" Tryska: ") +#define MSG_RUNOUT_SENSOR_ENABLE _UxGT("Senzor filamentu") #define MSG_ERR_HOMING_FAILED _UxGT("Parkovanie zlyhalo") #define MSG_ERR_PROBING_FAILED _UxGT("Kalibrácia zlyhala") #define MSG_M600_TOO_COLD _UxGT("M600: Príliš studený") diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index fc30d86ad8..b6b5b817cb 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -55,13 +55,13 @@ #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 PLA") // Ön Isınma PLA +#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 ABS") // Ön Isınma ABS +#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 @@ -166,14 +166,14 @@ #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_ZLIFT _UxGT("Hop mm") // Hop mm +#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_CNG_SDCARD _UxGT("SD Değiştir") // SD Değiştir +#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 diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 6236320589..98dbfad4d5 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -52,12 +52,12 @@ #define MSG_SET_HOME_OFFSETS _UxGT("Зберегти паркув.") #define MSG_HOME_OFFSETS_APPLIED _UxGT("Зміщення застос.") #define MSG_SET_ORIGIN _UxGT("Встанов. початок") -#define MSG_PREHEAT_1 _UxGT("Нагрів PLA") +#define MSG_PREHEAT_1 _UxGT("Нагрів " PREHEAT_1_LABEL) #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" Все") #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" Стіл") #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" нал.") -#define MSG_PREHEAT_2 _UxGT("Нагрів ABS") +#define MSG_PREHEAT_2 _UxGT("Нагрів " PREHEAT_2_LABEL) #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" Все") #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" Стіл") @@ -156,7 +156,7 @@ #define MSG_STOPPED _UxGT("ЗУПИНЕНО. ") #define MSG_FILAMENTCHANGE _UxGT("Зміна волокна") #define MSG_INIT_SDCARD _UxGT("Старт SD картки") -#define MSG_CNG_SDCARD _UxGT("Заміна SD карти") +#define MSG_CHANGE_SDCARD _UxGT("Заміна SD карти") #define MSG_ZPROBE_OUT _UxGT("Z дет. не в межах") #define MSG_BLTOUCH_SELFTEST _UxGT("BLTouch Само-Тест") #define MSG_BLTOUCH_RESET _UxGT("Скинути BLTouch") diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index acdd097c23..16c932032b 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -30,8 +30,6 @@ #ifndef LANGUAGE_ZH_CN_H #define LANGUAGE_ZH_CN_H -//#define TALL_FONT_CORRECTION (1) - #define CHARSIZE 3 #define WELCOME_MSG MACHINE_NAME _UxGT("已就绪.") //" ready." @@ -57,12 +55,12 @@ #define MSG_SET_HOME_OFFSETS _UxGT("设置原点偏移") //"Set home offsets" #define MSG_HOME_OFFSETS_APPLIED _UxGT("偏移已启用") //"Offsets applied" #define MSG_SET_ORIGIN _UxGT("设置原点") //"Set origin" -#define MSG_PREHEAT_1 _UxGT("预热PLA") //"Preheat PLA" +#define MSG_PREHEAT_1 _UxGT("预热" PREHEAT_1_LABEL) //"Preheat PREHEAT_2_LABEL" #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") //MSG_PREHEAT_1 " " #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" 全部") //MSG_PREHEAT_1 " All" #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" 热床") //MSG_PREHEAT_1 " Bed" #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" 设置") //MSG_PREHEAT_1 " conf" -#define MSG_PREHEAT_2 _UxGT("预热ABS") //"Preheat ABS" +#define MSG_PREHEAT_2 _UxGT("预热" PREHEAT_2_LABEL) //"Preheat PREHEAT_2_LABEL" #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") //MSG_PREHEAT_2 " " #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" 全部") //MSG_PREHEAT_2 " All" #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" 热床") //MSG_PREHEAT_2 " Bed" @@ -93,22 +91,22 @@ #define MSG_UBL_MOVING_TO_NEXT _UxGT("移动到下一个") // "Moving to next" #define MSG_UBL_ACTIVATE_MESH _UxGT("激活UBL") // "Activate UBL" #define MSG_UBL_DEACTIVATE_MESH _UxGT("关闭UBL") // "Deactivate UBL" -#define MSG_UBL_SET_BED_TEMP _UxGT("设置热床温度") // "Bed Temp" -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("热端温度") // "Hotend Temp" +#define MSG_UBL_SET_TEMP_BED _UxGT("设置热床温度") // "Bed Temp" +#define MSG_UBL_SET_TEMP_HOTEND _UxGT("热端温度") // "Hotend Temp" #define MSG_UBL_MESH_EDIT _UxGT("网格编辑") // "Mesh Edit" #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("编辑客户网格") // "Edit Custom Mesh" #define MSG_UBL_FINE_TUNE_MESH _UxGT("细调网格") // "Fine Tuning Mesh" #define MSG_UBL_DONE_EDITING_MESH _UxGT("完成编辑网格") // "Done Editing Mesh" #define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("创设客户网格") // "Build Custom Mesh" #define MSG_UBL_BUILD_MESH_MENU _UxGT("创设网格") // "Build Mesh" -#define MSG_UBL_BUILD_PLA_MESH _UxGT("创设PLA网格") // "Build PLA Mesh" -#define MSG_UBL_BUILD_ABS_MESH _UxGT("创设ABS网格") // "Build ABS Mesh" +#define MSG_UBL_BUILD_MESH_M1 _UxGT("创设" PREHEAT_1_LABEL "网格") // "Build PREHEAT_1_LABEL Mesh" +#define MSG_UBL_BUILD_MESH_M2 _UxGT("创设" PREHEAT_2_LABEL "网格") // "Build PREHEAT_2_LABEL Mesh" #define MSG_UBL_BUILD_COLD_MESH _UxGT("创设冷网格") // "Build Cold Mesh" #define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("调整网格高度") // "Adjust Mesh Height" #define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("高度合计") // "Height Amount" #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("批准网格") // "Validate Mesh" -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("批准PLA网格") // "Validate PLA Mesh" -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("批准ABS网格") // "Validate ABS Mesh" +#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("批准" PREHEAT_1_LABEL "网格") // "Validate PREHEAT_1_LABEL Mesh" +#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("批准" PREHEAT_2_LABEL "网格") // "Validate PREHEAT_2_LABEL Mesh" #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("批准客户网格") // "Validate Custom Mesh" #define MSG_UBL_CONTINUE_MESH _UxGT("继续热床网格") // "Continue Bed Mesh" #define MSG_UBL_MESH_LEVELING _UxGT("网格调平") // "Mesh Leveling" @@ -229,7 +227,7 @@ #define MSG_E6STEPS _UxGT("挤出机6步数/mm") //"E6steps/mm" #define MSG_TEMPERATURE _UxGT("温度") //"Temperature" #define MSG_MOTION _UxGT("运动") //"Motion" -#define MSG_FILAMENT _UxGT("丝料测容") //"Filament" lcd_control_volumetric_menu +#define MSG_FILAMENT _UxGT("丝料测容") //"Filament" menu_advanced_filament #define MSG_VOLUMETRIC_ENABLED _UxGT("测容积mm³") //"E in mm3" volumetric_enabled #define MSG_FILAMENT_DIAM _UxGT("丝料直径") //"Fil. Dia." #define MSG_FILAMENT_UNLOAD _UxGT("卸载 mm") // "Unload mm" @@ -259,7 +257,7 @@ #define MSG_CONTROL_RETRACT _UxGT("回抽长度mm") //"Retract mm" retract_length, retract length (positive mm) #define MSG_CONTROL_RETRACT_SWAP _UxGT("换手回抽长度mm") //"Swap Re.mm" swap_retract_length, swap retract length (positive mm), for extruder change #define MSG_CONTROL_RETRACTF _UxGT("回抽速率mm/s") //"Retract V" retract_feedrate_mm_s, feedrate for retracting (mm/s) -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") //"Hop mm" retract_zlift, retract Z-lift +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") //"Hop mm" retract_zraise, retract Z-lift #define MSG_CONTROL_RETRACT_RECOVER _UxGT("回抽恢复长度mm") //"UnRet +mm" retract_recover_length, additional recover length (mm, added to retract length when recovering) #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("换手回抽恢复长度mm") //"S UnRet+mm" swap_retract_recover_length, additional swap recover length (mm, added to retract length when recovering from extruder change) #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("回抽恢复后进料速率mm/s") //"UnRet V" retract_recover_feedrate_mm_s, feedrate for recovering from retraction (mm/s) @@ -270,7 +268,7 @@ #define MSG_FILAMENTUNLOAD _UxGT("卸载丝料") // "Unload filament" #define MSG_FILAMENTUNLOAD_ALL _UxGT("卸载全部") // "Unload All" #define MSG_INIT_SDCARD _UxGT("初始化存储卡") //"Init. SD card" -#define MSG_CNG_SDCARD _UxGT("更换存储卡") //"Change SD card" +#define MSG_CHANGE_SDCARD _UxGT("更换存储卡") //"Change SD card" #define MSG_ZPROBE_OUT _UxGT("Z探针在热床之外") //"Z probe out. bed" Z probe is not within the physical limits #define MSG_SKEW_FACTOR _UxGT("偏斜因数") // "Skew Factor" #define MSG_BLTOUCH _UxGT("BLTouch") // "BLTouch" diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index a4885a80da..ff2d690650 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -30,8 +30,6 @@ #ifndef LANGUAGE_ZH_TW_H #define LANGUAGE_ZH_TW_H -//#define TALL_FONT_CORRECTION (1) - #define CHARSIZE 3 #define WELCOME_MSG MACHINE_NAME _UxGT("已就緒.") //" ready." @@ -57,12 +55,12 @@ #define MSG_SET_HOME_OFFSETS _UxGT("設置原點偏移") //"Set home offsets" #define MSG_HOME_OFFSETS_APPLIED _UxGT("偏移已啟用") //"Offsets applied" #define MSG_SET_ORIGIN _UxGT("設置原點") //"Set origin" -#define MSG_PREHEAT_1 _UxGT("預熱PLA") //"Preheat PLA" +#define MSG_PREHEAT_1 _UxGT("預熱" PREHEAT_1_LABEL) //"Preheat PREHEAT_1_LABEL" #define MSG_PREHEAT_1_N MSG_PREHEAT_1 _UxGT(" ") //MSG_PREHEAT_1 " " #define MSG_PREHEAT_1_ALL MSG_PREHEAT_1 _UxGT(" 全部") //MSG_PREHEAT_1 " All" #define MSG_PREHEAT_1_BEDONLY MSG_PREHEAT_1 _UxGT(" 熱床") //MSG_PREHEAT_1 " Bed" #define MSG_PREHEAT_1_SETTINGS MSG_PREHEAT_1 _UxGT(" 設置") //MSG_PREHEAT_1 " conf" -#define MSG_PREHEAT_2 _UxGT("預熱ABS") //"Preheat ABS" +#define MSG_PREHEAT_2 _UxGT("預熱" PREHEAT_2_LABEL) //"Preheat PREHEAT_2_LABEL" #define MSG_PREHEAT_2_N MSG_PREHEAT_2 _UxGT(" ") //MSG_PREHEAT_2 " " #define MSG_PREHEAT_2_ALL MSG_PREHEAT_2 _UxGT(" 全部") //MSG_PREHEAT_2 " All" #define MSG_PREHEAT_2_BEDONLY MSG_PREHEAT_2 _UxGT(" 熱床") //MSG_PREHEAT_2 " Bed" @@ -93,22 +91,22 @@ #define MSG_UBL_MOVING_TO_NEXT _UxGT("移動到下一個") // "Moving to next" #define MSG_UBL_ACTIVATE_MESH _UxGT("激活UBL") // "Activate UBL" #define MSG_UBL_DEACTIVATE_MESH _UxGT("關閉UBL") // "Deactivate UBL" -#define MSG_UBL_SET_BED_TEMP _UxGT("設置熱床溫度") // "Bed Temp" -#define MSG_UBL_SET_HOTEND_TEMP _UxGT("熱端溫度") // "Hotend Temp" +#define MSG_UBL_SET_TEMP_BED _UxGT("設置熱床溫度") // "Bed Temp" +#define MSG_UBL_SET_TEMP_HOTEND _UxGT("熱端溫度") // "Hotend Temp" #define MSG_UBL_MESH_EDIT _UxGT("網格編輯") // "Mesh Edit" #define MSG_UBL_EDIT_CUSTOM_MESH _UxGT("編輯客戶網格") // "Edit Custom Mesh" #define MSG_UBL_FINE_TUNE_MESH _UxGT("細調網格") // "Fine Tuning Mesh" #define MSG_UBL_DONE_EDITING_MESH _UxGT("完成編輯網格") // "Done Editing Mesh" #define MSG_UBL_BUILD_CUSTOM_MESH _UxGT("創設客戶網格") // "Build Custom Mesh" #define MSG_UBL_BUILD_MESH_MENU _UxGT("創設網格") // "Build Mesh" -#define MSG_UBL_BUILD_PLA_MESH _UxGT("創設PLA網格") // "Build PLA Mesh" -#define MSG_UBL_BUILD_ABS_MESH _UxGT("創設ABS網格") // "Build ABS Mesh" +#define MSG_UBL_BUILD_MESH_M1 _UxGT("創設" PREHEAT_1_LABEL "網格") // "Build PREHEAT_1_LABEL Mesh" +#define MSG_UBL_BUILD_MESH_M2 _UxGT("創設" PREHEAT_2_LABEL "網格") // "Build PREHEAT_2_LABEL Mesh" #define MSG_UBL_BUILD_COLD_MESH _UxGT("創設冷網格") // "Build Cold Mesh" #define MSG_UBL_MESH_HEIGHT_ADJUST _UxGT("調整網格高度") // "Adjust Mesh Height" #define MSG_UBL_MESH_HEIGHT_AMOUNT _UxGT("高度合計") // "Height Amount" #define MSG_UBL_VALIDATE_MESH_MENU _UxGT("批准網格") // "Validate Mesh" -#define MSG_UBL_VALIDATE_PLA_MESH _UxGT("批准PLA網格") // "Validate PLA Mesh" -#define MSG_UBL_VALIDATE_ABS_MESH _UxGT("批准ABS網格") // "Validate ABS Mesh" +#define MSG_UBL_VALIDATE_MESH_M1 _UxGT("批准" PREHEAT_1_LABEL "網格") // "Validate PREHEAT_1_LABEL Mesh" +#define MSG_UBL_VALIDATE_MESH_M2 _UxGT("批准" PREHEAT_2_LABEL "網格") // "Validate PREHEAT_2_LABEL Mesh" #define MSG_UBL_VALIDATE_CUSTOM_MESH _UxGT("批准客戶網格") // "Validate Custom Mesh" #define MSG_UBL_CONTINUE_MESH _UxGT("繼續熱床網格") // "Continue Bed Mesh" #define MSG_UBL_MESH_LEVELING _UxGT("網格調平") // "Mesh Leveling" @@ -229,7 +227,7 @@ #define MSG_E6STEPS _UxGT("擠出機6步數/mm") //"E6steps/mm" #define MSG_TEMPERATURE _UxGT("溫度") //"Temperature" #define MSG_MOTION _UxGT("運作") //"Motion" -#define MSG_FILAMENT _UxGT("絲料測容") //"Filament" lcd_control_volumetric_menu +#define MSG_FILAMENT _UxGT("絲料測容") //"Filament" menu_control_volumetric #define MSG_VOLUMETRIC_ENABLED _UxGT("測容積mm³") //"E in mm3" volumetric_enabled #define MSG_FILAMENT_DIAM _UxGT("絲料直徑") //"Fil. Dia." #define MSG_FILAMENT_UNLOAD _UxGT("卸載 mm") // "Unload mm" @@ -259,7 +257,7 @@ #define MSG_CONTROL_RETRACT _UxGT("回縮長度mm") //"Retract mm" retract_length, retract length (positive mm) #define MSG_CONTROL_RETRACT_SWAP _UxGT("換手回抽長度mm") //"Swap Re.mm" swap_retract_length, swap retract length (positive mm), for extruder change #define MSG_CONTROL_RETRACTF _UxGT("回縮速率mm/s") //"Retract V" retract_feedrate_mm_s, feedrate for retracting (mm/s) -#define MSG_CONTROL_RETRACT_ZLIFT _UxGT("Hop mm") //"Hop mm" retract_zlift, retract Z-lift +#define MSG_CONTROL_RETRACT_ZHOP _UxGT("Hop mm") //"Hop mm" retract_zraise, retract Z-lift #define MSG_CONTROL_RETRACT_RECOVER _UxGT("回縮恢復長度mm") //"UnRet +mm" retract_recover_length, additional recover length (mm, added to retract length when recovering) #define MSG_CONTROL_RETRACT_RECOVER_SWAP _UxGT("換手回縮恢復長度mm") //"S UnRet+mm" swap_retract_recover_length, additional swap recover length (mm, added to retract length when recovering from extruder change) #define MSG_CONTROL_RETRACT_RECOVERF _UxGT("回縮恢復後進料速率mm/s") //"UnRet V" retract_recover_feedrate_mm_s, feedrate for recovering from retraction (mm/s) @@ -270,7 +268,7 @@ #define MSG_FILAMENTUNLOAD _UxGT("卸載絲料") // "Unload filament" #define MSG_FILAMENTUNLOAD_ALL _UxGT("卸載全部") // "Unload All" #define MSG_INIT_SDCARD _UxGT("初始化記憶卡") //"Init. SD card" -#define MSG_CNG_SDCARD _UxGT("更換記憶卡") //"Change SD card" +#define MSG_CHANGE_SDCARD _UxGT("更換記憶卡") //"Change SD card" #define MSG_ZPROBE_OUT _UxGT("Z探針在熱床之外") //"Z probe out. bed" Z probe is not within the physical limits #define MSG_SKEW_FACTOR _UxGT("偏斜因數") // "Skew Factor" #define MSG_BLTOUCH _UxGT("BLTouch") // "BLTouch" diff --git a/Marlin/src/lcd/lcdprint.h b/Marlin/src/lcd/lcdprint.h index 47f14a5aea..b7366aff89 100644 --- a/Marlin/src/lcd/lcdprint.h +++ b/Marlin/src/lcd/lcdprint.h @@ -6,15 +6,16 @@ * @date 2016-08-19 * @copyright GPL/BSD */ -#ifndef _LCDPRINT_H -#define _LCDPRINT_H +#pragma once #include "fontutils.h" -#if DISABLED(DOGLCD) - #define _UxGT(a) a +#include "../inc/MarlinConfigPre.h" + +#if HAS_GRAPHICAL_LCD + #include "dogm/u8g_fontutf8.h" #else - #include "u8g_fontutf8.h" + #define _UxGT(a) a #endif #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u) @@ -54,5 +55,3 @@ inline int lcd_put_u8str_P(PGM_P str) { return lcd_put_u8str_max_P(str, PIXEL_LE 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); } - -#endif // _LCDPRINT_H diff --git a/Marlin/src/lcd/malyanlcd.cpp b/Marlin/src/lcd/malyanlcd.cpp index 3af38a8101..24c633536d 100644 --- a/Marlin/src/lcd/malyanlcd.cpp +++ b/Marlin/src/lcd/malyanlcd.cpp @@ -254,9 +254,7 @@ void process_lcd_p_command(const char* command) { quickstop_stepper(); print_job_timer.stop(); thermalManager.disable_all_heaters(); - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) fan_speed[i] = 0; - #endif + zero_fan_speeds(); wait_for_heatup = false; write_to_lcd_P(PSTR("{SYS:STARTED}")); #endif diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp new file mode 100644 index 0000000000..181d067333 --- /dev/null +++ b/Marlin/src/lcd/menu/menu.cpp @@ -0,0 +1,479 @@ +/** + * 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/MarlinConfigPre.h" + +#if ENABLED(ULTIPANEL) + +#include "menu.h" +#include "../ultralcd.h" +#include "../../module/planner.h" +#include "../../module/motion.h" +#include "../../gcode/queue.h" +#include "../../sd/cardreader.h" + +#if ENABLED(EEPROM_SETTINGS) + #include "../../module/configuration_store.h" +#endif + +#if WATCH_HOTENDS || WATCH_THE_BED + #include "../../module/temperature.h" +#endif + +#if ENABLED(BABYSTEP_ZPROBE_OFFSET) + #include "../../module/probe.h" +#endif + +#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) || ENABLED(AUTO_BED_LEVELING_UBL) + #include "../../feature/bedlevel/bedlevel.h" +#endif + +//////////////////////////////////////////// +///////////// Global Variables ///////////// +//////////////////////////////////////////// + +// Menu Navigation +int8_t encoderTopLine; +typedef struct { + screenFunc_t menu_function; + uint32_t encoder_position; +} menuPosition; +menuPosition screen_history[6]; +uint8_t screen_history_depth = 0; +bool screen_changed, defer_return_to_status; + +// Value Editing +PGM_P editLabel; +void *editValue; +int32_t minEditValue, maxEditValue; +screenFunc_t callbackFunc; +bool liveEdit; + +// Prevent recursion into screen handlers +bool no_reentry = false; + +//////////////////////////////////////////// +//////// Menu Navigation & History ///////// +//////////////////////////////////////////// + +void lcd_status_screen(); + +void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); } + +void lcd_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; + ++screen_history_depth; + } +} + +void lcd_goto_previous_menu() { + if (screen_history_depth > 0) { + --screen_history_depth; + lcd_goto_screen( + screen_history[screen_history_depth].menu_function, + screen_history[screen_history_depth].encoder_position + ); + } + else + lcd_return_to_status(); +} + +void lcd_goto_previous_menu_no_defer() { + defer_return_to_status = false; + lcd_goto_previous_menu(); +} + +//////////////////////////////////////////// +/////////// Common Menu Actions //////////// +//////////////////////////////////////////// + +void _menu_action_back() { lcd_goto_previous_menu(); } +void menu_action_submenu(screenFunc_t func) { lcd_save_previous_screen(); lcd_goto_screen(func); } +void menu_action_gcode(PGM_P pgcode) { enqueue_and_echo_commands_P(pgcode); } +void menu_action_function(screenFunc_t func) { (*func)(); } + +//////////////////////////////////////////// +/////////// Menu Editing Actions /////////// +//////////////////////////////////////////// + +/** + * Functions for editing single values + * + * The "DEFINE_MENU_EDIT_TYPE" macro generates the functions needed to edit a numerical value. + * + * For example, DEFINE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1) expands into these functions: + * + * bool _menu_edit_int3(); + * void menu_edit_int3(); // edit int16_t (interactively) + * void menu_edit_callback_int3(); // edit int16_t (interactively) with callback on completion + * void _menu_action_setting_edit_int3(PGM_P const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue); + * void menu_action_setting_edit_int3(PGM_P const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue); + * void menu_action_setting_edit_callback_int3(PGM_P const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue, const screenFunc_t callback, const bool live); // edit int16_t with callback + * + * 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(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) + * + * ...which calls: + * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) + */ +#define DEFINE_MENU_EDIT_TYPE(TYPE, NAME, STRFUNC, SCALE) \ + bool _menu_edit_ ## NAME() { \ + ENCODER_DIRECTION_NORMAL(); \ + if ((int32_t)encoderPosition < 0) encoderPosition = 0; \ + if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \ + if (lcdDrawUpdate) \ + lcd_implementation_drawedit(editLabel, STRFUNC(((TYPE)((int32_t)encoderPosition + minEditValue)) * (1.0f / SCALE))); \ + if (lcd_clicked || (liveEdit && lcdDrawUpdate)) { \ + TYPE value = ((TYPE)((int32_t)encoderPosition + minEditValue)) * (1.0f / SCALE); \ + if (editValue != NULL) *((TYPE*)editValue) = value; \ + if (callbackFunc && (liveEdit || lcd_clicked)) (*callbackFunc)(); \ + if (lcd_clicked) lcd_goto_previous_menu(); \ + } \ + return use_click(); \ + } \ + void menu_edit_ ## NAME() { _menu_edit_ ## NAME(); } \ + void _menu_action_setting_edit_ ## NAME(PGM_P const pstr, TYPE* const ptr, const TYPE minValue, const TYPE maxValue) { \ + lcd_save_previous_screen(); \ + lcd_refresh(); \ + \ + editLabel = pstr; \ + editValue = ptr; \ + minEditValue = minValue * SCALE; \ + maxEditValue = maxValue * SCALE - minEditValue; \ + encoderPosition = (*ptr) * SCALE - minEditValue; \ + } \ + void menu_action_setting_edit_callback_ ## NAME(PGM_P const pstr, TYPE * const ptr, const TYPE minValue, const TYPE maxValue, const screenFunc_t callback/*=NULL*/, const bool live/*=false*/) { \ + _menu_action_setting_edit_ ## NAME(pstr, ptr, minValue, maxValue); \ + currentScreen = menu_edit_ ## NAME; \ + callbackFunc = callback; \ + liveEdit = live; \ + } \ + typedef void NAME##_void + +DEFINE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1); +DEFINE_MENU_EDIT_TYPE(int16_t, int4, itostr4sign, 1); +DEFINE_MENU_EDIT_TYPE(uint8_t, int8, i8tostr3, 1); +DEFINE_MENU_EDIT_TYPE(float, float3, ftostr3, 1); +DEFINE_MENU_EDIT_TYPE(float, float52, ftostr52, 100); +DEFINE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000); +DEFINE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 0.01f); +DEFINE_MENU_EDIT_TYPE(float, float51, ftostr51sign, 10); +DEFINE_MENU_EDIT_TYPE(float, float52sign, ftostr52sign, 100); +DEFINE_MENU_EDIT_TYPE(float, float62, ftostr62rj, 100); +DEFINE_MENU_EDIT_TYPE(uint32_t, long5, ftostr5rj, 0.01f); + +void menu_action_setting_edit_bool(PGM_P pstr, bool* ptr) { UNUSED(pstr); *ptr ^= true; lcd_refresh(); } +void menu_action_setting_edit_callback_bool(PGM_P pstr, bool* ptr, screenFunc_t callback) { + menu_action_setting_edit_bool(pstr, ptr); + (*callback)(); +} + +//////////////////////////////////////////// +///////////////// Menu Tree //////////////// +//////////////////////////////////////////// + +#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + float lcd_z_fade_height; + void _lcd_set_z_fade_height() { set_z_fade_height(lcd_z_fade_height); } +#endif + +bool printer_busy() { return planner.movesplanned() || IS_SD_PRINTING(); } + +#if HAS_CHARACTER_LCD && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(LCD_PROGRESS_BAR_TEST) || ENABLED(AUTO_BED_LEVELING_UBL)) + void lcd_set_custom_characters( + #if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN) + const uint8_t screen_charset=CHARSET_INFO + #endif + ); +#endif + +/** + * General function to go directly to a screen + */ +void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) { + if (currentScreen != screen) { + + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + // Shadow for editing the fade height + lcd_z_fade_height = planner.z_fade_height; + #endif + + #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) && ENABLED(BABYSTEPPING) + static millis_t doubleclick_expire_ms = 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) + doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL; + } + else if (screen == lcd_status_screen && currentScreen == menu_main && PENDING(millis(), doubleclick_expire_ms)) { + if (printer_busy()) { + screen = + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + lcd_babystep_zoffset + #else + lcd_babystep_z + #endif + ; + } + #if ENABLED(MOVE_Z_WHEN_IDLE) + else { + move_menu_scale = MOVE_Z_IDLE_MULTIPLICATOR; + screen = lcd_move_z; + } + #endif + } + #endif + + currentScreen = screen; + encoderPosition = encoder; + if (screen == lcd_status_screen) { + defer_return_to_status = false; + #if ENABLED(AUTO_BED_LEVELING_UBL) + ubl.lcd_map_control = false; + #endif + screen_history_depth = 0; + } + lcd_implementation_clear(); + // Re-initialize custom characters that may be re-used + #if HAS_CHARACTER_LCD && ENABLED(AUTO_BED_LEVELING_UBL) + if (!ubl.lcd_map_control) { + lcd_set_custom_characters( + #if ENABLED(LCD_PROGRESS_BAR) + screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU + #endif + ); + } + #elif ENABLED(LCD_PROGRESS_BAR) + lcd_set_custom_characters(screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU); + #endif + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; + screen_changed = true; + #if HAS_GRAPHICAL_LCD + drawing_screen = false; + #endif + } +} + +//////////////////////////////////////////// +///////////// Manual Movement ////////////// +//////////////////////////////////////////// + +// +// Display the synchronize screen until moves are +// finished, and don't return to the caller until +// done. ** This blocks the command queue! ** +// +static PGM_P sync_message; + +void _lcd_synchronize() { + if (lcdDrawUpdate) lcd_implementation_drawmenu_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); + planner.synchronize(); // idle() is called until moves complete + no_reentry = false; + lcd_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*/) { + static const char moving[] PROGMEM = MSG_MOVING; + sync_message = msg ? msg : moving; + _lcd_synchronize(); +} + +/** + * Scrolling for menus and other line-based screens + * + * encoderLine is the position based on the encoder + * encoderTopLine is the top menu line to display + * _lcdLineNr is the index of the LCD line (e.g., 0-3) + * _menuLineNr is the menu item to draw and process + * _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM + * screen_items is the total number of items in the menu (after one call) + */ +int8_t encoderLine, screen_items; +void scroll_screen(const uint8_t limit, const bool is_menu) { + ENCODER_DIRECTION_MENUS(); + ENCODER_RATE_MULTIPLY(false); + if (encoderPosition > 0x8000) encoderPosition = 0; + if (first_page) { + encoderLine = 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); + } + if (is_menu) { + NOMORE(encoderTopLine, encoderLine); + if (encoderLine >= encoderTopLine + LCD_HEIGHT) + encoderTopLine = encoderLine - LCD_HEIGHT + 1; + } + else + encoderTopLine = encoderLine; +} + +void lcd_completion_feedback(const bool good/*=true*/) { + if (good) { + lcd_buzz(100, 659); + lcd_buzz(100, 698); + } + else lcd_buzz(20, 440); +} + +#if HAS_LINE_TO_Z + + void line_to_z(const float &z) { + current_position[Z_AXIS] = z; + planner.buffer_line(current_position, MMM_TO_MMS(manual_feedrate_mm_m[Z_AXIS]), active_extruder); + } + +#endif + +#if ENABLED(BABYSTEP_ZPROBE_OFFSET) + + void lcd_babystep_zoffset() { + if (use_click()) { return lcd_goto_previous_menu_no_defer(); } + defer_return_to_status = 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; + + const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment, + new_probe_offset = zprobe_zoffset + diff, + new_offs = + #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) + do_probe ? new_probe_offset : hotend_offset[Z_AXIS][active_extruder] - diff + #else + new_probe_offset + #endif + ; + if (WITHIN(new_offs, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + + thermalManager.babystep_axis(Z_AXIS, babystep_increment); + + if (do_probe) zprobe_zoffset = new_offs; + #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) + else hotend_offset[Z_AXIS][active_extruder] = new_offs; + #endif + + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; + } + } + if (lcdDrawUpdate) { + #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) + if (!do_probe) + lcd_implementation_drawedit(PSTR(MSG_IDEX_Z_OFFSET), ftostr43sign(hotend_offset[Z_AXIS][active_extruder])); + else + #endif + lcd_implementation_drawedit(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset)); + + #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) + if (do_probe) _lcd_zoffset_overlay_gfx(zprobe_zoffset); + #endif + } + } + +#endif // BABYSTEP_ZPROBE_OFFSET + +/** + * Watch temperature callbacks + */ +#if HAS_TEMP_HOTEND + #if WATCH_HOTENDS + #define _WATCH_FUNC(N) thermalManager.start_watching_heater(N) + #else + #define _WATCH_FUNC(N) NOOP + #endif + void watch_temp_callback_E0() { _WATCH_FUNC(0); } + #if HOTENDS > 1 + void watch_temp_callback_E1() { _WATCH_FUNC(1); } + #if HOTENDS > 2 + void watch_temp_callback_E2() { _WATCH_FUNC(2); } + #if HOTENDS > 3 + void watch_temp_callback_E3() { _WATCH_FUNC(3); } + #if HOTENDS > 4 + void watch_temp_callback_E4() { _WATCH_FUNC(4); } + #if HOTENDS > 5 + void watch_temp_callback_E5() { _WATCH_FUNC(5); } + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 +#endif // HAS_TEMP_HOTEND + +void watch_temp_callback_bed() { + #if WATCH_THE_BED + thermalManager.start_watching_bed(); + #endif +} + +#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE) + + void lcd_enqueue_command(const char * const cmd) { + no_reentry = true; + enqueue_and_echo_command_now(cmd); + no_reentry = false; + } + + void lcd_enqueue_commands_P(PGM_P const cmd) { + no_reentry = true; + enqueue_and_echo_commands_now_P(cmd); + no_reentry = false; + } + +#endif + +#if ENABLED(EEPROM_SETTINGS) + void lcd_store_settings() { lcd_completion_feedback(settings.save()); } + void lcd_load_settings() { lcd_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 ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)) + #include "../../feature/bedlevel/bedlevel.h" + void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(!planner.leveling_active); } +#endif + +#endif // ULTIPANEL diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h new file mode 100644 index 0000000000..fbbb00392b --- /dev/null +++ b/Marlin/src/lcd/menu/menu.h @@ -0,0 +1,396 @@ +/** + * 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 + +#include "../ultralcd.h" +#include "../../inc/MarlinConfig.h" + +extern uint32_t encoderPosition; +extern int8_t encoderLine, encoderTopLine, screen_items; +extern millis_t lastEncoderMovementMillis; +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_goto_previous_menu(); +void lcd_goto_previous_menu_no_defer(); + +//////////////////////////////////////////// +///////// Menu Item Draw Functions ///////// +//////////////////////////////////////////// + +#if ENABLED(SDSUPPORT) + class CardReader; +#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, dummy) 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, dummy) 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); +#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, ...) { \ + UNUSED(pstr2); \ + DRAWMENU_SETTING_EDIT_GENERIC(STRFUNC(*(data))); \ + } \ + FORCE_INLINE void lcd_implementation_drawmenu_setting_edit_callback_ ## NAME (const bool sel, const uint8_t row, PGM_P pstr, PGM_P pstr2, TYPE * const data, ...) { \ + UNUSED(pstr2); \ + DRAWMENU_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), ...) { \ + UNUSED(pstr2); UNUSED(pset); \ + DRAWMENU_SETTING_EDIT_GENERIC(STRFUNC(pget())); \ + } \ + typedef void NAME##_void +DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(int16_t, int3, itostr3); +DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(int16_t, int4, itostr4sign); +DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(uint8_t, int8, i8tostr3); +DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float3, ftostr3); +DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52, ftostr52); +DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float43, ftostr43sign); +DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float5, ftostr5rj); +DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float51, ftostr51sign); +DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52sign, ftostr52sign); +DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float62, ftostr62rj); +DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(uint32_t, long5, ftostr5rj); + +#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_callback_bool(sel, row, pstr, pstr2, data, callback) 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) + +//////////////////////////////////////////// +/////////////// Menu Actions /////////////// +//////////////////////////////////////////// + +#define menu_action_back(dummy) _menu_action_back() +void _menu_action_back(); +void menu_action_submenu(screenFunc_t data); +void menu_action_function(menuAction_t data); +void menu_action_gcode(const char* pgcode); + +//////////////////////////////////////////// +/////////// Menu Editing Actions /////////// +//////////////////////////////////////////// + +#define DECLARE_MENU_EDIT_TYPE(TYPE, NAME) \ + bool _menu_edit_ ## NAME(); \ + void menu_edit_ ## NAME(); \ + void menu_edit_callback_ ## NAME(); \ + void _menu_action_setting_edit_ ## NAME(PGM_P const pstr, TYPE* const ptr, const TYPE minValue, const TYPE maxValue); \ + void menu_action_setting_edit_callback_ ## NAME(PGM_P const pstr, TYPE * const ptr, const TYPE minValue, const TYPE maxValue, const screenFunc_t callback=NULL, const bool live=false); \ + FORCE_INLINE void menu_action_setting_edit_ ## NAME(PGM_P const pstr, TYPE * const ptr, const TYPE minValue, const TYPE maxValue) { \ + menu_action_setting_edit_callback_ ## NAME(pstr, ptr, minValue, maxValue); \ + } \ + typedef void NAME##_void + +DECLARE_MENU_EDIT_TYPE(int16_t, int3); +DECLARE_MENU_EDIT_TYPE(int16_t, int4); +DECLARE_MENU_EDIT_TYPE(uint8_t, int8); +DECLARE_MENU_EDIT_TYPE(float, float3); +DECLARE_MENU_EDIT_TYPE(float, float52); +DECLARE_MENU_EDIT_TYPE(float, float43); +DECLARE_MENU_EDIT_TYPE(float, float5); +DECLARE_MENU_EDIT_TYPE(float, float51); +DECLARE_MENU_EDIT_TYPE(float, float52sign); +DECLARE_MENU_EDIT_TYPE(float, float62); +DECLARE_MENU_EDIT_TYPE(uint32_t, long5); + +void menu_action_setting_edit_bool(PGM_P pstr, bool* ptr); +void menu_action_setting_edit_callback_bool(PGM_P pstr, bool* ptr, screenFunc_t callbackFunc); + +//////////////////////////////////////////// +//////////// Menu System Macros //////////// +//////////////////////////////////////////// + +/** + * SCREEN_OR_MENU_LOOP generates init code for a screen or menu + * + * encoderTopLine is the top menu line to display + * _lcdLineNr is the index of the LCD line (e.g., 0-3) + * _menuLineNr is the menu item to draw and process + * _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM + */ +#define SCREEN_OR_MENU_LOOP() \ + int8_t _menuLineNr = encoderTopLine, _thisItemNr; \ + for (int8_t _lcdLineNr = 0; _lcdLineNr < LCD_HEIGHT; _lcdLineNr++, _menuLineNr++) { \ + _thisItemNr = 0 + +/** + * START_SCREEN Opening code for a screen having only static items. + * Do simplified scrolling of the entire screen. + * + * START_MENU Opening code for a screen with menu items. + * Scroll as-needed to keep the selected line in view. + */ +#define START_SCREEN() \ + scroll_screen(LCD_HEIGHT, false); \ + bool _skipStatic = false; \ + SCREEN_OR_MENU_LOOP() + +#define START_MENU() \ + scroll_screen(1, true); \ + bool _skipStatic = true; \ + SCREEN_OR_MENU_LOOP() + +#define END_SCREEN() \ + } \ + screen_items = _thisItemNr + +#define END_MENU() \ + } \ + 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 bool encoderRateMultiplierEnabled; + #define ENCODER_RATE_MULTIPLY(F) (encoderRateMultiplierEnabled = F) + + //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value + + /** + * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item + */ + #define MENU_MULTIPLIER_ITEM(TYPE, LABEL, ...) do { \ + _MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \ + encoderRateMultiplierEnabled = true; \ + lastEncoderMovementMillis = 0; \ + _MENU_ITEM_PART_2(TYPE, PSTR(LABEL), ## __VA_ARGS__); \ + }while(0) + +#else // !ENCODER_RATE_MULTIPLIER + #define ENCODER_RATE_MULTIPLY(F) NOOP +#endif // !ENCODER_RATE_MULTIPLIER + +/** + * MENU_ITEM generates draw & handler code for a menu item, potentially calling: + * + * lcd_implementation_drawmenu_[type](sel, row, label, arg3...) + * menu_action_[type](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_action_back() + * + * MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause) + * lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause) + * menu_action_function(lcd_sdcard_pause) + * + * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999) + * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(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_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) + * + */ +#define _MENU_ITEM_PART_1(TYPE, ...) \ + if (_menuLineNr == _thisItemNr) { \ + if (encoderLine == _thisItemNr && lcd_clicked) { \ + lcd_clicked = false + +#define _MENU_ITEM_PART_2(TYPE, PLABEL, ...) \ + menu_action_ ## TYPE(__VA_ARGS__); \ + if (screen_changed) return; \ + } \ + if (lcdDrawUpdate) \ + lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ## __VA_ARGS__); \ + } \ + ++_thisItemNr + +#define MENU_ITEM_P(TYPE, PLABEL, ...) do { \ + _skipStatic = false; \ + _MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \ + _MENU_ITEM_PART_2(TYPE, PLABEL, ## __VA_ARGS__); \ + }while(0) + +#define MENU_ITEM(TYPE, LABEL, ...) MENU_ITEM_P(TYPE, PSTR(LABEL), ## __VA_ARGS__) + +#define MENU_ITEM_ADDON_START(X) \ + if (lcdDrawUpdate && _menuLineNr == _thisItemNr - 1) { \ + SETCURSOR(X, _lcdLineNr) + +#define MENU_ITEM_ADDON_END() } (0) + +#define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0) + +// Used to print static text with no visible cursor. +// Parameters: label [, bool center [, bool invert [, char *value] ] ] +#define STATIC_ITEM_P(LABEL, ...) do{ \ + if (_menuLineNr == _thisItemNr) { \ + if (_skipStatic && encoderLine <= _thisItemNr) { \ + encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ + ++encoderLine; \ + } \ + if (lcdDrawUpdate) \ + lcd_implementation_drawmenu_static(_lcdLineNr, LABEL, ## __VA_ARGS__); \ + } \ + ++_thisItemNr; } while(0) + +#define STATIC_ITEM(LABEL, ...) STATIC_ITEM_P(PSTR(LABEL), ## __VA_ARGS__) + +#define MENU_ITEM_DUMMY() do { _thisItemNr++; }while(0) +#define MENU_ITEM_EDIT(TYPE, LABEL, ...) MENU_ITEM(_CAT(setting_edit_,TYPE), LABEL, PSTR(LABEL), ## __VA_ARGS__) +#define MENU_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_ITEM(_CAT(setting_edit_callback_,TYPE), LABEL, PSTR(LABEL), ## __VA_ARGS__) +#if ENABLED(ENCODER_RATE_MULTIPLIER) + #define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, ...) MENU_MULTIPLIER_ITEM(_CAT(setting_edit_,TYPE), LABEL, PSTR(LABEL), ## __VA_ARGS__) + #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_MULTIPLIER_ITEM(_CAT(setting_edit_callback_,TYPE), LABEL, PSTR(LABEL), ## __VA_ARGS__) +#else // !ENCODER_RATE_MULTIPLIER + #define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, ...) MENU_ITEM(_CAT(setting_edit_,TYPE), LABEL, PSTR(LABEL), ## __VA_ARGS__) + #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_ITEM(_CAT(setting_edit_callback_,TYPE), LABEL, PSTR(LABEL), ## __VA_ARGS__) +#endif // !ENCODER_RATE_MULTIPLIER + +//////////////////////////////////////////// +/////////////// Menu Screens /////////////// +//////////////////////////////////////////// + +void menu_main(); +void menu_move(); + +#if ENABLED(SDSUPPORT) + void menu_sdcard(); +#endif + +// First Fan Speed title in "Tune" and "Control>Temperature" menus +#if FAN_COUNT > 0 && HAS_FAN0 + #if FAN_COUNT > 1 + #define FAN_SPEED_1_SUFFIX " 1" + #else + #define FAN_SPEED_1_SUFFIX "" + #endif +#endif + +//////////////////////////////////////////// +//////// Menu Item Helper Functions //////// +//////////////////////////////////////////// + +void lcd_move_z(); +void lcd_synchronize(PGM_P const msg=NULL); +void _lcd_draw_homing(); + +void watch_temp_callback_E0(); +void watch_temp_callback_E1(); +void watch_temp_callback_E2(); +void watch_temp_callback_E3(); +void watch_temp_callback_E4(); +void watch_temp_callback_E5(); +void watch_temp_callback_bed(); + +#define HAS_LINE_TO_Z (ENABLED(DELTA) || ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING) || ENABLED(LEVEL_BED_CORNERS)) + +#if HAS_LINE_TO_Z + void line_to_z(const float &z); +#endif + +#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE) + void lcd_enqueue_command(const char * const cmd); + void lcd_enqueue_commands_P(PGM_P const cmd); +#endif + +#if ENABLED(LEVEL_BED_CORNERS) + void _lcd_level_bed_corners(); +#endif + +#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + extern float lcd_z_fade_height; + void _lcd_set_z_fade_height(); +#endif + +#if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)) + void _lcd_toggle_bed_leveling(); +#endif + +#if ENABLED(BABYSTEPPING) + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + void lcd_babystep_zoffset(); + #else + void lcd_babystep_z(); + #endif +#endif + +#if ENABLED(EEPROM_SETTINGS) + void lcd_store_settings(); + void lcd_load_settings(); +#endif diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp new file mode 100644 index 0000000000..6fb5317e9c --- /dev/null +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -0,0 +1,644 @@ +/** + * 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 . + * + */ + +// +// Advanced Settings Menus +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU + +#include "menu.h" +#include "../../module/planner.h" + +#if DISABLED(NO_VOLUMETRICS) + #include "../../gcode/parser.h" +#endif + +#if HAS_BED_PROBE + #include "../../module/probe.h" + #if ENABLED(BLTOUCH) + #include "../../module/endstops.h" + #endif +#endif + +#if ENABLED(PIDTEMP) + #include "../../module/temperature.h" +#endif + +#if HAS_M206_COMMAND + // + // Set the home offset based on the current_position + // + void _lcd_set_home_offsets() { + enqueue_and_echo_commands_P(PSTR("M428")); + lcd_return_to_status(); + } +#endif + +#if ENABLED(SD_FIRMWARE_UPDATE) + + #include "../../module/configuration_store.h" + + // + // Toggle the SD Firmware Update state in EEPROM + // + 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(); + } +#endif + +#if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) + // + // Advanced Settings > Filament + // + void menu_advanced_filament() { + START_MENU(); + MENU_BACK(MSG_ADVANCED_SETTINGS); + + #if ENABLED(LIN_ADVANCE) + #if EXTRUDERS == 1 + MENU_ITEM_EDIT(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); + #elif EXTRUDERS > 1 + #define EDIT_ADVANCE_K(N) MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E##N, &planner.extruder_advance_K[N-1], 0, 999) + EDIT_ADVANCE_K(1); + EDIT_ADVANCE_K(2); + #if EXTRUDERS > 2 + EDIT_ADVANCE_K(3); + #if EXTRUDERS > 3 + EDIT_ADVANCE_K(4); + #if EXTRUDERS > 4 + EDIT_ADVANCE_K(5); + #if EXTRUDERS > 5 + EDIT_ADVANCE_K(6); + #endif // EXTRUDERS > 5 + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 + #endif // EXTRUDERS > 1 + #endif + + #if DISABLED(NO_VOLUMETRICS) + MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &parser.volumetric_enabled, planner.calculate_volumetric_multipliers); + + if (parser.volumetric_enabled) { + #if EXTRUDERS == 1 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[0], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); + #else // EXTRUDERS > 1 + #define EDIT_FIL_DIAM(N) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E##N, &planner.filament_size[N-1], 1.5f, 3.25f, planner.calculate_volumetric_multipliers) + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); + EDIT_FIL_DIAM(1); + EDIT_FIL_DIAM(2); + #if EXTRUDERS > 2 + EDIT_FIL_DIAM(3); + #if EXTRUDERS > 3 + EDIT_FIL_DIAM(4); + #if EXTRUDERS > 4 + EDIT_FIL_DIAM(5); + #if EXTRUDERS > 5 + EDIT_FIL_DIAM(6); + #endif // EXTRUDERS > 5 + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 + #endif // EXTRUDERS > 1 + } + #endif + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + constexpr float extrude_maxlength = + #if ENABLED(PREVENT_LENGTHY_EXTRUDE) + EXTRUDE_MAXLENGTH + #else + 999 + #endif + ; + + #if EXTRUDERS == 1 + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &fc_settings[0].unload_length, 0, extrude_maxlength); + #else // EXTRUDERS > 1 + #define EDIT_FIL_UNLOAD(N) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E##N, &fc_settings[N-1].unload_length, 0, extrude_maxlength) + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength); + EDIT_FIL_UNLOAD(1); + EDIT_FIL_UNLOAD(2); + #if EXTRUDERS > 2 + EDIT_FIL_UNLOAD(3); + #if EXTRUDERS > 3 + EDIT_FIL_UNLOAD(4); + #if EXTRUDERS > 4 + EDIT_FIL_UNLOAD(5); + #if EXTRUDERS > 5 + EDIT_FIL_UNLOAD(6); + #endif // EXTRUDERS > 5 + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 + #endif // EXTRUDERS > 1 + + #if EXTRUDERS == 1 + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &fc_settings[0].load_length, 0, extrude_maxlength); + #else // EXTRUDERS > 1 + #define EDIT_FIL_LOAD(N) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E##N, &fc_settings[N-1].load_length, 0, extrude_maxlength) + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength); + EDIT_FIL_LOAD(1); + EDIT_FIL_LOAD(2); + #if EXTRUDERS > 2 + EDIT_FIL_LOAD(3); + #if EXTRUDERS > 3 + EDIT_FIL_LOAD(4); + #if EXTRUDERS > 4 + EDIT_FIL_LOAD(5); + #if EXTRUDERS > 5 + EDIT_FIL_LOAD(6); + #endif // EXTRUDERS > 5 + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 + #endif // EXTRUDERS > 1 + #endif + + END_MENU(); + } + +#endif // !NO_VOLUMETRICS || ADVANCED_PAUSE_FEATURE + +// +// Advanced Settings > Temperature helpers +// + +#if ENABLED(PID_AUTOTUNE_MENU) + + #if ENABLED(PIDTEMP) + int16_t autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(150); + #endif + + #if ENABLED(PIDTEMPBED) + int16_t autotune_temp_bed = 70; + #endif + + void _lcd_autotune(const int16_t e) { + char cmd[30]; + sprintf_P(cmd, PSTR("M303 U1 E%i S%i"), e, + #if HAS_PID_FOR_BOTH + e < 0 ? autotune_temp_bed : autotune_temp[e] + #elif ENABLED(PIDTEMPBED) + autotune_temp_bed + #else + autotune_temp[e] + #endif + ); + lcd_enqueue_command(cmd); + } + +#endif // PID_AUTOTUNE_MENU + +#if ENABLED(PIDTEMP) + + float raw_Ki, raw_Kd; // place-holders for Ki and Kd edits + + // Helpers for editing PID Ki & Kd values + // grab the PID value out of the temp variable; scale it; then update the PID driver + void copy_and_scalePID_i(int16_t e) { + #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1 + UNUSED(e); + #endif + PID_PARAM(Ki, e) = scalePID_i(raw_Ki); + thermalManager.updatePID(); + } + void copy_and_scalePID_d(int16_t e) { + #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1 + UNUSED(e); + #endif + PID_PARAM(Kd, e) = scalePID_d(raw_Kd); + thermalManager.updatePID(); + } + #define _DEFINE_PIDTEMP_BASE_FUNCS(N) \ + void copy_and_scalePID_i_E ## N() { copy_and_scalePID_i(N); } \ + void copy_and_scalePID_d_E ## N() { copy_and_scalePID_d(N); } + + #if ENABLED(PID_AUTOTUNE_MENU) + #define DEFINE_PIDTEMP_FUNCS(N) \ + _DEFINE_PIDTEMP_BASE_FUNCS(N); \ + void lcd_autotune_callback_E ## N() { _lcd_autotune(N); } typedef void _pid_##N##_void + #else + #define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N) typedef void _pid_##N##_void + #endif + + DEFINE_PIDTEMP_FUNCS(0); + #if ENABLED(PID_PARAMS_PER_HOTEND) + #if HOTENDS > 1 + DEFINE_PIDTEMP_FUNCS(1); + #if HOTENDS > 2 + DEFINE_PIDTEMP_FUNCS(2); + #if HOTENDS > 3 + DEFINE_PIDTEMP_FUNCS(3); + #if HOTENDS > 4 + DEFINE_PIDTEMP_FUNCS(4); + #if HOTENDS > 5 + DEFINE_PIDTEMP_FUNCS(5); + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 + #endif // PID_PARAMS_PER_HOTEND + +#endif // PIDTEMP + +// +// Advanced Settings > Temperature +// +void menu_advanced_temperature() { + START_MENU(); + MENU_BACK(MSG_ADVANCED_SETTINGS); + // + // Autotemp, Min, Max, Fact + // + #if ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND + MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &planner.autotemp_enabled); + MENU_ITEM_EDIT(float3, MSG_MIN, &planner.autotemp_min, 0, float(HEATER_0_MAXTEMP) - 15); + MENU_ITEM_EDIT(float3, MSG_MAX, &planner.autotemp_max, 0, float(HEATER_0_MAXTEMP) - 15); + MENU_ITEM_EDIT(float52, MSG_FACTOR, &planner.autotemp_factor, 0, 1); + #endif + + // + // PID-P, PID-I, PID-D, PID-C, PID Autotune + // PID-P E1, PID-I E1, PID-D E1, PID-C E1, PID Autotune E1 + // PID-P E2, PID-I E2, PID-D E2, PID-C E2, PID Autotune E2 + // PID-P E3, PID-I E3, PID-D E3, PID-C E3, PID Autotune E3 + // PID-P E4, PID-I E4, PID-D E4, PID-C E4, PID Autotune E4 + // PID-P E5, PID-I E5, PID-D E5, PID-C E5, PID Autotune E5 + // + #if ENABLED(PIDTEMP) + + #define _PID_BASE_MENU_ITEMS(ELABEL, eindex) \ + raw_Ki = unscalePID_i(PID_PARAM(Ki, eindex)); \ + raw_Kd = unscalePID_d(PID_PARAM(Kd, eindex)); \ + MENU_ITEM_EDIT(float52sign, MSG_PID_P ELABEL, &PID_PARAM(Kp, eindex), 1, 9990); \ + MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_I ELABEL, &raw_Ki, 0.01f, 9990, copy_and_scalePID_i_E ## eindex); \ + MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex) + + #if ENABLED(PID_EXTRUSION_SCALING) + #define _PID_MENU_ITEMS(ELABEL, eindex) \ + _PID_BASE_MENU_ITEMS(ELABEL, eindex); \ + MENU_ITEM_EDIT(float3, MSG_PID_C ELABEL, &PID_PARAM(Kc, eindex), 1, 9990) + #else + #define _PID_MENU_ITEMS(ELABEL, eindex) _PID_BASE_MENU_ITEMS(ELABEL, eindex) + #endif + + #if ENABLED(PID_AUTOTUNE_MENU) + #define PID_MENU_ITEMS(ELABEL, eindex) \ + _PID_MENU_ITEMS(ELABEL, eindex); \ + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PID_AUTOTUNE ELABEL, &autotune_temp[eindex], 150, heater_maxtemp[eindex] - 15, lcd_autotune_callback_E ## eindex) + #else + #define PID_MENU_ITEMS(ELABEL, eindex) _PID_MENU_ITEMS(ELABEL, eindex) + #endif + + #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 + PID_MENU_ITEMS(" " MSG_E1, 0); + PID_MENU_ITEMS(" " MSG_E2, 1); + #if HOTENDS > 2 + PID_MENU_ITEMS(" " MSG_E3, 2); + #if HOTENDS > 3 + PID_MENU_ITEMS(" " MSG_E4, 3); + #if HOTENDS > 4 + PID_MENU_ITEMS(" " MSG_E5, 4); + #if HOTENDS > 5 + PID_MENU_ITEMS(" " MSG_E6, 5); + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #else // !PID_PARAMS_PER_HOTEND || HOTENDS == 1 + PID_MENU_ITEMS("", 0); + #endif // !PID_PARAMS_PER_HOTEND || HOTENDS == 1 + + #endif // PIDTEMP + + END_MENU(); +} + +#if DISABLED(SLIM_LCD_MENUS) + + void _reset_acceleration_rates() { planner.reset_acceleration_rates(); } + #if ENABLED(DISTINCT_E_FACTORS) + void _reset_e_acceleration_rate(const uint8_t e) { if (e == active_extruder) _reset_acceleration_rates(); } + void _reset_e0_acceleration_rate() { _reset_e_acceleration_rate(0); } + void _reset_e1_acceleration_rate() { _reset_e_acceleration_rate(1); } + #if E_STEPPERS > 2 + void _reset_e2_acceleration_rate() { _reset_e_acceleration_rate(2); } + #if E_STEPPERS > 3 + void _reset_e3_acceleration_rate() { _reset_e_acceleration_rate(3); } + #if E_STEPPERS > 4 + void _reset_e4_acceleration_rate() { _reset_e_acceleration_rate(4); } + #if E_STEPPERS > 5 + void _reset_e5_acceleration_rate() { _reset_e_acceleration_rate(5); } + #endif // E_STEPPERS > 5 + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #endif + + void _planner_refresh_positioning() { planner.refresh_positioning(); } + #if ENABLED(DISTINCT_E_FACTORS) + void _planner_refresh_e_positioning(const uint8_t e) { + if (e == active_extruder) + _planner_refresh_positioning(); + else + planner.steps_to_mm[E_AXIS + e] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS + e]; + } + void _planner_refresh_e0_positioning() { _planner_refresh_e_positioning(0); } + void _planner_refresh_e1_positioning() { _planner_refresh_e_positioning(1); } + #if E_STEPPERS > 2 + void _planner_refresh_e2_positioning() { _planner_refresh_e_positioning(2); } + #if E_STEPPERS > 3 + void _planner_refresh_e3_positioning() { _planner_refresh_e_positioning(3); } + #if E_STEPPERS > 4 + void _planner_refresh_e4_positioning() { _planner_refresh_e_positioning(4); } + #if E_STEPPERS > 5 + void _planner_refresh_e5_positioning() { _planner_refresh_e_positioning(5); } + #endif // E_STEPPERS > 5 + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #endif + + // M203 / M205 Velocity options + void menu_advanced_velocity() { + START_MENU(); + MENU_BACK(MSG_ADVANCED_SETTINGS); + + // M203 Max Feedrate + #define EDIT_VMAX(N) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_A, &planner.settings.max_feedrate_mm_s[A_AXIS], 1, 999) + EDIT_VMAX(A); + EDIT_VMAX(B); + EDIT_VMAX(C); + + #if ENABLED(DISTINCT_E_FACTORS) + #define EDIT_VMAX_E(N) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E##N, &planner.settings.max_feedrate_mm_s[E_AXIS_N(N-1)], 1, 999) + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.settings.max_feedrate_mm_s[E_AXIS_N(active_extruder)], 1, 999); + EDIT_VMAX_E(1); + EDIT_VMAX_E(2); + #if E_STEPPERS > 2 + EDIT_VMAX_E(3); + #if E_STEPPERS > 3 + EDIT_VMAX_E(4); + #if E_STEPPERS > 4 + EDIT_VMAX_E(5); + #if E_STEPPERS > 5 + EDIT_VMAX_E(6); + #endif // E_STEPPERS > 5 + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #else + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.settings.max_feedrate_mm_s[E_AXIS], 1, 999); + #endif + + // M205 S Min Feedrate + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMIN, &planner.settings.min_feedrate_mm_s, 0, 999); + + // M205 T Min Travel Feedrate + MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.settings.min_travel_feedrate_mm_s, 0, 999); + + END_MENU(); + } + + // M201 / M204 Accelerations + void menu_advanced_acceleration() { + START_MENU(); + MENU_BACK(MSG_ADVANCED_SETTINGS); + + // M204 P Acceleration + MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_ACC, &planner.settings.acceleration, 10, 99000); + + // M204 R Retract Acceleration + MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.settings.retract_acceleration, 100, 99000); + + // M204 T Travel Acceleration + MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.settings.travel_acceleration, 100, 99000); + + // M201 settings + #define EDIT_AMAX(Q,L) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_##Q, &planner.settings.max_acceleration_mm_per_s2[_AXIS(Q)], L, 99000, _reset_acceleration_rates) + EDIT_AMAX(A,100); + EDIT_AMAX(B,100); + EDIT_AMAX(C, 10); + + #if ENABLED(DISTINCT_E_FACTORS) + #define EDIT_AMAX_E(N,E) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E##N, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(E)], 100, 99000, _reset_e##E##_acceleration_rate) + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(active_extruder)], 100, 99000, _reset_acceleration_rates); + EDIT_AMAX_E(1,0); + EDIT_AMAX_E(2,1); + #if E_STEPPERS > 2 + EDIT_AMAX_E(3,2); + #if E_STEPPERS > 3 + EDIT_AMAX_E(4,3); + #if E_STEPPERS > 4 + EDIT_AMAX_E(5,4); + #if E_STEPPERS > 5 + EDIT_AMAX_E(6,5); + #endif // E_STEPPERS > 5 + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #else + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates); + #endif + + END_MENU(); + } + + // M205 Jerk + void menu_advanced_jerk() { + START_MENU(); + MENU_BACK(MSG_ADVANCED_SETTINGS); + + #if ENABLED(JUNCTION_DEVIATION) + #if ENABLED(LIN_ADVANCE) + MENU_ITEM_EDIT_CALLBACK(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.01f, 0.3f, planner.recalculate_max_e_jerk); + #else + MENU_ITEM_EDIT(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.01f, 0.3f); + #endif + #endif + #if HAS_CLASSIC_JERK + #define EDIT_JERK(N) MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_V##N##_JERK, &planner.max_jerk[_AXIS(N)], 1, 990) + EDIT_JERK(A); + EDIT_JERK(B); + #if ENABLED(DELTA) + EDIT_JERK(C); + #else + MENU_MULTIPLIER_ITEM_EDIT(float52sign, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 0.1f, 990); + #endif + #if DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE) + EDIT_JERK(E); + #endif + #endif + + END_MENU(); + } + + // M92 Steps-per-mm + void menu_advanced_steps_per_mm() { + START_MENU(); + MENU_BACK(MSG_ADVANCED_SETTINGS); + + #define EDIT_QSTEPS(Q) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_##Q##STEPS, &planner.settings.axis_steps_per_mm[_AXIS(Q)], 5, 9999, _planner_refresh_positioning) + EDIT_QSTEPS(A); + EDIT_QSTEPS(B); + EDIT_QSTEPS(C); + + #if ENABLED(DISTINCT_E_FACTORS) + #define EDIT_ESTEPS(N,E) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E##N##STEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(E)], 5, 9999, _planner_refresh_e##E##_positioning) + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.settings.axis_steps_per_mm[E_AXIS_N(active_extruder)], 5, 9999, _planner_refresh_positioning); + EDIT_ESTEPS(1,0); + EDIT_ESTEPS(2,1); + #if E_STEPPERS > 2 + EDIT_ESTEPS(3,2); + #if E_STEPPERS > 3 + EDIT_ESTEPS(4,3); + #if E_STEPPERS > 4 + EDIT_ESTEPS(5,4); + #if E_STEPPERS > 5 + EDIT_ESTEPS(6,5); + #endif // E_STEPPERS > 5 + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #else + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning); + #endif + + END_MENU(); + } + + #if ENABLED(EEPROM_SETTINGS) + + #include "../../module/configuration_store.h" + + static void lcd_init_eeprom() { + lcd_completion_feedback(settings.init_eeprom()); + lcd_goto_previous_menu(); + } + + static void lcd_init_eeprom_confirm() { + START_MENU(); + MENU_BACK(MSG_ADVANCED_SETTINGS); + MENU_ITEM(function, MSG_INIT_EEPROM, lcd_init_eeprom); + END_MENU(); + } + + #endif + +#endif // !SLIM_LCD_MENUS + +void menu_advanced_settings() { + START_MENU(); + MENU_BACK(MSG_CONFIGURATION); + + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); + #elif HAS_BED_PROBE + MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + #endif + + #if DISABLED(SLIM_LCD_MENUS) + + #if HAS_M206_COMMAND + // + // Set Home Offsets + // + MENU_ITEM(function, MSG_SET_HOME_OFFSETS, _lcd_set_home_offsets); + #endif + + // M203 / M205 - Feedrate items + MENU_ITEM(submenu, MSG_VELOCITY, menu_advanced_velocity); + + // M201 - Acceleration items + MENU_ITEM(submenu, MSG_ACCELERATION, menu_advanced_acceleration); + + // M205 - Max Jerk + MENU_ITEM(submenu, MSG_JERK, menu_advanced_jerk); + + if (!printer_busy()) { + // M92 - Steps Per mm + MENU_ITEM(submenu, MSG_STEPS_PER_MM, menu_advanced_steps_per_mm); + } + + #endif // !SLIM_LCD_MENUS + + MENU_ITEM(submenu, MSG_TEMPERATURE, menu_advanced_temperature); + + #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) + MENU_ITEM(submenu, MSG_FILAMENT, menu_advanced_filament); + #elif ENABLED(LIN_ADVANCE) + #if EXTRUDERS == 1 + MENU_ITEM_EDIT(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); + #elif EXTRUDERS > 1 + #define EDIT_ADVANCE_K(N) MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E##N, &planner.extruder_advance_K[N-1], 0, 999) + EDIT_ADVANCE_K(1); + EDIT_ADVANCE_K(2); + #if EXTRUDERS > 2 + EDIT_ADVANCE_K(3); + #if EXTRUDERS > 3 + EDIT_ADVANCE_K(4); + #if EXTRUDERS > 4 + EDIT_ADVANCE_K(5); + #if EXTRUDERS > 5 + EDIT_ADVANCE_K(6); + #endif // EXTRUDERS > 5 + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 + #endif // EXTRUDERS > 1 + #endif + + // M540 S - Abort on endstop hit when SD printing + #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) + MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &planner.abort_on_endstop_hit); + #endif + + // + // BLTouch Self-Test and Reset + // + #if ENABLED(BLTOUCH) + MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST))); + if (!endstops.z_probe_enabled && TEST_BLTOUCH()) + MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET))); + #endif + + #if ENABLED(SD_FIRMWARE_UPDATE) + bool sd_update_state = settings.sd_update_status(); + MENU_ITEM_EDIT_CALLBACK(bool, MSG_SD_UPDATE, &sd_update_state, _lcd_toggle_sd_update); + #endif + + #if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) + MENU_ITEM(submenu, MSG_INIT_EEPROM, lcd_init_eeprom_confirm); + #endif + + END_MENU(); +} + +#endif // HAS_LCD_MENU diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp new file mode 100644 index 0000000000..5c172b6cf6 --- /dev/null +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -0,0 +1,339 @@ +/** + * 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 . + * + */ + +// +// Bed Leveling Menus +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU && ENABLED(LCD_BED_LEVELING) + +#include "menu.h" +#include "../../module/planner.h" +#include "../../feature/bedlevel/bedlevel.h" + +#if ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING) + + #include "../../module/motion.h" + #include "../../gcode/queue.h" + + // + // Motion > Level Bed handlers + // + + static uint8_t manual_probe_index; + + // LCD probed points are from defaults + constexpr uint8_t total_probe_points = ( + #if ENABLED(AUTO_BED_LEVELING_3POINT) + 3 + #elif ABL_GRID || ENABLED(MESH_BED_LEVELING) + GRID_MAX_POINTS + #endif + ); + + bool lcd_wait_for_move; + + // + // Bed leveling is done. Wait for G29 to complete. + // A flag is used so that this can release control + // and allow the command queue to be processed. + // + // When G29 finishes the last move: + // - Raise Z to the "manual probe height" + // - Don't return until done. + // + // ** This blocks the command queue! ** + // + void _lcd_level_bed_done() { + if (!lcd_wait_for_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)); + #endif + lcd_goto_previous_menu_no_defer(); + lcd_completion_feedback(); + } + if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_DONE)); + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; + } + + void _lcd_level_goto_next_point(); + + // + // Step 7: Get the Z coordinate, click goes to the next point or exits + // + void _lcd_level_bed_get_z() { + ENCODER_DIRECTION_NORMAL(); + + if (use_click()) { + + // + // Save the current Z position and move + // + + // If done... + if (++manual_probe_index >= total_probe_points) { + // + // The last G29 records the point and enables bed leveling + // + lcd_wait_for_move = true; + lcd_goto_screen(_lcd_level_bed_done); + #if ENABLED(MESH_BED_LEVELING) + enqueue_and_echo_commands_P(PSTR("G29 S2")); + #elif ENABLED(PROBE_MANUALLY) + enqueue_and_echo_commands_P(PSTR("G29 V1")); + #endif + } + else + _lcd_level_goto_next_point(); + + return; + } + + // + // Encoder knob or keypad buttons adjust the Z position + // + if (encoderPosition) { + const float z = current_position[Z_AXIS] + float((int32_t)encoderPosition) * (MBL_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; + } + + // + // Draw on first display, then only on Z change + // + if (lcdDrawUpdate) { + const float v = current_position[Z_AXIS]; + lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); + } + } + + // + // Step 6: Display "Next point: 1 / 9" while waiting for move to finish + // + void _lcd_level_bed_moving() { + if (lcdDrawUpdate) { + 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); + } + lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW; + if (!lcd_wait_for_move) lcd_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); + + // G29 Records Z, moves, and signals when it pauses + lcd_wait_for_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) + enqueue_and_echo_commands_P(PSTR("G29 V1")); + #endif + } + + // + // Step 4: Display "Click to Begin", wait for click + // 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()) { + manual_probe_index = 0; + _lcd_level_goto_next_point(); + } + } + + // + // Step 3: Display "Homing XYZ" - Wait for homing to finish + // + void _lcd_level_bed_homing() { + _lcd_draw_homing(); + if (all_axes_homed()) lcd_goto_screen(_lcd_level_bed_homing_done); + } + + #if ENABLED(PROBE_MANUALLY) + extern bool g29_in_progress; + #endif + + // + // Step 2: Continue Bed Leveling... + // + void _lcd_level_bed_continue() { + defer_return_to_status = true; + axis_homed = 0; + lcd_goto_screen(_lcd_level_bed_homing); + enqueue_and_echo_commands_P(PSTR("G28")); + } + +#endif // PROBE_MANUALLY || MESH_BED_LEVELING + +#if ENABLED(LEVEL_BED_CORNERS) + + /** + * Level corners, starting in the front-left corner. + */ + static int8_t bed_corner; + void _lcd_goto_next_corner() { + line_to_z(4.0); + switch (bed_corner) { + case 0: + current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET; + current_position[Y_AXIS] = Y_MIN_BED + LEVEL_CORNERS_INSET; + break; + case 1: + current_position[X_AXIS] = X_MAX_BED - LEVEL_CORNERS_INSET; + break; + case 2: + current_position[Y_AXIS] = Y_MAX_BED - LEVEL_CORNERS_INSET; + break; + case 3: + current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET; + break; + #if ENABLED(LEVEL_CENTER_TOO) + case 4: + current_position[X_AXIS] = X_CENTER; + current_position[Y_AXIS] = Y_CENTER; + break; + #endif + } + planner.buffer_line(current_position, MMM_TO_MMS(manual_feedrate_mm_m[X_AXIS]), active_extruder); + line_to_z(0.0); + if (++bed_corner > 3 + #if ENABLED(LEVEL_CENTER_TOO) + + 1 + #endif + ) bed_corner = 0; + } + + void _lcd_corner_submenu() { + START_MENU(); + MENU_ITEM(function, + #if ENABLED(LEVEL_CENTER_TOO) + MSG_LEVEL_BED_NEXT_POINT + #else + MSG_NEXT_CORNER + #endif + , _lcd_goto_next_corner); + MENU_ITEM(function, MSG_BACK, lcd_goto_previous_menu_no_defer); + END_MENU(); + } + + void _lcd_level_bed_corners_homing() { + _lcd_draw_homing(); + if (all_axes_homed()) { + bed_corner = 0; + lcd_goto_screen(_lcd_corner_submenu); + _lcd_goto_next_corner(); + } + } + + void _lcd_level_bed_corners() { + defer_return_to_status = true; + if (!all_axes_known()) { + axis_homed = 0; + enqueue_and_echo_commands_P(PSTR("G28")); + } + lcd_goto_screen(_lcd_level_bed_corners_homing); + } + +#endif // LEVEL_BED_CORNERS + +/** + * Step 1: Bed Level entry-point + * + * << Motion + * Auto Home (if homing needed) + * Leveling On/Off (if data exists, and homed) + * Fade Height: --- (Req: ENABLE_LEVELING_FADE_HEIGHT) + * Mesh Z Offset: --- (Req: MESH_BED_LEVELING) + * Z Probe Offset: --- (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET) + * Level Bed > + * Level Corners > (if homed) + * Load Settings (Req: EEPROM_SETTINGS) + * Save Settings (Req: EEPROM_SETTINGS) + */ +void menu_bed_leveling() { + START_MENU(); + MENU_BACK(MSG_MOTION); + + const bool is_homed = all_axes_known(); + + // Auto Home if not using manual probing + #if DISABLED(PROBE_MANUALLY) && DISABLED(MESH_BED_LEVELING) + if (!is_homed) MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); + #endif + + // Level Bed + #if ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING) + // Manual leveling uses a guided procedure + MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue); + #else + // Automatic leveling can just run the G-code + MENU_ITEM(gcode, MSG_LEVEL_BED, is_homed ? PSTR("G29") : PSTR("G28\nG29")); + #endif + + // Homed and leveling is valid? Then leveling can be toggled. + if (is_homed && leveling_is_valid()) { + bool new_level_state = planner.leveling_active; + MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &new_level_state, _lcd_toggle_bed_leveling); + } + + // Z Fade Height + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &lcd_z_fade_height, 0, 100, _lcd_set_z_fade_height); + #endif + + // + // MBL Z Offset + // + #if ENABLED(MESH_BED_LEVELING) + MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); + #endif + + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); + #elif HAS_BED_PROBE + MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + #endif + + #if ENABLED(LEVEL_BED_CORNERS) + // Move to the next corner for leveling + MENU_ITEM(submenu, MSG_LEVEL_CORNERS, _lcd_level_bed_corners); + #endif + + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); + MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); + #endif + END_MENU(); +} + +#endif // HAS_LCD_MENU && LCD_BED_LEVELING diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp new file mode 100644 index 0000000000..9124a218bf --- /dev/null +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -0,0 +1,373 @@ +/** + * 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 . + * + */ + +// +// Configuration Menu +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU + +#include "menu.h" + +#include "../../module/configuration_store.h" + +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #include "../../feature/runout.h" +#endif + +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(); +} + +#if ENABLED(LCD_PROGRESS_BAR_TEST) + + static void progress_bar_test() { + static int8_t bar_percent = 0; + if (use_click()) { + lcd_goto_previous_menu(); + lcd_set_custom_characters(CHARSET_MENU); + return; + } + bar_percent += (int8_t)encoderPosition; + bar_percent = constrain(bar_percent, 0, 100); + encoderPosition = 0; + lcd_implementation_drawmenu_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); + } + + void _progress_bar_test() { + lcd_goto_screen(progress_bar_test); + lcd_set_custom_characters(); + } + +#endif // LCD_PROGRESS_BAR_TEST + +#if HAS_DEBUG_MENU + + void menu_debug() { + START_MENU(); + + MENU_BACK(MSG_MAIN); + + #if ENABLED(LCD_PROGRESS_BAR_TEST) + MENU_ITEM(submenu, MSG_PROGRESS_BAR_TEST, _progress_bar_test); + #endif + + END_MENU(); + } + +#endif + +#if EXTRUDERS > 1 + + #include "../../module/tool_change.h" + + void menu_tool_change() { + START_MENU(); + MENU_BACK(MSG_MAIN); + #if ENABLED(SINGLENOZZLE) + MENU_ITEM_EDIT(float3, MSG_FILAMENT_SWAP_LENGTH, &toolchange_settings.swap_length, 0, 200); + MENU_MULTIPLIER_ITEM_EDIT(int4, MSG_SINGLENOZZLE_RETRACT_SPD, &toolchange_settings.retract_speed, 10, 5400); + MENU_MULTIPLIER_ITEM_EDIT(int4, MSG_SINGLENOZZLE_PRIME_SPD, &toolchange_settings.prime_speed, 10, 5400); + #endif + MENU_ITEM_EDIT(float3, MSG_TOOL_CHANGE_ZLIFT, &toolchange_settings.z_raise, 0, 10); + END_MENU(); + } + +#endif + +#if ENABLED(DUAL_X_CARRIAGE) + + #include "../../module/motion.h" + #include "../../gcode/queue.h" + + void _recalc_IDEX_settings() { + if (active_extruder) { // For the 2nd extruder re-home so the next tool-change gets the new offsets. + enqueue_and_echo_commands_P(PSTR("G28")); // In future, we can babystep the 2nd extruder (if active), making homing unnecessary. + active_extruder = 0; + } + } + + void menu_IDEX() { + START_MENU(); + MENU_BACK(MSG_MAIN); + + MENU_ITEM(gcode, MSG_IDEX_MODE_AUTOPARK, PSTR("M605 S1\nG28 X\nG1 X100")); + const bool need_g28 = !(TEST(axis_known_position, Y_AXIS) && TEST(axis_known_position, Z_AXIS)); + MENU_ITEM(gcode, MSG_IDEX_MODE_DUPLICATE, need_g28 + ? PSTR("M605 S1\nT0\nG28\nM605 S2 X200\nG28 X\nG1 X100") // If Y or Z is not homed, do a full G28 first + : PSTR("M605 S1\nT0\nM605 S2 X200\nG28 X\nG1 X100") + ); + //MENU_ITEM(gcode, MSG_IDEX_MODE_SCALED_COPY, need_g28 + // ? PSTR("M605 S1\nT0\nG28\nM605 S2 X200\nG28 X\nG1 X100\nM605 S3 X200") // If Y or Z is not homed, do a full G28 first + // : PSTR("M605 S1\nT0\nM605 S2 X200\nG28 X\nG1 X100\nM605 S3 X200") + //); + MENU_ITEM(gcode, MSG_IDEX_MODE_FULL_CTRL, PSTR("M605 S0\nG28 X")); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_IDEX_X_OFFSET , &hotend_offset[X_AXIS][1], MIN(X2_HOME_POS, X2_MAX_POS) - 25.0, MAX(X2_HOME_POS, X2_MAX_POS) + 25.0, _recalc_IDEX_settings); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_IDEX_Y_OFFSET , &hotend_offset[Y_AXIS][1], -10.0, 10.0, _recalc_IDEX_settings); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_IDEX_Z_OFFSET , &hotend_offset[Z_AXIS][1], -10.0, 10.0, _recalc_IDEX_settings); + MENU_ITEM(gcode, MSG_IDEX_SAVE_OFFSETS, PSTR("M500")); + END_MENU(); + } + +#endif + +#if ENABLED(BLTOUCH) + + void menu_bltouch() { + START_MENU(); + MENU_BACK(MSG_MAIN); + MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET))); + MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST))); + MENU_ITEM(gcode, MSG_BLTOUCH_DEPLOY, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_DEPLOY))); + MENU_ITEM(gcode, MSG_BLTOUCH_STOW, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_STOW))); + END_MENU(); + } + +#endif + +#if ENABLED(MENU_ITEM_CASE_LIGHT) + + #include "../../feature/caselight.h" + + void menu_case_light() { + START_MENU(); + MENU_BACK(MSG_MAIN); + MENU_ITEM_EDIT_CALLBACK(int8, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true); + MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); + END_MENU(); + } + +#endif + +#if ENABLED(FWRETRACT) + + #include "../../feature/fwretract.h" + + void menu_config_retract() { + START_MENU(); + MENU_BACK(MSG_CONTROL); + #if ENABLED(FWRETRACT_AUTORETRACT) + MENU_ITEM_EDIT_CALLBACK(bool, MSG_AUTORETRACT, &fwretract.autoretract_enabled, fwretract.refresh_autoretract); + #endif + MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT, &fwretract.settings.retract_length, 0, 100); + #if EXTRUDERS > 1 + MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_SWAP, &fwretract.settings.swap_retract_length, 0, 100); + #endif + MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &fwretract.settings.retract_feedrate_mm_s, 1, 999); + MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_ZHOP, &fwretract.settings.retract_zraise, 0, 999); + MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_RECOVER, &fwretract.settings.retract_recover_length, -100, 100); + #if EXTRUDERS > 1 + MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_RECOVER_SWAP, &fwretract.settings.swap_retract_recover_length, -100, 100); + #endif + MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &fwretract.settings.retract_recover_feedrate_mm_s, 1, 999); + #if EXTRUDERS > 1 + MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVER_SWAPF, &fwretract.settings.swap_retract_recover_feedrate_mm_s, 1, 999); + #endif + END_MENU(); + } + +#endif + +#if ENABLED(DAC_STEPPER_CURRENT) + + #include "../../feature/dac/stepper_dac.h" + + uint8_t driverPercent[XYZE]; + inline void dac_driver_getValues() { LOOP_XYZE(i) driverPercent[i] = dac_current_get_percent((AxisEnum)i); } + static void dac_driver_commit() { dac_current_set_percents(driverPercent); } + + void menu_dac() { + dac_driver_getValues(); + START_MENU(); + MENU_BACK(MSG_CONTROL); + #define EDIT_DAC_PERCENT(N) MENU_ITEM_EDIT_CALLBACK(int8, MSG_##N " " MSG_DAC_PERCENT, &driverPercent[_AXIS(N)], 0, 100, dac_driver_commit) + EDIT_DAC_PERCENT(X); + EDIT_DAC_PERCENT(Y); + EDIT_DAC_PERCENT(Z); + EDIT_DAC_PERCENT(E); + MENU_ITEM(function, MSG_DAC_EEPROM_WRITE, dac_commit_eeprom); + END_MENU(); + } + +#endif + +#if HAS_MOTOR_CURRENT_PWM + + #include "../../module/stepper.h" + + void menu_pwm() { + START_MENU(); + MENU_BACK(MSG_CONTROL); + #define EDIT_CURRENT_PWM(LABEL,I) MENU_ITEM_EDIT_CALLBACK(long5, LABEL, &stepper.motor_current_setting[I], 100, 2000, stepper.refresh_motor_power) + #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) + EDIT_CURRENT_PWM(MSG_X MSG_Y, 0); + #endif + #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) + EDIT_CURRENT_PWM(MSG_Z, 1); + #endif + #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) + EDIT_CURRENT_PWM(MSG_E, 2); + #endif + END_MENU(); + } + +#endif + +#if DISABLED(SLIM_LCD_MENUS) + + void _menu_configuration_preheat_settings(const uint8_t material) { + #if HOTENDS > 5 + #define MINTEMP_ALL MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP, HEATER_4_MINTEMP, HEATER_5_MINTEMP) + #define MAXTEMP_ALL MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP) + #elif HOTENDS > 4 + #define MINTEMP_ALL MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP, HEATER_4_MINTEMP) + #define MAXTEMP_ALL MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP) + #elif HOTENDS > 3 + #define MINTEMP_ALL MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP) + #define MAXTEMP_ALL MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP) + #elif HOTENDS > 2 + #define MINTEMP_ALL MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP) + #define MAXTEMP_ALL MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP) + #elif HOTENDS > 1 + #define MINTEMP_ALL MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP) + #define MAXTEMP_ALL MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP) + #else + #define MINTEMP_ALL HEATER_0_MINTEMP + #define MAXTEMP_ALL HEATER_0_MAXTEMP + #endif + START_MENU(); + MENU_BACK(MSG_CONFIGURATION); + MENU_ITEM_EDIT(int8, MSG_FAN_SPEED, &lcd_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); + #endif + #if HAS_HEATED_BED + MENU_ITEM_EDIT(int3, MSG_BED, &lcd_preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 15); + #endif + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); + #endif + END_MENU(); + } + + void menu_preheat_material1_settings() { _menu_configuration_preheat_settings(0); } + void menu_preheat_material2_settings() { _menu_configuration_preheat_settings(1); } + +#endif + +void menu_configuration() { + START_MENU(); + MENU_BACK(MSG_MAIN); + + // + // Debug Menu when certain options are enabled + // + #if HAS_DEBUG_MENU + MENU_ITEM(submenu, MSG_DEBUG_MENU, menu_debug); + #endif + + MENU_ITEM(submenu, MSG_ADVANCED_SETTINGS, menu_advanced_settings); + + const bool busy = printer_busy(); + if (!busy) { + // + // Delta Calibration + // + #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) + MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, menu_delta_calibrate); + #endif + + #if ENABLED(DUAL_X_CARRIAGE) + MENU_ITEM(submenu, MSG_IDEX_MENU, menu_IDEX); + #endif + + #if ENABLED(BLTOUCH) + MENU_ITEM(submenu, MSG_BLTOUCH, menu_bltouch); + #endif + } + + // + // Set single nozzle filament retract and prime length + // + #if EXTRUDERS > 1 + MENU_ITEM(submenu, MSG_TOOL_CHANGE, menu_tool_change); + #endif + + // + // Set Case light on/off/brightness + // + #if ENABLED(MENU_ITEM_CASE_LIGHT) + if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) + MENU_ITEM(submenu, MSG_CASE_LIGHT, menu_case_light); + else + MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); + #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); + #endif + #if ENABLED(FWRETRACT) + MENU_ITEM(submenu, MSG_RETRACT, menu_config_retract); + #endif + #if ENABLED(DAC_STEPPER_CURRENT) + MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, menu_dac); + #endif + #if HAS_MOTOR_CURRENT_PWM + MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, menu_pwm); + #endif + + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + MENU_ITEM_EDIT(bool, MSG_RUNOUT_SENSOR_ENABLE, &runout.enabled); + #endif + + #if DISABLED(SLIM_LCD_MENUS) + // Preheat configurations + MENU_ITEM(submenu, MSG_PREHEAT_1_SETTINGS, menu_preheat_material1_settings); + MENU_ITEM(submenu, MSG_PREHEAT_2_SETTINGS, menu_preheat_material2_settings); + #endif + + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); + if (!busy) + MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); + #endif + + if (!busy) + MENU_ITEM(function, MSG_RESTORE_FAILSAFE, lcd_factory_settings); + + END_MENU(); +} + +#endif // HAS_LCD_MENU diff --git a/Marlin/src/lcd/menu/menu_custom.cpp b/Marlin/src/lcd/menu/menu_custom.cpp new file mode 100644 index 0000000000..f823a1049f --- /dev/null +++ b/Marlin/src/lcd/menu/menu_custom.cpp @@ -0,0 +1,87 @@ +/** + * 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 . + * + */ + +// +// Custom User Menu +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU && ENABLED(CUSTOM_USER_MENUS) + +#include "menu.h" +#include "../../gcode/queue.h" + +#ifdef USER_SCRIPT_DONE + #define _DONE_SCRIPT "\n" USER_SCRIPT_DONE +#else + #define _DONE_SCRIPT "" +#endif + +void _lcd_user_gcode(PGM_P const cmd) { + enqueue_and_echo_commands_P(cmd); + #if ENABLED(USER_SCRIPT_AUDIBLE_FEEDBACK) + lcd_completion_feedback(); + #endif + #if ENABLED(USER_SCRIPT_RETURN) + lcd_return_to_status(); + #endif +} + +#if defined(USER_DESC_1) && defined(USER_GCODE_1) + void lcd_user_gcode_1() { _lcd_user_gcode(PSTR(USER_GCODE_1 _DONE_SCRIPT)); } +#endif +#if defined(USER_DESC_2) && defined(USER_GCODE_2) + void lcd_user_gcode_2() { _lcd_user_gcode(PSTR(USER_GCODE_2 _DONE_SCRIPT)); } +#endif +#if defined(USER_DESC_3) && defined(USER_GCODE_3) + void lcd_user_gcode_3() { _lcd_user_gcode(PSTR(USER_GCODE_3 _DONE_SCRIPT)); } +#endif +#if defined(USER_DESC_4) && defined(USER_GCODE_4) + void lcd_user_gcode_4() { _lcd_user_gcode(PSTR(USER_GCODE_4 _DONE_SCRIPT)); } +#endif +#if defined(USER_DESC_5) && defined(USER_GCODE_5) + void lcd_user_gcode_5() { _lcd_user_gcode(PSTR(USER_GCODE_5 _DONE_SCRIPT)); } +#endif + +void menu_user() { + START_MENU(); + MENU_BACK(MSG_MAIN); + #if defined(USER_DESC_1) && defined(USER_GCODE_1) + MENU_ITEM(function, USER_DESC_1, lcd_user_gcode_1); + #endif + #if defined(USER_DESC_2) && defined(USER_GCODE_2) + MENU_ITEM(function, USER_DESC_2, lcd_user_gcode_2); + #endif + #if defined(USER_DESC_3) && defined(USER_GCODE_3) + MENU_ITEM(function, USER_DESC_3, lcd_user_gcode_3); + #endif + #if defined(USER_DESC_4) && defined(USER_GCODE_4) + MENU_ITEM(function, USER_DESC_4, lcd_user_gcode_4); + #endif + #if defined(USER_DESC_5) && defined(USER_GCODE_5) + MENU_ITEM(function, USER_DESC_5, lcd_user_gcode_5); + #endif + END_MENU(); +} + +#endif // HAS_LCD_MENU && CUSTOM_USER_MENUS diff --git a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp new file mode 100644 index 0000000000..62692f03c5 --- /dev/null +++ b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp @@ -0,0 +1,137 @@ +/** + * 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 . + * + */ + +// +// Delta Calibrate Menu +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU && (ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION)) + +#include "menu.h" +#include "../../module/delta.h" +#include "../../module/motion.h" + +#if HAS_LEVELING + #include "../../feature/bedlevel/bedlevel.h" +#endif + +void _man_probe_pt(const float &rx, const float &ry) { + do_blocking_move_to(rx, ry, Z_CLEARANCE_BETWEEN_PROBES); + lcd_synchronize(); + move_menu_scale = MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT)); + lcd_goto_screen(lcd_move_z); +} + +#if ENABLED(DELTA_AUTO_CALIBRATION) + + #include "../../gcode/gcode.h" + + float lcd_probe_pt(const float &rx, const float &ry) { + _man_probe_pt(rx, ry); + KEEPALIVE_STATE(PAUSED_FOR_USER); + defer_return_to_status = true; + wait_for_user = true; + while (wait_for_user) idle(); + KEEPALIVE_STATE(IN_HANDLER); + lcd_goto_previous_menu_no_defer(); + return current_position[Z_AXIS]; + } + +#endif + +#if ENABLED(DELTA_CALIBRATION_MENU) + + #include "../../gcode/queue.h" + + void _lcd_calibrate_homing() { + _lcd_draw_homing(); + if (all_axes_homed()) lcd_goto_previous_menu(); + } + + void _lcd_delta_calibrate_home() { + enqueue_and_echo_commands_P(PSTR("G28")); + lcd_goto_screen(_lcd_calibrate_homing); + } + + void _goto_tower_x() { _man_probe_pt(cos(RADIANS(210)) * delta_calibration_radius, sin(RADIANS(210)) * delta_calibration_radius); } + void _goto_tower_y() { _man_probe_pt(cos(RADIANS(330)) * delta_calibration_radius, sin(RADIANS(330)) * delta_calibration_radius); } + void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); } + void _goto_center() { _man_probe_pt(0,0); } + +#endif + +void _recalc_delta_settings() { + #if HAS_LEVELING + reset_bed_level(); // After changing kinematics bed-level data is no longer valid + #endif + recalc_delta_settings(); +} + +void lcd_delta_settings() { + START_MENU(); + MENU_BACK(MSG_DELTA_CALIBRATE); + MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings); + #define EDIT_ENDSTOP_ADJ(LABEL,N) MENU_ITEM_EDIT_CALLBACK(float43, LABEL, &delta_endstop_adj[_AXIS(N)], -5, 5, _recalc_delta_settings) + EDIT_ENDSTOP_ADJ("Ex",A); + EDIT_ENDSTOP_ADJ("Ey",B); + EDIT_ENDSTOP_ADJ("Ez",C); + MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings); + #define EDIT_ANGLE_TRIM(LABEL,N) MENU_ITEM_EDIT_CALLBACK(float43, LABEL, &delta_tower_angle_trim[_AXIS(N)], -5, 5, _recalc_delta_settings) + EDIT_ANGLE_TRIM("Tx",A); + EDIT_ANGLE_TRIM("Ty",B); + EDIT_ANGLE_TRIM("Tz",C); + MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5, delta_diagonal_rod + 5, _recalc_delta_settings); + END_MENU(); +} + +void menu_delta_calibrate() { + START_MENU(); + MENU_BACK(MSG_MAIN); + + #if ENABLED(DELTA_AUTO_CALIBRATION) + MENU_ITEM(gcode, MSG_DELTA_AUTO_CALIBRATE, PSTR("G33")); + MENU_ITEM(gcode, MSG_DELTA_HEIGHT_CALIBRATE, PSTR("G33 S P1")); + MENU_ITEM(gcode, MSG_DELTA_Z_OFFSET_CALIBRATE, PSTR("G33 P-1")); + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); + MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); + #endif + #endif + + MENU_ITEM(submenu, MSG_DELTA_SETTINGS, lcd_delta_settings); + + #if ENABLED(DELTA_CALIBRATION_MENU) + MENU_ITEM(submenu, MSG_AUTO_HOME, _lcd_delta_calibrate_home); + if (all_axes_homed()) { + MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_X, _goto_tower_x); + MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Y, _goto_tower_y); + MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Z, _goto_tower_z); + MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_CENTER, _goto_center); + } + #endif + + END_MENU(); +} + +#endif // HAS_LCD_MENU && (DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION) diff --git a/Marlin/src/lcd/menu/menu_filament.cpp b/Marlin/src/lcd/menu/menu_filament.cpp new file mode 100644 index 0000000000..2fc085a4e5 --- /dev/null +++ b/Marlin/src/lcd/menu/menu_filament.cpp @@ -0,0 +1,581 @@ +/** + * 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 . + * + */ + +// +// Filament Change Menu +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU && ENABLED(ADVANCED_PAUSE_FEATURE) + +#include "menu.h" +#include "../../module/temperature.h" +#include "../../feature/pause.h" + +// +// Change Filament > Change/Unload/Load Filament +// +static AdvancedPauseMode _change_filament_temp_mode; // =ADVANCED_PAUSE_MODE_PAUSE_PRINT +static int8_t _change_filament_temp_extruder; // =0 + +inline PGM_P _change_filament_temp_command() { + switch (_change_filament_temp_mode) { + case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: + return PSTR("M701 T%d"); + case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: + return _change_filament_temp_extruder >= 0 ? PSTR("M702 T%d") : PSTR("M702 ;%d"); + case ADVANCED_PAUSE_MODE_PAUSE_PRINT: + default: + return PSTR("M600 B0 T%d"); + } + return PSTR(MSG_FILAMENTCHANGE); +} + +static void _change_filament_temp(const uint16_t temperature) { + char cmd[11]; + sprintf_P(cmd, _change_filament_temp_command(), _change_filament_temp_extruder); + thermalManager.setTargetHotend(temperature, _change_filament_temp_extruder); + lcd_enqueue_command(cmd); +} +inline void _lcd_change_filament_temp_1_func() { _change_filament_temp(PREHEAT_1_TEMP_HOTEND); } +inline void _lcd_change_filament_temp_2_func() { _change_filament_temp(PREHEAT_2_TEMP_HOTEND); } +inline void _lcd_change_filament_temp_custom_cb() { _change_filament_temp(thermalManager.target_temperature[_change_filament_temp_extruder]); } + +static PGM_P change_filament_header(const AdvancedPauseMode mode) { + switch (mode) { + case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: + return PSTR(MSG_FILAMENTLOAD); + case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: + return PSTR(MSG_FILAMENTUNLOAD); + default: break; + } + return PSTR(MSG_FILAMENTCHANGE); +} + +void _menu_temp_filament_op(const AdvancedPauseMode mode, const int8_t extruder) { + _change_filament_temp_mode = mode; + _change_filament_temp_extruder = extruder; + START_MENU(); + if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), true, true); + MENU_BACK(MSG_BACK); + MENU_ITEM(function, MSG_PREHEAT_1, _lcd_change_filament_temp_1_func); + MENU_ITEM(function, MSG_PREHEAT_2, _lcd_change_filament_temp_2_func); + uint16_t max_temp; + switch (extruder) { + default: max_temp = HEATER_0_MAXTEMP; + #if HOTENDS > 1 + case 1: max_temp = HEATER_1_MAXTEMP; break; + #if HOTENDS > 2 + case 2: max_temp = HEATER_2_MAXTEMP; break; + #if HOTENDS > 3 + case 3: max_temp = HEATER_3_MAXTEMP; break; + #if HOTENDS > 4 + case 4: max_temp = HEATER_4_MAXTEMP; break; + #if HOTENDS > 5 + case 5: max_temp = HEATER_5_MAXTEMP; break; + #endif + #endif + #endif + #endif + #endif + } + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PREHEAT_CUSTOM, &thermalManager.target_temperature[_change_filament_temp_extruder], EXTRUDE_MINTEMP, max_temp - 15, _lcd_change_filament_temp_custom_cb); + END_MENU(); +} +void menu_temp_e0_filament_change() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 0); } +void menu_temp_e0_filament_load() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 0); } +void menu_temp_e0_filament_unload() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 0); } +#if E_STEPPERS > 1 + void menu_temp_e1_filament_change() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 1); } + void menu_temp_e1_filament_load() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 1); } + void menu_temp_e1_filament_unload() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 1); } + #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) + void menu_unload_filament_all_temp() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, -1); } + #endif + #if E_STEPPERS > 2 + void menu_temp_e2_filament_change() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 2); } + void menu_temp_e2_filament_load() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 2); } + void menu_temp_e2_filament_unload() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 2); } + #if E_STEPPERS > 3 + void menu_temp_e3_filament_change() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 3); } + void menu_temp_e3_filament_load() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 3); } + void menu_temp_e3_filament_unload() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 3); } + #if E_STEPPERS > 4 + void menu_temp_e4_filament_change() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 4); } + void menu_temp_e4_filament_load() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 4); } + void menu_temp_e4_filament_unload() { _menu_temp_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 4); } + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 +#endif // E_STEPPERS > 1 + +/** + * + * "Change Filament" submenu + * + */ +#if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) + void menu_change_filament() { + START_MENU(); + MENU_BACK(MSG_MAIN); + + // Change filament + #if E_STEPPERS == 1 + PGM_P msg0 = PSTR(MSG_FILAMENTCHANGE); + if (thermalManager.targetTooColdToExtrude(active_extruder)) + MENU_ITEM_P(submenu, msg0, menu_temp_e0_filament_change); + else + MENU_ITEM_P(gcode, msg0, PSTR("M600 B0")); + #else + PGM_P msg0 = PSTR(MSG_FILAMENTCHANGE " " MSG_E1); + PGM_P msg1 = PSTR(MSG_FILAMENTCHANGE " " MSG_E2); + if (thermalManager.targetTooColdToExtrude(0)) + MENU_ITEM_P(submenu, msg0, menu_temp_e0_filament_change); + else + MENU_ITEM_P(gcode, msg0, PSTR("M600 B0 T0")); + if (thermalManager.targetTooColdToExtrude(1)) + MENU_ITEM_P(submenu, msg1, menu_temp_e1_filament_change); + else + MENU_ITEM_P(gcode, msg1, PSTR("M600 B0 T1")); + #if E_STEPPERS > 2 + PGM_P msg2 = PSTR(MSG_FILAMENTCHANGE " " MSG_E3); + if (thermalManager.targetTooColdToExtrude(2)) + MENU_ITEM_P(submenu, msg2, menu_temp_e2_filament_change); + else + MENU_ITEM_P(gcode, msg2, PSTR("M600 B0 T2")); + #if E_STEPPERS > 3 + PGM_P msg3 = PSTR(MSG_FILAMENTCHANGE " " MSG_E4); + if (thermalManager.targetTooColdToExtrude(3)) + MENU_ITEM_P(submenu, msg3, menu_temp_e3_filament_change); + else + MENU_ITEM_P(gcode, msg3, PSTR("M600 B0 T3")); + #if E_STEPPERS > 4 + PGM_P msg4 = PSTR(MSG_FILAMENTCHANGE " " MSG_E5); + if (thermalManager.targetTooColdToExtrude(4)) + MENU_ITEM_P(submenu, msg4, menu_temp_e4_filament_change); + else + MENU_ITEM_P(gcode, msg4, PSTR("M600 B0 T4")); + #if E_STEPPERS > 5 + PGM_P msg5 = PSTR(MSG_FILAMENTCHANGE " " MSG_E6); + if (thermalManager.targetTooColdToExtrude(5)) + MENU_ITEM_P(submenu, msg5, menu_temp_e5_filament_change); + else + MENU_ITEM_P(gcode, msg5, PSTR("M600 B0 T5")); + #endif // E_STEPPERS > 5 + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #endif // E_STEPPERS == 1 + + #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) + if (!printer_busy()) { + // Load filament + #if E_STEPPERS == 1 + PGM_P msg0 = PSTR(MSG_FILAMENTLOAD); + if (thermalManager.targetTooColdToExtrude(active_extruder)) + MENU_ITEM_P(submenu, msg0, menu_temp_e0_filament_load); + else + MENU_ITEM_P(gcode, msg0, PSTR("M701")); + #else + PGM_P msg0 = PSTR(MSG_FILAMENTLOAD " " MSG_E1); + PGM_P msg1 = PSTR(MSG_FILAMENTLOAD " " MSG_E2); + if (thermalManager.targetTooColdToExtrude(0)) + MENU_ITEM_P(submenu, msg0, menu_temp_e0_filament_load); + else + MENU_ITEM_P(gcode, msg0, PSTR("M701 T0")); + if (thermalManager.targetTooColdToExtrude(1)) + MENU_ITEM_P(submenu, msg1, menu_temp_e1_filament_load); + else + MENU_ITEM_P(gcode, msg1, PSTR("M701 T1")); + #if E_STEPPERS > 2 + PGM_P msg2 = PSTR(MSG_FILAMENTLOAD " " MSG_E3); + if (thermalManager.targetTooColdToExtrude(2)) + MENU_ITEM_P(submenu, msg2, menu_temp_e2_filament_load); + else + MENU_ITEM_P(gcode, msg2, PSTR("M701 T2")); + #if E_STEPPERS > 3 + PGM_P msg3 = PSTR(MSG_FILAMENTLOAD " " MSG_E4); + if (thermalManager.targetTooColdToExtrude(3)) + MENU_ITEM_P(submenu, msg3, menu_temp_e3_filament_load); + else + MENU_ITEM_P(gcode, msg3, PSTR("M701 T3")); + #if E_STEPPERS > 4 + PGM_P msg4 = PSTR(MSG_FILAMENTLOAD " " MSG_E5); + if (thermalManager.targetTooColdToExtrude(4)) + MENU_ITEM_P(submenu, msg4, menu_temp_e4_filament_load); + else + MENU_ITEM_P(gcode, msg4, PSTR("M701 T4")); + #if E_STEPPERS > 5 + PGM_P msg5 = PSTR(MSG_FILAMENTLOAD " " MSG_E6); + if (thermalManager.targetTooColdToExtrude(5)) + MENU_ITEM_P(submenu, msg5, menu_temp_e5_filament_load); + else + MENU_ITEM_P(gcode, msg5, PSTR("M701 T5")); + #endif // E_STEPPERS > 5 + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #endif // E_STEPPERS == 1 + + // Unload filament + #if E_STEPPERS == 1 + if (thermalManager.targetHotEnoughToExtrude(active_extruder)) + MENU_ITEM(gcode, MSG_FILAMENTUNLOAD, PSTR("M702")); + else + MENU_ITEM(submenu, MSG_FILAMENTUNLOAD, menu_temp_e0_filament_unload); + #else + #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) + if (thermalManager.targetHotEnoughToExtrude(0) + #if E_STEPPERS > 1 + && thermalManager.targetHotEnoughToExtrude(1) + #if E_STEPPERS > 2 + && thermalManager.targetHotEnoughToExtrude(2) + #if E_STEPPERS > 3 + && thermalManager.targetHotEnoughToExtrude(3) + #if E_STEPPERS > 4 + && thermalManager.targetHotEnoughToExtrude(4) + #if E_STEPPERS > 5 + && thermalManager.targetHotEnoughToExtrude(5) + #endif // E_STEPPERS > 5 + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #endif // E_STEPPERS > 1 + ) + MENU_ITEM(gcode, MSG_FILAMENTUNLOAD_ALL, PSTR("M702")); + else + MENU_ITEM(submenu, MSG_FILAMENTUNLOAD_ALL, menu_unload_filament_all_temp); + #endif + if (thermalManager.targetHotEnoughToExtrude(0)) + MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E1, PSTR("M702 T0")); + else + MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E1, menu_temp_e0_filament_unload); + if (thermalManager.targetHotEnoughToExtrude(1)) + MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E2, PSTR("M702 T1")); + else + MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E2, menu_temp_e1_filament_unload); + #if E_STEPPERS > 2 + if (thermalManager.targetHotEnoughToExtrude(2)) + MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E3, PSTR("M702 T2")); + else + MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E3, menu_temp_e2_filament_unload); + #if E_STEPPERS > 3 + if (thermalManager.targetHotEnoughToExtrude(3)) + MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E4, PSTR("M702 T3")); + else + MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E4, menu_temp_e3_filament_unload); + #if E_STEPPERS > 4 + if (thermalManager.targetHotEnoughToExtrude(4)) + MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E5, PSTR("M702 T4")); + else + MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E5, menu_temp_e4_filament_unload); + #if E_STEPPERS > 5 + if (thermalManager.targetHotEnoughToExtrude(5)) + MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E6, PSTR("M702 T5")); + else + MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E6, menu_temp_e5_filament_unload); + #endif // E_STEPPERS > 5 + #endif // E_STEPPERS > 4 + #endif // E_STEPPERS > 3 + #endif // E_STEPPERS > 2 + #endif // E_STEPPERS == 1 + } + #endif + + END_MENU(); + } +#endif + +static AdvancedPauseMode advanced_pause_mode = ADVANCED_PAUSE_MODE_PAUSE_PRINT; +static uint8_t hotend_status_extruder = 0; + +static PGM_P advanced_pause_header() { + switch (advanced_pause_mode) { + case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: + return PSTR(MSG_FILAMENT_CHANGE_HEADER_LOAD); + case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: + return PSTR(MSG_FILAMENT_CHANGE_HEADER_UNLOAD); + default: break; + } + return PSTR(MSG_FILAMENT_CHANGE_HEADER_PAUSE); +} + +// 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 (_skipStatic && encoderLine <= _thisItemNr) { \ + encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ + ++encoderLine; \ + } \ + lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ + } \ + ++_thisItemNr; \ +}while(0) + +void lcd_advanced_pause_resume_print() { + advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_RESUME_PRINT; +} + +void lcd_advanced_pause_extrude_more() { + advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE; +} + +void menu_advanced_pause_option() { + START_MENU(); + #if LCD_HEIGHT > 2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false); + #endif + MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_RESUME, lcd_advanced_pause_resume_print); + MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_PURGE, lcd_advanced_pause_extrude_more); + END_MENU(); +} + +void lcd_advanced_pause_init_message() { + START_SCREEN(); + STATIC_ITEM_P(advanced_pause_header(), true, true); + STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_1); + #ifdef MSG_FILAMENT_CHANGE_INIT_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_2); + #define __FC_LINES_A 3 + #else + #define __FC_LINES_A 2 + #endif + #ifdef MSG_FILAMENT_CHANGE_INIT_3 + STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_3); + #define _FC_LINES_A (__FC_LINES_A + 1) + #else + #define _FC_LINES_A __FC_LINES_A + #endif + #if LCD_HEIGHT > _FC_LINES_A + 1 + STATIC_ITEM(" "); + #endif + HOTEND_STATUS_ITEM(); + END_SCREEN(); +} + +void lcd_advanced_pause_unload_message() { + START_SCREEN(); + STATIC_ITEM_P(advanced_pause_header(), true, true); + STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_1); + #ifdef MSG_FILAMENT_CHANGE_UNLOAD_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_2); + #define __FC_LINES_B 3 + #else + #define __FC_LINES_B 2 + #endif + #ifdef MSG_FILAMENT_CHANGE_UNLOAD_3 + STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_3); + #define _FC_LINES_B (__FC_LINES_B + 1) + #else + #define _FC_LINES_B __FC_LINES_B + #endif + #if LCD_HEIGHT > _FC_LINES_B + 1 + STATIC_ITEM(" "); + #endif + HOTEND_STATUS_ITEM(); + END_SCREEN(); +} + +void lcd_advanced_pause_wait_for_nozzles_to_heat() { + START_SCREEN(); + STATIC_ITEM_P(advanced_pause_header(), true, true); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEATING_1); + #ifdef MSG_FILAMENT_CHANGE_HEATING_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEATING_2); + #define _FC_LINES_C 3 + #else + #define _FC_LINES_C 2 + #endif + #if LCD_HEIGHT > _FC_LINES_C + 1 + STATIC_ITEM(" "); + #endif + HOTEND_STATUS_ITEM(); + END_SCREEN(); +} + +void lcd_advanced_pause_heat_nozzle() { + START_SCREEN(); + STATIC_ITEM_P(advanced_pause_header(), true, true); + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEAT_1); + #ifdef MSG_FILAMENT_CHANGE_INSERT_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_HEAT_2); + #define _FC_LINES_D 3 + #else + #define _FC_LINES_D 2 + #endif + #if LCD_HEIGHT > _FC_LINES_D + 1 + STATIC_ITEM(" "); + #endif + HOTEND_STATUS_ITEM(); + END_SCREEN(); +} + +void lcd_advanced_pause_insert_message() { + START_SCREEN(); + STATIC_ITEM_P(advanced_pause_header(), true, true); + STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_1); + #ifdef MSG_FILAMENT_CHANGE_INSERT_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_2); + #define __FC_LINES_E 3 + #else + #define __FC_LINES_E 2 + #endif + #ifdef MSG_FILAMENT_CHANGE_INSERT_3 + STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_3); + #define _FC_LINES_E (__FC_LINES_E + 1) + #else + #define _FC_LINES_E __FC_LINES_E + #endif + #if LCD_HEIGHT > _FC_LINES_E + 1 + STATIC_ITEM(" "); + #endif + HOTEND_STATUS_ITEM(); + END_SCREEN(); +} + +void lcd_advanced_pause_load_message() { + START_SCREEN(); + STATIC_ITEM_P(advanced_pause_header(), true, true); + STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_1); + #ifdef MSG_FILAMENT_CHANGE_LOAD_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_2); + #define __FC_LINES_F 3 + #else + #define __FC_LINES_F 2 + #endif + #ifdef MSG_FILAMENT_CHANGE_LOAD_3 + STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_3); + #define _FC_LINES_F (__FC_LINES_F + 1) + #else + #define _FC_LINES_F __FC_LINES_F + #endif + #if LCD_HEIGHT > _FC_LINES_F + 1 + STATIC_ITEM(" "); + #endif + HOTEND_STATUS_ITEM(); + END_SCREEN(); +} + +void lcd_advanced_pause_purge_message() { + START_SCREEN(); + STATIC_ITEM_P(advanced_pause_header(), true, true); + STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_1); + #ifdef MSG_FILAMENT_CHANGE_PURGE_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_2); + #define __FC_LINES_G 3 + #else + #define __FC_LINES_G 2 + #endif + #ifdef MSG_FILAMENT_CHANGE_PURGE_3 + STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_3); + #define _FC_LINES_G (__FC_LINES_G + 1) + #else + #define _FC_LINES_G __FC_LINES_G + #endif + #if LCD_HEIGHT > _FC_LINES_G + 1 + STATIC_ITEM(" "); + #endif + HOTEND_STATUS_ITEM(); + END_SCREEN(); +} + +#if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) + void menu_advanced_pause_continuous_purge() { + START_SCREEN(); + STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_1); + #ifdef MSG_FILAMENT_CHANGE_PURGE_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_2); + #define __FC_LINES_G 3 + #else + #define __FC_LINES_G 2 + #endif + #ifdef MSG_FILAMENT_CHANGE_PURGE_3 + STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_3); + #define _FC_LINES_G (__FC_LINES_G + 1) + #else + #define _FC_LINES_G __FC_LINES_G + #endif + #if LCD_HEIGHT > _FC_LINES_G + 1 + STATIC_ITEM(" "); + #endif + HOTEND_STATUS_ITEM(); + STATIC_ITEM(MSG_USERWAIT); + END_SCREEN(); + } +#endif + +void lcd_advanced_pause_resume_message() { + START_SCREEN(); + STATIC_ITEM_P(advanced_pause_header(), true, true); + STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_1); + #ifdef MSG_FILAMENT_CHANGE_RESUME_2 + STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_2); + #endif + #ifdef MSG_FILAMENT_CHANGE_RESUME_3 + STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_3); + #endif + END_SCREEN(); +} + +FORCE_INLINE screenFunc_t ap_message_screen(const AdvancedPauseMessage message) { + switch (message) { + case ADVANCED_PAUSE_MESSAGE_INIT: return lcd_advanced_pause_init_message; + case ADVANCED_PAUSE_MESSAGE_UNLOAD: return lcd_advanced_pause_unload_message; + case ADVANCED_PAUSE_MESSAGE_INSERT: return lcd_advanced_pause_insert_message; + case ADVANCED_PAUSE_MESSAGE_LOAD: return lcd_advanced_pause_load_message; + case ADVANCED_PAUSE_MESSAGE_PURGE: return lcd_advanced_pause_purge_message; + case ADVANCED_PAUSE_MESSAGE_RESUME: return lcd_advanced_pause_resume_message; + case ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE: return lcd_advanced_pause_heat_nozzle; + case ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT: return lcd_advanced_pause_wait_for_nozzles_to_heat; + case ADVANCED_PAUSE_MESSAGE_OPTION: advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_WAIT_FOR; + return menu_advanced_pause_option; + #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) + case ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE: return menu_advanced_pause_continuous_purge; + #endif + case ADVANCED_PAUSE_MESSAGE_STATUS: + default: break; + } + return NULL; +} + +void lcd_advanced_pause_show_message( + const AdvancedPauseMessage message, + const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/, + const uint8_t extruder/*=active_extruder*/ +) { + advanced_pause_mode = mode; + hotend_status_extruder = extruder; + const screenFunc_t next_screen = ap_message_screen(message); + if (next_screen) { + defer_return_to_status = true; + lcd_goto_screen(next_screen); + } + else + lcd_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 new file mode 100644 index 0000000000..a4860093eb --- /dev/null +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -0,0 +1,198 @@ +/** + * 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 . + * + */ + +// +// Info Menu +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU && ENABLED(LCD_INFO_MENU) + +#include "menu.h" +// #include "../../module/motion.h" +// #include "../../module/planner.h" +// #include "../../module/temperature.h" +// #include "../../Marlin.h" + +// #if HAS_LEVELING +// #include "../../feature/bedlevel/bedlevel.h" +// #endif + + +#if ENABLED(PRINTCOUNTER) + + #include "../../module/printcounter.h" + + // + // About Printer > Printer Stats + // + void menu_info_stats() { + if (use_click()) { return lcd_goto_previous_menu(); } + + char buffer[21]; + printStatistics stats = print_job_timer.getStats(); + + START_SCREEN(); // 12345678901234567890 + STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count: 999 + STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS": ", false, false, itostr3left(stats.finishedPrints)); // Completed : 666 + + duration_t elapsed = stats.printTime; + elapsed.toString(buffer); + + STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false); // Total print Time: + STATIC_ITEM("", false, false, buffer); // 99y 364d 23h 59m 59s + + elapsed = stats.longestPrint; + elapsed.toString(buffer); + + STATIC_ITEM(MSG_INFO_PRINT_LONGEST ": ", false, false); // Longest job time: + STATIC_ITEM("", false, false, buffer); // 99y 364d 23h 59m 59s + + sprintf_P(buffer, PSTR("%ld.%im"), long(stats.filamentUsed / 1000), int16_t(stats.filamentUsed / 100) % 10); + STATIC_ITEM(MSG_INFO_PRINT_FILAMENT ": ", false, false); // Extruded total: + STATIC_ITEM("", false, false, buffer); // 125m + END_SCREEN(); + } + +#endif + +// +// About Printer > Thermistors +// +void menu_info_thermistors() { + if (use_click()) { return lcd_goto_previous_menu(); } + START_SCREEN(); + #define THERMISTOR_ID TEMP_SENSOR_0 + #include "../thermistornames.h" + STATIC_ITEM("T0: " THERMISTOR_NAME, false, true); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_0_MINTEMP), false); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_0_MAXTEMP), false); + + #if TEMP_SENSOR_1 != 0 + #undef THERMISTOR_ID + #define THERMISTOR_ID TEMP_SENSOR_1 + #include "../thermistornames.h" + STATIC_ITEM("T1: " THERMISTOR_NAME, false, true); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_1_MINTEMP), false); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_1_MAXTEMP), false); + #endif + + #if TEMP_SENSOR_2 != 0 + #undef THERMISTOR_ID + #define THERMISTOR_ID TEMP_SENSOR_2 + #include "../thermistornames.h" + STATIC_ITEM("T2: " THERMISTOR_NAME, false, true); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_2_MINTEMP), false); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_2_MAXTEMP), false); + #endif + + #if TEMP_SENSOR_3 != 0 + #undef THERMISTOR_ID + #define THERMISTOR_ID TEMP_SENSOR_3 + #include "../thermistornames.h" + STATIC_ITEM("T3: " THERMISTOR_NAME, false, true); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_3_MINTEMP), false); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_3_MAXTEMP), false); + #endif + + #if TEMP_SENSOR_4 != 0 + #undef THERMISTOR_ID + #define THERMISTOR_ID TEMP_SENSOR_4 + #include "../thermistornames.h" + STATIC_ITEM("T4: " THERMISTOR_NAME, false, true); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_4_MINTEMP), false); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_4_MAXTEMP), false); + #endif + + #if HAS_HEATED_BED + #undef THERMISTOR_ID + #define THERMISTOR_ID TEMP_SENSOR_BED + #include "../thermistornames.h" + STATIC_ITEM("TBed:" THERMISTOR_NAME, false, true); + STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(BED_MINTEMP), false); + STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(BED_MAXTEMP), false); + #endif + END_SCREEN(); +} + +// +// About Printer > Board Info +// +void menu_info_board() { + if (use_click()) { return lcd_goto_previous_menu(); } + START_SCREEN(); + STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController + STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000 + STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION, true); // Protocol: 1.0 + #if POWER_SUPPLY == 0 + STATIC_ITEM(MSG_INFO_PSU ": Generic", true); + #elif POWER_SUPPLY == 1 + STATIC_ITEM(MSG_INFO_PSU ": ATX", true); // Power Supply: ATX + #elif POWER_SUPPLY == 2 + STATIC_ITEM(MSG_INFO_PSU ": XBox", true); // Power Supply: XBox + #endif + END_SCREEN(); +} + +// +// About Printer > Printer Info +// +void menu_info_printer() { + if (use_click()) { return lcd_goto_previous_menu(); } + START_SCREEN(); + STATIC_ITEM(MSG_MARLIN, true, true); // Marlin + STATIC_ITEM(SHORT_BUILD_VERSION, true); // x.x.x-Branch + STATIC_ITEM(STRING_DISTRIBUTION_DATE, true); // YYYY-MM-DD HH:MM + STATIC_ITEM(MACHINE_NAME, true); // My3DPrinter + STATIC_ITEM(WEBSITE_URL, true); // www.my3dprinter.com + STATIC_ITEM(MSG_INFO_EXTRUDERS ": " STRINGIFY(EXTRUDERS), true); // Extruders: 2 + #if ENABLED(AUTO_BED_LEVELING_3POINT) + STATIC_ITEM(MSG_3POINT_LEVELING, true); // 3-Point Leveling + #elif ENABLED(AUTO_BED_LEVELING_LINEAR) + STATIC_ITEM(MSG_LINEAR_LEVELING, true); // Linear Leveling + #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) + STATIC_ITEM(MSG_BILINEAR_LEVELING, true); // Bi-linear Leveling + #elif ENABLED(AUTO_BED_LEVELING_UBL) + STATIC_ITEM(MSG_UBL_LEVELING, true); // Unified Bed Leveling + #elif ENABLED(MESH_BED_LEVELING) + STATIC_ITEM(MSG_MESH_LEVELING, true); // Mesh Leveling + #endif + END_SCREEN(); +} + +// +// "About Printer" submenu +// +void menu_info() { + START_MENU(); + MENU_BACK(MSG_MAIN); + MENU_ITEM(submenu, MSG_INFO_PRINTER_MENU, menu_info_printer); // Printer Info > + MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, menu_info_board); // Board Info > + MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, menu_info_thermistors); // Thermistors > + #if ENABLED(PRINTCOUNTER) + MENU_ITEM(submenu, MSG_INFO_STATS_MENU, menu_info_stats); // Printer Stats > + #endif + END_MENU(); +} + +#endif // HAS_LCD_MENU && LCD_INFO_MENU diff --git a/Marlin/src/lcd/menu/menu_job_recovery.cpp b/Marlin/src/lcd/menu/menu_job_recovery.cpp new file mode 100644 index 0000000000..51adcaf0d2 --- /dev/null +++ b/Marlin/src/lcd/menu/menu_job_recovery.cpp @@ -0,0 +1,106 @@ +/** + * 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 . + * + */ + +// +// Job Recovery Menu +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU && ENABLED(POWER_LOSS_RECOVERY) + +#include "menu.h" +#include "../../gcode/queue.h" +#include "../../sd/cardreader.h" +#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; +} + +static void lcd_power_loss_recovery_cancel() { + card.removeJobRecoveryFile(); + card.autostart_index = 0; + lcd_return_to_status(); +} + +void menu_job_recovery() { + defer_return_to_status = true; + START_MENU(); + STATIC_ITEM(MSG_POWER_LOSS_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(); +} + +#endif // HAS_LCD_MENU && POWER_LOSS_RECOVERY diff --git a/Marlin/src/lcd/menu/menu_led.cpp b/Marlin/src/lcd/menu/menu_led.cpp new file mode 100644 index 0000000000..d85fe338fb --- /dev/null +++ b/Marlin/src/lcd/menu/menu_led.cpp @@ -0,0 +1,83 @@ +/** + * 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 . + * + */ + +// +// LED Menu +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU && ENABLED(LED_CONTROL_MENU) + +#include "menu.h" +#include "../../feature/leds/leds.h" + +#if ENABLED(LED_COLOR_PRESETS) + + void menu_led_presets() { + START_MENU(); + #if LCD_HEIGHT > 2 + STATIC_ITEM(MSG_LED_PRESETS, true, true); + #endif + MENU_BACK(MSG_LED_CONTROL); + MENU_ITEM(function, MSG_SET_LEDS_WHITE, leds.set_white); + MENU_ITEM(function, MSG_SET_LEDS_RED, leds.set_red); + MENU_ITEM(function, MSG_SET_LEDS_ORANGE, leds.set_orange); + MENU_ITEM(function, MSG_SET_LEDS_YELLOW,leds.set_yellow); + MENU_ITEM(function, MSG_SET_LEDS_GREEN, leds.set_green); + MENU_ITEM(function, MSG_SET_LEDS_BLUE, leds.set_blue); + MENU_ITEM(function, MSG_SET_LEDS_INDIGO, leds.set_indigo); + MENU_ITEM(function, MSG_SET_LEDS_VIOLET, leds.set_violet); + END_MENU(); + } + +#endif + +void menu_led_custom() { + START_MENU(); + MENU_BACK(MSG_LED_CONTROL); + MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true); + MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true); + MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true); + #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) + MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true); + #if ENABLED(NEOPIXEL_LED) + MENU_ITEM_EDIT_CALLBACK(int8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true); + #endif + #endif + END_MENU(); +} + +void menu_led() { + START_MENU(); + MENU_BACK(MSG_MAIN); + bool led_on = leds.lights_on; + MENU_ITEM_EDIT_CALLBACK(bool, MSG_LEDS, &led_on, leds.toggle); + MENU_ITEM(function, MSG_SET_LEDS_DEFAULT, leds.set_default); + #if ENABLED(LED_COLOR_PRESETS) + MENU_ITEM(submenu, MSG_LED_PRESETS, menu_led_presets); + #endif + MENU_ITEM(submenu, MSG_CUSTOM_LEDS, menu_led_custom); + END_MENU(); +} + +#endif // HAS_LCD_MENU && LED_CONTROL_MENU diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp new file mode 100644 index 0000000000..2d227b34f0 --- /dev/null +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -0,0 +1,166 @@ +/** + * 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 . + * + */ + +// +// Main Menu +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU + +#include "menu.h" +#include "../../module/temperature.h" + +#if ENABLED(SDSUPPORT) + + #include "../../sd/cardreader.h" + #include "../../gcode/queue.h" + #include "../../module/printcounter.h" + + void lcd_sdcard_pause() { + card.pauseSDPrint(); + print_job_timer.pause(); + #if ENABLED(PARK_HEAD_ON_PAUSE) + enqueue_and_echo_commands_P(PSTR("M125")); + #endif + lcd_reset_status(); + } + + void lcd_sdcard_resume() { + #if ENABLED(PARK_HEAD_ON_PAUSE) + enqueue_and_echo_commands_P(PSTR("M24")); + #else + card.startFileprint(); + print_job_timer.start(); + #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(); + } + + #if ENABLED(MENU_ADDAUTOSTART) + + void lcd_autostart_sd() { card.beginautostart(); } + + #endif + +#endif // SDSUPPORT + +void menu_tune(); +void menu_motion(); +void menu_temperature(); +void menu_configuration(); +void menu_user(); +void menu_temp_e0_filament_change(); +void menu_change_filament(); +void menu_info(); +void menu_led(); + +void menu_main() { + START_MENU(); + MENU_BACK(MSG_WATCH); + + #if ENABLED(SDSUPPORT) + if (card.cardOK) { + if (card.isFileOpen()) { + if (card.sdprinting) + MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause); + else + MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume); + MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop); + } + else { + MENU_ITEM(submenu, MSG_CARD_MENU, menu_sdcard); + #if !PIN_EXISTS(SD_DETECT) + MENU_ITEM(gcode, MSG_CHANGE_SDCARD, PSTR("M21")); // SD-card changed by user + #endif + } + } + else { + MENU_ITEM(submenu, MSG_NO_CARD, menu_sdcard); + #if !PIN_EXISTS(SD_DETECT) + MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface + #endif + } + #endif // SDSUPPORT + + const bool busy = printer_busy(); + if (busy) + MENU_ITEM(submenu, MSG_TUNE, menu_tune); + else { + MENU_ITEM(submenu, MSG_MOTION, menu_motion); + MENU_ITEM(submenu, MSG_TEMPERATURE, menu_temperature); + } + + MENU_ITEM(submenu, MSG_CONFIGURATION, menu_configuration); + + #if ENABLED(CUSTOM_USER_MENUS) + MENU_ITEM(submenu, MSG_USER_MENU, menu_user); + #endif + + #if ENABLED(ADVANCED_PAUSE_FEATURE) + #if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES) + if (thermalManager.targetHotEnoughToExtrude(active_extruder)) + MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600 B0")); + else + MENU_ITEM(submenu, MSG_FILAMENTCHANGE, menu_temp_e0_filament_change); + #else + MENU_ITEM(submenu, MSG_FILAMENTCHANGE, menu_change_filament); + #endif + #endif + + #if ENABLED(LCD_INFO_MENU) + MENU_ITEM(submenu, MSG_INFO_MENU, menu_info); + #endif + + #if ENABLED(LED_CONTROL_MENU) + MENU_ITEM(submenu, MSG_LED_CONTROL, menu_led); + #endif + + // + // Switch power on/off + // + #if HAS_POWER_SWITCH + if (powersupply_on) + MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81")); + else + MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80")); + #endif + + // + // Autostart + // + #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) + if (!busy) + MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd); + #endif + + END_MENU(); +} + +#endif // HAS_LCD_MENU diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp new file mode 100644 index 0000000000..5ec938d369 --- /dev/null +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -0,0 +1,499 @@ +/** + * 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 . + * + */ + +// +// Motion Menu +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU + +#include "menu.h" +#include "../../module/motion.h" + +#if ENABLED(DELTA) + #include "../../module/delta.h" +#endif + +#if ENABLED(PREVENT_COLD_EXTRUSION) + #include "../../module/temperature.h" +#endif + +#if HAS_LEVELING + #include "../../module/planner.h" + #include "../../feature/bedlevel/bedlevel.h" +#endif + +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 +#if IS_KINEMATIC + extern float manual_move_offset; +#endif + +// +// Tell lcd_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; + #endif + manual_move_start_time = millis() + (move_menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves + manual_move_axis = (int8_t)axis; +} + +// +// "Motion" > "Move Axis" submenu +// + +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) { + + // Start with no limits to movement + float min = current_position[axis] - 1000, + max = current_position[axis] + 1000; + + // Limit to software endstops, if enabled + #if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) + if (soft_endstops_enabled) switch (axis) { + case X_AXIS: + #if ENABLED(MIN_SOFTWARE_ENDSTOP_X) + min = soft_endstop_min[X_AXIS]; + #endif + #if ENABLED(MAX_SOFTWARE_ENDSTOP_X) + max = soft_endstop_max[X_AXIS]; + #endif + break; + case Y_AXIS: + #if ENABLED(MIN_SOFTWARE_ENDSTOP_Y) + min = soft_endstop_min[Y_AXIS]; + #endif + #if ENABLED(MAX_SOFTWARE_ENDSTOP_Y) + max = soft_endstop_max[Y_AXIS]; + #endif + break; + case Z_AXIS: + #if ENABLED(MIN_SOFTWARE_ENDSTOP_Z) + min = soft_endstop_min[Z_AXIS]; + #endif + #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z) + max = soft_endstop_max[Z_AXIS]; + #endif + default: break; + } + #endif // MIN_SOFTWARE_ENDSTOPS || MAX_SOFTWARE_ENDSTOPS + + // Delta limits XY based on the current offset from center + // This assumes the center is 0,0 + #if ENABLED(DELTA) + if (axis != Z_AXIS) { + max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis + min = -max; + } + #endif + + // Get the new position + const float diff = float((int32_t)encoderPosition) * move_menu_scale; + #if IS_KINEMATIC + manual_move_offset += diff; + if ((int32_t)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) + NOLESS(current_position[axis], min); + else + NOMORE(current_position[axis], max); + #endif + + manual_move_to_current(axis); + lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + } + encoderPosition = 0; + if (lcdDrawUpdate) { + const float pos = NATIVE_TO_LOGICAL(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)); + } +} +inline void lcd_move_x() { _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS); } +inline void lcd_move_y() { _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS); } +inline void lcd_move_z() { _lcd_move_xyz(PSTR(MSG_MOVE_Z), Z_AXIS); } +static void _lcd_move_e( + #if E_MANUAL > 1 + 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 IS_KINEMATIC + manual_move_offset += diff; + #else + current_position[E_AXIS] += diff; + #endif + manual_move_to_current(E_AXIS + #if E_MANUAL > 1 + , eindex + #endif + ); + lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + } + encoderPosition = 0; + } + if (lcdDrawUpdate) { + PGM_P pos_label; + #if E_MANUAL == 1 + pos_label = PSTR(MSG_MOVE_E); + #else + switch (eindex) { + default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break; + case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break; + #if E_MANUAL > 2 + case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break; + #if E_MANUAL > 3 + case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break; + #if E_MANUAL > 4 + case 4: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E5); break; + #if E_MANUAL > 5 + case 5: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E6); break; + #endif // E_MANUAL > 5 + #endif // E_MANUAL > 4 + #endif // E_MANUAL > 3 + #endif // E_MANUAL > 2 + } + #endif // E_MANUAL > 1 + + lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS] + #if IS_KINEMATIC + + manual_move_offset + #endif + #if ENABLED(MANUAL_E_MOVES_RELATIVE) + - manual_move_e_origin + #endif + )); + } +} + +inline void lcd_move_e() { _lcd_move_e(); } +#if E_MANUAL > 1 + inline void lcd_move_e0() { _lcd_move_e(0); } + inline void lcd_move_e1() { _lcd_move_e(1); } + #if E_MANUAL > 2 + inline void lcd_move_e2() { _lcd_move_e(2); } + #if E_MANUAL > 3 + inline void lcd_move_e3() { _lcd_move_e(3); } + #if E_MANUAL > 4 + inline void lcd_move_e4() { _lcd_move_e(4); } + #if E_MANUAL > 5 + inline void lcd_move_e5() { _lcd_move_e(5); } + #endif // E_MANUAL > 5 + #endif // E_MANUAL > 4 + #endif // E_MANUAL > 3 + #endif // E_MANUAL > 2 +#endif // E_MANUAL > 1 + +// +// "Motion" > "Move Xmm" > "Move XYZ" submenu +// + +screenFunc_t _manual_move_func_ptr; + +void _goto_manual_move(const float scale) { + defer_return_to_status = true; + move_menu_scale = scale; + lcd_goto_screen(_manual_move_func_ptr); +} +void menu_move_10mm() { _goto_manual_move(10); } +void menu_move_1mm() { _goto_manual_move( 1); } +void menu_move_01mm() { _goto_manual_move( 0.1f); } + +void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int8_t eindex=-1) { + _manual_move_func_ptr = func; + START_MENU(); + if (LCD_HEIGHT >= 4) { + switch (axis) { + case X_AXIS: + STATIC_ITEM(MSG_MOVE_X, true, true); break; + case Y_AXIS: + STATIC_ITEM(MSG_MOVE_Y, true, true); break; + case Z_AXIS: + STATIC_ITEM(MSG_MOVE_Z, true, true); break; + default: + #if ENABLED(MANUAL_E_MOVES_RELATIVE) + manual_move_e_origin = current_position[E_AXIS]; + #endif + STATIC_ITEM(MSG_MOVE_E, true, true); + break; + } + } + #if ENABLED(PREVENT_COLD_EXTRUSION) + if (axis == E_AXIS && thermalManager.tooColdToExtrude(eindex >= 0 ? eindex : active_extruder)) + MENU_BACK(MSG_HOTEND_TOO_COLD); + else + #endif + { + MENU_BACK(MSG_MOVE_AXIS); + MENU_ITEM(submenu, MSG_MOVE_10MM, menu_move_10mm); + MENU_ITEM(submenu, MSG_MOVE_1MM, menu_move_1mm); + MENU_ITEM(submenu, MSG_MOVE_01MM, menu_move_01mm); + } + END_MENU(); +} +void lcd_move_get_x_amount() { _menu_move_distance(X_AXIS, lcd_move_x); } +void lcd_move_get_y_amount() { _menu_move_distance(Y_AXIS, lcd_move_y); } +void lcd_move_get_z_amount() { _menu_move_distance(Z_AXIS, lcd_move_z); } +void lcd_move_get_e_amount() { _menu_move_distance(E_AXIS, lcd_move_e, -1); } +#if E_MANUAL > 1 + void lcd_move_get_e0_amount() { _menu_move_distance(E_AXIS, lcd_move_e0, 0); } + void lcd_move_get_e1_amount() { _menu_move_distance(E_AXIS, lcd_move_e1, 1); } + #if E_MANUAL > 2 + void lcd_move_get_e2_amount() { _menu_move_distance(E_AXIS, lcd_move_e2, 2); } + #if E_MANUAL > 3 + void lcd_move_get_e3_amount() { _menu_move_distance(E_AXIS, lcd_move_e3, 3); } + #if E_MANUAL > 4 + void lcd_move_get_e4_amount() { _menu_move_distance(E_AXIS, lcd_move_e4, 4); } + #if E_MANUAL > 5 + void lcd_move_get_e5_amount() { _menu_move_distance(E_AXIS, lcd_move_e5, 5); } + #endif // E_MANUAL > 5 + #endif // E_MANUAL > 4 + #endif // E_MANUAL > 3 + #endif // E_MANUAL > 2 +#endif // E_MANUAL > 1 + +#if ENABLED(DELTA) + void lcd_lower_z_to_clip_height() { + line_to_z(delta_clip_start_height); + lcd_synchronize(); + } +#endif + +void menu_move() { + START_MENU(); + MENU_BACK(MSG_MOTION); + + #if HAS_SOFTWARE_ENDSTOPS && ENABLED(SOFT_ENDSTOPS_MENU_ITEM) + MENU_ITEM_EDIT(bool, MSG_LCD_SOFT_ENDSTOPS, &soft_endstops_enabled); + #endif + + if ( + #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING) + all_axes_homed() + #else + true + #endif + ) { + if ( + #if ENABLED(DELTA) + current_position[Z_AXIS] <= delta_clip_start_height + #else + true + #endif + ) { + MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_get_x_amount); + MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_get_y_amount); + } + #if ENABLED(DELTA) + else + MENU_ITEM(function, MSG_FREE_XY, lcd_lower_z_to_clip_height); + #endif + + MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_get_z_amount); + } + else + MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); + + #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE) + + #if EXTRUDERS == 6 + switch (active_extruder) { + case 0: MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); break; + case 1: MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); break; + case 2: MENU_ITEM(gcode, MSG_SELECT " " MSG_E4, PSTR("T3")); break; + case 3: MENU_ITEM(gcode, MSG_SELECT " " MSG_E3, PSTR("T2")); break; + case 4: MENU_ITEM(gcode, MSG_SELECT " " MSG_E6, PSTR("T5")); break; + case 5: MENU_ITEM(gcode, MSG_SELECT " " MSG_E5, PSTR("T4")); break; + } + #elif EXTRUDERS == 5 || EXTRUDERS == 4 + switch (active_extruder) { + case 0: MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); break; + case 1: MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); break; + case 2: MENU_ITEM(gcode, MSG_SELECT " " MSG_E4, PSTR("T3")); break; + case 3: MENU_ITEM(gcode, MSG_SELECT " " MSG_E3, PSTR("T2")); break; + } + #elif EXTRUDERS == 3 + if (active_extruder < 2) { + if (active_extruder) + MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); + else + MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); + } + #else + if (active_extruder) + MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); + else + MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); + #endif + + #elif ENABLED(DUAL_X_CARRIAGE) + + if (active_extruder) + MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); + else + MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); + + #endif + + #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE) + + // Only the current... + MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount); + // ...and the non-switching + #if E_MANUAL == 5 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount); + #elif E_MANUAL == 3 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount); + #endif + + #else + + // Independent extruders with one E-stepper per hotend + MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount); + #if E_MANUAL > 1 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_get_e0_amount); + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_get_e1_amount); + #if E_MANUAL > 2 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount); + #if E_MANUAL > 3 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_get_e3_amount); + #if E_MANUAL > 4 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount); + #if E_MANUAL > 5 + MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E6, lcd_move_get_e5_amount); + #endif // E_MANUAL > 5 + #endif // E_MANUAL > 4 + #endif // E_MANUAL > 3 + #endif // E_MANUAL > 2 + #endif // E_MANUAL > 1 + + #endif + + END_MENU(); +} + +void _lcd_ubl_level_bed(); +void menu_bed_leveling(); + +void menu_motion() { + START_MENU(); + + // + // ^ Main + // + MENU_BACK(MSG_MAIN); + + // + // Move Axis + // + #if ENABLED(DELTA) + if (all_axes_homed()) + #endif + MENU_ITEM(submenu, MSG_MOVE_AXIS, menu_move); + + // + // Auto Home + // + MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); + #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) + MENU_ITEM(gcode, MSG_AUTO_HOME_X, PSTR("G28 X")); + MENU_ITEM(gcode, MSG_AUTO_HOME_Y, PSTR("G28 Y")); + MENU_ITEM(gcode, MSG_AUTO_HOME_Z, PSTR("G28 Z")); + #endif + + // + // TMC Z Calibration + // + #if ENABLED(TMC_Z_CALIBRATION) + MENU_ITEM(gcode, MSG_TMC_Z_CALIBRATION, PSTR("G28\nM915")); + #endif + + // + // Level Bed + // + #if ENABLED(AUTO_BED_LEVELING_UBL) + + MENU_ITEM(submenu, MSG_UBL_LEVEL_BED, _lcd_ubl_level_bed); + + #elif ENABLED(LCD_BED_LEVELING) + + if (!g29_in_progress) MENU_ITEM(submenu, MSG_BED_LEVELING, menu_bed_leveling); + + #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS) + + #if DISABLED(PROBE_MANUALLY) + MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G28\nG29")); + #endif + if (leveling_is_valid()) { + bool new_level_state = planner.leveling_active; + MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &new_level_state, _lcd_toggle_bed_leveling); + } + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &lcd_z_fade_height, 0, 100, _lcd_set_z_fade_height); + #endif + + #endif + + #if ENABLED(LEVEL_BED_CORNERS) && DISABLED(LCD_BED_LEVELING) + MENU_ITEM(function, MSG_LEVEL_CORNERS, _lcd_level_bed_corners); + #endif + + // + // Disable Steppers + // + MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); + + END_MENU(); +} + +#endif // HAS_LCD_MENU diff --git a/Marlin/src/lcd/menu/menu_sdcard.cpp b/Marlin/src/lcd/menu/menu_sdcard.cpp new file mode 100644 index 0000000000..7b7eba8143 --- /dev/null +++ b/Marlin/src/lcd/menu/menu_sdcard.cpp @@ -0,0 +1,137 @@ +/** + * 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 . + * + */ + +// +// SD Card Menu +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU && ENABLED(SDSUPPORT) + +#include "menu.h" +#include "../../sd/cardreader.h" + +#if !PIN_EXISTS(SD_DETECT) + void lcd_sd_refresh() { + card.initsd(); + encoderTopLine = 0; + } +#endif + +void lcd_sd_updir() { + encoderPosition = card.updir() ? ENCODER_STEPS_PER_MENU_ITEM : 0; + encoderTopLine = 0; + screen_changed = true; + lcd_refresh(); +} + +#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) + uint32_t last_sdfile_encoderPosition = 0xFFFF; + + void lcd_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 + + lcd_goto_screen(menu_sdcard, last_sdfile_encoderPosition); + defer_return_to_status = true; + last_sdfile_encoderPosition = 0xFFFF; + + #if HAS_GRAPHICAL_LCD + lcd_update(); + #endif + } +#endif + +void menu_action_sdfile(CardReader &theCard) { + #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) + last_sdfile_encoderPosition = encoderPosition; // Save which file was selected for later use + #endif + card.openAndPrintFile(theCard.filename); + lcd_return_to_status(); + lcd_reset_status(); +} + +void menu_action_sddirectory(CardReader &theCard) { + card.chdir(theCard.filename); + encoderTopLine = 0; + encoderPosition = 2 * ENCODER_STEPS_PER_MENU_ITEM; + screen_changed = true; + #if HAS_GRAPHICAL_LCD + drawing_screen = false; + #endif + lcd_refresh(); +} + +void menu_sdcard() { + ENCODER_DIRECTION_MENUS(); + + const uint16_t fileCnt = card.get_num_Files(); + + START_MENU(); + MENU_BACK(MSG_MAIN); + card.getWorkDirName(); + if (card.filename[0] == '/') { + #if !PIN_EXISTS(SD_DETECT) + MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh); + #endif + } + else { + MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir); + } + + for (uint16_t i = 0; i < fileCnt; i++) { + if (_menuLineNr == _thisItemNr) { + const uint16_t nr = + #if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA) + fileCnt - 1 - + #endif + i; + + #if ENABLED(SDCARD_SORT_ALPHA) + card.getfilename_sorted(nr); + #else + card.getfilename(nr); + #endif + + if (card.filenameIsDir) + MENU_ITEM(sddirectory, MSG_CARD_MENU, card); + else + MENU_ITEM(sdfile, MSG_CARD_MENU, card); + } + else { + MENU_ITEM_DUMMY(); + } + } + END_MENU(); +} + +#endif // HAS_LCD_MENU && SDSUPPORT diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp new file mode 100644 index 0000000000..b1d09e96cd --- /dev/null +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -0,0 +1,389 @@ +/** + * 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 . + * + */ + +// +// Temperature Menu +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU + +#include "menu.h" +#include "../../module/temperature.h" + +#if FAN_COUNT > 1 + #include "../../module/motion.h" +#endif + +// Initialized by settings.load() +int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2]; +uint8_t lcd_preheat_fan_speed[2]; + +// +// "Temperature" submenu items +// + +void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb, const uint8_t fan) { + if (temph > 0) thermalManager.setTargetHotend(MIN(heater_maxtemp[endnum], temph), endnum); + #if HAS_HEATED_BED + if (tempb >= 0) thermalManager.setTargetBed(tempb); + #else + UNUSED(tempb); + #endif + #if FAN_COUNT > 0 + #if FAN_COUNT > 1 + fan_speed[active_extruder < FAN_COUNT ? active_extruder : 0] = fan; + #else + fan_speed[0] = fan; + #endif + #else + UNUSED(fan); + #endif + lcd_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]); } + #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]); } + #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]); } + #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]); } + #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]); } + #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]); } + #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]); } + #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]); } + #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]); } + #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]); } + #endif + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + + #if HAS_HEATED_BED + void lcd_preheat_m1_e0(); + void lcd_preheat_m2_e0(); + #else + void lcd_preheat_m1_e0_only(); + void lcd_preheat_m2_e0_only(); + #endif + + void lcd_preheat_m1_all() { + #if HOTENDS > 1 + thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 1); + #if HOTENDS > 2 + thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 2); + #if HOTENDS > 3 + thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 3); + #if HOTENDS > 4 + thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 4); + #if HOTENDS > 5 + thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 5); + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 + #if HAS_HEATED_BED + lcd_preheat_m1_e0(); + #else + lcd_preheat_m1_e0_only(); + #endif + } + + void lcd_preheat_m2_all() { + #if HOTENDS > 1 + thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 1); + #if HOTENDS > 2 + thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 2); + #if HOTENDS > 3 + thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 3); + #if HOTENDS > 4 + thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 4); + #if HOTENDS > 5 + thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 5); + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 + #if HAS_HEATED_BED + lcd_preheat_m2_e0(); + #else + lcd_preheat_m2_e0_only(); + #endif + } + +#endif // HOTENDS > 1 + +#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]); } + + #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]); } + #endif + + void menu_preheat_m1() { + START_MENU(); + MENU_BACK(MSG_TEMPERATURE); + #if HOTENDS == 1 + #if HAS_HEATED_BED + MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0); + MENU_ITEM(function, MSG_PREHEAT_1_END, lcd_preheat_m1_e0_only); + #else + MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only); + #endif + #elif HOTENDS > 1 + #if HAS_HEATED_BED + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0); + MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E1, lcd_preheat_m1_e0_only); + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1); + MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E2, lcd_preheat_m1_e1_only); + #else + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0_only); + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1_only); + #endif + #if HOTENDS > 2 + #if HAS_HEATED_BED + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2); + MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E3, lcd_preheat_m1_e2_only); + #else + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2_only); + #endif + #if HOTENDS > 3 + #if HAS_HEATED_BED + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3); + MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E4, lcd_preheat_m1_e3_only); + #else + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3_only); + #endif + #if HOTENDS > 4 + #if HAS_HEATED_BED + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H5, lcd_preheat_m1_e4); + MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E5, lcd_preheat_m1_e4_only); + #else + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H5, lcd_preheat_m1_e4_only); + #endif + #if HOTENDS > 5 + #if HAS_HEATED_BED + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H6, lcd_preheat_m1_e5); + MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E6, lcd_preheat_m1_e5_only); + #else + MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H6, lcd_preheat_m1_e5_only); + #endif + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + MENU_ITEM(function, MSG_PREHEAT_1_ALL, lcd_preheat_m1_all); + #endif // HOTENDS > 1 + #if HAS_HEATED_BED + MENU_ITEM(function, MSG_PREHEAT_1_BEDONLY, lcd_preheat_m1_bedonly); + #endif + END_MENU(); + } + + void menu_preheat_m2() { + START_MENU(); + MENU_BACK(MSG_TEMPERATURE); + #if HOTENDS == 1 + #if HAS_HEATED_BED + MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0); + MENU_ITEM(function, MSG_PREHEAT_2_END, lcd_preheat_m2_e0_only); + #else + MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only); + #endif + #elif HOTENDS > 1 + #if HAS_HEATED_BED + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0); + MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E1, lcd_preheat_m2_e0_only); + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1); + MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E2, lcd_preheat_m2_e1_only); + #else + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0_only); + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1_only); + #endif + #if HOTENDS > 2 + #if HAS_HEATED_BED + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2); + MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E3, lcd_preheat_m2_e2_only); + #else + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2_only); + #endif + #if HOTENDS > 3 + #if HAS_HEATED_BED + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3); + MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E4, lcd_preheat_m2_e3_only); + #else + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3_only); + #endif + #if HOTENDS > 4 + #if HAS_HEATED_BED + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H5, lcd_preheat_m2_e4); + MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E5, lcd_preheat_m2_e4_only); + #else + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H5, lcd_preheat_m2_e4_only); + #endif + #if HOTENDS > 5 + #if HAS_HEATED_BED + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H6, lcd_preheat_m2_e5); + MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E6, lcd_preheat_m2_e5_only); + #else + MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H6, lcd_preheat_m2_e5_only); + #endif + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + MENU_ITEM(function, MSG_PREHEAT_2_ALL, lcd_preheat_m2_all); + #endif // HOTENDS > 1 + #if HAS_HEATED_BED + MENU_ITEM(function, MSG_PREHEAT_2_BEDONLY, lcd_preheat_m2_bedonly); + #endif + END_MENU(); + } + + void lcd_cooldown() { + zero_fan_speeds(); + thermalManager.disable_all_heaters(); + lcd_return_to_status(); + } + +#endif // HAS_TEMP_HOTEND || HAS_HEATED_BED + +void menu_temperature() { + START_MENU(); + MENU_BACK(MSG_MAIN); + + // + // Nozzle: + // Nozzle [1-5]: + // + #if HOTENDS == 1 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); + #else // HOTENDS > 1 + #define EDIT_TARGET(N,I) MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N##N, &thermalManager.target_temperature[I], 0, HEATER_##I##_MAXTEMP - 15, watch_temp_callback_E##I) + EDIT_TARGET(1,0); + EDIT_TARGET(2,1); + #if HOTENDS > 2 + EDIT_TARGET(3,2); + #if HOTENDS > 3 + EDIT_TARGET(4,3); + #if HOTENDS > 4 + EDIT_TARGET(5,4); + #if HOTENDS > 5 + EDIT_TARGET(6,5); + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 + + // + // Bed: + // + #if HAS_HEATED_BED + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed); + #endif + + // + // Fan Speed: + // + #if FAN_COUNT > 0 + #if HAS_FAN0 + MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &fan_speed[0], 0, 255); + #if ENABLED(EXTRA_FAN_SPEED) + MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &new_fan_speed[0], 3, 255); + #endif + #endif + #if HAS_FAN1 + MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED " 2", &fan_speed[1], 0, 255); + #if ENABLED(EXTRA_FAN_SPEED) + MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 2", &new_fan_speed[1], 3, 255); + #endif + #endif + #if HAS_FAN2 + MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED " 3", &fan_speed[2], 0, 255); + #if ENABLED(EXTRA_FAN_SPEED) + MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 3", &new_fan_speed[2], 3, 255); + #endif + #endif + #endif // FAN_COUNT > 0 + + #if HAS_TEMP_HOTEND + + // + // Cooldown + // + bool has_heat = false; + HOTEND_LOOP() if (thermalManager.target_temperature[HOTEND_INDEX]) { has_heat = true; break; } + #if HAS_TEMP_BED + if (thermalManager.target_temperature_bed) has_heat = true; + #endif + if (has_heat) MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown); + + // + // Preheat for Material 1 and 2 + // + #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || HAS_HEATED_BED + MENU_ITEM(submenu, MSG_PREHEAT_1, menu_preheat_m1); + MENU_ITEM(submenu, MSG_PREHEAT_2, menu_preheat_m2); + #else + MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only); + MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only); + #endif + + #endif // HAS_TEMP_HOTEND + + END_MENU(); +} + +#endif // HAS_LCD_MENU diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp new file mode 100644 index 0000000000..97c7d86a7b --- /dev/null +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -0,0 +1,206 @@ +/** + * 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 . + * + */ + +// +// Tune Menu +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU + +#include "menu.h" +#include "../../module/motion.h" +#include "../../module/planner.h" +#include "../../module/temperature.h" +#include "../../Marlin.h" + +#if HAS_LEVELING + #include "../../feature/bedlevel/bedlevel.h" +#endif + +// Refresh the E factor after changing flow +void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); } +#if EXTRUDERS > 1 + void _lcd_refresh_e_factor() { planner.refresh_e_factor(active_extruder); } + void _lcd_refresh_e_factor_1() { planner.refresh_e_factor(1); } + #if EXTRUDERS > 2 + void _lcd_refresh_e_factor_2() { planner.refresh_e_factor(2); } + #if EXTRUDERS > 3 + void _lcd_refresh_e_factor_3() { planner.refresh_e_factor(3); } + #if EXTRUDERS > 4 + void _lcd_refresh_e_factor_4() { planner.refresh_e_factor(4); } + #if EXTRUDERS > 5 + void _lcd_refresh_e_factor_5() { planner.refresh_e_factor(5); } + #endif // EXTRUDERS > 5 + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 +#endif // EXTRUDERS > 1 + +#if ENABLED(BABYSTEPPING) + + 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; + 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 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; defer_return_to_status = true; } + void lcd_babystep_y() { lcd_goto_screen(_lcd_babystep_y); babysteps_done = 0; defer_return_to_status = 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; defer_return_to_status = true; } + #endif + +#endif // BABYSTEPPING + +void menu_tune() { + START_MENU(); + MENU_BACK(MSG_MAIN); + + // + // Speed: + // + MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999); + + // + // Manual bed leveling, Bed Z: + // + #if ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING) + MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); + #endif + + // + // Nozzle: + // Nozzle [1-4]: + // + #if HOTENDS == 1 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); + #else // HOTENDS > 1 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); + #if HOTENDS > 2 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); + #if HOTENDS > 3 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); + #if HOTENDS > 4 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N5, &thermalManager.target_temperature[4], 0, HEATER_4_MAXTEMP - 15, watch_temp_callback_E4); + #if HOTENDS > 5 + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N6, &thermalManager.target_temperature[5], 0, HEATER_5_MAXTEMP - 15, watch_temp_callback_E5); + #endif // HOTENDS > 5 + #endif // HOTENDS > 4 + #endif // HOTENDS > 3 + #endif // HOTENDS > 2 + #endif // HOTENDS > 1 + + // + // Bed: + // + #if HAS_HEATED_BED + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed); + #endif + + // + // Fan Speed: + // + #if FAN_COUNT > 0 + #if HAS_FAN0 + MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &fan_speed[0], 0, 255); + #if ENABLED(EXTRA_FAN_SPEED) + MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &new_fan_speed[0], 3, 255); + #endif + #endif + #if HAS_FAN1 + MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED " 2", &fan_speed[1], 0, 255); + #if ENABLED(EXTRA_FAN_SPEED) + MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 2", &new_fan_speed[1], 3, 255); + #endif + #endif + #if HAS_FAN2 + MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED " 3", &fan_speed[2], 0, 255); + #if ENABLED(EXTRA_FAN_SPEED) + MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 3", &new_fan_speed[2], 3, 255); + #endif + #endif + #endif // FAN_COUNT > 0 + + // + // Flow: + // Flow [1-5]: + // + #if EXTRUDERS == 1 + MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0); + #else // EXTRUDERS > 1 + MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, _lcd_refresh_e_factor); + MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N1, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0); + MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N2, &planner.flow_percentage[1], 10, 999, _lcd_refresh_e_factor_1); + #if EXTRUDERS > 2 + MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N3, &planner.flow_percentage[2], 10, 999, _lcd_refresh_e_factor_2); + #if EXTRUDERS > 3 + MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N4, &planner.flow_percentage[3], 10, 999, _lcd_refresh_e_factor_3); + #if EXTRUDERS > 4 + MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N5, &planner.flow_percentage[4], 10, 999, _lcd_refresh_e_factor_4); + #if EXTRUDERS > 5 + MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N6, &planner.flow_percentage[5], 10, 999, _lcd_refresh_e_factor_5); + #endif // EXTRUDERS > 5 + #endif // EXTRUDERS > 4 + #endif // EXTRUDERS > 3 + #endif // EXTRUDERS > 2 + #endif // EXTRUDERS > 1 + + // + // Babystep X: + // Babystep Y: + // Babystep Z: + // + #if ENABLED(BABYSTEPPING) + #if ENABLED(BABYSTEP_XY) + MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x); + MENU_ITEM(submenu, MSG_BABYSTEP_Y, lcd_babystep_y); + #endif + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); + #else + MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z); + #endif + #endif + + END_MENU(); +} + +#endif // HAS_LCD_MENU diff --git a/Marlin/src/lcd/menu/menu_ubl.cpp b/Marlin/src/lcd/menu/menu_ubl.cpp new file mode 100644 index 0000000000..fdda55812c --- /dev/null +++ b/Marlin/src/lcd/menu/menu_ubl.cpp @@ -0,0 +1,606 @@ +/** + * 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 . + * + */ + +// +// Unified Bed Leveling Menus +// + +#include "../../inc/MarlinConfigPre.h" + +#if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL) + +#include "menu.h" +#include "../../module/planner.h" +#include "../../module/configuration_store.h" +#include "../../feature/bedlevel/bedlevel.h" + +static int16_t ubl_storage_slot = 0, + custom_hotend_temp = 190, + side_points = 3, + ubl_fillin_amount = 5, + ubl_height_amount = 1, + n_edit_pts = 1, + x_plot = 0, + y_plot = 0; + +#if HAS_HEATED_BED + static int16_t custom_bed_temp = 50; +#endif + +float mesh_edit_value, mesh_edit_accumulator; // We round mesh_edit_value to 2.5 decimal places. So we keep a + // separate value that doesn't lose precision. +static int16_t ubl_encoderPosition = 0; + +static void _lcd_mesh_fine_tune(PGM_P msg) { + defer_return_to_status = 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; + + 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 ENABLED(MESH_EDIT_GFX_OVERLAY) + _lcd_zoffset_overlay_gfx(mesh_edit_value); + #endif + } +} + +void _lcd_mesh_edit_NOP() { + defer_return_to_status = true; +} + +float lcd_mesh_edit() { + lcd_goto_screen(_lcd_mesh_edit_NOP); + lcdDrawUpdate = 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); +} + +void _lcd_z_offset_edit() { + _lcd_mesh_fine_tune(PSTR("Z-Offset: ")); +} + +float lcd_z_offset_edit() { + lcd_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); +} + +/** + * UBL Build Custom Mesh Command + */ +void _lcd_ubl_build_custom_mesh() { + char UBL_LCD_GCODE[20]; + enqueue_and_echo_commands_P(PSTR("G28")); + #if HAS_HEATED_BED + sprintf_P(UBL_LCD_GCODE, PSTR("M190 S%i"), custom_bed_temp); + lcd_enqueue_command(UBL_LCD_GCODE); + #endif + sprintf_P(UBL_LCD_GCODE, PSTR("M109 S%i"), custom_hotend_temp); + lcd_enqueue_command(UBL_LCD_GCODE); + enqueue_and_echo_commands_P(PSTR("G29 P1")); +} + +/** + * UBL Custom Mesh submenu + * + * << Build Mesh + * Hotend Temp: --- + * Bed Temp: --- + * Build Custom Mesh + */ +void _lcd_ubl_custom_mesh() { + START_MENU(); + MENU_BACK(MSG_UBL_BUILD_MESH_MENU); + MENU_ITEM_EDIT(int3, MSG_UBL_HOTEND_TEMP_CUSTOM, &custom_hotend_temp, EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP - 10)); + #if HAS_HEATED_BED + MENU_ITEM_EDIT(int3, MSG_UBL_BED_TEMP_CUSTOM, &custom_bed_temp, BED_MINTEMP, (BED_MAXTEMP - 15)); + #endif + MENU_ITEM(function, MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh); + END_MENU(); +} + +/** + * UBL Adjust Mesh Height Command + */ +void _lcd_ubl_adjust_height_cmd() { + char UBL_LCD_GCODE[16]; + const int ind = ubl_height_amount > 0 ? 9 : 10; + strcpy_P(UBL_LCD_GCODE, PSTR("G29 P6 C -")); + sprintf_P(&UBL_LCD_GCODE[ind], PSTR(".%i"), ABS(ubl_height_amount)); + lcd_enqueue_command(UBL_LCD_GCODE); +} + +/** + * UBL Adjust Mesh Height submenu + * + * << Edit Mesh + * Height Amount: --- + * Adjust Mesh Height + * << Info Screen + */ +void _menu_ubl_height_adjust() { + START_MENU(); + MENU_BACK(MSG_UBL_EDIT_MESH_MENU); + 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); + END_MENU(); +} + +/** + * UBL Edit Mesh submenu + * + * << UBL Tools + * Fine Tune All + * Fine Tune Closest + * - Adjust Mesh Height >> + * << Info Screen + */ +void _lcd_ubl_edit_mesh() { + START_MENU(); + MENU_BACK(MSG_UBL_TOOLS); + 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); + END_MENU(); +} + +/** + * UBL Validate Custom Mesh Command + */ +void _lcd_ubl_validate_custom_mesh() { + char UBL_LCD_GCODE[24]; + const int temp = + #if HAS_HEATED_BED + custom_bed_temp + #else + 0 + #endif + ; + sprintf_P(UBL_LCD_GCODE, PSTR("G26 C B%i H%i P"), temp, custom_hotend_temp); + lcd_enqueue_commands_P(PSTR("G28")); + lcd_enqueue_command(UBL_LCD_GCODE); +} + +/** + * UBL Validate Mesh submenu + * + * << UBL Tools + * Mesh Validation with Material 1 + * Mesh Validation with Material 2 + * Validate Custom Mesh + * << Info Screen + */ +void _lcd_ubl_validate_mesh() { + START_MENU(); + MENU_BACK(MSG_UBL_TOOLS); + #if HAS_HEATED_BED + MENU_ITEM(gcode, MSG_UBL_VALIDATE_MESH_M1, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_1_TEMP_BED) " H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); + MENU_ITEM(gcode, MSG_UBL_VALIDATE_MESH_M2, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_2_TEMP_BED) " H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); + #else + MENU_ITEM(gcode, MSG_UBL_VALIDATE_MESH_M1, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); + 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); + END_MENU(); +} + +/** + * UBL Grid Leveling Command + */ +void _lcd_ubl_grid_level_cmd() { + char UBL_LCD_GCODE[10]; + sprintf_P(UBL_LCD_GCODE, PSTR("G29 J%i"), side_points); + lcd_enqueue_command(UBL_LCD_GCODE); +} + +/** + * UBL Grid Leveling submenu + * + * << UBL Tools + * Side points: --- + * Level Mesh + */ +void _lcd_ubl_grid_level() { + START_MENU(); + MENU_BACK(MSG_UBL_TOOLS); + MENU_ITEM_EDIT(int3, MSG_UBL_SIDE_POINTS, &side_points, 2, 6); + MENU_ITEM(function, MSG_UBL_MESH_LEVEL, _lcd_ubl_grid_level_cmd); + END_MENU(); +} + +/** + * UBL Mesh Leveling submenu + * + * << UBL Tools + * 3-Point Mesh Leveling + * - Grid Mesh Leveling >> + * << Info Screen + */ +void _lcd_ubl_mesh_leveling() { + START_MENU(); + 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); + END_MENU(); +} + +/** + * UBL Fill-in Amount Mesh Command + */ +void _lcd_ubl_fillin_amount_cmd() { + char UBL_LCD_GCODE[16]; + sprintf_P(UBL_LCD_GCODE, PSTR("G29 P3 R C.%i"), ubl_fillin_amount); + lcd_enqueue_command(UBL_LCD_GCODE); +} + +/** + * UBL Fill-in Mesh submenu + * + * << Build Mesh + * Fill-in Amount: --- + * Fill-in Mesh + * Smart Fill-in + * Manual Fill-in + * << Info Screen + */ +void _menu_ubl_fillin() { + START_MENU(); + MENU_BACK(MSG_UBL_BUILD_MESH_MENU); + 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); + END_MENU(); +} + +void _lcd_ubl_invalidate() { + ubl.invalidate(); + SERIAL_PROTOCOLLNPGM("Mesh invalidated."); +} + +/** + * UBL Build Mesh submenu + * + * << UBL Tools + * Build Mesh with Material 1 + * Build Mesh with Material 2 + * - Build Custom Mesh >> + * Build Cold Mesh + * - Fill-in Mesh >> + * Continue Bed Mesh + * Invalidate All + * Invalidate Closest + * << Info Screen + */ +void _lcd_ubl_build_mesh() { + START_MENU(); + MENU_BACK(MSG_UBL_TOOLS); + #if HAS_HEATED_BED + MENU_ITEM(gcode, MSG_UBL_BUILD_MESH_M1, PSTR( + "G28\n" + "M190 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\n" + "M109 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) "\n" + "G29 P1\n" + "M104 S0\n" + "M140 S0" + )); + MENU_ITEM(gcode, MSG_UBL_BUILD_MESH_M2, PSTR( + "G28\n" + "M190 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\n" + "M109 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) "\n" + "G29 P1\n" + "M104 S0\n" + "M140 S0" + )); + #else + MENU_ITEM(gcode, MSG_UBL_BUILD_MESH_M1, PSTR( + "G28\n" + "M109 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) "\n" + "G29 P1\n" + "M104 S0" + )); + MENU_ITEM(gcode, MSG_UBL_BUILD_MESH_M2, PSTR( + "G28\n" + "M109 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) "\n" + "G29 P1\n" + "M104 S0" + )); + #endif + MENU_ITEM(submenu, MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_custom_mesh); + MENU_ITEM(gcode, MSG_UBL_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); + MENU_ITEM(submenu, MSG_UBL_FILLIN_MESH, _menu_ubl_fillin); + 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); + END_MENU(); +} + +/** + * UBL Load Mesh Command + */ +void _lcd_ubl_load_mesh_cmd() { + char UBL_LCD_GCODE[25]; + sprintf_P(UBL_LCD_GCODE, PSTR("G29 L%i"), ubl_storage_slot); + lcd_enqueue_command(UBL_LCD_GCODE); + sprintf_P(UBL_LCD_GCODE, PSTR("M117 " MSG_MESH_LOADED), ubl_storage_slot); + lcd_enqueue_command(UBL_LCD_GCODE); +} + +/** + * UBL Save Mesh Command + */ +void _lcd_ubl_save_mesh_cmd() { + char UBL_LCD_GCODE[25]; + sprintf_P(UBL_LCD_GCODE, PSTR("G29 S%i"), ubl_storage_slot); + lcd_enqueue_command(UBL_LCD_GCODE); + sprintf_P(UBL_LCD_GCODE, PSTR("M117 " MSG_MESH_SAVED), ubl_storage_slot); + lcd_enqueue_command(UBL_LCD_GCODE); +} + +/** + * UBL Mesh Storage submenu + * + * << Unified Bed Leveling + * Memory Slot: --- + * Load Bed Mesh + * Save Bed Mesh + */ +void _lcd_ubl_storage_mesh() { + int16_t a = settings.calc_num_meshes(); + START_MENU(); + MENU_BACK(MSG_UBL_LEVEL_BED); + if (!WITHIN(ubl_storage_slot, 0, a - 1)) { + STATIC_ITEM(MSG_NO_STORAGE); + } + else { + MENU_ITEM_EDIT(int3, MSG_UBL_STORAGE_SLOT, &ubl_storage_slot, 0, a - 1); + MENU_ITEM(function, MSG_UBL_LOAD_MESH, _lcd_ubl_load_mesh_cmd); + MENU_ITEM(function, MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd); + } + END_MENU(); +} + +/** + * UBL LCD "radar" map homing + */ +void _lcd_ubl_output_map_lcd(); + +void _lcd_ubl_map_homing() { + defer_return_to_status = 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); + } +} + +/** + * UBL LCD "radar" map point editing + */ +void _lcd_ubl_map_lcd_edit_cmd() { + char UBL_LCD_GCODE[50], str[10], str2[10]; + dtostrf(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]), 0, 2, str); + dtostrf(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]), 0, 2, str2); + snprintf_P(UBL_LCD_GCODE, sizeof(UBL_LCD_GCODE), PSTR("G29 P4 X%s Y%s R%i"), str, str2, n_edit_pts); + lcd_enqueue_command(UBL_LCD_GCODE); +} + +/** + * UBL LCD Map Movement + */ +void ubl_map_move_to_xy() { + current_position[X_AXIS] = pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]); + current_position[Y_AXIS] = pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]); + planner.buffer_line(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder); +} + +/** + * UBL LCD "radar" map + */ +void set_current_from_steppers_for_axis(const AxisEnum axis); +void sync_plan_position(); + +void _lcd_do_nothing() {} +void _lcd_hard_stop() { + const screenFunc_t old_screen = currentScreen; + currentScreen = _lcd_do_nothing; + planner.quick_stop(); + currentScreen = old_screen; + set_current_from_steppers_for_axis(ALL_AXES); + sync_plan_position(); +} + +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 (encoderPosition) { + step_scaler += (int32_t)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; + } + + // Encoder to the right (++) + if (x_plot >= GRID_MAX_POINTS_X) { x_plot = 0; y_plot++; } + if (y_plot >= GRID_MAX_POINTS_Y) y_plot = 0; + + // Encoder to the left (--) + if (x_plot <= GRID_MAX_POINTS_X - (GRID_MAX_POINTS_X + 1)) { x_plot = GRID_MAX_POINTS_X - 1; y_plot--; } + if (y_plot <= GRID_MAX_POINTS_Y - (GRID_MAX_POINTS_Y + 1)) y_plot = GRID_MAX_POINTS_Y - 1; + + // Prevent underrun/overrun of plot numbers + x_plot = constrain(x_plot, GRID_MAX_POINTS_X - (GRID_MAX_POINTS_X + 1), GRID_MAX_POINTS_X + 1); + y_plot = constrain(y_plot, GRID_MAX_POINTS_Y - (GRID_MAX_POINTS_Y + 1), GRID_MAX_POINTS_Y + 1); + + // Determine number of points to edit + #if IS_KINEMATIC + n_edit_pts = 9; //TODO: Delta accessible edit points + #else + const bool xc = WITHIN(x_plot, 1, GRID_MAX_POINTS_X - 2), + yc = WITHIN(y_plot, 1, GRID_MAX_POINTS_Y - 2); + n_edit_pts = yc ? (xc ? 9 : 6) : (xc ? 6 : 4); // Corners + #endif + + if (lcdDrawUpdate) { + lcd_implementation_ubl_plot(x_plot, y_plot); + + if (planner.movesplanned()) // If the nozzle is already moving, cancel the move. + _lcd_hard_stop(); + + ubl_map_move_to_xy(); // Move to new location + } +} + +/** + * UBL Homing before LCD map + */ +void _lcd_ubl_output_map_lcd_cmd() { + if (!all_axes_known()) { + axis_homed = 0; + enqueue_and_echo_commands_P(PSTR("G28")); + } + lcd_goto_screen(_lcd_ubl_map_homing); +} + +/** + * UBL Output map submenu + * + * << Unified Bed Leveling + * Output for Host + * Output for CSV + * Off Printer Backup + * Output Mesh Map + */ +void _lcd_ubl_output_map() { + START_MENU(); + MENU_BACK(MSG_UBL_LEVEL_BED); + MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_HOST, PSTR("G29 T0")); + MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_CSV, PSTR("G29 T1")); + MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_BACKUP, PSTR("G29 S-1")); + MENU_ITEM(function, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map_lcd_cmd); + END_MENU(); +} + +/** + * UBL Tools submenu + * + * << Unified Bed Leveling + * - Build Mesh >> + * - Validate Mesh >> + * - Edit Mesh >> + * - Mesh Leveling >> + */ +void _menu_ubl_tools() { + START_MENU(); + MENU_BACK(MSG_UBL_LEVEL_BED); + MENU_ITEM(submenu, MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh); + MENU_ITEM(gcode, MSG_UBL_MANUAL_MESH, PSTR("G29 I999\nG29 P2 B T0")); + MENU_ITEM(submenu, MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); + MENU_ITEM(submenu, MSG_UBL_EDIT_MESH_MENU, _lcd_ubl_edit_mesh); + MENU_ITEM(submenu, MSG_UBL_MESH_LEVELING, _lcd_ubl_mesh_leveling); + END_MENU(); +} + +/** + * UBL Step-By-Step submenu + * + * << Unified Bed Leveling + * 1 Build Cold Mesh + * 2 Smart Fill-in + * - 3 Validate Mesh >> + * 4 Fine Tune All + * - 5 Validate Mesh >> + * 6 Fine Tune All + * 7 Save Bed Mesh + */ +void _lcd_ubl_step_by_step() { + START_MENU(); + MENU_BACK(MSG_UBL_LEVEL_BED); + MENU_ITEM(gcode, "1 " MSG_UBL_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); + MENU_ITEM(gcode, "2 " MSG_UBL_SMART_FILLIN, PSTR("G29 P3 T0")); + MENU_ITEM(submenu, "3 " MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); + MENU_ITEM(gcode, "4 " MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); + MENU_ITEM(submenu, "5 " MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); + MENU_ITEM(gcode, "6 " MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); + MENU_ITEM(function, "7 " MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd); + END_MENU(); +} + +/** + * UBL System submenu + * + * << Motion + * - Manually Build Mesh >> + * - Activate UBL >> + * - Deactivate UBL >> + * - Step-By-Step UBL >> + * - Mesh Storage >> + * - Output Map >> + * - UBL Tools >> + * - Output UBL Info >> + */ + +void _lcd_ubl_level_bed() { + START_MENU(); + MENU_BACK(MSG_MOTION); + MENU_ITEM(gcode, MSG_UBL_ACTIVATE_MESH, PSTR("G29 A")); + MENU_ITEM(gcode, MSG_UBL_DEACTIVATE_MESH, PSTR("G29 D")); + MENU_ITEM(submenu, MSG_UBL_STEP_BY_STEP_MENU, _lcd_ubl_step_by_step); + MENU_ITEM(function, MSG_UBL_MESH_EDIT, _lcd_ubl_output_map_lcd_cmd); + MENU_ITEM(submenu, MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh); + MENU_ITEM(submenu, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map); + MENU_ITEM(submenu, MSG_UBL_TOOLS, _menu_ubl_tools); + MENU_ITEM(gcode, MSG_UBL_INFO_UBL, PSTR("G29 W")); + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &lcd_z_fade_height, 0, 100, _lcd_set_z_fade_height); + #endif + END_MENU(); +} + +#endif // HAS_LCD_MENU && AUTO_BED_LEVELING_UBL diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 479eb3c6e7..6d67683bcb 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -27,6 +27,7 @@ #include #include "ultralcd.h" +#include "lcdprint.h" #include "../sd/cardreader.h" #include "../module/temperature.h" @@ -40,7 +41,6 @@ #include "../module/configuration_store.h" #include "../module/tool_change.h" - #include "../Marlin.h" #if ENABLED(ADVANCED_PAUSE_FEATURE) @@ -49,6 +49,9 @@ #if ENABLED(POWER_LOSS_RECOVERY) #include "../feature/power_loss_recovery.h" + #if ENABLED(ULTIPANEL) + void menu_job_recovery(); + #endif #endif #if ENABLED(PRINTCOUNTER) && ENABLED(LCD_INFO_MENU) @@ -67,25 +70,24 @@ #include "../feature/bedlevel/bedlevel.h" #endif -#if ENABLED(LED_CONTROL_MENU) - #include "../feature/leds/leds.h" -#endif - -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - #include "../feature/runout.h" -#endif - #if DISABLED(LCD_USE_I2C_BUZZER) #include "../libs/buzzer.h" #endif +// Buttons +volatile uint8_t buttons; + +#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 - uint8_t status_scroll_offset = 0; #else #define MAX_MESSAGE_LENGTH CHARSIZE * (LCD_WIDTH) #endif @@ -98,5231 +100,48 @@ uint8_t lcd_status_update_delay = 1, // First update one loop delayed millis_t previous_lcd_status_ms = 0; #endif -#if ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES) - uint8_t filename_scroll_pos, filename_scroll_max, filename_scroll_hash; +#if ENABLED(SDSUPPORT) && ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES) + uint8_t filename_scroll_pos, filename_scroll_max; #endif #if ENABLED(LCD_SET_PROGRESS_MANUALLY) uint8_t progress_bar_percent; #endif -#if ENABLED(DOGLCD) - #include "ultralcd_impl_DOGM.h" +millis_t next_button_update_ms; + +#if HAS_GRAPHICAL_LCD bool drawing_screen, first_page; // = false -#else - #include "ultralcd_impl_HD44780.h" - constexpr bool first_page = true; #endif -// The main status screen +#if ENABLED(ENCODER_RATE_MULTIPLIER) + bool encoderRateMultiplierEnabled; +#endif + +#if ENABLED(REVERSE_MENU_DIRECTION) + int8_t encoderDirection = 1; +#endif + void lcd_status_screen(); -LCDViewAction lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; -uint16_t max_display_update_time = 0; -millis_t next_lcd_update_ms; +#if HAS_LCD_MENU + #include "menu/menu.h" -#if ENABLED(ULTIPANEL) + screenFunc_t currentScreen = lcd_status_screen; - #define DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(_type, _name, _strFunc) \ - inline void lcd_implementation_drawmenu_setting_edit_ ## _name (const bool sel, const uint8_t row, PGM_P pstr, PGM_P pstr2, _type * const data, ...) { \ - UNUSED(pstr2); \ - DRAWMENU_SETTING_EDIT_GENERIC(_strFunc(*(data))); \ - } \ - inline void lcd_implementation_drawmenu_setting_edit_callback_ ## _name (const bool sel, const uint8_t row, PGM_P pstr, PGM_P pstr2, _type * const data, ...) { \ - UNUSED(pstr2); \ - DRAWMENU_SETTING_EDIT_GENERIC(_strFunc(*(data))); \ - } \ - 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), ...) { \ - UNUSED(pstr2); UNUSED(pset); \ - DRAWMENU_SETTING_EDIT_GENERIC(_strFunc(pget())); \ - } \ - typedef void _name##_void - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(int16_t, int3, itostr3); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(int16_t, int4, itostr4sign); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(uint8_t, int8, i8tostr3); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float3, ftostr3); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52, ftostr52); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float43, ftostr43sign); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float5, ftostr5rj); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float51, ftostr51sign); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52sign, ftostr52sign); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float62, ftostr62rj); - DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(uint32_t, long5, ftostr5rj); - #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_callback_bool(sel, row, pstr, pstr2, data, callback) 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) - - #ifndef TALL_FONT_CORRECTION - #define TALL_FONT_CORRECTION 0 - #endif - - bool no_reentry = false; - constexpr int8_t menu_bottom = LCD_HEIGHT - (TALL_FONT_CORRECTION); - - // Initialized by settings.load() - int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2]; - uint8_t lcd_preheat_fan_speed[2]; - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION) - bool lcd_external_control; // = false - #endif - - #if ENABLED(BABYSTEPPING) - long babysteps_done = 0; - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - static void lcd_babystep_zoffset(); - #else - static void lcd_babystep_z(); - #endif - #endif - - #if ENABLED(DAC_STEPPER_CURRENT) - #include "../feature/dac/stepper_dac.h" //was dac_mcp4728.h MarlinMain uses stepper dac for the m-codes - uint8_t driverPercent[XYZE]; - #endif - - //////////////////////////////////////////// - ///////////////// Menu Tree //////////////// - //////////////////////////////////////////// - - void lcd_main_menu(); - void lcd_tune_menu(); - void lcd_movement_menu(); - void lcd_move_menu(); - void lcd_configuration_menu(); - void lcd_temperature_menu(); - void lcd_advanced_settings_menu(); - - #if DISABLED(SLIM_LCD_MENUS) - void lcd_configuration_temperature_preheat_material1_settings_menu(); - void lcd_configuration_temperature_preheat_material2_settings_menu(); - #endif - - #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - void lcd_advanced_filament_menu(); - #endif - - #if ENABLED(LCD_INFO_MENU) - #if ENABLED(PRINTCOUNTER) - void lcd_info_stats_menu(); - #endif - void lcd_info_thermistors_menu(); - void lcd_info_board_menu(); - void lcd_info_menu(); - #endif // LCD_INFO_MENU - - #if ENABLED(LED_CONTROL_MENU) - void lcd_led_menu(); - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - void lcd_change_filament_menu(); - #else - void lcd_temp_menu_e0_filament_change(); - #endif - #endif - - #if ENABLED(DAC_STEPPER_CURRENT) - void dac_driver_commit(); - void dac_driver_getValues(); - void lcd_dac_menu(); - void lcd_dac_write_eeprom(); - #endif - - #if ENABLED(FWRETRACT) - #include "../feature/fwretract.h" - void lcd_config_retract_menu(); - #endif - - #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) - void lcd_delta_calibrate_menu(); - #endif - - #if ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING) - #include "../feature/bedlevel/mbl/mesh_bed_leveling.h" - #endif - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - static float new_z_fade_height; - void _lcd_set_z_fade_height() { set_z_fade_height(new_z_fade_height); } - #endif - - //////////////////////////////////////////// - //////////// Menu System Actions /////////// - //////////////////////////////////////////// - - #define menu_action_back(dummy) _menu_action_back() - void _menu_action_back(); - void menu_action_submenu(screenFunc_t data); - void menu_action_gcode(PGM_P pgcode); - void menu_action_function(menuAction_t data); - - #define DECLARE_MENU_EDIT_TYPE(_type, _name) \ - bool _menu_edit_ ## _name(); \ - void menu_edit_ ## _name(); \ - void menu_edit_callback_ ## _name(); \ - void _menu_action_setting_edit_ ## _name(PGM_P const pstr, _type* const ptr, const _type minValue, const _type maxValue); \ - void menu_action_setting_edit_ ## _name(PGM_P const pstr, _type * const ptr, const _type minValue, const _type maxValue); \ - void menu_action_setting_edit_callback_ ## _name(PGM_P const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback=NULL, const bool live=false); \ - typedef void _name##_void - - DECLARE_MENU_EDIT_TYPE(int16_t, int3); - DECLARE_MENU_EDIT_TYPE(int16_t, int4); - DECLARE_MENU_EDIT_TYPE(uint8_t, int8); - DECLARE_MENU_EDIT_TYPE(float, float3); - DECLARE_MENU_EDIT_TYPE(float, float52); - DECLARE_MENU_EDIT_TYPE(float, float43); - DECLARE_MENU_EDIT_TYPE(float, float5); - DECLARE_MENU_EDIT_TYPE(float, float51); - DECLARE_MENU_EDIT_TYPE(float, float52sign); - DECLARE_MENU_EDIT_TYPE(float, float62); - DECLARE_MENU_EDIT_TYPE(uint32_t, long5); - - void menu_action_setting_edit_bool(PGM_P pstr, bool* ptr); - void menu_action_setting_edit_callback_bool(PGM_P pstr, bool* ptr, screenFunc_t callbackFunc); - - #if ENABLED(SDSUPPORT) - void lcd_sdcard_menu(); - void menu_action_sdfile(CardReader &theCard); - void menu_action_sddirectory(CardReader &theCard); - #endif - - //////////////////////////////////////////// - //////////// Menu System Macros //////////// - //////////////////////////////////////////// - - /** - * MENU_ITEM generates draw & handler code for a menu item, potentially calling: - * - * lcd_implementation_drawmenu_[type](sel, row, label, arg3...) - * menu_action_[type](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_action_back() - * - * MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause) - * lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause) - * menu_action_function(lcd_sdcard_pause) - * - * MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999) - * MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(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_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - * - */ - #define _MENU_ITEM_PART_1(TYPE, ...) \ - if (_menuLineNr == _thisItemNr) { \ - if (encoderLine == _thisItemNr && lcd_clicked) { \ - lcd_clicked = false - - #define _MENU_ITEM_PART_2(TYPE, PLABEL, ...) \ - menu_action_ ## TYPE(__VA_ARGS__); \ - if (screen_changed) return; \ - } \ - if (lcdDrawUpdate) \ - lcd_implementation_drawmenu_ ## TYPE(encoderLine == _thisItemNr, _lcdLineNr, PLABEL, ## __VA_ARGS__); \ - } \ - ++_thisItemNr - - #define MENU_ITEM_P(TYPE, PLABEL, ...) do { \ - _skipStatic = false; \ - _MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \ - _MENU_ITEM_PART_2(TYPE, PLABEL, ## __VA_ARGS__); \ - }while(0) - - #define MENU_ITEM(TYPE, LABEL, ...) MENU_ITEM_P(TYPE, PSTR(LABEL), ## __VA_ARGS__) - - #define MENU_BACK(LABEL) MENU_ITEM(back, LABEL, 0) - - // Used to print static text with no visible cursor. - // Parameters: label [, bool center [, bool invert [, char *value] ] ] - #define STATIC_ITEM_P(LABEL, ...) \ - if (_menuLineNr == _thisItemNr) { \ - if (_skipStatic && encoderLine <= _thisItemNr) { \ - encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ - ++encoderLine; \ - } \ - if (lcdDrawUpdate) \ - lcd_implementation_drawmenu_static(_lcdLineNr, LABEL, ## __VA_ARGS__); \ - } \ - ++_thisItemNr - - #define STATIC_ITEM(LABEL, ...) STATIC_ITEM_P(PSTR(LABEL), ## __VA_ARGS__) - - #if ENABLED(ENCODER_RATE_MULTIPLIER) - - bool encoderRateMultiplierEnabled; - #define ENCODER_RATE_MULTIPLY(F) (encoderRateMultiplierEnabled = F) - - //#define ENCODER_RATE_MULTIPLIER_DEBUG // If defined, output the encoder steps per second value - - /** - * MENU_MULTIPLIER_ITEM generates drawing and handling code for a multiplier menu item - */ - #define MENU_MULTIPLIER_ITEM(TYPE, LABEL, ...) do { \ - _MENU_ITEM_PART_1(TYPE, ## __VA_ARGS__); \ - encoderRateMultiplierEnabled = true; \ - lastEncoderMovementMillis = 0; \ - _MENU_ITEM_PART_2(TYPE, PSTR(LABEL), ## __VA_ARGS__); \ - }while(0) - - #else // !ENCODER_RATE_MULTIPLIER - #define ENCODER_RATE_MULTIPLY(F) NOOP - #endif // !ENCODER_RATE_MULTIPLIER - - #define MENU_ITEM_DUMMY() do { _thisItemNr++; }while(0) - #define MENU_ITEM_EDIT(TYPE, LABEL, ...) MENU_ITEM(_CAT(setting_edit_,TYPE), LABEL, PSTR(LABEL), ## __VA_ARGS__) - #define MENU_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_ITEM(_CAT(setting_edit_callback_,TYPE), LABEL, PSTR(LABEL), ## __VA_ARGS__) - #if ENABLED(ENCODER_RATE_MULTIPLIER) - #define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, ...) MENU_MULTIPLIER_ITEM(_CAT(setting_edit_,TYPE), LABEL, PSTR(LABEL), ## __VA_ARGS__) - #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_MULTIPLIER_ITEM(_CAT(setting_edit_callback_,TYPE), LABEL, PSTR(LABEL), ## __VA_ARGS__) - #else // !ENCODER_RATE_MULTIPLIER - #define MENU_MULTIPLIER_ITEM_EDIT(TYPE, LABEL, ...) MENU_ITEM(_CAT(setting_edit_,TYPE), LABEL, PSTR(LABEL), ## __VA_ARGS__) - #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(TYPE, LABEL, ...) MENU_ITEM(_CAT(setting_edit_callback_,TYPE), LABEL, PSTR(LABEL), ## __VA_ARGS__) - #endif // !ENCODER_RATE_MULTIPLIER - - #define SCREEN_OR_MENU_LOOP() \ - int8_t _menuLineNr = encoderTopLine, _thisItemNr; \ - for (int8_t _lcdLineNr = 0; _lcdLineNr < menu_bottom; _lcdLineNr++, _menuLineNr++) { \ - _thisItemNr = 0 - - /** - * START_SCREEN Opening code for a screen having only static items. - * Do simplified scrolling of the entire screen. - * - * START_MENU Opening code for a screen with menu items. - * Scroll as-needed to keep the selected line in view. - */ - #define START_SCREEN() \ - scroll_screen(menu_bottom, false); \ - bool _skipStatic = false; \ - SCREEN_OR_MENU_LOOP() - - #define START_MENU() \ - scroll_screen(1, true); \ - bool _skipStatic = true; \ - SCREEN_OR_MENU_LOOP() - - #define END_SCREEN() \ - } \ - screen_items = _thisItemNr - - #define END_MENU() \ - } \ - screen_items = _thisItemNr; \ - UNUSED(_skipStatic) - - //////////////////////////////////////////// - ///////////// Global Variables ///////////// - //////////////////////////////////////////// - - /** - * 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) - int8_t encoderDirection = 1; - #define ENCODER_DIRECTION_NORMAL() (encoderDirection = 1) - #define ENCODER_DIRECTION_MENUS() (encoderDirection = -1) - #else - #define ENCODER_DIRECTION_NORMAL() ; - #define ENCODER_DIRECTION_MENUS() ; - #endif - - // Encoder Movement + // Encoder Handling volatile int8_t encoderDiff; // Updated in lcd_buttons_update, added to encoderPosition every LCD update uint32_t encoderPosition; millis_t lastEncoderMovementMillis = 0; - - // Button States bool lcd_clicked, wait_for_unclick; - volatile uint8_t buttons; - millis_t next_button_update_ms; - #if ENABLED(REPRAPWORLD_KEYPAD) - volatile uint8_t buttons_reprapworld_keypad; - #endif - #if ENABLED(LCD_HAS_SLOW_BUTTONS) - volatile uint8_t slow_buttons; - #endif + float move_menu_scale; - // Menu System Navigation - screenFunc_t currentScreen = lcd_status_screen; - int8_t encoderTopLine; - typedef struct { - screenFunc_t menu_function; - uint32_t encoder_position; - } menuPosition; - menuPosition screen_history[6]; - uint8_t screen_history_depth = 0; - bool screen_changed, defer_return_to_status; - - // Value Editing - PGM_P editLabel; - void *editValue; - int32_t minEditValue, maxEditValue; - screenFunc_t callbackFunc; - bool liveEdit; - - // Manual Moves - const float manual_feedrate_mm_m[] = MANUAL_FEEDRATE; - millis_t manual_move_start_time = 0; - int8_t manual_move_axis = (int8_t)NO_AXIS; - #if EXTRUDERS > 1 - int8_t manual_move_e_index = 0; - #else - #define manual_move_e_index 0 - #endif - - #if ENABLED(MANUAL_E_MOVES_RELATIVE) - float manual_move_e_origin = 0; - #endif - - #if IS_KINEMATIC - bool processing_manual_move = false; - float manual_move_offset = 0; - #else - constexpr bool processing_manual_move = false; - #endif - - #if PIN_EXISTS(SD_DETECT) - uint8_t lcd_sd_status; - #endif - - #if ENABLED(PIDTEMP) - float raw_Ki, raw_Kd; // place-holders for Ki and Kd edits - #endif - - inline bool use_click() { + bool use_click() { const bool click = lcd_clicked; lcd_clicked = false; return click; } - - inline bool printer_busy() { return planner.movesplanned() || IS_SD_PRINTING; } - - void lcd_move_z(); - float move_menu_scale; - - /** - * General function to go directly to a screen - */ - void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) { - if (currentScreen != screen) { - - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - // Shadow for editing the fade height - new_z_fade_height = planner.z_fade_height; - #endif - - #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) && ENABLED(BABYSTEPPING) - static millis_t doubleclick_expire_ms = 0; - // Going to lcd_main_menu from status screen? Remember first click time. - // Going back to status screen within a very short time? Go to Z babystepping. - if (screen == lcd_main_menu) { - if (currentScreen == lcd_status_screen) - doubleclick_expire_ms = millis() + DOUBLECLICK_MAX_INTERVAL; - } - else if (screen == lcd_status_screen && currentScreen == lcd_main_menu && PENDING(millis(), doubleclick_expire_ms)) { - if (printer_busy()) { - screen = - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - lcd_babystep_zoffset - #else - lcd_babystep_z - #endif - ; - } - #if ENABLED(MOVE_Z_WHEN_IDLE) - else { - move_menu_scale = MOVE_Z_IDLE_MULTIPLICATOR; - screen = lcd_move_z; - } - #endif - } - #endif - - currentScreen = screen; - encoderPosition = encoder; - if (screen == lcd_status_screen) { - defer_return_to_status = false; - #if ENABLED(AUTO_BED_LEVELING_UBL) - ubl.lcd_map_control = false; - #endif - screen_history_depth = 0; - } - lcd_implementation_clear(); - // Re-initialize custom characters that may be re-used - #if DISABLED(DOGLCD) && ENABLED(AUTO_BED_LEVELING_UBL) - if (!ubl.lcd_map_control) { - lcd_set_custom_characters( - #if ENABLED(LCD_PROGRESS_BAR) - screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU - #endif - ); - } - #elif ENABLED(LCD_PROGRESS_BAR) - lcd_set_custom_characters(screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU); - #endif - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - screen_changed = true; - #if ENABLED(DOGLCD) - drawing_screen = false; - #endif - } - } - - /** - * Show "Moving..." till moves are done, then revert to previous display. - */ - static const char moving[] PROGMEM = MSG_MOVING; - static PGM_P sync_message = moving; - - // - // Display the synchronize screen until moves are - // finished, and don't return to the caller until - // done. ** This blocks the command queue! ** - // - void _lcd_synchronize() { - if (lcdDrawUpdate) lcd_implementation_drawmenu_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); - planner.synchronize(); // idle() is called until moves complete - no_reentry = false; - lcd_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) { - sync_message = msg ? msg : moving; - _lcd_synchronize(); - } - - void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); } - - void lcd_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; - ++screen_history_depth; - } - } - - void lcd_goto_previous_menu() { - if (screen_history_depth > 0) { - --screen_history_depth; - lcd_goto_screen( - screen_history[screen_history_depth].menu_function, - screen_history[screen_history_depth].encoder_position - ); - } - else - lcd_return_to_status(); - } - - void lcd_goto_previous_menu_no_defer() { - defer_return_to_status = false; - lcd_goto_previous_menu(); - } - - /** - * Scrolling for menus and other line-based screens - * - * encoderLine is the position based on the encoder - * encoderTopLine is the top menu line to display - * _lcdLineNr is the index of the LCD line (e.g., 0-3) - * _menuLineNr is the menu item to draw and process - * _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM - * screen_items is the total number of items in the menu (after one call) - */ - int8_t encoderLine, screen_items; - void scroll_screen(const uint8_t limit, const bool is_menu) { - ENCODER_DIRECTION_MENUS(); - ENCODER_RATE_MULTIPLY(false); - if (encoderPosition > 0x8000) encoderPosition = 0; - if (first_page) { - encoderLine = 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); - } - if (is_menu) { - NOMORE(encoderTopLine, encoderLine); - if (encoderLine >= encoderTopLine + menu_bottom) - encoderTopLine = encoderLine - menu_bottom + 1; - } - else - encoderTopLine = encoderLine; - } - -#endif // ULTIPANEL - -/** - * - * "Info Screen" - * - * This is very display-dependent, so the lcd implementation draws this. - */ - -void lcd_status_screen() { - - #if ENABLED(ULTIPANEL) - ENCODER_DIRECTION_NORMAL(); - ENCODER_RATE_MULTIPLY(false); - #endif - - #if ENABLED(LCD_SET_PROGRESS_MANUALLY) && ENABLED(SDSUPPORT) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD)) - // Progress bar % comes from SD when actively printing - if (IS_SD_PRINTING) - progress_bar_percent = card.percentDone(); - #endif - - #if ENABLED(LCD_PROGRESS_BAR) - - // - // HD44780 implements the following message blinking and - // message expiration because Status Line and Progress Bar - // share the same line on the display. - // - - millis_t ms = millis(); - - // If the message will blink rather than expire... - #if DISABLED(PROGRESS_MSG_ONCE) - if (ELAPSED(ms, progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME)) - progress_bar_ms = ms; - #endif - - #if PROGRESS_MSG_EXPIRE > 0 - - // 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 (ELAPSED(ms, expire_status_ms)) { - lcd_status_message[0] = '\0'; - expire_status_ms = 0; - } - } - else { - // Defer message expiration before bar appears - // and during any pause (not just SD) - expire_status_ms += LCD_UPDATE_INTERVAL; - } - } - - #endif // PROGRESS_MSG_EXPIRE - - #endif // LCD_PROGRESS_BAR - - #if ENABLED(ULTIPANEL) - - if (use_click()) { - #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) - previous_lcd_status_ms = millis(); // get status message to show up for a while - #endif - lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. - #if ENABLED(LCD_PROGRESS_BAR) - CHARSET_MENU - #endif - ); - lcd_goto_screen(lcd_main_menu); - return; - } - - #if ENABLED(ULTIPANEL_FEEDMULTIPLY) - const int16_t new_frm = feedrate_percentage + (int32_t)encoderPosition; - // Dead zone at 100% feedrate - if ((feedrate_percentage < 100 && new_frm > 100) || (feedrate_percentage > 100 && new_frm < 100)) { - feedrate_percentage = 100; - encoderPosition = 0; - } - else if (feedrate_percentage == 100) { - if ((int32_t)encoderPosition > ENCODER_FEEDRATE_DEADZONE) { - feedrate_percentage += (int32_t)encoderPosition - (ENCODER_FEEDRATE_DEADZONE); - encoderPosition = 0; - } - else if ((int32_t)encoderPosition < -(ENCODER_FEEDRATE_DEADZONE)) { - feedrate_percentage += (int32_t)encoderPosition + ENCODER_FEEDRATE_DEADZONE; - encoderPosition = 0; - } - } - else { - feedrate_percentage = new_frm; - encoderPosition = 0; - } - #endif // ULTIPANEL_FEEDMULTIPLY - - feedrate_percentage = constrain(feedrate_percentage, 10, 999); - - #endif // ULTIPANEL - - lcd_implementation_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 (card.sdprinting) - return lcd_setstatus(card.longest_filename(), true); - #endif - else if (print_job_timer.isRunning()) - msg = printing; - else - msg = welcome; - - lcd_setstatusPGM(msg, -1); -} - -/** - * - * draw the kill screen - * - */ -void kill_screen(PGM_P lcd_msg) { - lcd_init(); - lcd_setalertstatusPGM(lcd_msg); - lcd_kill_screen(); -} - -/** - * - * Audio feedback for controller clicks - * - */ -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); - #else - UNUSED(duration); UNUSED(freq); - #endif -} - -void lcd_quick_feedback(const bool clear_buttons) { - - #if ENABLED(ULTIPANEL) - lcd_refresh(); - if (clear_buttons) buttons = 0; - next_button_update_ms = millis() + 500; - #else - UNUSED(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); - - #if ENABLED(ULTIPANEL) - #if ENABLED(LCD_USE_I2C_BUZZER) - delay(10); - #elif PIN_EXISTS(BEEPER) - for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } - #endif - #endif -} - -#if ENABLED(ULTIPANEL) - - void lcd_completion_feedback(const bool good/*=true*/) { - if (good) { - lcd_buzz(100, 659); - lcd_buzz(100, 698); - } - else lcd_buzz(20, 440); - } - - inline void line_to_current_z() { - planner.buffer_line(current_position, MMM_TO_MMS(manual_feedrate_mm_m[Z_AXIS]), active_extruder); - } - - inline void line_to_z(const float &z) { - current_position[Z_AXIS] = z; - line_to_current_z(); - } - - #if ENABLED(SDSUPPORT) - - void lcd_sdcard_pause() { - card.pauseSDPrint(); - print_job_timer.pause(); - #if ENABLED(PARK_HEAD_ON_PAUSE) - enqueue_and_echo_commands_P(PSTR("M125")); - #endif - lcd_reset_status(); - } - - void lcd_sdcard_resume() { - #if ENABLED(PARK_HEAD_ON_PAUSE) - enqueue_and_echo_commands_P(PSTR("M24")); - #else - card.startFileprint(); - print_job_timer.start(); - #endif - lcd_reset_status(); - } - - bool abort_sd_printing; // =false - - void lcd_sdcard_stop() { - wait_for_heatup = wait_for_user = false; - abort_sd_printing = true; - lcd_setstatusPGM(PSTR(MSG_PRINT_ABORTED), -1); - lcd_return_to_status(); - } - - #endif // SDSUPPORT - - #if ENABLED(POWER_LOSS_RECOVERY) - - 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; - } - - static void lcd_power_loss_recovery_cancel() { - card.removeJobRecoveryFile(); - card.autostart_index = 0; - lcd_return_to_status(); - } - - static void lcd_job_recovery_menu() { - defer_return_to_status = true; - START_MENU(); - STATIC_ITEM(MSG_POWER_LOSS_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(); - } - - #endif // POWER_LOSS_RECOVERY - - #if ENABLED(SINGLENOZZLE) - void singlenozzle_swap_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - MENU_ITEM_EDIT(float3, MSG_FILAMENT_SWAP_LENGTH, &sn_settings.swap_length, 0, 200); - MENU_MULTIPLIER_ITEM_EDIT(int4, MSG_SINGLENOZZLE_RETRACT_SPD, &sn_settings.retract_speed, 10, 5400); - MENU_MULTIPLIER_ITEM_EDIT(int4, MSG_SINGLENOZZLE_PRIME_SPD, &sn_settings.prime_speed, 10, 5400); - END_MENU(); - } - #endif - - #if ENABLED(MENU_ITEM_CASE_LIGHT) - - #include "../feature/caselight.h" - - void case_light_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_CASE_LIGHT_BRIGHTNESS, &case_light_brightness, 0, 255, update_case_light, true); - MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); - END_MENU(); - } - #endif // MENU_ITEM_CASE_LIGHT - - #if ENABLED(BLTOUCH) - - /** - * - * "BLTouch" submenu - * - */ - static void bltouch_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET))); - MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST))); - MENU_ITEM(gcode, MSG_BLTOUCH_DEPLOY, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_DEPLOY))); - MENU_ITEM(gcode, MSG_BLTOUCH_STOW, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_STOW))); - END_MENU(); - } - - #endif // BLTOUCH - - #if ENABLED(LCD_PROGRESS_BAR_TEST) - - static void progress_bar_test() { - static int8_t bar_percent = 0; - if (use_click()) { - lcd_goto_previous_menu(); - lcd_set_custom_characters(CHARSET_MENU); - return; - } - bar_percent += (int8_t)encoderPosition; - bar_percent = constrain(bar_percent, 0, 100); - encoderPosition = 0; - lcd_implementation_drawmenu_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); - } - - void _progress_bar_test() { - lcd_goto_screen(progress_bar_test); - lcd_set_custom_characters(); - } - - #endif // LCD_PROGRESS_BAR_TEST - - #if HAS_DEBUG_MENU - - void lcd_debug_menu() { - START_MENU(); - - MENU_BACK(MSG_MAIN); - - #if ENABLED(LCD_PROGRESS_BAR_TEST) - MENU_ITEM(submenu, MSG_PROGRESS_BAR_TEST, _progress_bar_test); - #endif - - END_MENU(); - } - - #endif // HAS_DEBUG_MENU - - /** - * IDEX submenu - */ - #if ENABLED(DUAL_X_CARRIAGE) - static void _recalc_IDEX_settings() { - if (active_extruder) { // For the 2nd extruder re-home so the next tool-change gets the new offsets. - enqueue_and_echo_commands_P(PSTR("G28")); // In future, we can babystep the 2nd extruder (if active), making homing unnecessary. - active_extruder = 0; - } - } - - static void IDEX_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - - MENU_ITEM(gcode, MSG_IDEX_MODE_AUTOPARK, PSTR("M605 S1\nG28 X\nG1 X100")); - const bool need_g28 = !(TEST(axis_known_position, Y_AXIS) && TEST(axis_known_position, Z_AXIS)); - MENU_ITEM(gcode, MSG_IDEX_MODE_DUPLICATE, need_g28 - ? PSTR("M605 S1\nT0\nG28\nM605 S2 X200\nG28 X\nG1 X100") // If Y or Z is not homed, do a full G28 first - : PSTR("M605 S1\nT0\nM605 S2 X200\nG28 X\nG1 X100") - ); - //MENU_ITEM(gcode, MSG_IDEX_MODE_SCALED_COPY, need_g28 - // ? PSTR("M605 S1\nT0\nG28\nM605 S2 X200\nG28 X\nG1 X100\nM605 S3 X200") // If Y or Z is not homed, do a full G28 first - // : PSTR("M605 S1\nT0\nM605 S2 X200\nG28 X\nG1 X100\nM605 S3 X200") - //); - MENU_ITEM(gcode, MSG_IDEX_MODE_FULL_CTRL, PSTR("M605 S0\nG28 X")); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_IDEX_X_OFFSET , &hotend_offset[X_AXIS][1], MIN(X2_HOME_POS, X2_MAX_POS) - 25.0, MAX(X2_HOME_POS, X2_MAX_POS) + 25.0, _recalc_IDEX_settings); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_IDEX_Y_OFFSET , &hotend_offset[Y_AXIS][1], -10.0, 10.0, _recalc_IDEX_settings); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float52, MSG_IDEX_Z_OFFSET , &hotend_offset[Z_AXIS][1], -10.0, 10.0, _recalc_IDEX_settings); - MENU_ITEM(gcode, MSG_IDEX_SAVE_OFFSETS, PSTR("M500")); - END_MENU(); - } - #endif // DUAL_X_CARRIAGE - - #if ENABLED(CUSTOM_USER_MENUS) - - #ifdef USER_SCRIPT_DONE - #define _DONE_SCRIPT "\n" USER_SCRIPT_DONE - #else - #define _DONE_SCRIPT "" - #endif - - void _lcd_user_gcode(PGM_P const cmd) { - enqueue_and_echo_commands_P(cmd); - #if ENABLED(USER_SCRIPT_AUDIBLE_FEEDBACK) - lcd_completion_feedback(); - #endif - #if ENABLED(USER_SCRIPT_RETURN) - lcd_return_to_status(); - #endif - } - - #if defined(USER_DESC_1) && defined(USER_GCODE_1) - void lcd_user_gcode_1() { _lcd_user_gcode(PSTR(USER_GCODE_1 _DONE_SCRIPT)); } - #endif - #if defined(USER_DESC_2) && defined(USER_GCODE_2) - void lcd_user_gcode_2() { _lcd_user_gcode(PSTR(USER_GCODE_2 _DONE_SCRIPT)); } - #endif - #if defined(USER_DESC_3) && defined(USER_GCODE_3) - void lcd_user_gcode_3() { _lcd_user_gcode(PSTR(USER_GCODE_3 _DONE_SCRIPT)); } - #endif - #if defined(USER_DESC_4) && defined(USER_GCODE_4) - void lcd_user_gcode_4() { _lcd_user_gcode(PSTR(USER_GCODE_4 _DONE_SCRIPT)); } - #endif - #if defined(USER_DESC_5) && defined(USER_GCODE_5) - void lcd_user_gcode_5() { _lcd_user_gcode(PSTR(USER_GCODE_5 _DONE_SCRIPT)); } - #endif - - void _lcd_user_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - #if defined(USER_DESC_1) && defined(USER_GCODE_1) - MENU_ITEM(function, USER_DESC_1, lcd_user_gcode_1); - #endif - #if defined(USER_DESC_2) && defined(USER_GCODE_2) - MENU_ITEM(function, USER_DESC_2, lcd_user_gcode_2); - #endif - #if defined(USER_DESC_3) && defined(USER_GCODE_3) - MENU_ITEM(function, USER_DESC_3, lcd_user_gcode_3); - #endif - #if defined(USER_DESC_4) && defined(USER_GCODE_4) - MENU_ITEM(function, USER_DESC_4, lcd_user_gcode_4); - #endif - #if defined(USER_DESC_5) && defined(USER_GCODE_5) - MENU_ITEM(function, USER_DESC_5, lcd_user_gcode_5); - #endif - END_MENU(); - } - - #endif - - /** - * - * "Main" menu - * - */ - - #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) - - void lcd_autostart_sd() { card.beginautostart(); } - - #endif - - void lcd_main_menu() { - START_MENU(); - MENU_BACK(MSG_WATCH); - - #if ENABLED(SDSUPPORT) - if (card.cardOK) { - if (card.isFileOpen()) { - if (card.sdprinting) - MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause); - else - MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume); - MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop); - } - else { - MENU_ITEM(submenu, MSG_CARD_MENU, lcd_sdcard_menu); - #if !PIN_EXISTS(SD_DETECT) - MENU_ITEM(gcode, MSG_CNG_SDCARD, PSTR("M21")); // SD-card changed by user - #endif - } - } - else { - MENU_ITEM(submenu, MSG_NO_CARD, lcd_sdcard_menu); - #if !PIN_EXISTS(SD_DETECT) - MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface - #endif - } - #endif // SDSUPPORT - - const bool busy = printer_busy(); - if (busy) - MENU_ITEM(submenu, MSG_TUNE, lcd_tune_menu); - else { - MENU_ITEM(submenu, MSG_MOTION, lcd_movement_menu); - MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_temperature_menu); - } - - MENU_ITEM(submenu, MSG_CONFIGURATION, lcd_configuration_menu); - - #if ENABLED(CUSTOM_USER_MENUS) - MENU_ITEM(submenu, MSG_USER_MENU, _lcd_user_menu); - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES) - if (thermalManager.targetHotEnoughToExtrude(active_extruder)) - MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600 B0")); - else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_temp_menu_e0_filament_change); - #else - MENU_ITEM(submenu, MSG_FILAMENTCHANGE, lcd_change_filament_menu); - #endif - #endif - - #if ENABLED(LCD_INFO_MENU) - MENU_ITEM(submenu, MSG_INFO_MENU, lcd_info_menu); - #endif - - #if ENABLED(LED_CONTROL_MENU) - MENU_ITEM(submenu, MSG_LED_CONTROL, lcd_led_menu); - #endif - - // - // Switch power on/off - // - #if HAS_POWER_SWITCH - if (powersupply_on) - MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81")); - else - MENU_ITEM(gcode, MSG_SWITCH_PS_ON, PSTR("M80")); - #endif - - // - // Autostart - // - #if ENABLED(SDSUPPORT) && ENABLED(MENU_ADDAUTOSTART) - if (!busy) - MENU_ITEM(function, MSG_AUTOSTART, lcd_autostart_sd); - #endif - - END_MENU(); - } - - /** - * - * "Tune" submenu items - * - */ - - #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) || ENABLED(MESH_EDIT_GFX_OVERLAY) - - void _lcd_zoffset_overlay_gfx(const float zvalue) { - // Determine whether the user is raising or lowering the nozzle. - static int8_t dir; - static float old_zvalue; - if (zvalue != old_zvalue) { - dir = zvalue ? zvalue < old_zvalue ? -1 : 1 : 0; - old_zvalue = zvalue; - } - - #if ENABLED(OVERLAY_GFX_REVERSE) - const unsigned char *rot_up = ccw_bmp, *rot_down = cw_bmp; - #else - const unsigned char *rot_up = cw_bmp, *rot_down = ccw_bmp; - #endif - - #if ENABLED(USE_BIG_EDIT_FONT) - const int left = 0, right = 45, nozzle = 95; - #else - const int left = 5, right = 90, nozzle = 60; - #endif - - // Draw a representation of the nozzle - if (PAGE_CONTAINS(3, 16)) u8g.drawBitmapP(nozzle + 6, 4 - dir, 2, 12, nozzle_bmp); - if (PAGE_CONTAINS(20, 20)) u8g.drawBitmapP(nozzle + 0, 20, 3, 1, offset_bedline_bmp); - - // Draw cw/ccw indicator and up/down arrows. - if (PAGE_CONTAINS(47, 62)) { - u8g.drawBitmapP(left + 0, 47, 3, 16, rot_down); - u8g.drawBitmapP(right + 0, 47, 3, 16, rot_up); - u8g.drawBitmapP(right + 20, 48 - dir, 2, 13, up_arrow_bmp); - u8g.drawBitmapP(left + 20, 49 - dir, 2, 13, down_arrow_bmp); - } - } - - #endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY - - #if ENABLED(BABYSTEPPING) - - 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; - 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 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; defer_return_to_status = true; } - void lcd_babystep_y() { lcd_goto_screen(_lcd_babystep_y); babysteps_done = 0; defer_return_to_status = true; } - #endif - - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - - void lcd_babystep_zoffset() { - if (use_click()) { return lcd_goto_previous_menu_no_defer(); } - defer_return_to_status = 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; - - const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment, - new_probe_offset = zprobe_zoffset + diff, - new_offs = - #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - do_probe ? new_probe_offset : hotend_offset[Z_AXIS][active_extruder] - diff - #else - new_probe_offset - #endif - ; - if (WITHIN(new_offs, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { - - thermalManager.babystep_axis(Z_AXIS, babystep_increment); - - if (do_probe) zprobe_zoffset = new_offs; - #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - else hotend_offset[Z_AXIS][active_extruder] = new_offs; - #endif - - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - } - } - if (lcdDrawUpdate) { - #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET) - if (!do_probe) - lcd_implementation_drawedit(PSTR(MSG_IDEX_Z_OFFSET), ftostr43sign(hotend_offset[Z_AXIS][active_extruder])); - else - #endif - lcd_implementation_drawedit(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset)); - - #if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) - if (do_probe) _lcd_zoffset_overlay_gfx(zprobe_zoffset); - #endif - } - } - - #else // !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; defer_return_to_status = true; } - - #endif // !BABYSTEP_ZPROBE_OFFSET - - #endif // BABYSTEPPING - - #if ENABLED(AUTO_BED_LEVELING_UBL) - - float mesh_edit_value, mesh_edit_accumulator; // We round mesh_edit_value to 2.5 decimal places. So we keep a - // separate value that doesn't lose precision. - static int16_t ubl_encoderPosition = 0; - - static void _lcd_mesh_fine_tune(PGM_P msg) { - defer_return_to_status = 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; - - 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 ENABLED(MESH_EDIT_GFX_OVERLAY) - _lcd_zoffset_overlay_gfx(mesh_edit_value); - #endif - } - } - - void _lcd_mesh_edit_NOP() { - defer_return_to_status = true; - } - - float lcd_mesh_edit() { - lcd_goto_screen(_lcd_mesh_edit_NOP); - lcdDrawUpdate = 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); - } - - void _lcd_z_offset_edit() { - _lcd_mesh_fine_tune(PSTR("Z-Offset: ")); - } - - float lcd_z_offset_edit() { - lcd_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); - } - - #endif // AUTO_BED_LEVELING_UBL - - - /** - * Watch temperature callbacks - */ - #if HAS_TEMP_HOTEND - #if WATCH_HOTENDS - #define _WATCH_FUNC(N) thermalManager.start_watching_heater(N) - #else - #define _WATCH_FUNC(N) NOOP - #endif - void watch_temp_callback_E0() { _WATCH_FUNC(0); } - #if HOTENDS > 1 - void watch_temp_callback_E1() { _WATCH_FUNC(1); } - #if HOTENDS > 2 - void watch_temp_callback_E2() { _WATCH_FUNC(2); } - #if HOTENDS > 3 - void watch_temp_callback_E3() { _WATCH_FUNC(3); } - #if HOTENDS > 4 - void watch_temp_callback_E4() { _WATCH_FUNC(4); } - #if HOTENDS > 5 - void watch_temp_callback_E5() { _WATCH_FUNC(5); } - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #endif // HAS_TEMP_HOTEND - - void watch_temp_callback_bed() { - #if WATCH_THE_BED - thermalManager.start_watching_bed(); - #endif - } - - // First Fan Speed title in "Tune" and "Control>Temperature" menus - #if FAN_COUNT > 0 && HAS_FAN0 - #if FAN_COUNT > 1 - #define FAN_SPEED_1_SUFFIX " 1" - #else - #define FAN_SPEED_1_SUFFIX "" - #endif - #endif - - // Refresh the E factor after changing flow - inline void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); } - #if EXTRUDERS > 1 - inline void _lcd_refresh_e_factor() { planner.refresh_e_factor(active_extruder); } - inline void _lcd_refresh_e_factor_1() { planner.refresh_e_factor(1); } - #if EXTRUDERS > 2 - inline void _lcd_refresh_e_factor_2() { planner.refresh_e_factor(2); } - #if EXTRUDERS > 3 - inline void _lcd_refresh_e_factor_3() { planner.refresh_e_factor(3); } - #if EXTRUDERS > 4 - inline void _lcd_refresh_e_factor_4() { planner.refresh_e_factor(4); } - #if EXTRUDERS > 5 - inline void _lcd_refresh_e_factor_5() { planner.refresh_e_factor(5); } - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - - /** - * - * "Tune" submenu - * - */ - void lcd_tune_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - - // - // Speed: - // - MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999); - - // - // Manual bed leveling, Bed Z: - // - #if ENABLED(MESH_BED_LEVELING) && ENABLED(LCD_BED_LEVELING) - MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); - #endif - - // - // Nozzle: - // Nozzle [1-4]: - // - #if HOTENDS == 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - #else // HOTENDS > 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); - #if HOTENDS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); - #if HOTENDS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); - #if HOTENDS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N5, &thermalManager.target_temperature[4], 0, HEATER_4_MAXTEMP - 15, watch_temp_callback_E4); - #if HOTENDS > 5 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N6, &thermalManager.target_temperature[5], 0, HEATER_5_MAXTEMP - 15, watch_temp_callback_E5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - - // - // Bed: - // - #if HAS_HEATED_BED - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed); - #endif - - // - // Fan Speed: - // - #if FAN_COUNT > 0 - #if (HAS_FAN0 && FAN_NUM_AS_LASER!=0) - MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &fan_speed[0], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &new_fan_speed[0], 3, 255); - #endif - #endif - #if (HAS_FAN1 && FAN_NUM_AS_LASER!=1) - MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED " 2", &fan_speed[1], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 2", &new_fan_speed[1], 3, 255); - #endif - #endif - #if (HAS_FAN2 && FAN_NUM_AS_LASER!=2) - MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED " 3", &fan_speed[2], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 3", &new_fan_speed[2], 3, 255); - #endif - #endif - #endif // FAN_COUNT > 0 - - // - // Laser ON/OFF: - // - #if ENABLED(FAN_AS_LASER) - MENU_ITEM(gcode, MSG_LASER_ON, PSTR(" M3 ")); - MENU_ITEM(gcode, MSG_LASER_OFF, PSTR(" M5 ")); - #endif - - // - // Flow: - // Flow [1-5]: - // - #if EXTRUDERS == 1 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0); - #else // EXTRUDERS > 1 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, _lcd_refresh_e_factor); - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N1, &planner.flow_percentage[0], 10, 999, _lcd_refresh_e_factor_0); - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N2, &planner.flow_percentage[1], 10, 999, _lcd_refresh_e_factor_1); - #if EXTRUDERS > 2 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N3, &planner.flow_percentage[2], 10, 999, _lcd_refresh_e_factor_2); - #if EXTRUDERS > 3 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N4, &planner.flow_percentage[3], 10, 999, _lcd_refresh_e_factor_3); - #if EXTRUDERS > 4 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N5, &planner.flow_percentage[4], 10, 999, _lcd_refresh_e_factor_4); - #if EXTRUDERS > 5 - MENU_ITEM_EDIT_CALLBACK(int3, MSG_FLOW MSG_N6, &planner.flow_percentage[5], 10, 999, _lcd_refresh_e_factor_5); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - - // - // Babystep X: - // Babystep Y: - // Babystep Z: - // - #if ENABLED(BABYSTEPPING) - #if ENABLED(BABYSTEP_XY) - MENU_ITEM(submenu, MSG_BABYSTEP_X, lcd_babystep_x); - MENU_ITEM(submenu, MSG_BABYSTEP_Y, lcd_babystep_y); - #endif - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); - #else - MENU_ITEM(submenu, MSG_BABYSTEP_Z, lcd_babystep_z); - #endif - #endif - - END_MENU(); - } - - /** - * - * "Driver current control" submenu items - * - */ - #if ENABLED(DAC_STEPPER_CURRENT) - - void dac_driver_getValues() { LOOP_XYZE(i) driverPercent[i] = dac_current_get_percent((AxisEnum)i); } - - void dac_driver_commit() { dac_current_set_percents(driverPercent); } - - void dac_driver_eeprom_write() { dac_commit_eeprom(); } - - void lcd_dac_menu() { - dac_driver_getValues(); - START_MENU(); - MENU_BACK(MSG_CONTROL); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_X " " MSG_DAC_PERCENT, &driverPercent[X_AXIS], 0, 100, dac_driver_commit); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_Y " " MSG_DAC_PERCENT, &driverPercent[Y_AXIS], 0, 100, dac_driver_commit); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_Z " " MSG_DAC_PERCENT, &driverPercent[Z_AXIS], 0, 100, dac_driver_commit); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_E " " MSG_DAC_PERCENT, &driverPercent[E_AXIS], 0, 100, dac_driver_commit); - MENU_ITEM(function, MSG_DAC_EEPROM_WRITE, dac_driver_eeprom_write); - END_MENU(); - } - - #endif // DAC_STEPPER_CURRENT - - #if HAS_MOTOR_CURRENT_PWM - - void lcd_pwm_menu() { - START_MENU(); - MENU_BACK(MSG_CONTROL); - #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) - MENU_ITEM_EDIT_CALLBACK(long5, MSG_X MSG_Y, &stepper.motor_current_setting[0], 100, 2000, Stepper::refresh_motor_power); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_Z) - MENU_ITEM_EDIT_CALLBACK(long5, MSG_Z, &stepper.motor_current_setting[1], 100, 2000, Stepper::refresh_motor_power); - #endif - #if PIN_EXISTS(MOTOR_CURRENT_PWM_E) - MENU_ITEM_EDIT_CALLBACK(long5, MSG_E, &stepper.motor_current_setting[2], 100, 2000, Stepper::refresh_motor_power); - #endif - END_MENU(); - } - - #endif // HAS_MOTOR_CURRENT_PWM - - constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP); - - /** - * - * "Temperature" submenu items - * - */ - void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb, const uint8_t fan) { - if (temph > 0) thermalManager.setTargetHotend(MIN(heater_maxtemp[endnum], temph), endnum); - #if HAS_HEATED_BED - if (tempb >= 0) thermalManager.setTargetBed(tempb); - #else - UNUSED(tempb); - #endif - #if FAN_COUNT > 0 - #if FAN_COUNT > 1 - fan_speed[active_extruder < FAN_COUNT ? active_extruder : 0] = fan; - #else - fan_speed[0] = fan; - #endif - #else - UNUSED(fan); - #endif - lcd_return_to_status(); - } - - #if HAS_TEMP_HOTEND - 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]); } - #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]); } - #endif - #endif - - #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]); } - #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]); } - #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]); } - #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]); } - #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]); } - #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]); } - #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]); } - #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]); } - #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]); } - #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]); } - #endif - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - - void lcd_preheat_m1_all() { - #if HOTENDS > 1 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 1); - #if HOTENDS > 2 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 2); - #if HOTENDS > 3 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 3); - #if HOTENDS > 4 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 4); - #if HOTENDS > 5 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[0], 5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - lcd_preheat_m1_e0(); - #else - lcd_preheat_m1_e0_only(); - #endif - } - void lcd_preheat_m2_all() { - #if HOTENDS > 1 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 1); - #if HOTENDS > 2 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 2); - #if HOTENDS > 3 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 3); - #if HOTENDS > 4 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 4); - #if HOTENDS > 5 - thermalManager.setTargetHotend(lcd_preheat_hotend_temp[1], 5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - lcd_preheat_m2_e0(); - #else - lcd_preheat_m2_e0_only(); - #endif - } - - #endif // HOTENDS > 1 - - #if HAS_HEATED_BED - 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]); } - #endif - - #if HAS_TEMP_HOTEND || HAS_HEATED_BED - - void lcd_preheat_m1_menu() { - START_MENU(); - MENU_BACK(MSG_TEMPERATURE); - #if HOTENDS == 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0); - MENU_ITEM(function, MSG_PREHEAT_1_END, lcd_preheat_m1_e0_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only); - #endif - #elif HOTENDS > 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E1, lcd_preheat_m1_e0_only); - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E2, lcd_preheat_m1_e1_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H1, lcd_preheat_m1_e0_only); - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H2, lcd_preheat_m1_e1_only); - #endif - #if HOTENDS > 2 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E3, lcd_preheat_m1_e2_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H3, lcd_preheat_m1_e2_only); - #endif - #if HOTENDS > 3 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E4, lcd_preheat_m1_e3_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H4, lcd_preheat_m1_e3_only); - #endif - #if HOTENDS > 4 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H5, lcd_preheat_m1_e4); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E5, lcd_preheat_m1_e4_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H5, lcd_preheat_m1_e4_only); - #endif - #if HOTENDS > 5 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H6, lcd_preheat_m1_e5); - MENU_ITEM(function, MSG_PREHEAT_1_END " " MSG_E6, lcd_preheat_m1_e5_only); - #else - MENU_ITEM(function, MSG_PREHEAT_1_N MSG_H6, lcd_preheat_m1_e5_only); - #endif - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - MENU_ITEM(function, MSG_PREHEAT_1_ALL, lcd_preheat_m1_all); - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_1_BEDONLY, lcd_preheat_m1_bedonly); - #endif - END_MENU(); - } - - void lcd_preheat_m2_menu() { - START_MENU(); - MENU_BACK(MSG_TEMPERATURE); - #if HOTENDS == 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0); - MENU_ITEM(function, MSG_PREHEAT_2_END, lcd_preheat_m2_e0_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only); - #endif - #elif HOTENDS > 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E1, lcd_preheat_m2_e0_only); - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E2, lcd_preheat_m2_e1_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H1, lcd_preheat_m2_e0_only); - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H2, lcd_preheat_m2_e1_only); - #endif - #if HOTENDS > 2 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E3, lcd_preheat_m2_e2_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H3, lcd_preheat_m2_e2_only); - #endif - #if HOTENDS > 3 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E4, lcd_preheat_m2_e3_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H4, lcd_preheat_m2_e3_only); - #endif - #if HOTENDS > 4 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H5, lcd_preheat_m2_e4); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E5, lcd_preheat_m2_e4_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H5, lcd_preheat_m2_e4_only); - #endif - #if HOTENDS > 5 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H6, lcd_preheat_m2_e5); - MENU_ITEM(function, MSG_PREHEAT_2_END " " MSG_E6, lcd_preheat_m2_e5_only); - #else - MENU_ITEM(function, MSG_PREHEAT_2_N MSG_H6, lcd_preheat_m2_e5_only); - #endif - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - MENU_ITEM(function, MSG_PREHEAT_2_ALL, lcd_preheat_m2_all); - #endif // HOTENDS > 1 - #if HAS_HEATED_BED - MENU_ITEM(function, MSG_PREHEAT_2_BEDONLY, lcd_preheat_m2_bedonly); - #endif - END_MENU(); - } - - #endif // HAS_TEMP_HOTEND || HAS_HEATED_BED - - void lcd_cooldown() { - #if FAN_COUNT > 0 - for (uint8_t i = 0; i < FAN_COUNT; i++) fan_speed[i] = 0; - #endif - thermalManager.disable_all_heaters(); - lcd_return_to_status(); - } - - #if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE) - - /** - * If the queue is full, the command will fail, so we have to loop - * with idle() to make sure the command has been enqueued. - */ - void lcd_enqueue_command(char * const cmd) { - no_reentry = true; - enqueue_and_echo_command_now(cmd); - no_reentry = false; - } - - void lcd_enqueue_commands_P(PGM_P const cmd) { - no_reentry = true; - enqueue_and_echo_commands_now_P(cmd); - no_reentry = false; - } - - #endif - - #if ENABLED(EEPROM_SETTINGS) - static void lcd_store_settings() { lcd_completion_feedback(settings.save()); } - static void lcd_load_settings() { lcd_completion_feedback(settings.load()); } - #endif - - inline 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 ENABLED(LEVEL_BED_CORNERS) - - /** - * Level corners, starting in the front-left corner. - */ - static int8_t bed_corner; - void _lcd_goto_next_corner() { - line_to_z(4.0); - switch (bed_corner) { - case 0: - current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET; - current_position[Y_AXIS] = Y_MIN_BED + LEVEL_CORNERS_INSET; - break; - case 1: - current_position[X_AXIS] = X_MAX_BED - LEVEL_CORNERS_INSET; - break; - case 2: - current_position[Y_AXIS] = Y_MAX_BED - LEVEL_CORNERS_INSET; - break; - case 3: - current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET; - break; - #if ENABLED(LEVEL_CENTER_TOO) - case 4: - current_position[X_AXIS] = X_CENTER; - current_position[Y_AXIS] = Y_CENTER; - break; - #endif - } - planner.buffer_line(current_position, MMM_TO_MMS(manual_feedrate_mm_m[X_AXIS]), active_extruder); - line_to_z(0.0); - if (++bed_corner > 3 - #if ENABLED(LEVEL_CENTER_TOO) - + 1 - #endif - ) bed_corner = 0; - } - - void _lcd_corner_submenu() { - START_MENU(); - MENU_ITEM(function, - #if ENABLED(LEVEL_CENTER_TOO) - MSG_LEVEL_BED_NEXT_POINT - #else - MSG_NEXT_CORNER - #endif - , _lcd_goto_next_corner); - MENU_ITEM(function, MSG_BACK, lcd_goto_previous_menu_no_defer); - END_MENU(); - } - - void _lcd_level_bed_corners_homing() { - _lcd_draw_homing(); - if (all_axes_homed()) { - bed_corner = 0; - lcd_goto_screen(_lcd_corner_submenu); - _lcd_goto_next_corner(); - } - } - - void _lcd_level_bed_corners() { - defer_return_to_status = true; - if (!all_axes_known()) { - axis_homed = 0; - enqueue_and_echo_commands_P(PSTR("G28")); - } - lcd_goto_screen(_lcd_level_bed_corners_homing); - } - - #endif // LEVEL_BED_CORNERS - - #if ENABLED(LCD_BED_LEVELING) && (ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING)) - - /** - * - * "Motion" > "Level Bed" handlers - * - */ - - static uint8_t manual_probe_index; - - // LCD probed points are from defaults - constexpr uint8_t total_probe_points = ( - #if ENABLED(AUTO_BED_LEVELING_3POINT) - 3 - #elif ABL_GRID || ENABLED(MESH_BED_LEVELING) - GRID_MAX_POINTS - #endif - ); - - bool lcd_wait_for_move; - - // - // Bed leveling is done. Wait for G29 to complete. - // A flag is used so that this can release control - // and allow the command queue to be processed. - // - // When G29 finishes the last move: - // - Raise Z to the "manual probe height" - // - Don't return until done. - // - // ** This blocks the command queue! ** - // - void _lcd_level_bed_done() { - if (!lcd_wait_for_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)); - #endif - lcd_goto_previous_menu_no_defer(); - lcd_completion_feedback(); - } - if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_DONE)); - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; - } - - void _lcd_level_goto_next_point(); - - /** - * Step 7: Get the Z coordinate, click goes to the next point or exits - */ - void _lcd_level_bed_get_z() { - ENCODER_DIRECTION_NORMAL(); - - if (use_click()) { - - // - // Save the current Z position and move - // - - // If done... - if (++manual_probe_index >= total_probe_points) { - // - // The last G29 records the point and enables bed leveling - // - lcd_wait_for_move = true; - lcd_goto_screen(_lcd_level_bed_done); - #if ENABLED(MESH_BED_LEVELING) - enqueue_and_echo_commands_P(PSTR("G29 S2")); - #elif ENABLED(PROBE_MANUALLY) - enqueue_and_echo_commands_P(PSTR("G29 V1")); - #endif - } - else - _lcd_level_goto_next_point(); - - return; - } - - // - // Encoder knob or keypad buttons adjust the Z position - // - if (encoderPosition) { - const float z = current_position[Z_AXIS] + float((int32_t)encoderPosition) * (MBL_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; - } - - // - // Draw on first display, then only on Z change - // - if (lcdDrawUpdate) { - const float v = current_position[Z_AXIS]; - lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001f : 0.0001f), '+')); - } - } - - /** - * Step 6: Display "Next point: 1 / 9" while waiting for move to finish - */ - void _lcd_level_bed_moving() { - if (lcdDrawUpdate) { - 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); - } - lcdDrawUpdate = LCDVIEW_CALL_NO_REDRAW; - if (!lcd_wait_for_move) lcd_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); - - // G29 Records Z, moves, and signals when it pauses - lcd_wait_for_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) - enqueue_and_echo_commands_P(PSTR("G29 V1")); - #endif - } - - /** - * Step 4: Display "Click to Begin", wait for click - * 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()) { - manual_probe_index = 0; - _lcd_level_goto_next_point(); - } - } - - /** - * Step 3: Display "Homing XYZ" - Wait for homing to finish - */ - void _lcd_level_bed_homing() { - _lcd_draw_homing(); - if (all_axes_homed()) lcd_goto_screen(_lcd_level_bed_homing_done); - } - - #if ENABLED(PROBE_MANUALLY) - extern bool g29_in_progress; - #endif - - /** - * Step 2: Continue Bed Leveling... - */ - void _lcd_level_bed_continue() { - defer_return_to_status = true; - axis_homed = 0; - lcd_goto_screen(_lcd_level_bed_homing); - enqueue_and_echo_commands_P(PSTR("G28")); - } - - #elif ENABLED(AUTO_BED_LEVELING_UBL) - - void _lcd_ubl_level_bed(); - - static int16_t ubl_storage_slot = 0, - custom_hotend_temp = 190, - side_points = 3, - ubl_fillin_amount = 5, - ubl_height_amount = 1, - n_edit_pts = 1, - x_plot = 0, - y_plot = 0; - - #if HAS_HEATED_BED - static int16_t custom_bed_temp = 50; - #endif - - /** - * UBL Build Custom Mesh Command - */ - void _lcd_ubl_build_custom_mesh() { - char UBL_LCD_GCODE[20]; - enqueue_and_echo_commands_P(PSTR("G28")); - #if HAS_HEATED_BED - sprintf_P(UBL_LCD_GCODE, PSTR("M190 S%i"), custom_bed_temp); - lcd_enqueue_command(UBL_LCD_GCODE); - #endif - sprintf_P(UBL_LCD_GCODE, PSTR("M109 S%i"), custom_hotend_temp); - lcd_enqueue_command(UBL_LCD_GCODE); - enqueue_and_echo_commands_P(PSTR("G29 P1")); - } - - /** - * UBL Custom Mesh submenu - * - * << Build Mesh - * Hotend Temp: --- - * Bed Temp: --- - * Build Custom Mesh - */ - void _lcd_ubl_custom_mesh() { - START_MENU(); - MENU_BACK(MSG_UBL_BUILD_MESH_MENU); - MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_HOTEND_TEMP, &custom_hotend_temp, EXTRUDE_MINTEMP, (HEATER_0_MAXTEMP - 10)); - #if HAS_HEATED_BED - MENU_ITEM_EDIT(int3, MSG_UBL_CUSTOM_BED_TEMP, &custom_bed_temp, BED_MINTEMP, (BED_MAXTEMP - 15)); - #endif - MENU_ITEM(function, MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_build_custom_mesh); - END_MENU(); - } - - /** - * UBL Adjust Mesh Height Command - */ - void _lcd_ubl_adjust_height_cmd() { - char UBL_LCD_GCODE[16]; - const int ind = ubl_height_amount > 0 ? 9 : 10; - strcpy_P(UBL_LCD_GCODE, PSTR("G29 P6 C -")); - sprintf_P(&UBL_LCD_GCODE[ind], PSTR(".%i"), ABS(ubl_height_amount)); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Adjust Mesh Height submenu - * - * << Edit Mesh - * Height Amount: --- - * Adjust Mesh Height - * << Info Screen - */ - void _lcd_ubl_height_adjust_menu() { - START_MENU(); - MENU_BACK(MSG_UBL_EDIT_MESH_MENU); - 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); - END_MENU(); - } - - /** - * UBL Edit Mesh submenu - * - * << UBL Tools - * Fine Tune All - * Fine Tune Closest - * - Adjust Mesh Height >> - * << Info Screen - */ - void _lcd_ubl_edit_mesh() { - START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - 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, _lcd_ubl_height_adjust_menu); - MENU_ITEM(function, MSG_WATCH, lcd_return_to_status); - END_MENU(); - } - - /** - * UBL Validate Custom Mesh Command - */ - void _lcd_ubl_validate_custom_mesh() { - char UBL_LCD_GCODE[24]; - const int temp = - #if HAS_HEATED_BED - custom_bed_temp - #else - 0 - #endif - ; - sprintf_P(UBL_LCD_GCODE, PSTR("G26 C B%i H%i P"), temp, custom_hotend_temp); - lcd_enqueue_commands_P(PSTR("G28")); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Validate Mesh submenu - * - * << UBL Tools - * PLA Mesh Validation - * ABS Mesh Validation - * Validate Custom Mesh - * << Info Screen - */ - void _lcd_ubl_validate_mesh() { - START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - #if HAS_HEATED_BED - MENU_ITEM(gcode, MSG_UBL_VALIDATE_PLA_MESH, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_1_TEMP_BED) " H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); - MENU_ITEM(gcode, MSG_UBL_VALIDATE_ABS_MESH, PSTR("G28\nG26 C B" STRINGIFY(PREHEAT_2_TEMP_BED) " H" STRINGIFY(PREHEAT_2_TEMP_HOTEND) " P")); - #else - MENU_ITEM(gcode, MSG_UBL_VALIDATE_PLA_MESH, PSTR("G28\nG26 C B0 H" STRINGIFY(PREHEAT_1_TEMP_HOTEND) " P")); - MENU_ITEM(gcode, MSG_UBL_VALIDATE_ABS_MESH, 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); - END_MENU(); - } - - /** - * UBL Grid Leveling Command - */ - void _lcd_ubl_grid_level_cmd() { - char UBL_LCD_GCODE[10]; - sprintf_P(UBL_LCD_GCODE, PSTR("G29 J%i"), side_points); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Grid Leveling submenu - * - * << UBL Tools - * Side points: --- - * Level Mesh - */ - void _lcd_ubl_grid_level() { - START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - MENU_ITEM_EDIT(int3, MSG_UBL_SIDE_POINTS, &side_points, 2, 6); - MENU_ITEM(function, MSG_UBL_MESH_LEVEL, _lcd_ubl_grid_level_cmd); - END_MENU(); - } - - /** - * UBL Mesh Leveling submenu - * - * << UBL Tools - * 3-Point Mesh Leveling - * - Grid Mesh Leveling >> - * << Info Screen - */ - void _lcd_ubl_mesh_leveling() { - START_MENU(); - 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); - END_MENU(); - } - - /** - * UBL Fill-in Amount Mesh Command - */ - void _lcd_ubl_fillin_amount_cmd() { - char UBL_LCD_GCODE[16]; - sprintf_P(UBL_LCD_GCODE, PSTR("G29 P3 R C.%i"), ubl_fillin_amount); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Fill-in Mesh submenu - * - * << Build Mesh - * Fill-in Amount: --- - * Fill-in Mesh - * Smart Fill-in - * Manual Fill-in - * << Info Screen - */ - void _lcd_ubl_fillin_menu() { - START_MENU(); - MENU_BACK(MSG_UBL_BUILD_MESH_MENU); - 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); - END_MENU(); - } - - void _lcd_ubl_invalidate() { - ubl.invalidate(); - SERIAL_PROTOCOLLNPGM("Mesh invalidated."); - } - - /** - * UBL Build Mesh submenu - * - * << UBL Tools - * Build PLA Mesh - * Build ABS Mesh - * - Build Custom Mesh >> - * Build Cold Mesh - * - Fill-in Mesh >> - * Continue Bed Mesh - * Invalidate All - * Invalidate Closest - * << Info Screen - */ - void _lcd_ubl_build_mesh() { - START_MENU(); - MENU_BACK(MSG_UBL_TOOLS); - #if HAS_HEATED_BED - MENU_ITEM(gcode, MSG_UBL_BUILD_PLA_MESH, PSTR( - "G28\n" - "M190 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\n" - "M109 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0\n" - "M140 S0" - )); - MENU_ITEM(gcode, MSG_UBL_BUILD_ABS_MESH, PSTR( - "G28\n" - "M190 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\n" - "M109 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0\n" - "M140 S0" - )); - #else - MENU_ITEM(gcode, MSG_UBL_BUILD_PLA_MESH, PSTR( - "G28\n" - "M109 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0" - )); - MENU_ITEM(gcode, MSG_UBL_BUILD_ABS_MESH, PSTR( - "G28\n" - "M109 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) "\n" - "G29 P1\n" - "M104 S0" - )); - #endif - MENU_ITEM(submenu, MSG_UBL_BUILD_CUSTOM_MESH, _lcd_ubl_custom_mesh); - MENU_ITEM(gcode, MSG_UBL_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); - MENU_ITEM(submenu, MSG_UBL_FILLIN_MESH, _lcd_ubl_fillin_menu); - 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); - END_MENU(); - } - - /** - * UBL Load Mesh Command - */ - void _lcd_ubl_load_mesh_cmd() { - char UBL_LCD_GCODE[25]; - sprintf_P(UBL_LCD_GCODE, PSTR("G29 L%i"), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); - sprintf_P(UBL_LCD_GCODE, PSTR("M117 " MSG_MESH_LOADED), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Save Mesh Command - */ - void _lcd_ubl_save_mesh_cmd() { - char UBL_LCD_GCODE[25]; - sprintf_P(UBL_LCD_GCODE, PSTR("G29 S%i"), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); - sprintf_P(UBL_LCD_GCODE, PSTR("M117 " MSG_MESH_SAVED), ubl_storage_slot); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL Mesh Storage submenu - * - * << Unified Bed Leveling - * Memory Slot: --- - * Load Bed Mesh - * Save Bed Mesh - */ - void _lcd_ubl_storage_mesh() { - int16_t a = settings.calc_num_meshes(); - START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); - if (!WITHIN(ubl_storage_slot, 0, a - 1)) { - STATIC_ITEM(MSG_NO_STORAGE); - } - else { - MENU_ITEM_EDIT(int3, MSG_UBL_STORAGE_SLOT, &ubl_storage_slot, 0, a - 1); - MENU_ITEM(function, MSG_UBL_LOAD_MESH, _lcd_ubl_load_mesh_cmd); - MENU_ITEM(function, MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd); - } - END_MENU(); - } - - /** - * UBL LCD "radar" map homing - */ - void _lcd_ubl_output_map_lcd(); - - void _lcd_ubl_map_homing() { - defer_return_to_status = 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); - } - } - - /** - * UBL LCD "radar" map point editing - */ - void _lcd_ubl_map_lcd_edit_cmd() { - char UBL_LCD_GCODE[50], str[10], str2[10]; - dtostrf(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]), 0, 2, str); - dtostrf(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]), 0, 2, str2); - snprintf_P(UBL_LCD_GCODE, sizeof(UBL_LCD_GCODE), PSTR("G29 P4 X%s Y%s R%i"), str, str2, n_edit_pts); - lcd_enqueue_command(UBL_LCD_GCODE); - } - - /** - * UBL LCD Map Movement - */ - void ubl_map_move_to_xy() { - current_position[X_AXIS] = pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]); - current_position[Y_AXIS] = pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]); - planner.buffer_line(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder); - } - - /** - * UBL LCD "radar" map - */ - void set_current_from_steppers_for_axis(const AxisEnum axis); - void sync_plan_position(); - - void _lcd_do_nothing() {} - void _lcd_hard_stop() { - const screenFunc_t old_screen = currentScreen; - currentScreen = _lcd_do_nothing; - planner.quick_stop(); - currentScreen = old_screen; - set_current_from_steppers_for_axis(ALL_AXES); - sync_plan_position(); - } - - 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 (encoderPosition) { - step_scaler += (int32_t)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; - } - - // Encoder to the right (++) - if (x_plot >= GRID_MAX_POINTS_X) { x_plot = 0; y_plot++; } - if (y_plot >= GRID_MAX_POINTS_Y) y_plot = 0; - - // Encoder to the left (--) - if (x_plot <= GRID_MAX_POINTS_X - (GRID_MAX_POINTS_X + 1)) { x_plot = GRID_MAX_POINTS_X - 1; y_plot--; } - if (y_plot <= GRID_MAX_POINTS_Y - (GRID_MAX_POINTS_Y + 1)) y_plot = GRID_MAX_POINTS_Y - 1; - - // Prevent underrun/overrun of plot numbers - x_plot = constrain(x_plot, GRID_MAX_POINTS_X - (GRID_MAX_POINTS_X + 1), GRID_MAX_POINTS_X + 1); - y_plot = constrain(y_plot, GRID_MAX_POINTS_Y - (GRID_MAX_POINTS_Y + 1), GRID_MAX_POINTS_Y + 1); - - // Determine number of points to edit - #if IS_KINEMATIC - n_edit_pts = 9; //TODO: Delta accessible edit points - #else - const bool xc = WITHIN(x_plot, 1, GRID_MAX_POINTS_X - 2), - yc = WITHIN(y_plot, 1, GRID_MAX_POINTS_Y - 2); - n_edit_pts = yc ? (xc ? 9 : 6) : (xc ? 6 : 4); // Corners - #endif - - if (lcdDrawUpdate) { - lcd_implementation_ubl_plot(x_plot, y_plot); - - if (planner.movesplanned()) // If the nozzle is already moving, cancel the move. - _lcd_hard_stop(); - - ubl_map_move_to_xy(); // Move to new location - } - } - - /** - * UBL Homing before LCD map - */ - void _lcd_ubl_output_map_lcd_cmd() { - if (!all_axes_known()) { - axis_homed = 0; - enqueue_and_echo_commands_P(PSTR("G28")); - } - lcd_goto_screen(_lcd_ubl_map_homing); - } - - /** - * UBL Output map submenu - * - * << Unified Bed Leveling - * Output for Host - * Output for CSV - * Off Printer Backup - * Output Mesh Map - */ - void _lcd_ubl_output_map() { - START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); - MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_HOST, PSTR("G29 T0")); - MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_CSV, PSTR("G29 T1")); - MENU_ITEM(gcode, MSG_UBL_OUTPUT_MAP_BACKUP, PSTR("G29 S-1")); - MENU_ITEM(function, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map_lcd_cmd); - END_MENU(); - } - - /** - * UBL Tools submenu - * - * << Unified Bed Leveling - * - Build Mesh >> - * - Validate Mesh >> - * - Edit Mesh >> - * - Mesh Leveling >> - */ - void _lcd_ubl_tools_menu() { - START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); - MENU_ITEM(submenu, MSG_UBL_BUILD_MESH_MENU, _lcd_ubl_build_mesh); - MENU_ITEM(gcode, MSG_UBL_MANUAL_MESH, PSTR("G29 I999\nG29 P2 B T0")); - MENU_ITEM(submenu, MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - MENU_ITEM(submenu, MSG_UBL_EDIT_MESH_MENU, _lcd_ubl_edit_mesh); - MENU_ITEM(submenu, MSG_UBL_MESH_LEVELING, _lcd_ubl_mesh_leveling); - END_MENU(); - } - - /** - * UBL Step-By-Step submenu - * - * << Unified Bed Leveling - * 1 Build Cold Mesh - * 2 Smart Fill-in - * - 3 Validate Mesh >> - * 4 Fine Tune All - * - 5 Validate Mesh >> - * 6 Fine Tune All - * 7 Save Bed Mesh - */ - void _lcd_ubl_step_by_step() { - START_MENU(); - MENU_BACK(MSG_UBL_LEVEL_BED); - MENU_ITEM(gcode, "1 " MSG_UBL_BUILD_COLD_MESH, PSTR("G28\nG29 P1")); - MENU_ITEM(gcode, "2 " MSG_UBL_SMART_FILLIN, PSTR("G29 P3 T0")); - MENU_ITEM(submenu, "3 " MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - MENU_ITEM(gcode, "4 " MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); - MENU_ITEM(submenu, "5 " MSG_UBL_VALIDATE_MESH_MENU, _lcd_ubl_validate_mesh); - MENU_ITEM(gcode, "6 " MSG_UBL_FINE_TUNE_ALL, PSTR("G29 P4 R999 T")); - MENU_ITEM(function, "7 " MSG_UBL_SAVE_MESH, _lcd_ubl_save_mesh_cmd); - END_MENU(); - } - - /** - * UBL System submenu - * - * << Motion - * - Manually Build Mesh >> - * - Activate UBL >> - * - Deactivate UBL >> - * - Step-By-Step UBL >> - * - Mesh Storage >> - * - Output Map >> - * - UBL Tools >> - * - Output UBL Info >> - */ - - void _lcd_ubl_level_bed() { - START_MENU(); - MENU_BACK(MSG_MOTION); - MENU_ITEM(gcode, MSG_UBL_ACTIVATE_MESH, PSTR("G29 A")); - MENU_ITEM(gcode, MSG_UBL_DEACTIVATE_MESH, PSTR("G29 D")); - MENU_ITEM(submenu, MSG_UBL_STEP_BY_STEP_MENU, _lcd_ubl_step_by_step); - MENU_ITEM(function, MSG_UBL_MESH_EDIT, _lcd_ubl_output_map_lcd_cmd); - MENU_ITEM(submenu, MSG_UBL_STORAGE_MESH_MENU, _lcd_ubl_storage_mesh); - MENU_ITEM(submenu, MSG_UBL_OUTPUT_MAP, _lcd_ubl_output_map); - MENU_ITEM(submenu, MSG_UBL_TOOLS, _lcd_ubl_tools_menu); - MENU_ITEM(gcode, MSG_UBL_INFO_UBL, PSTR("G29 W")); - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif - END_MENU(); - } - - #endif // AUTO_BED_LEVELING_UBL - - - #if ENABLED(LCD_BED_LEVELING) || (HAS_LEVELING && DISABLED(SLIM_LCD_MENUS)) - void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(!planner.leveling_active); } - #endif - - #if ENABLED(LCD_BED_LEVELING) - - /** - * Step 1: Bed Level entry-point - * - * << Motion - * Auto Home (if homing needed) - * Leveling On/Off (if data exists, and homed) - * Fade Height: --- (Req: ENABLE_LEVELING_FADE_HEIGHT) - * Mesh Z Offset: --- (Req: MESH_BED_LEVELING) - * Z Probe Offset: --- (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET) - * Level Bed > - * Level Corners > (if homed) - * Load Settings (Req: EEPROM_SETTINGS) - * Save Settings (Req: EEPROM_SETTINGS) - */ - void lcd_bed_leveling_menu() { - START_MENU(); - MENU_BACK(MSG_MOTION); - - const bool is_homed = all_axes_known(); - - // Auto Home if not using manual probing - #if DISABLED(PROBE_MANUALLY) && DISABLED(MESH_BED_LEVELING) - if (!is_homed) MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); - #endif - - // Level Bed - #if ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING) - // Manual leveling uses a guided procedure - MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue); - #else - // Automatic leveling can just run the G-code - MENU_ITEM(gcode, MSG_LEVEL_BED, is_homed ? PSTR("G29") : PSTR("G28\nG29")); - #endif - - // Homed and leveling is valid? Then leveling can be toggled. - if (is_homed && leveling_is_valid()) { - bool new_level_state = planner.leveling_active; - MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &new_level_state, _lcd_toggle_bed_leveling); - } - - // Z Fade Height - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif - - // - // MBL Z Offset - // - #if ENABLED(MESH_BED_LEVELING) - MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1); - #endif - - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); - #elif HAS_BED_PROBE - MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); - #endif - - #if ENABLED(LEVEL_BED_CORNERS) - // Move to the next corner for leveling - MENU_ITEM(submenu, MSG_LEVEL_CORNERS, _lcd_level_bed_corners); - #endif - - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - #endif - END_MENU(); - } - - #endif // LCD_BED_LEVELING - - /** - * - * "Movement" submenu - * - */ - - void lcd_movement_menu() { - START_MENU(); - - // - // ^ Main - // - MENU_BACK(MSG_MAIN); - - // - // Move Axis - // - #if ENABLED(DELTA) - if (all_axes_homed()) - #endif - MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu); - - // - // Auto Home - // - MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); - #if ENABLED(INDIVIDUAL_AXIS_HOMING_MENU) - MENU_ITEM(gcode, MSG_AUTO_HOME_X, PSTR("G28 X")); - MENU_ITEM(gcode, MSG_AUTO_HOME_Y, PSTR("G28 Y")); - MENU_ITEM(gcode, MSG_AUTO_HOME_Z, PSTR("G28 Z")); - #endif - - // - // TMC Z Calibration - // - #if ENABLED(TMC_Z_CALIBRATION) - MENU_ITEM(gcode, MSG_TMC_Z_CALIBRATION, PSTR("G28\nM915")); - #endif - - // - // Level Bed - // - #if ENABLED(AUTO_BED_LEVELING_UBL) - - MENU_ITEM(submenu, MSG_UBL_LEVEL_BED, _lcd_ubl_level_bed); - - #elif ENABLED(LCD_BED_LEVELING) - - #if ENABLED(PROBE_MANUALLY) - if (!g29_in_progress) - #endif - MENU_ITEM(submenu, MSG_BED_LEVELING, lcd_bed_leveling_menu); - - #elif HAS_LEVELING && DISABLED(SLIM_LCD_MENUS) - - #if DISABLED(PROBE_MANUALLY) - MENU_ITEM(gcode, MSG_LEVEL_BED, PSTR("G28\nG29")); - #endif - if (leveling_is_valid()) { - bool new_level_state = planner.leveling_active; - MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &new_level_state, _lcd_toggle_bed_leveling); - } - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float3, MSG_Z_FADE_HEIGHT, &new_z_fade_height, 0, 100, _lcd_set_z_fade_height); - #endif - - #endif - - #if ENABLED(LEVEL_BED_CORNERS) && DISABLED(LCD_BED_LEVELING) - MENU_ITEM(function, MSG_LEVEL_CORNERS, _lcd_level_bed_corners); - #endif - - // - // Disable Steppers - // - MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84")); - - END_MENU(); - } - - #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) - - void _man_probe_pt(const float &rx, const float &ry) { - do_blocking_move_to_z(Z_CLEARANCE_BETWEEN_PROBES); - do_blocking_move_to_xy(rx, ry); - - lcd_synchronize(); - move_menu_scale = MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT)); - lcd_goto_screen(lcd_move_z); - } - - #endif // DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION - - #if ENABLED(DELTA_AUTO_CALIBRATION) - - float lcd_probe_pt(const float &rx, const float &ry) { - _man_probe_pt(rx, ry); - KEEPALIVE_STATE(PAUSED_FOR_USER); - defer_return_to_status = true; - wait_for_user = true; - while (wait_for_user) idle(); - KEEPALIVE_STATE(IN_HANDLER); - lcd_goto_previous_menu_no_defer(); - return current_position[Z_AXIS]; - } - - #endif // DELTA_AUTO_CALIBRATION - - #if ENABLED(DELTA_CALIBRATION_MENU) - - void _lcd_calibrate_homing() { - _lcd_draw_homing(); - if (all_axes_homed()) lcd_goto_previous_menu(); - } - - void _lcd_delta_calibrate_home() { - enqueue_and_echo_commands_P(PSTR("G28")); - lcd_goto_screen(_lcd_calibrate_homing); - } - - void _goto_tower_x() { _man_probe_pt(cos(RADIANS(210)) * delta_calibration_radius, sin(RADIANS(210)) * delta_calibration_radius); } - void _goto_tower_y() { _man_probe_pt(cos(RADIANS(330)) * delta_calibration_radius, sin(RADIANS(330)) * delta_calibration_radius); } - void _goto_tower_z() { _man_probe_pt(cos(RADIANS( 90)) * delta_calibration_radius, sin(RADIANS( 90)) * delta_calibration_radius); } - void _goto_center() { _man_probe_pt(0,0); } - - #endif // DELTA_CALIBRATION_MENU - - #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) - - void _recalc_delta_settings() { - #if HAS_LEVELING - reset_bed_level(); // After changing kinematics bed-level data is no longer valid - #endif - recalc_delta_settings(); - } - - void lcd_delta_settings() { - START_MENU(); - MENU_BACK(MSG_DELTA_CALIBRATE); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_HEIGHT, &delta_height, delta_height - 10, delta_height + 10, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ex", &delta_endstop_adj[A_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ey", &delta_endstop_adj[B_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ez", &delta_endstop_adj[C_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_RADIUS, &delta_radius, delta_radius - 5, delta_radius + 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Tx", &delta_tower_angle_trim[A_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Ty", &delta_tower_angle_trim[B_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float43, "Tz", &delta_tower_angle_trim[C_AXIS], -5, 5, _recalc_delta_settings); - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_DELTA_DIAG_ROD, &delta_diagonal_rod, delta_diagonal_rod - 5, delta_diagonal_rod + 5, _recalc_delta_settings); - END_MENU(); - } - - void lcd_delta_calibrate_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - #if ENABLED(DELTA_AUTO_CALIBRATION) - MENU_ITEM(gcode, MSG_DELTA_AUTO_CALIBRATE, PSTR("G33")); - MENU_ITEM(gcode, MSG_DELTA_HEIGHT_CALIBRATE, PSTR("G33 S P1")); - MENU_ITEM(gcode, MSG_DELTA_Z_OFFSET_CALIBRATE, PSTR("G33 P-1")); - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); - #endif - #endif - MENU_ITEM(submenu, MSG_DELTA_SETTINGS, lcd_delta_settings); - #if ENABLED(DELTA_CALIBRATION_MENU) - MENU_ITEM(submenu, MSG_AUTO_HOME, _lcd_delta_calibrate_home); - if (all_axes_homed()) { - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_X, _goto_tower_x); - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Y, _goto_tower_y); - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Z, _goto_tower_z); - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_CENTER, _goto_center); - } - #endif - END_MENU(); - } - - #endif // DELTA_CALIBRATION_MENU || DELTA_AUTO_CALIBRATION - - /** - * If the most recent manual move hasn't been fed to the planner yet, - * and the planner can accept one, send immediately - */ - inline void manage_manual_move() { - - if (processing_manual_move) return; - - if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) { - - #if IS_KINEMATIC - - const float old_feedrate = feedrate_mm_s; - feedrate_mm_s = MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]); - - #if EXTRUDERS > 1 - const int8_t old_extruder = active_extruder; - if (manual_move_axis == E_AXIS) active_extruder = manual_move_e_index; - #endif - - // Set movement on a single axis - set_destination_from_current(); - destination[manual_move_axis] += manual_move_offset; - - // Reset for the next move - manual_move_offset = 0; - manual_move_axis = (int8_t)NO_AXIS; - - // DELTA and SCARA machines use segmented moves, which could fill the planner during the call to - // move_to_destination. This will cause idle() to be called, which can then call this function while the - // previous invocation is being blocked. Modifications to manual_move_offset shouldn't be made while - // processing_manual_move is true or the planner will get out of sync. - processing_manual_move = true; - prepare_move_to_destination(); // will call set_current_from_destination() - processing_manual_move = false; - - feedrate_mm_s = old_feedrate; - #if EXTRUDERS > 1 - active_extruder = old_extruder; - #endif - - #else - - planner.buffer_line(current_position, MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_axis == E_AXIS ? manual_move_e_index : active_extruder); - manual_move_axis = (int8_t)NO_AXIS; - - #endif - } - } - - /** - * Set a flag that lcd_update() should 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; - #endif - manual_move_start_time = millis() + (move_menu_scale < 0.99f ? 0UL : 250UL); // delay for bigger moves - manual_move_axis = (int8_t)axis; - } - - /** - * - * "Motion" > "Move Axis" submenu - * - */ - - 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) { - - // Start with no limits to movement - float min = current_position[axis] - 1000, - max = current_position[axis] + 1000; - - // Limit to software endstops, if enabled - #if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS) - if (soft_endstops_enabled) switch (axis) { - case X_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_X) - min = soft_endstop_min[X_AXIS]; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_X) - max = soft_endstop_max[X_AXIS]; - #endif - break; - case Y_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_Y) - min = soft_endstop_min[Y_AXIS]; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_Y) - max = soft_endstop_max[Y_AXIS]; - #endif - break; - case Z_AXIS: - #if ENABLED(MIN_SOFTWARE_ENDSTOP_Z) - min = soft_endstop_min[Z_AXIS]; - #endif - #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z) - max = soft_endstop_max[Z_AXIS]; - #endif - default: break; - } - #endif // MIN_SOFTWARE_ENDSTOPS || MAX_SOFTWARE_ENDSTOPS - - // Delta limits XY based on the current offset from center - // This assumes the center is 0,0 - #if ENABLED(DELTA) - if (axis != Z_AXIS) { - max = SQRT(sq((float)(DELTA_PRINTABLE_RADIUS)) - sq(current_position[Y_AXIS - axis])); // (Y_AXIS - axis) == the other axis - min = -max; - } - #endif - - // Get the new position - const float diff = float((int32_t)encoderPosition) * move_menu_scale; - #if IS_KINEMATIC - manual_move_offset += diff; - if ((int32_t)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) - NOLESS(current_position[axis], min); - else - NOMORE(current_position[axis], max); - #endif - - manual_move_to_current(axis); - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - } - encoderPosition = 0; - if (lcdDrawUpdate) { - const float pos = NATIVE_TO_LOGICAL(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)); - } - } - void lcd_move_x() { _lcd_move_xyz(PSTR(MSG_MOVE_X), X_AXIS); } - void lcd_move_y() { _lcd_move_xyz(PSTR(MSG_MOVE_Y), Y_AXIS); } - void lcd_move_z() { _lcd_move_xyz(PSTR(MSG_MOVE_Z), Z_AXIS); } - void _lcd_move_e( - #if E_MANUAL > 1 - 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 IS_KINEMATIC - manual_move_offset += diff; - #else - current_position[E_AXIS] += diff; - #endif - manual_move_to_current(E_AXIS - #if E_MANUAL > 1 - , eindex - #endif - ); - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - } - encoderPosition = 0; - } - if (lcdDrawUpdate) { - PGM_P pos_label; - #if E_MANUAL == 1 - pos_label = PSTR(MSG_MOVE_E); - #else - switch (eindex) { - default: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E1); break; - case 1: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E2); break; - #if E_MANUAL > 2 - case 2: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E3); break; - #if E_MANUAL > 3 - case 3: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E4); break; - #if E_MANUAL > 4 - case 4: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E5); break; - #if E_MANUAL > 5 - case 5: pos_label = PSTR(MSG_MOVE_E MSG_MOVE_E6); break; - #endif // E_MANUAL > 5 - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - } - #endif // E_MANUAL > 1 - lcd_implementation_drawedit(pos_label, ftostr41sign(current_position[E_AXIS] - #if IS_KINEMATIC - + manual_move_offset - #endif - #if ENABLED(MANUAL_E_MOVES_RELATIVE) - - manual_move_e_origin - #endif - )); - } - } - - void lcd_move_e() { _lcd_move_e(); } - #if E_MANUAL > 1 - void lcd_move_e0() { _lcd_move_e(0); } - void lcd_move_e1() { _lcd_move_e(1); } - #if E_MANUAL > 2 - void lcd_move_e2() { _lcd_move_e(2); } - #if E_MANUAL > 3 - void lcd_move_e3() { _lcd_move_e(3); } - #if E_MANUAL > 4 - void lcd_move_e4() { _lcd_move_e(4); } - #if E_MANUAL > 5 - void lcd_move_e5() { _lcd_move_e(5); } - #endif // E_MANUAL > 5 - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - #endif // E_MANUAL > 1 - - /** - * - * "Motion" > "Move Xmm" > "Move XYZ" submenu - * - */ - - screenFunc_t _manual_move_func_ptr; - - void _goto_manual_move(const float scale) { - defer_return_to_status = true; - move_menu_scale = scale; - lcd_goto_screen(_manual_move_func_ptr); - } - void lcd_move_menu_10mm() { _goto_manual_move(10); } - void lcd_move_menu_1mm() { _goto_manual_move( 1); } - void lcd_move_menu_01mm() { _goto_manual_move( 0.1f); } - - void _lcd_move_distance_menu(const AxisEnum axis, const screenFunc_t func) { - _manual_move_func_ptr = func; - START_MENU(); - if (LCD_HEIGHT >= 4) { - switch (axis) { - case X_AXIS: - STATIC_ITEM(MSG_MOVE_X, true, true); break; - case Y_AXIS: - STATIC_ITEM(MSG_MOVE_Y, true, true); break; - case Z_AXIS: - STATIC_ITEM(MSG_MOVE_Z, true, true); break; - default: - #if ENABLED(MANUAL_E_MOVES_RELATIVE) - manual_move_e_origin = current_position[E_AXIS]; - #endif - STATIC_ITEM(MSG_MOVE_E, true, true); - break; - } - } - MENU_BACK(MSG_MOVE_AXIS); - MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm); - MENU_ITEM(submenu, MSG_MOVE_1MM, lcd_move_menu_1mm); - MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm); - END_MENU(); - } - void lcd_move_get_x_amount() { _lcd_move_distance_menu(X_AXIS, lcd_move_x); } - void lcd_move_get_y_amount() { _lcd_move_distance_menu(Y_AXIS, lcd_move_y); } - void lcd_move_get_z_amount() { _lcd_move_distance_menu(Z_AXIS, lcd_move_z); } - void lcd_move_get_e_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e); } - #if E_MANUAL > 1 - void lcd_move_get_e0_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e0); } - void lcd_move_get_e1_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e1); } - #if E_MANUAL > 2 - void lcd_move_get_e2_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e2); } - #if E_MANUAL > 3 - void lcd_move_get_e3_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e3); } - #if E_MANUAL > 4 - void lcd_move_get_e4_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e4); } - #if E_MANUAL > 5 - void lcd_move_get_e5_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e5); } - #endif // E_MANUAL > 5 - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - #endif // E_MANUAL > 1 - - /** - * - * "Motion" > "Move Axis" submenu - * - */ - - #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING) - #define _MOVE_XYZ_ALLOWED (all_axes_homed()) - #else - #define _MOVE_XYZ_ALLOWED true - #endif - - #if ENABLED(DELTA) - #define _MOVE_XY_ALLOWED (current_position[Z_AXIS] <= delta_clip_start_height) - void lcd_lower_z_to_clip_height() { - line_to_z(delta_clip_start_height); - lcd_synchronize(); - } - #else - #define _MOVE_XY_ALLOWED true - #endif - - void lcd_move_menu() { - START_MENU(); - MENU_BACK(MSG_MOTION); - - #if HAS_SOFTWARE_ENDSTOPS && ENABLED(SOFT_ENDSTOPS_MENU_ITEM) - MENU_ITEM_EDIT(bool, MSG_LCD_SOFT_ENDSTOPS, &soft_endstops_enabled); - #endif - - if (_MOVE_XYZ_ALLOWED) { - if (_MOVE_XY_ALLOWED) { - MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_get_x_amount); - MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_get_y_amount); - } - #if ENABLED(DELTA) - else - MENU_ITEM(function, MSG_FREE_XY, lcd_lower_z_to_clip_height); - #endif - - MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_get_z_amount); - } - else - MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28")); - - #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE) - - #if EXTRUDERS == 6 - switch (active_extruder) { - case 0: MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); break; - case 1: MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); break; - case 2: MENU_ITEM(gcode, MSG_SELECT " " MSG_E4, PSTR("T3")); break; - case 3: MENU_ITEM(gcode, MSG_SELECT " " MSG_E3, PSTR("T2")); break; - case 4: MENU_ITEM(gcode, MSG_SELECT " " MSG_E6, PSTR("T5")); break; - case 5: MENU_ITEM(gcode, MSG_SELECT " " MSG_E5, PSTR("T4")); break; - } - #elif EXTRUDERS == 5 || EXTRUDERS == 4 - switch (active_extruder) { - case 0: MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); break; - case 1: MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); break; - case 2: MENU_ITEM(gcode, MSG_SELECT " " MSG_E4, PSTR("T3")); break; - case 3: MENU_ITEM(gcode, MSG_SELECT " " MSG_E3, PSTR("T2")); break; - } - #elif EXTRUDERS == 3 - if (active_extruder < 2) { - if (active_extruder) - MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); - else - MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); - } - #else - if (active_extruder) - MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); - else - MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); - #endif - - #elif ENABLED(DUAL_X_CARRIAGE) - - if (active_extruder) - MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0")); - else - MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1")); - - #endif - - #if ENABLED(SWITCHING_EXTRUDER) || ENABLED(SWITCHING_NOZZLE) - - // Only the current... - MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount); - // ...and the non-switching - #if E_MANUAL == 5 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount); - #elif E_MANUAL == 3 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount); - #endif - - #else - - // Independent extruders with one E-stepper per hotend - MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount); - #if E_MANUAL > 1 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_get_e0_amount); - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_get_e1_amount); - #if E_MANUAL > 2 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount); - #if E_MANUAL > 3 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_get_e3_amount); - #if E_MANUAL > 4 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E5, lcd_move_get_e4_amount); - #if E_MANUAL > 5 - MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E6, lcd_move_get_e5_amount); - #endif // E_MANUAL > 5 - #endif // E_MANUAL > 4 - #endif // E_MANUAL > 3 - #endif // E_MANUAL > 2 - #endif // E_MANUAL > 1 - - #endif - - END_MENU(); - } - - /** - * - * "Configuration" submenu - * - */ - - #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(); - } - - #if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) - - static void lcd_init_eeprom() { - lcd_completion_feedback(settings.init_eeprom()); - lcd_goto_previous_menu(); - } - - static void lcd_init_eeprom_confirm() { - START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); - MENU_ITEM(function, MSG_INIT_EEPROM, lcd_init_eeprom); - END_MENU(); - } - - #endif - - void lcd_configuration_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - - // - // Debug Menu when certain options are enabled - // - #if HAS_DEBUG_MENU - MENU_ITEM(submenu, MSG_DEBUG_MENU, lcd_debug_menu); - #endif - - MENU_ITEM(submenu, MSG_ADVANCED_SETTINGS, lcd_advanced_settings_menu); - - const bool busy = printer_busy(); - if (!busy) { - // - // Delta Calibration - // - #if ENABLED(DELTA_CALIBRATION_MENU) || ENABLED(DELTA_AUTO_CALIBRATION) - MENU_ITEM(submenu, MSG_DELTA_CALIBRATE, lcd_delta_calibrate_menu); - #endif - - #if ENABLED(DUAL_X_CARRIAGE) - MENU_ITEM(submenu, MSG_IDEX_MENU, IDEX_menu); - #endif - - #if ENABLED(BLTOUCH) - MENU_ITEM(submenu, MSG_BLTOUCH, bltouch_menu); - #endif - } - - // - // Set single nozzle filament retract and prime length - // - #if ENABLED(SINGLENOZZLE) - MENU_ITEM(submenu, MSG_SINGLENOZZLE_TOOL_CHANGE, singlenozzle_swap_menu); - #endif - - // - // Set Case light on/off/brightness - // - #if ENABLED(MENU_ITEM_CASE_LIGHT) - if (USEABLE_HARDWARE_PWM(CASE_LIGHT_PIN)) - MENU_ITEM(submenu, MSG_CASE_LIGHT, case_light_menu); - else - MENU_ITEM_EDIT_CALLBACK(bool, MSG_CASE_LIGHT, (bool*)&case_light_on, update_case_light); - #endif - - #if HAS_LCD_CONTRAST - MENU_ITEM_EDIT_CALLBACK(int3, MSG_CONTRAST, &lcd_contrast, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX, lcd_callback_set_contrast, true); - #endif - #if ENABLED(FWRETRACT) - MENU_ITEM(submenu, MSG_RETRACT, lcd_config_retract_menu); - #endif - #if ENABLED(DAC_STEPPER_CURRENT) - MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, lcd_dac_menu); - #endif - #if HAS_MOTOR_CURRENT_PWM - MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, lcd_pwm_menu); - #endif - - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - MENU_ITEM_EDIT(bool, MSG_RUNOUT_SENSOR_ENABLE, &runout.enabled); - #endif - - #if DISABLED(SLIM_LCD_MENUS) - // Preheat configurations - MENU_ITEM(submenu, MSG_PREHEAT_1_SETTINGS, lcd_configuration_temperature_preheat_material1_settings_menu); - MENU_ITEM(submenu, MSG_PREHEAT_2_SETTINGS, lcd_configuration_temperature_preheat_material2_settings_menu); - #endif - - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - if (!busy) - MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); - #endif - - if (!busy) - MENU_ITEM(function, MSG_RESTORE_FAILSAFE, lcd_factory_settings); - - END_MENU(); - } - - /** - * - * "Temperature" submenu - * - */ - - #if ENABLED(PID_AUTOTUNE_MENU) - - #if ENABLED(PIDTEMP) - int16_t autotune_temp[HOTENDS] = ARRAY_BY_HOTENDS1(150); - #endif - - #if ENABLED(PIDTEMPBED) - int16_t autotune_temp_bed = 70; - #endif - - void _lcd_autotune(int16_t e) { - char cmd[30]; - sprintf_P(cmd, PSTR("M303 U1 E%i S%i"), e, - #if HAS_PID_FOR_BOTH - e < 0 ? autotune_temp_bed : autotune_temp[e] - #elif ENABLED(PIDTEMPBED) - autotune_temp_bed - #else - autotune_temp[e] - #endif - ); - lcd_enqueue_command(cmd); - } - - #endif // PID_AUTOTUNE_MENU - - #if ENABLED(PIDTEMP) - - // Helpers for editing PID Ki & Kd values - // grab the PID value out of the temp variable; scale it; then update the PID driver - void copy_and_scalePID_i(int16_t e) { - #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1 - UNUSED(e); - #endif - PID_PARAM(Ki, e) = scalePID_i(raw_Ki); - thermalManager.updatePID(); - } - void copy_and_scalePID_d(int16_t e) { - #if DISABLED(PID_PARAMS_PER_HOTEND) || HOTENDS == 1 - UNUSED(e); - #endif - PID_PARAM(Kd, e) = scalePID_d(raw_Kd); - thermalManager.updatePID(); - } - #define _DEFINE_PIDTEMP_BASE_FUNCS(N) \ - void copy_and_scalePID_i_E ## N() { copy_and_scalePID_i(N); } \ - void copy_and_scalePID_d_E ## N() { copy_and_scalePID_d(N); } - - #if ENABLED(PID_AUTOTUNE_MENU) - #define DEFINE_PIDTEMP_FUNCS(N) \ - _DEFINE_PIDTEMP_BASE_FUNCS(N); \ - void lcd_autotune_callback_E ## N() { _lcd_autotune(N); } typedef void _pid_##N##_void - #else - #define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N) typedef void _pid_##N##_void - #endif - - DEFINE_PIDTEMP_FUNCS(0); - #if ENABLED(PID_PARAMS_PER_HOTEND) - #if HOTENDS > 1 - DEFINE_PIDTEMP_FUNCS(1); - #if HOTENDS > 2 - DEFINE_PIDTEMP_FUNCS(2); - #if HOTENDS > 3 - DEFINE_PIDTEMP_FUNCS(3); - #if HOTENDS > 4 - DEFINE_PIDTEMP_FUNCS(4); - #if HOTENDS > 5 - DEFINE_PIDTEMP_FUNCS(5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - #endif // PID_PARAMS_PER_HOTEND - - #endif // PIDTEMP - - /** - * - * "Temperature" submenu - * - */ - void lcd_temperature_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - - // - // Nozzle: - // Nozzle [1-5]: - // - #if HOTENDS == 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - #else // HOTENDS > 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N1, &thermalManager.target_temperature[0], 0, HEATER_0_MAXTEMP - 15, watch_temp_callback_E0); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N2, &thermalManager.target_temperature[1], 0, HEATER_1_MAXTEMP - 15, watch_temp_callback_E1); - #if HOTENDS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N3, &thermalManager.target_temperature[2], 0, HEATER_2_MAXTEMP - 15, watch_temp_callback_E2); - #if HOTENDS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N4, &thermalManager.target_temperature[3], 0, HEATER_3_MAXTEMP - 15, watch_temp_callback_E3); - #if HOTENDS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N5, &thermalManager.target_temperature[4], 0, HEATER_4_MAXTEMP - 15, watch_temp_callback_E4); - #if HOTENDS > 5 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_NOZZLE MSG_N6, &thermalManager.target_temperature[5], 0, HEATER_5_MAXTEMP - 15, watch_temp_callback_E5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #endif // HOTENDS > 1 - - // - // Bed: - // - #if HAS_HEATED_BED - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_BED, &thermalManager.target_temperature_bed, 0, BED_MAXTEMP - 15, watch_temp_callback_bed); - #endif - - // - // Fan Speed: - // - #if FAN_COUNT > 0 - #if (HAS_FAN0 && FAN_NUM_AS_LASER!=0) - MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &fan_speed[0], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &new_fan_speed[0], 3, 255); - #endif - #endif - #if (HAS_FAN1 && FAN_NUM_AS_LASER!=1) - MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED " 2", &fan_speed[1], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 2", &new_fan_speed[1], 3, 255); - #endif - #endif - #if (HAS_FAN2 && FAN_NUM_AS_LASER!=2) - MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_FAN_SPEED " 3", &fan_speed[2], 0, 255); - #if ENABLED(EXTRA_FAN_SPEED) - MENU_MULTIPLIER_ITEM_EDIT(int8, MSG_EXTRA_FAN_SPEED " 3", &new_fan_speed[2], 3, 255); - #endif - #endif - #endif // FAN_COUNT > 0 - - // - // Laser ON/OFF: - // - #if ENABLED(FAN_AS_LASER) - MENU_ITEM(gcode, MSG_LASER_ON, PSTR(" M3 ")); - MENU_ITEM(gcode, MSG_LASER_OFF, PSTR(" M5 ")); - #endif - - #if HAS_TEMP_HOTEND - - // - // Cooldown - // - bool has_heat = false; - HOTEND_LOOP() if (thermalManager.target_temperature[HOTEND_INDEX]) { has_heat = true; break; } - #if HAS_TEMP_BED - if (thermalManager.target_temperature_bed) has_heat = true; - #endif - if (has_heat) MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown); - - // - // Preheat for Material 1 and 2 - // - #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || HAS_HEATED_BED - MENU_ITEM(submenu, MSG_PREHEAT_1, lcd_preheat_m1_menu); - MENU_ITEM(submenu, MSG_PREHEAT_2, lcd_preheat_m2_menu); - #else - MENU_ITEM(function, MSG_PREHEAT_1, lcd_preheat_m1_e0_only); - MENU_ITEM(function, MSG_PREHEAT_2, lcd_preheat_m2_e0_only); - #endif - - #endif // HAS_TEMP_HOTEND - - END_MENU(); - } - - /** - * - * "Advanced Settings" -> "Temperature" submenu - * - */ - void lcd_advanced_temperature_menu() { - START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); - // - // Autotemp, Min, Max, Fact - // - #if ENABLED(AUTOTEMP) && HAS_TEMP_HOTEND - MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &planner.autotemp_enabled); - MENU_ITEM_EDIT(float3, MSG_MIN, &planner.autotemp_min, 0, float(HEATER_0_MAXTEMP) - 15); - MENU_ITEM_EDIT(float3, MSG_MAX, &planner.autotemp_max, 0, float(HEATER_0_MAXTEMP) - 15); - MENU_ITEM_EDIT(float52, MSG_FACTOR, &planner.autotemp_factor, 0, 1); - #endif - - // - // PID-P, PID-I, PID-D, PID-C, PID Autotune - // PID-P E1, PID-I E1, PID-D E1, PID-C E1, PID Autotune E1 - // PID-P E2, PID-I E2, PID-D E2, PID-C E2, PID Autotune E2 - // PID-P E3, PID-I E3, PID-D E3, PID-C E3, PID Autotune E3 - // PID-P E4, PID-I E4, PID-D E4, PID-C E4, PID Autotune E4 - // PID-P E5, PID-I E5, PID-D E5, PID-C E5, PID Autotune E5 - // - #if ENABLED(PIDTEMP) - - #define _PID_BASE_MENU_ITEMS(ELABEL, eindex) \ - raw_Ki = unscalePID_i(PID_PARAM(Ki, eindex)); \ - raw_Kd = unscalePID_d(PID_PARAM(Kd, eindex)); \ - MENU_ITEM_EDIT(float52sign, MSG_PID_P ELABEL, &PID_PARAM(Kp, eindex), 1, 9990); \ - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_I ELABEL, &raw_Ki, 0.01f, 9990, copy_and_scalePID_i_E ## eindex); \ - MENU_ITEM_EDIT_CALLBACK(float52sign, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex) - - #if ENABLED(PID_EXTRUSION_SCALING) - #define _PID_MENU_ITEMS(ELABEL, eindex) \ - _PID_BASE_MENU_ITEMS(ELABEL, eindex); \ - MENU_ITEM_EDIT(float3, MSG_PID_C ELABEL, &PID_PARAM(Kc, eindex), 1, 9990) - #else - #define _PID_MENU_ITEMS(ELABEL, eindex) _PID_BASE_MENU_ITEMS(ELABEL, eindex) - #endif - - #if ENABLED(PID_AUTOTUNE_MENU) - #define PID_MENU_ITEMS(ELABEL, eindex) \ - _PID_MENU_ITEMS(ELABEL, eindex); \ - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PID_AUTOTUNE ELABEL, &autotune_temp[eindex], 150, heater_maxtemp[eindex] - 15, lcd_autotune_callback_E ## eindex) - #else - #define PID_MENU_ITEMS(ELABEL, eindex) _PID_MENU_ITEMS(ELABEL, eindex) - #endif - - #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1 - PID_MENU_ITEMS(" " MSG_E1, 0); - PID_MENU_ITEMS(" " MSG_E2, 1); - #if HOTENDS > 2 - PID_MENU_ITEMS(" " MSG_E3, 2); - #if HOTENDS > 3 - PID_MENU_ITEMS(" " MSG_E4, 3); - #if HOTENDS > 4 - PID_MENU_ITEMS(" " MSG_E5, 4); - #if HOTENDS > 5 - PID_MENU_ITEMS(" " MSG_E6, 5); - #endif // HOTENDS > 5 - #endif // HOTENDS > 4 - #endif // HOTENDS > 3 - #endif // HOTENDS > 2 - #else // !PID_PARAMS_PER_HOTEND || HOTENDS == 1 - PID_MENU_ITEMS("", 0); - #endif // !PID_PARAMS_PER_HOTEND || HOTENDS == 1 - - #endif // PIDTEMP - - END_MENU(); - } - - #if DISABLED(SLIM_LCD_MENUS) - - void _lcd_configuration_temperature_preheat_settings_menu(const uint8_t material) { - #if HOTENDS > 5 - #define MINTEMP_ALL MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP, HEATER_4_MINTEMP, HEATER_5_MINTEMP) - #define MAXTEMP_ALL MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP) - #elif HOTENDS > 4 - #define MINTEMP_ALL MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP, HEATER_4_MINTEMP) - #define MAXTEMP_ALL MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP) - #elif HOTENDS > 3 - #define MINTEMP_ALL MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP, HEATER_3_MINTEMP) - #define MAXTEMP_ALL MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP) - #elif HOTENDS > 2 - #define MINTEMP_ALL MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP, HEATER_2_MINTEMP) - #define MAXTEMP_ALL MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP) - #elif HOTENDS > 1 - #define MINTEMP_ALL MIN(HEATER_0_MINTEMP, HEATER_1_MINTEMP) - #define MAXTEMP_ALL MAX(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP) - #else - #define MINTEMP_ALL HEATER_0_MINTEMP - #define MAXTEMP_ALL HEATER_0_MAXTEMP - #endif - START_MENU(); - MENU_BACK(MSG_CONFIGURATION); - MENU_ITEM_EDIT(int8, MSG_FAN_SPEED, &lcd_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); - #endif - #if HAS_HEATED_BED - MENU_ITEM_EDIT(int3, MSG_BED, &lcd_preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 15); - #endif - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); - #endif - END_MENU(); - } - - /** - * - * "Temperature" > "Preheat Material 1 conf" submenu - * - */ - void lcd_configuration_temperature_preheat_material1_settings_menu() { _lcd_configuration_temperature_preheat_settings_menu(0); } - - /** - * - * "Temperature" > "Preheat Material 2 conf" submenu - * - */ - void lcd_configuration_temperature_preheat_material2_settings_menu() { _lcd_configuration_temperature_preheat_settings_menu(1); } - - void _reset_acceleration_rates() { planner.reset_acceleration_rates(); } - #if ENABLED(DISTINCT_E_FACTORS) - void _reset_e_acceleration_rate(const uint8_t e) { if (e == active_extruder) _reset_acceleration_rates(); } - void _reset_e0_acceleration_rate() { _reset_e_acceleration_rate(0); } - void _reset_e1_acceleration_rate() { _reset_e_acceleration_rate(1); } - #if E_STEPPERS > 2 - void _reset_e2_acceleration_rate() { _reset_e_acceleration_rate(2); } - #if E_STEPPERS > 3 - void _reset_e3_acceleration_rate() { _reset_e_acceleration_rate(3); } - #if E_STEPPERS > 4 - void _reset_e4_acceleration_rate() { _reset_e_acceleration_rate(4); } - #if E_STEPPERS > 5 - void _reset_e5_acceleration_rate() { _reset_e_acceleration_rate(5); } - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif - - void _planner_refresh_positioning() { planner.refresh_positioning(); } - #if ENABLED(DISTINCT_E_FACTORS) - void _planner_refresh_e_positioning(const uint8_t e) { - if (e == active_extruder) - _planner_refresh_positioning(); - else - planner.steps_to_mm[E_AXIS + e] = 1.0f / planner.settings.axis_steps_per_mm[E_AXIS + e]; - } - void _planner_refresh_e0_positioning() { _planner_refresh_e_positioning(0); } - void _planner_refresh_e1_positioning() { _planner_refresh_e_positioning(1); } - #if E_STEPPERS > 2 - void _planner_refresh_e2_positioning() { _planner_refresh_e_positioning(2); } - #if E_STEPPERS > 3 - void _planner_refresh_e3_positioning() { _planner_refresh_e_positioning(3); } - #if E_STEPPERS > 4 - void _planner_refresh_e4_positioning() { _planner_refresh_e_positioning(4); } - #if E_STEPPERS > 5 - void _planner_refresh_e5_positioning() { _planner_refresh_e_positioning(5); } - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif - - // M203 / M205 Velocity options - void lcd_advanced_velocity_menu() { - START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); - - // M203 Max Feedrate - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_A, &planner.settings.max_feedrate_mm_s[A_AXIS], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_B, &planner.settings.max_feedrate_mm_s[B_AXIS], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_C, &planner.settings.max_feedrate_mm_s[C_AXIS], 1, 999); - - #if ENABLED(DISTINCT_E_FACTORS) - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.settings.max_feedrate_mm_s[E_AXIS + active_extruder], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E1, &planner.settings.max_feedrate_mm_s[E_AXIS], 1, 999); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E2, &planner.settings.max_feedrate_mm_s[E_AXIS + 1], 1, 999); - #if E_STEPPERS > 2 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E3, &planner.settings.max_feedrate_mm_s[E_AXIS + 2], 1, 999); - #if E_STEPPERS > 3 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E4, &planner.settings.max_feedrate_mm_s[E_AXIS + 3], 1, 999); - #if E_STEPPERS > 4 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E5, &planner.settings.max_feedrate_mm_s[E_AXIS + 4], 1, 999); - #if E_STEPPERS > 5 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E6, &planner.settings.max_feedrate_mm_s[E_AXIS + 5], 1, 999); - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #else - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.settings.max_feedrate_mm_s[E_AXIS], 1, 999); - #endif - - // M205 S Min Feedrate - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VMIN, &planner.settings.min_feedrate_mm_s, 0, 999); - - // M205 T Min Travel Feedrate - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.settings.min_travel_feedrate_mm_s, 0, 999); - - END_MENU(); - } - - // M201 / M204 Accelerations - void lcd_advanced_acceleration_menu() { - START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); - - // M204 P Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_ACC, &planner.settings.acceleration, 10, 99000); - - // M204 R Retract Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.settings.retract_acceleration, 100, 99000); - - // M204 T Travel Acceleration - MENU_MULTIPLIER_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.settings.travel_acceleration, 100, 99000); - - // M201 settings - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_A, &planner.settings.max_acceleration_mm_per_s2[A_AXIS], 100, 99000, _reset_acceleration_rates); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_B, &planner.settings.max_acceleration_mm_per_s2[B_AXIS], 100, 99000, _reset_acceleration_rates); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_C, &planner.settings.max_acceleration_mm_per_s2[C_AXIS], 10, 99000, _reset_acceleration_rates); - - #if ENABLED(DISTINCT_E_FACTORS) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS + active_extruder], 100, 99000, _reset_acceleration_rates); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E1, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_e0_acceleration_rate); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E2, &planner.settings.max_acceleration_mm_per_s2[E_AXIS + 1], 100, 99000, _reset_e1_acceleration_rate); - #if E_STEPPERS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E3, &planner.settings.max_acceleration_mm_per_s2[E_AXIS + 2], 100, 99000, _reset_e2_acceleration_rate); - #if E_STEPPERS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E4, &planner.settings.max_acceleration_mm_per_s2[E_AXIS + 3], 100, 99000, _reset_e3_acceleration_rate); - #if E_STEPPERS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E5, &planner.settings.max_acceleration_mm_per_s2[E_AXIS + 4], 100, 99000, _reset_e4_acceleration_rate); - #if E_STEPPERS > 5 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E6, &planner.settings.max_acceleration_mm_per_s2[E_AXIS + 5], 100, 99000, _reset_e5_acceleration_rate); - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #else - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.settings.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates); - #endif - - END_MENU(); - } - - // M205 Jerk - void lcd_advanced_jerk_menu() { - START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); - - #if ENABLED(JUNCTION_DEVIATION) - #if ENABLED(LIN_ADVANCE) - MENU_ITEM_EDIT_CALLBACK(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.01f, 0.3f, planner.recalculate_max_e_jerk); - #else - MENU_ITEM_EDIT(float43, MSG_JUNCTION_DEVIATION, &planner.junction_deviation_mm, 0.01f, 0.3f); - #endif - #endif - #if HAS_CLASSIC_JERK - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VA_JERK, &planner.max_jerk[A_AXIS], 1, 990); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VB_JERK, &planner.max_jerk[B_AXIS], 1, 990); - #if ENABLED(DELTA) - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 1, 990); - #else - MENU_MULTIPLIER_ITEM_EDIT(float52sign, MSG_VC_JERK, &planner.max_jerk[C_AXIS], 0.1f, 990); - #endif - #if DISABLED(JUNCTION_DEVIATION) || DISABLED(LIN_ADVANCE) - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_VE_JERK, &planner.max_jerk[E_AXIS], 1, 990); - #endif - #endif - - END_MENU(); - } - - // M92 Steps-per-mm - void lcd_advanced_steps_per_mm_menu() { - START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); - - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ASTEPS, &planner.settings.axis_steps_per_mm[A_AXIS], 5, 9999, _planner_refresh_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_BSTEPS, &planner.settings.axis_steps_per_mm[B_AXIS], 5, 9999, _planner_refresh_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_CSTEPS, &planner.settings.axis_steps_per_mm[C_AXIS], 5, 9999, _planner_refresh_positioning); - - #if ENABLED(DISTINCT_E_FACTORS) - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.settings.axis_steps_per_mm[E_AXIS + active_extruder], 5, 9999, _planner_refresh_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E1STEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_e0_positioning); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E2STEPS, &planner.settings.axis_steps_per_mm[E_AXIS + 1], 5, 9999, _planner_refresh_e1_positioning); - #if E_STEPPERS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E3STEPS, &planner.settings.axis_steps_per_mm[E_AXIS + 2], 5, 9999, _planner_refresh_e2_positioning); - #if E_STEPPERS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E4STEPS, &planner.settings.axis_steps_per_mm[E_AXIS + 3], 5, 9999, _planner_refresh_e3_positioning); - #if E_STEPPERS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E5STEPS, &planner.settings.axis_steps_per_mm[E_AXIS + 4], 5, 9999, _planner_refresh_e4_positioning); - #if E_STEPPERS > 5 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_E6STEPS, &planner.settings.axis_steps_per_mm[E_AXIS + 5], 5, 9999, _planner_refresh_e5_positioning); - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #else - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_ESTEPS, &planner.settings.axis_steps_per_mm[E_AXIS], 5, 9999, _planner_refresh_positioning); - #endif - - END_MENU(); - } - - #endif // !SLIM_LCD_MENUS - - /** - * - * "Advanced Settings" submenu - * - */ - - #if HAS_M206_COMMAND - /** - * Set the home offset based on the current_position - */ - void lcd_set_home_offsets() { - // M428 Command - enqueue_and_echo_commands_P(PSTR("M428")); - lcd_return_to_status(); - } - #endif - - #if ENABLED(SD_FIRMWARE_UPDATE) - /** - * Toggle the SD Firmware Update state in EEPROM - */ - 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(); - } - #endif - - void lcd_advanced_settings_menu() { - START_MENU(); - MENU_BACK(MSG_CONFIGURATION); - - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); - #elif HAS_BED_PROBE - MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); - #endif - - #if DISABLED(SLIM_LCD_MENUS) - - #if HAS_M206_COMMAND - // - // Set Home Offsets - // - MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets); - #endif - - // M203 / M205 - Feedrate items - MENU_ITEM(submenu, MSG_VELOCITY, lcd_advanced_velocity_menu); - - // M201 - Acceleration items - MENU_ITEM(submenu, MSG_ACCELERATION, lcd_advanced_acceleration_menu); - - // M205 - Max Jerk - MENU_ITEM(submenu, MSG_JERK, lcd_advanced_jerk_menu); - - if (!printer_busy) { - // M92 - Steps Per mm - MENU_ITEM(submenu, MSG_STEPS_PER_MM, lcd_advanced_steps_per_mm_menu); - } - - #endif // !SLIM_LCD_MENUS - - MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_advanced_temperature_menu); - - #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - MENU_ITEM(submenu, MSG_FILAMENT, lcd_advanced_filament_menu); - #elif ENABLED(LIN_ADVANCE) - #if EXTRUDERS == 1 - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); - #elif EXTRUDERS > 1 - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E1, &planner.extruder_advance_K[0], 0, 999); - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E2, &planner.extruder_advance_K[1], 0, 999); - #if EXTRUDERS > 2 - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E3, &planner.extruder_advance_K[2], 0, 999); - #if EXTRUDERS > 3 - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E4, &planner.extruder_advance_K[3], 0, 999); - #if EXTRUDERS > 4 - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E5, &planner.extruder_advance_K[4], 0, 999); - #if EXTRUDERS > 5 - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E6, &planner.extruder_advance_K[5], 0, 999); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - #endif - - // M540 S - Abort on endstop hit when SD printing - #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) - MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &planner.abort_on_endstop_hit); - #endif - - // - // BLTouch Self-Test and Reset - // - #if ENABLED(BLTOUCH) - MENU_ITEM(gcode, MSG_BLTOUCH_SELFTEST, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_SELFTEST))); - if (!endstops.z_probe_enabled && TEST_BLTOUCH()) - MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET))); - #endif - - #if ENABLED(SD_FIRMWARE_UPDATE) - bool sd_update_state = settings.sd_update_status(); - MENU_ITEM_EDIT_CALLBACK(bool, MSG_SD_UPDATE, &sd_update_state, _lcd_toggle_sd_update); - #endif - - #if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) - MENU_ITEM(submenu, MSG_INIT_EEPROM, lcd_init_eeprom_confirm); - #endif - - END_MENU(); - } - - #if DISABLED(NO_VOLUMETRICS) || ENABLED(ADVANCED_PAUSE_FEATURE) - /** - * - * "Advanced Settings" > "Filament" submenu - * - */ - void lcd_advanced_filament_menu() { - START_MENU(); - MENU_BACK(MSG_ADVANCED_SETTINGS); - - #if ENABLED(LIN_ADVANCE) - #if EXTRUDERS == 1 - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 999); - #elif EXTRUDERS > 1 - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E1, &planner.extruder_advance_K[0], 0, 999); - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E2, &planner.extruder_advance_K[1], 0, 999); - #if EXTRUDERS > 2 - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E3, &planner.extruder_advance_K[2], 0, 999); - #if EXTRUDERS > 3 - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E4, &planner.extruder_advance_K[3], 0, 999); - #if EXTRUDERS > 4 - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E5, &planner.extruder_advance_K[4], 0, 999); - #if EXTRUDERS > 5 - MENU_ITEM_EDIT(float52, MSG_ADVANCE_K MSG_E6, &planner.extruder_advance_K[5], 0, 999); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - #endif - - #if DISABLED(NO_VOLUMETRICS) - MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &parser.volumetric_enabled, planner.calculate_volumetric_multipliers); - - if (parser.volumetric_enabled) { - #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[0], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E1, &planner.filament_size[0], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E2, &planner.filament_size[1], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E3, &planner.filament_size[2], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E4, &planner.filament_size[3], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E5, &planner.filament_size[4], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #if EXTRUDERS > 5 - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float43, MSG_FILAMENT_DIAM MSG_DIAM_E6, &planner.filament_size[5], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - } - #endif - - #if ENABLED(ADVANCED_PAUSE_FEATURE) - const float extrude_maxlength = - #if ENABLED(PREVENT_LENGTHY_EXTRUDE) - EXTRUDE_MAXLENGTH - #else - 999 - #endif - ; - - #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &fc_settings[0].unload_length, 0, extrude_maxlength); - #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E1, &fc_settings[0].unload_length, 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E2, &fc_settings[1].unload_length, 0, extrude_maxlength); - #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E3, &fc_settings[2].unload_length, 0, extrude_maxlength); - #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E4, &fc_settings[3].unload_length, 0, extrude_maxlength); - #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E5, &fc_settings[4].unload_length, 0, extrude_maxlength); - #if EXTRUDERS > 5 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_UNLOAD MSG_DIAM_E6, &fc_settings[5].unload_length, 0, extrude_maxlength); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - - #if EXTRUDERS == 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &fc_settings[0].load_length, 0, extrude_maxlength); - #else // EXTRUDERS > 1 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E1, &fc_settings[0].load_length, 0, extrude_maxlength); - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E2, &fc_settings[1].load_length, 0, extrude_maxlength); - #if EXTRUDERS > 2 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E3, &fc_settings[2].load_length, 0, extrude_maxlength); - #if EXTRUDERS > 3 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E4, &fc_settings[3].load_length, 0, extrude_maxlength); - #if EXTRUDERS > 4 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E5, &fc_settings[4].load_length, 0, extrude_maxlength); - #if EXTRUDERS > 5 - MENU_MULTIPLIER_ITEM_EDIT(float3, MSG_FILAMENT_LOAD MSG_DIAM_E6, &fc_settings[5].load_length, 0, extrude_maxlength); - #endif // EXTRUDERS > 5 - #endif // EXTRUDERS > 4 - #endif // EXTRUDERS > 3 - #endif // EXTRUDERS > 2 - #endif // EXTRUDERS > 1 - #endif - - END_MENU(); - } - #endif // !NO_VOLUMETRICS || ADVANCED_PAUSE_FEATURE - - /** - * - * "Configuration" > "Retract" submenu - * - */ - #if ENABLED(FWRETRACT) - - void lcd_config_retract_menu() { - START_MENU(); - MENU_BACK(MSG_CONTROL); - #if ENABLED(FWRETRACT_AUTORETRACT) - MENU_ITEM_EDIT_CALLBACK(bool, MSG_AUTORETRACT, &fwretract.autoretract_enabled, fwretract.refresh_autoretract); - #endif - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT, &fwretract.settings.retract_length, 0, 100); - #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_SWAP, &fwretract.settings.swap_retract_length, 0, 100); - #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACTF, &fwretract.settings.retract_feedrate_mm_s, 1, 999); - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_ZLIFT, &fwretract.settings.retract_zlift, 0, 999); - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_RECOVER, &fwretract.settings.retract_recover_length, -100, 100); - #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float52sign, MSG_CONTROL_RETRACT_RECOVER_SWAP, &fwretract.settings.swap_retract_recover_length, -100, 100); - #endif - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVERF, &fwretract.settings.retract_recover_feedrate_mm_s, 1, 999); - #if EXTRUDERS > 1 - MENU_ITEM_EDIT(float3, MSG_CONTROL_RETRACT_RECOVER_SWAPF, &fwretract.settings.swap_retract_recover_feedrate_mm_s, 1, 999); - #endif - END_MENU(); - } - - #endif // FWRETRACT - - #if ENABLED(SDSUPPORT) - - #if !PIN_EXISTS(SD_DETECT) - void lcd_sd_refresh() { - card.initsd(); - encoderTopLine = 0; - } - #endif - - void lcd_sd_updir() { - encoderPosition = card.updir() ? ENCODER_STEPS_PER_MENU_ITEM : 0; - encoderTopLine = 0; - screen_changed = true; - lcd_refresh(); - } - - /** - * - * "Print from SD" submenu - * - */ - - #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - uint32_t last_sdfile_encoderPosition = 0xFFFF; - - void lcd_reselect_last_file() { - if (last_sdfile_encoderPosition == 0xFFFF) return; - #if ENABLED(DOGLCD) - // 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 - - lcd_goto_screen(lcd_sdcard_menu, last_sdfile_encoderPosition); - defer_return_to_status = true; - last_sdfile_encoderPosition = 0xFFFF; - - #if ENABLED(DOGLCD) - lcd_update(); - #endif - } - #endif - - void lcd_sdcard_menu() { - ENCODER_DIRECTION_MENUS(); - - const uint16_t fileCnt = card.get_num_Files(); - - START_MENU(); - MENU_BACK(MSG_MAIN); - card.getWorkDirName(); - if (card.filename[0] == '/') { - #if !PIN_EXISTS(SD_DETECT) - MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh); - #endif - } - else { - MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir); - } - - for (uint16_t i = 0; i < fileCnt; i++) { - if (_menuLineNr == _thisItemNr) { - const uint16_t nr = - #if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA) - fileCnt - 1 - - #endif - i; - - #if ENABLED(SDCARD_SORT_ALPHA) - card.getfilename_sorted(nr); - #else - card.getfilename(nr); - #endif - - if (card.filenameIsDir) - MENU_ITEM(sddirectory, MSG_CARD_MENU, card); - else - MENU_ITEM(sdfile, MSG_CARD_MENU, card); - } - else { - MENU_ITEM_DUMMY(); - } - } - END_MENU(); - } - - #endif // SDSUPPORT - - #if ENABLED(LCD_INFO_MENU) - - #if ENABLED(PRINTCOUNTER) - /** - * - * About Printer > Statistics submenu - * - */ - void lcd_info_stats_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } - - char buffer[21]; - printStatistics stats = print_job_timer.getStats(); - - START_SCREEN(); // 12345678901234567890 - STATIC_ITEM(MSG_INFO_PRINT_COUNT ": ", false, false, itostr3left(stats.totalPrints)); // Print Count: 999 - STATIC_ITEM(MSG_INFO_COMPLETED_PRINTS": ", false, false, itostr3left(stats.finishedPrints)); // Completed : 666 - - duration_t elapsed = stats.printTime; - elapsed.toString(buffer); - - STATIC_ITEM(MSG_INFO_PRINT_TIME ": ", false, false); // Total print Time: - STATIC_ITEM("", false, false, buffer); // 99y 364d 23h 59m 59s - - elapsed = stats.longestPrint; - elapsed.toString(buffer); - - STATIC_ITEM(MSG_INFO_PRINT_LONGEST ": ", false, false); // Longest job time: - STATIC_ITEM("", false, false, buffer); // 99y 364d 23h 59m 59s - - sprintf_P(buffer, PSTR("%ld.%im"), long(stats.filamentUsed / 1000), int16_t(stats.filamentUsed / 100) % 10); - STATIC_ITEM(MSG_INFO_PRINT_FILAMENT ": ", false, false); // Extruded total: - STATIC_ITEM("", false, false, buffer); // 125m - END_SCREEN(); - } - #endif // PRINTCOUNTER - - /** - * - * About Printer > Thermistors - * - */ - void lcd_info_thermistors_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } - START_SCREEN(); - #define THERMISTOR_ID TEMP_SENSOR_0 - #include "thermistornames.h" - STATIC_ITEM("T0: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_0_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_0_MAXTEMP), false); - - #if TEMP_SENSOR_1 != 0 - #undef THERMISTOR_ID - #define THERMISTOR_ID TEMP_SENSOR_1 - #include "thermistornames.h" - STATIC_ITEM("T1: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_1_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_1_MAXTEMP), false); - #endif - - #if TEMP_SENSOR_2 != 0 - #undef THERMISTOR_ID - #define THERMISTOR_ID TEMP_SENSOR_2 - #include "thermistornames.h" - STATIC_ITEM("T2: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_2_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_2_MAXTEMP), false); - #endif - - #if TEMP_SENSOR_3 != 0 - #undef THERMISTOR_ID - #define THERMISTOR_ID TEMP_SENSOR_3 - #include "thermistornames.h" - STATIC_ITEM("T3: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_3_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_3_MAXTEMP), false); - #endif - - #if TEMP_SENSOR_4 != 0 - #undef THERMISTOR_ID - #define THERMISTOR_ID TEMP_SENSOR_4 - #include "thermistornames.h" - STATIC_ITEM("T4: " THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(HEATER_4_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(HEATER_4_MAXTEMP), false); - #endif - - #if HAS_HEATED_BED - #undef THERMISTOR_ID - #define THERMISTOR_ID TEMP_SENSOR_BED - #include "thermistornames.h" - STATIC_ITEM("TBed:" THERMISTOR_NAME, false, true); - STATIC_ITEM(MSG_INFO_MIN_TEMP ": " STRINGIFY(BED_MINTEMP), false); - STATIC_ITEM(MSG_INFO_MAX_TEMP ": " STRINGIFY(BED_MAXTEMP), false); - #endif - END_SCREEN(); - } - - /** - * - * About Printer > Board Info - * - */ - void lcd_info_board_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } - START_SCREEN(); - STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController - STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000 - STATIC_ITEM(MSG_INFO_PROTOCOL ": " PROTOCOL_VERSION, true); // Protocol: 1.0 - #if POWER_SUPPLY == 0 - STATIC_ITEM(MSG_INFO_PSU ": Generic", true); - #elif POWER_SUPPLY == 1 - STATIC_ITEM(MSG_INFO_PSU ": ATX", true); // Power Supply: ATX - #elif POWER_SUPPLY == 2 - STATIC_ITEM(MSG_INFO_PSU ": XBox", true); // Power Supply: XBox - #endif - END_SCREEN(); - } - - /** - * - * About Printer > Printer Info - * - */ - void lcd_info_printer_menu() { - if (use_click()) { return lcd_goto_previous_menu(); } - START_SCREEN(); - STATIC_ITEM(MSG_MARLIN, true, true); // Marlin - STATIC_ITEM(SHORT_BUILD_VERSION, true); // x.x.x-Branch - STATIC_ITEM(STRING_DISTRIBUTION_DATE, true); // YYYY-MM-DD HH:MM - STATIC_ITEM(MACHINE_NAME, true); // My3DPrinter - STATIC_ITEM(WEBSITE_URL, true); // www.my3dprinter.com - STATIC_ITEM(MSG_INFO_EXTRUDERS ": " STRINGIFY(EXTRUDERS), true); // Extruders: 2 - #if ENABLED(AUTO_BED_LEVELING_3POINT) - STATIC_ITEM(MSG_3POINT_LEVELING, true); // 3-Point Leveling - #elif ENABLED(AUTO_BED_LEVELING_LINEAR) - STATIC_ITEM(MSG_LINEAR_LEVELING, true); // Linear Leveling - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - STATIC_ITEM(MSG_BILINEAR_LEVELING, true); // Bi-linear Leveling - #elif ENABLED(AUTO_BED_LEVELING_UBL) - STATIC_ITEM(MSG_UBL_LEVELING, true); // Unified Bed Leveling - #elif ENABLED(MESH_BED_LEVELING) - STATIC_ITEM(MSG_MESH_LEVELING, true); // Mesh Leveling - #endif - END_SCREEN(); - } - - /** - * - * "About Printer" submenu - * - */ - void lcd_info_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - MENU_ITEM(submenu, MSG_INFO_PRINTER_MENU, lcd_info_printer_menu); // Printer Info > - MENU_ITEM(submenu, MSG_INFO_BOARD_MENU, lcd_info_board_menu); // Board Info > - MENU_ITEM(submenu, MSG_INFO_THERMISTOR_MENU, lcd_info_thermistors_menu); // Thermistors > - #if ENABLED(PRINTCOUNTER) - MENU_ITEM(submenu, MSG_INFO_STATS_MENU, lcd_info_stats_menu); // Printer Statistics > - #endif - END_MENU(); - } - #endif // LCD_INFO_MENU - - /** - * - * LED Menu - * - */ - - #if ENABLED(LED_CONTROL_MENU) - - #if ENABLED(LED_COLOR_PRESETS) - - void lcd_led_presets_menu() { - START_MENU(); - #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_LED_PRESETS, true, true); - #endif - MENU_BACK(MSG_LED_CONTROL); - MENU_ITEM(function, MSG_SET_LEDS_WHITE, leds.set_white); - MENU_ITEM(function, MSG_SET_LEDS_RED, leds.set_red); - MENU_ITEM(function, MSG_SET_LEDS_ORANGE, leds.set_orange); - MENU_ITEM(function, MSG_SET_LEDS_YELLOW,leds.set_yellow); - MENU_ITEM(function, MSG_SET_LEDS_GREEN, leds.set_green); - MENU_ITEM(function, MSG_SET_LEDS_BLUE, leds.set_blue); - MENU_ITEM(function, MSG_SET_LEDS_INDIGO, leds.set_indigo); - MENU_ITEM(function, MSG_SET_LEDS_VIOLET, leds.set_violet); - END_MENU(); - } - #endif // LED_COLOR_PRESETS - - void lcd_led_custom_menu() { - START_MENU(); - MENU_BACK(MSG_LED_CONTROL); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_R, &leds.color.r, 0, 255, leds.update, true); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_G, &leds.color.g, 0, 255, leds.update, true); - MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_B, &leds.color.b, 0, 255, leds.update, true); - #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED) - MENU_ITEM_EDIT_CALLBACK(int8, MSG_INTENSITY_W, &leds.color.w, 0, 255, leds.update, true); - #if ENABLED(NEOPIXEL_LED) - MENU_ITEM_EDIT_CALLBACK(int8, MSG_LED_BRIGHTNESS, &leds.color.i, 0, 255, leds.update, true); - #endif - #endif - END_MENU(); - } - - void lcd_led_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - bool led_on = leds.lights_on; - MENU_ITEM_EDIT_CALLBACK(bool, MSG_LEDS, &led_on, leds.toggle); - MENU_ITEM(function, MSG_SET_LEDS_DEFAULT, leds.set_default); - #if ENABLED(LED_COLOR_PRESETS) - MENU_ITEM(submenu, MSG_LED_PRESETS, lcd_led_presets_menu); - #endif - MENU_ITEM(submenu, MSG_CUSTOM_LEDS, lcd_led_custom_menu); - END_MENU(); - } - - #endif // LED_CONTROL_MENU - - /** - * - * Filament Change Feature Screens - * - */ - #if ENABLED(ADVANCED_PAUSE_FEATURE) - - /** - * - * "Change Filament" > "Change/Unload/Load Filament" submenu - * - */ - static AdvancedPauseMode _change_filament_temp_mode; - static int8_t _change_filament_temp_extruder; - - static PGM_P _change_filament_temp_command() { - switch (_change_filament_temp_mode) { - case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: - return PSTR("M701 T%d"); - case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: - return _change_filament_temp_extruder >= 0 ? PSTR("M702 T%d") : PSTR("M702 ;%d"); - case ADVANCED_PAUSE_MODE_PAUSE_PRINT: - default: - return PSTR("M600 B0 T%d"); - } - return PSTR(MSG_FILAMENTCHANGE); - } - - void _change_filament_temp(const uint16_t temperature) { - char cmd[11]; - sprintf_P(cmd, _change_filament_temp_command(), _change_filament_temp_extruder); - thermalManager.setTargetHotend(temperature, _change_filament_temp_extruder); - lcd_enqueue_command(cmd); - } - void _lcd_change_filament_temp_1_menu() { _change_filament_temp(PREHEAT_1_TEMP_HOTEND); } - void _lcd_change_filament_temp_2_menu() { _change_filament_temp(PREHEAT_2_TEMP_HOTEND); } - void _lcd_change_filament_temp_custom_menu() { _change_filament_temp(thermalManager.target_temperature[_change_filament_temp_extruder]); } - - static PGM_P change_filament_header(const AdvancedPauseMode mode) { - switch (mode) { - case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: - return PSTR(MSG_FILAMENTLOAD); - case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: - return PSTR(MSG_FILAMENTUNLOAD); - default: break; - } - return PSTR(MSG_FILAMENTCHANGE); - } - - void _lcd_temp_menu_filament_op(const AdvancedPauseMode mode, const int8_t extruder) { - _change_filament_temp_mode = mode; - _change_filament_temp_extruder = extruder; - START_MENU(); - if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), true, true); - MENU_BACK(MSG_BACK); - MENU_ITEM(submenu, MSG_PREHEAT_1, _lcd_change_filament_temp_1_menu); - MENU_ITEM(submenu, MSG_PREHEAT_2, _lcd_change_filament_temp_2_menu); - uint16_t max_temp; - switch (extruder) { - default: max_temp = HEATER_0_MAXTEMP; - #if HOTENDS > 1 - case 1: max_temp = HEATER_1_MAXTEMP; break; - #if HOTENDS > 2 - case 2: max_temp = HEATER_2_MAXTEMP; break; - #if HOTENDS > 3 - case 3: max_temp = HEATER_3_MAXTEMP; break; - #if HOTENDS > 4 - case 4: max_temp = HEATER_4_MAXTEMP; break; - #if HOTENDS > 5 - case 5: max_temp = HEATER_5_MAXTEMP; break; - #endif - #endif - #endif - #endif - #endif - } - MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(int3, MSG_PREHEAT_CUSTOM, &thermalManager.target_temperature[_change_filament_temp_extruder], EXTRUDE_MINTEMP, max_temp - 15, _lcd_change_filament_temp_custom_menu); - END_MENU(); - } - void lcd_temp_menu_e0_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 0); } - void lcd_temp_menu_e0_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 0); } - void lcd_temp_menu_e0_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 0); } - #if E_STEPPERS > 1 - void lcd_temp_menu_e1_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 1); } - void lcd_temp_menu_e1_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 1); } - void lcd_temp_menu_e1_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 1); } - #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - void lcd_unload_filament_all_temp_menu() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, -1); } - #endif - #if E_STEPPERS > 2 - void lcd_temp_menu_e2_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 2); } - void lcd_temp_menu_e2_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 2); } - void lcd_temp_menu_e2_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 2); } - #if E_STEPPERS > 3 - void lcd_temp_menu_e3_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 3); } - void lcd_temp_menu_e3_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 3); } - void lcd_temp_menu_e3_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 3); } - #if E_STEPPERS > 4 - void lcd_temp_menu_e4_filament_change() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_PAUSE_PRINT, 4); } - void lcd_temp_menu_e4_filament_load() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_LOAD_FILAMENT, 4); } - void lcd_temp_menu_e4_filament_unload() { _lcd_temp_menu_filament_op(ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, 4); } - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - - /** - * - * "Change Filament" submenu - * - */ - #if E_STEPPERS > 1 || ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - void lcd_change_filament_menu() { - START_MENU(); - MENU_BACK(MSG_MAIN); - - // Change filament - #if E_STEPPERS == 1 - PGM_P msg0 = PSTR(MSG_FILAMENTCHANGE); - if (thermalManager.targetTooColdToExtrude(active_extruder)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_change); - else - MENU_ITEM_P(gcode, msg0, PSTR("M600 B0")); - #else - PGM_P msg0 = PSTR(MSG_FILAMENTCHANGE " " MSG_E1); - PGM_P msg1 = PSTR(MSG_FILAMENTCHANGE " " MSG_E2); - if (thermalManager.targetTooColdToExtrude(0)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_change); - else - MENU_ITEM_P(gcode, msg0, PSTR("M600 B0 T0")); - if (thermalManager.targetTooColdToExtrude(1)) - MENU_ITEM_P(submenu, msg1, lcd_temp_menu_e1_filament_change); - else - MENU_ITEM_P(gcode, msg1, PSTR("M600 B0 T1")); - #if E_STEPPERS > 2 - PGM_P msg2 = PSTR(MSG_FILAMENTCHANGE " " MSG_E3); - if (thermalManager.targetTooColdToExtrude(2)) - MENU_ITEM_P(submenu, msg2, lcd_temp_menu_e2_filament_change); - else - MENU_ITEM_P(gcode, msg2, PSTR("M600 B0 T2")); - #if E_STEPPERS > 3 - PGM_P msg3 = PSTR(MSG_FILAMENTCHANGE " " MSG_E4); - if (thermalManager.targetTooColdToExtrude(3)) - MENU_ITEM_P(submenu, msg3, lcd_temp_menu_e3_filament_change); - else - MENU_ITEM_P(gcode, msg3, PSTR("M600 B0 T3")); - #if E_STEPPERS > 4 - PGM_P msg4 = PSTR(MSG_FILAMENTCHANGE " " MSG_E5); - if (thermalManager.targetTooColdToExtrude(4)) - MENU_ITEM_P(submenu, msg4, lcd_temp_menu_e4_filament_change); - else - MENU_ITEM_P(gcode, msg4, PSTR("M600 B0 T4")); - #if E_STEPPERS > 5 - PGM_P msg5 = PSTR(MSG_FILAMENTCHANGE " " MSG_E6); - if (thermalManager.targetTooColdToExtrude(5)) - MENU_ITEM_P(submenu, msg5, lcd_temp_menu_e5_filament_change); - else - MENU_ITEM_P(gcode, msg5, PSTR("M600 B0 T5")); - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 - - #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - if (!printer_busy()) { - // Load filament - #if E_STEPPERS == 1 - PGM_P msg0 = PSTR(MSG_FILAMENTLOAD); - if (thermalManager.targetTooColdToExtrude(active_extruder)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_load); - else - MENU_ITEM_P(gcode, msg0, PSTR("M701")); - #else - PGM_P msg0 = PSTR(MSG_FILAMENTLOAD " " MSG_E1); - PGM_P msg1 = PSTR(MSG_FILAMENTLOAD " " MSG_E2); - if (thermalManager.targetTooColdToExtrude(0)) - MENU_ITEM_P(submenu, msg0, lcd_temp_menu_e0_filament_load); - else - MENU_ITEM_P(gcode, msg0, PSTR("M701 T0")); - if (thermalManager.targetTooColdToExtrude(1)) - MENU_ITEM_P(submenu, msg1, lcd_temp_menu_e1_filament_load); - else - MENU_ITEM_P(gcode, msg1, PSTR("M701 T1")); - #if E_STEPPERS > 2 - PGM_P msg2 = PSTR(MSG_FILAMENTLOAD " " MSG_E3); - if (thermalManager.targetTooColdToExtrude(2)) - MENU_ITEM_P(submenu, msg2, lcd_temp_menu_e2_filament_load); - else - MENU_ITEM_P(gcode, msg2, PSTR("M701 T2")); - #if E_STEPPERS > 3 - PGM_P msg3 = PSTR(MSG_FILAMENTLOAD " " MSG_E4); - if (thermalManager.targetTooColdToExtrude(3)) - MENU_ITEM_P(submenu, msg3, lcd_temp_menu_e3_filament_load); - else - MENU_ITEM_P(gcode, msg3, PSTR("M701 T3")); - #if E_STEPPERS > 4 - PGM_P msg4 = PSTR(MSG_FILAMENTLOAD " " MSG_E5); - if (thermalManager.targetTooColdToExtrude(4)) - MENU_ITEM_P(submenu, msg4, lcd_temp_menu_e4_filament_load); - else - MENU_ITEM_P(gcode, msg4, PSTR("M701 T4")); - #if E_STEPPERS > 5 - PGM_P msg5 = PSTR(MSG_FILAMENTLOAD " " MSG_E6); - if (thermalManager.targetTooColdToExtrude(5)) - MENU_ITEM_P(submenu, msg5, lcd_temp_menu_e5_filament_load); - else - MENU_ITEM_P(gcode, msg5, PSTR("M701 T5")); - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 - - // Unload filament - #if E_STEPPERS == 1 - if (thermalManager.targetHotEnoughToExtrude(active_extruder)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD, PSTR("M702")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD, lcd_temp_menu_e0_filament_unload); - #else - #if ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - if (thermalManager.targetHotEnoughToExtrude(0) - #if E_STEPPERS > 1 - && thermalManager.targetHotEnoughToExtrude(1) - #if E_STEPPERS > 2 - && thermalManager.targetHotEnoughToExtrude(2) - #if E_STEPPERS > 3 - && thermalManager.targetHotEnoughToExtrude(3) - #if E_STEPPERS > 4 - && thermalManager.targetHotEnoughToExtrude(4) - #if E_STEPPERS > 5 - && thermalManager.targetHotEnoughToExtrude(5) - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS > 1 - ) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD_ALL, PSTR("M702")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD_ALL, lcd_unload_filament_all_temp_menu); - #endif - if (thermalManager.targetHotEnoughToExtrude(0)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E1, PSTR("M702 T0")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E1, lcd_temp_menu_e0_filament_unload); - if (thermalManager.targetHotEnoughToExtrude(1)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E2, PSTR("M702 T1")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E2, lcd_temp_menu_e1_filament_unload); - #if E_STEPPERS > 2 - if (thermalManager.targetHotEnoughToExtrude(2)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E3, PSTR("M702 T2")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E3, lcd_temp_menu_e2_filament_unload); - #if E_STEPPERS > 3 - if (thermalManager.targetHotEnoughToExtrude(3)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E4, PSTR("M702 T3")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E4, lcd_temp_menu_e3_filament_unload); - #if E_STEPPERS > 4 - if (thermalManager.targetHotEnoughToExtrude(4)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E5, PSTR("M702 T4")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E5, lcd_temp_menu_e4_filament_unload); - #if E_STEPPERS > 5 - if (thermalManager.targetHotEnoughToExtrude(5)) - MENU_ITEM(gcode, MSG_FILAMENTUNLOAD " " MSG_E6, PSTR("M702 T5")); - else - MENU_ITEM(submenu, MSG_FILAMENTUNLOAD " " MSG_E6, lcd_temp_menu_e5_filament_unload); - #endif // E_STEPPERS > 5 - #endif // E_STEPPERS > 4 - #endif // E_STEPPERS > 3 - #endif // E_STEPPERS > 2 - #endif // E_STEPPERS == 1 - } - #endif - - END_MENU(); - } - #endif - - static AdvancedPauseMode advanced_pause_mode = ADVANCED_PAUSE_MODE_PAUSE_PRINT; - static uint8_t hotend_status_extruder = 0; - - static PGM_P advanced_pause_header() { - switch (advanced_pause_mode) { - case ADVANCED_PAUSE_MODE_LOAD_FILAMENT: - return PSTR(MSG_FILAMENT_CHANGE_HEADER_LOAD); - case ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT: - return PSTR(MSG_FILAMENT_CHANGE_HEADER_UNLOAD); - default: break; - } - return PSTR(MSG_FILAMENT_CHANGE_HEADER_PAUSE); - } - - // 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 (_skipStatic && encoderLine <= _thisItemNr) { \ - encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; \ - ++encoderLine; \ - } \ - lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; \ - } \ - ++_thisItemNr; \ - }while(0) - - void lcd_advanced_pause_resume_print() { - advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_RESUME_PRINT; - } - - void lcd_advanced_pause_extrude_more() { - advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE; - } - - void lcd_advanced_pause_option_menu() { - START_MENU(); - #if LCD_HEIGHT > 2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_OPTION_HEADER, true, false); - #endif - MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_RESUME, lcd_advanced_pause_resume_print); - MENU_ITEM(function, MSG_FILAMENT_CHANGE_OPTION_PURGE, lcd_advanced_pause_extrude_more); - END_MENU(); - } - - void lcd_advanced_pause_init_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_1); - #ifdef MSG_FILAMENT_CHANGE_INIT_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_2); - #define __FC_LINES_A 3 - #else - #define __FC_LINES_A 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_INIT_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_INIT_3); - #define _FC_LINES_A (__FC_LINES_A + 1) - #else - #define _FC_LINES_A __FC_LINES_A - #endif - #if LCD_HEIGHT > _FC_LINES_A + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_unload_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_1); - #ifdef MSG_FILAMENT_CHANGE_UNLOAD_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_2); - #define __FC_LINES_B 3 - #else - #define __FC_LINES_B 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_UNLOAD_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_UNLOAD_3); - #define _FC_LINES_B (__FC_LINES_B + 1) - #else - #define _FC_LINES_B __FC_LINES_B - #endif - #if LCD_HEIGHT > _FC_LINES_B + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_wait_for_nozzles_to_heat() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEATING_1); - #ifdef MSG_FILAMENT_CHANGE_HEATING_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEATING_2); - #define _FC_LINES_C 3 - #else - #define _FC_LINES_C 2 - #endif - #if LCD_HEIGHT > _FC_LINES_C + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_heat_nozzle() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEAT_1); - #ifdef MSG_FILAMENT_CHANGE_INSERT_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_HEAT_2); - #define _FC_LINES_D 3 - #else - #define _FC_LINES_D 2 - #endif - #if LCD_HEIGHT > _FC_LINES_D + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_insert_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_1); - #ifdef MSG_FILAMENT_CHANGE_INSERT_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_2); - #define __FC_LINES_E 3 - #else - #define __FC_LINES_E 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_INSERT_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_INSERT_3); - #define _FC_LINES_E (__FC_LINES_E + 1) - #else - #define _FC_LINES_E __FC_LINES_E - #endif - #if LCD_HEIGHT > _FC_LINES_E + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_load_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_1); - #ifdef MSG_FILAMENT_CHANGE_LOAD_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_2); - #define __FC_LINES_F 3 - #else - #define __FC_LINES_F 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_LOAD_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_LOAD_3); - #define _FC_LINES_F (__FC_LINES_F + 1) - #else - #define _FC_LINES_F __FC_LINES_F - #endif - #if LCD_HEIGHT > _FC_LINES_F + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - void lcd_advanced_pause_purge_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_1); - #ifdef MSG_FILAMENT_CHANGE_PURGE_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_2); - #define __FC_LINES_G 3 - #else - #define __FC_LINES_G 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_PURGE_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_3); - #define _FC_LINES_G (__FC_LINES_G + 1) - #else - #define _FC_LINES_G __FC_LINES_G - #endif - #if LCD_HEIGHT > _FC_LINES_G + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - END_SCREEN(); - } - - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - void lcd_advanced_pause_continuous_purge_menu() { - START_SCREEN(); - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_1); - #ifdef MSG_FILAMENT_CHANGE_PURGE_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_2); - #define __FC_LINES_G 3 - #else - #define __FC_LINES_G 2 - #endif - #ifdef MSG_FILAMENT_CHANGE_PURGE_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_3); - #define _FC_LINES_G (__FC_LINES_G + 1) - #else - #define _FC_LINES_G __FC_LINES_G - #endif - #if LCD_HEIGHT > _FC_LINES_G + 1 - STATIC_ITEM(" "); - #endif - HOTEND_STATUS_ITEM(); - STATIC_ITEM(MSG_USERWAIT); - END_SCREEN(); - } - #endif - - void lcd_advanced_pause_resume_message() { - START_SCREEN(); - STATIC_ITEM_P(advanced_pause_header(), true, true); - STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_1); - #ifdef MSG_FILAMENT_CHANGE_RESUME_2 - STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_2); - #endif - #ifdef MSG_FILAMENT_CHANGE_RESUME_3 - STATIC_ITEM(MSG_FILAMENT_CHANGE_RESUME_3); - #endif - END_SCREEN(); - } - - FORCE_INLINE screenFunc_t ap_message_screen(const AdvancedPauseMessage message) { - switch (message) { - case ADVANCED_PAUSE_MESSAGE_INIT: return lcd_advanced_pause_init_message; - case ADVANCED_PAUSE_MESSAGE_UNLOAD: return lcd_advanced_pause_unload_message; - case ADVANCED_PAUSE_MESSAGE_INSERT: return lcd_advanced_pause_insert_message; - case ADVANCED_PAUSE_MESSAGE_LOAD: return lcd_advanced_pause_load_message; - case ADVANCED_PAUSE_MESSAGE_PURGE: return lcd_advanced_pause_purge_message; - case ADVANCED_PAUSE_MESSAGE_RESUME: return lcd_advanced_pause_resume_message; - case ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE: return lcd_advanced_pause_heat_nozzle; - case ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT: return lcd_advanced_pause_wait_for_nozzles_to_heat; - case ADVANCED_PAUSE_MESSAGE_OPTION: advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_WAIT_FOR; - return lcd_advanced_pause_option_menu; - #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) - case ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE: return lcd_advanced_pause_continuous_purge_menu; - #endif - case ADVANCED_PAUSE_MESSAGE_STATUS: - default: break; - } - return NULL; - } - - void lcd_advanced_pause_show_message( - const AdvancedPauseMessage message, - const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/, - const uint8_t extruder/*=active_extruder*/ - ) { - advanced_pause_mode = mode; - hotend_status_extruder = extruder; - const screenFunc_t next_screen = ap_message_screen(message); - if (next_screen) { - defer_return_to_status = true; - lcd_goto_screen(next_screen); - } - else - lcd_return_to_status(); - } - - #endif // ADVANCED_PAUSE_FEATURE - - /** - * - * Functions for editing single values - * - * The "DEFINE_MENU_EDIT_TYPE" macro generates the functions needed to edit a numerical value. - * - * For example, DEFINE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1) expands into these functions: - * - * bool _menu_edit_int3(); - * void menu_edit_int3(); // edit int16_t (interactively) - * void menu_edit_callback_int3(); // edit int16_t (interactively) with callback on completion - * void _menu_action_setting_edit_int3(PGM_P const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue); - * void menu_action_setting_edit_int3(PGM_P const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue); - * void menu_action_setting_edit_callback_int3(PGM_P const pstr, int16_t * const ptr, const int16_t minValue, const int16_t maxValue, const screenFunc_t callback, const bool live); // edit int16_t with callback - * - * 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(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - * - * ...which calls: - * menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999) - */ - #define DEFINE_MENU_EDIT_TYPE(_type, _name, _strFunc, _scale) \ - bool _menu_edit_ ## _name() { \ - ENCODER_DIRECTION_NORMAL(); \ - if ((int32_t)encoderPosition < 0) encoderPosition = 0; \ - if ((int32_t)encoderPosition > maxEditValue) encoderPosition = maxEditValue; \ - if (lcdDrawUpdate) \ - lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) * (1.0f / _scale))); \ - if (lcd_clicked || (liveEdit && lcdDrawUpdate)) { \ - _type value = ((_type)((int32_t)encoderPosition + minEditValue)) * (1.0f / _scale); \ - if (editValue != NULL) *((_type*)editValue) = value; \ - if (callbackFunc && (liveEdit || lcd_clicked)) (*callbackFunc)(); \ - if (lcd_clicked) lcd_goto_previous_menu(); \ - } \ - return use_click(); \ - } \ - void menu_edit_ ## _name() { _menu_edit_ ## _name(); } \ - void _menu_action_setting_edit_ ## _name(PGM_P const pstr, _type* const ptr, const _type minValue, const _type maxValue) { \ - lcd_save_previous_screen(); \ - lcd_refresh(); \ - \ - editLabel = pstr; \ - editValue = ptr; \ - minEditValue = minValue * _scale; \ - maxEditValue = maxValue * _scale - minEditValue; \ - encoderPosition = (*ptr) * _scale - minEditValue; \ - } \ - void menu_action_setting_edit_callback_ ## _name(PGM_P const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback, const bool live) { \ - _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \ - currentScreen = menu_edit_ ## _name; \ - callbackFunc = callback; \ - liveEdit = live; \ - } \ - FORCE_INLINE void menu_action_setting_edit_ ## _name(PGM_P const pstr, _type * const ptr, const _type minValue, const _type maxValue) { \ - menu_action_setting_edit_callback_ ## _name(pstr, ptr, minValue, maxValue); \ - } \ - typedef void _name##_void - - DEFINE_MENU_EDIT_TYPE(int16_t, int3, itostr3, 1); - DEFINE_MENU_EDIT_TYPE(int16_t, int4, itostr4sign, 1); - DEFINE_MENU_EDIT_TYPE(uint8_t, int8, i8tostr3, 1); - DEFINE_MENU_EDIT_TYPE(float, float3, ftostr3, 1); - DEFINE_MENU_EDIT_TYPE(float, float52, ftostr52, 100); - DEFINE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000); - DEFINE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 0.01f); - DEFINE_MENU_EDIT_TYPE(float, float51, ftostr51sign, 10); - DEFINE_MENU_EDIT_TYPE(float, float52sign, ftostr52sign, 100); - DEFINE_MENU_EDIT_TYPE(float, float62, ftostr62rj, 100); - DEFINE_MENU_EDIT_TYPE(uint32_t, long5, ftostr5rj, 0.01f); - - /** - * - * Handlers for Keypad input - * - */ - #if ENABLED(ADC_KEYPAD) - - inline bool handle_adc_keypad() { - #define ADC_MIN_KEY_DELAY 100 - if (buttons_reprapworld_keypad) { - lcdDrawUpdate = LCDVIEW_REDRAW_NOW; - if (encoderDirection == -1) { // side effect which signals we are inside a menu - if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN) encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM; - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT) { menu_action_back(); lcd_quick_feedback(true); } - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) { lcd_return_to_status(); lcd_quick_feedback(true); } - } - else { - if (buttons_reprapworld_keypad & (EN_REPRAPWORLD_KEYPAD_DOWN|EN_REPRAPWORLD_KEYPAD_UP|EN_REPRAPWORLD_KEYPAD_RIGHT)) { - if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN) encoderPosition += ENCODER_PULSES_PER_STEP; - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) encoderPosition -= ENCODER_PULSES_PER_STEP; - else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) encoderPosition = 0; - } - } - #if ENABLED(ADC_KEYPAD_DEBUG) - SERIAL_PROTOCOLLNPAIR("buttons_reprapworld_keypad = ", (uint32_t)buttons_reprapworld_keypad); - SERIAL_PROTOCOLLNPAIR("encoderPosition = ", (uint32_t)encoderPosition); - #endif - next_button_update_ms = millis() + ADC_MIN_KEY_DELAY; - return true; - } - - return false; - } - - #elif ENABLED(REPRAPWORLD_KEYPAD) - - void _reprapworld_keypad_move(const AxisEnum axis, const int16_t dir) { - move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; - encoderPosition = dir; - switch (axis) { - case X_AXIS: lcd_move_x(); break; - case Y_AXIS: lcd_move_y(); break; - case Z_AXIS: lcd_move_z(); - default: break; - } - } - void reprapworld_keypad_move_z_up() { _reprapworld_keypad_move(Z_AXIS, 1); } - void reprapworld_keypad_move_z_down() { _reprapworld_keypad_move(Z_AXIS, -1); } - void reprapworld_keypad_move_x_left() { _reprapworld_keypad_move(X_AXIS, -1); } - void reprapworld_keypad_move_x_right() { _reprapworld_keypad_move(X_AXIS, 1); } - void reprapworld_keypad_move_y_up() { _reprapworld_keypad_move(Y_AXIS, -1); } - void reprapworld_keypad_move_y_down() { _reprapworld_keypad_move(Y_AXIS, 1); } - void reprapworld_keypad_move_home() { enqueue_and_echo_commands_P(PSTR("G28")); } // move all axes home and wait - void reprapworld_keypad_move_menu() { lcd_goto_screen(lcd_move_menu); } - - inline void handle_reprapworld_keypad() { - - static uint8_t keypad_debounce = 0; - - if (!REPRAPWORLD_KEYPAD_PRESSED) { - if (keypad_debounce > 0) keypad_debounce--; - } - else if (!keypad_debounce) { - keypad_debounce = 2; - - if (REPRAPWORLD_KEYPAD_MOVE_MENU) reprapworld_keypad_move_menu(); - - #if DISABLED(DELTA) && Z_HOME_DIR == -1 - if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up(); - #endif - - if (all_axes_homed()) { - #if ENABLED(DELTA) || Z_HOME_DIR != -1 - if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up(); - #endif - if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) reprapworld_keypad_move_z_down(); - if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) reprapworld_keypad_move_x_left(); - if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) reprapworld_keypad_move_x_right(); - if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) reprapworld_keypad_move_y_down(); - if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) reprapworld_keypad_move_y_up(); - } - else { - if (REPRAPWORLD_KEYPAD_MOVE_HOME) reprapworld_keypad_move_home(); - } - } - } - - #endif // REPRAPWORLD_KEYPAD - - /** - * - * Menu actions - * - */ - void _menu_action_back() { lcd_goto_previous_menu(); } - void menu_action_submenu(screenFunc_t func) { lcd_save_previous_screen(); lcd_goto_screen(func); } - void menu_action_gcode(PGM_P pgcode) { enqueue_and_echo_commands_P(pgcode); } - void menu_action_function(screenFunc_t func) { (*func)(); } - - #if ENABLED(SDSUPPORT) - - void menu_action_sdfile(CardReader &theCard) { - #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE) - last_sdfile_encoderPosition = encoderPosition; // Save which file was selected for later use - #endif - card.openAndPrintFile(theCard.filename); - lcd_return_to_status(); - lcd_reset_status(); - } - - void menu_action_sddirectory(CardReader &theCard) { - card.chdir(theCard.filename); - encoderTopLine = 0; - encoderPosition = 2 * ENCODER_STEPS_PER_MENU_ITEM; - screen_changed = true; - #if ENABLED(DOGLCD) - drawing_screen = false; - #endif - lcd_refresh(); - } - - #endif // SDSUPPORT - - void menu_action_setting_edit_bool(PGM_P pstr, bool* ptr) { UNUSED(pstr); *ptr ^= true; lcd_refresh(); } - void menu_action_setting_edit_callback_bool(PGM_P pstr, bool* ptr, screenFunc_t callback) { - menu_action_setting_edit_bool(pstr, ptr); - (*callback)(); - } - -#endif // ULTIPANEL +#endif void lcd_init() { @@ -5399,6 +218,392 @@ bool lcd_blink() { return blink != 0; } +//////////////////////////////////////////// +///////////// Keypad Handling ////////////// +//////////////////////////////////////////// + +#if ENABLED(REPRAPWORLD_KEYPAD) + volatile uint8_t buttons_reprapworld_keypad; +#endif + +#if ENABLED(ADC_KEYPAD) + + #define KEYPAD_HOME EN_REPRAPWORLD_KEYPAD_F1 + #define KEYPAD_EN_C EN_REPRAPWORLD_KEYPAD_MIDDLE + + inline bool handle_adc_keypad() { + #define ADC_MIN_KEY_DELAY 100 + if (buttons_reprapworld_keypad) { + lcdDrawUpdate = LCDVIEW_REDRAW_NOW; + if (encoderDirection == -1) { // side effect which signals we are inside a menu + if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN) encoderPosition -= ENCODER_STEPS_PER_MENU_ITEM; + else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) encoderPosition += ENCODER_STEPS_PER_MENU_ITEM; + else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT) { menu_action_back(); lcd_quick_feedback(true); } + else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) { lcd_return_to_status(); lcd_quick_feedback(true); } + } + else { + if (buttons_reprapworld_keypad & (EN_REPRAPWORLD_KEYPAD_DOWN|EN_REPRAPWORLD_KEYPAD_UP|EN_REPRAPWORLD_KEYPAD_RIGHT)) { + if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN) encoderPosition += ENCODER_PULSES_PER_STEP; + else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) encoderPosition -= ENCODER_PULSES_PER_STEP; + else if (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) encoderPosition = 0; + } + } + #if ENABLED(ADC_KEYPAD_DEBUG) + SERIAL_PROTOCOLLNPAIR("buttons_reprapworld_keypad = ", (uint32_t)buttons_reprapworld_keypad); + SERIAL_PROTOCOLLNPAIR("encoderPosition = ", (uint32_t)encoderPosition); + #endif + next_button_update_ms = millis() + ADC_MIN_KEY_DELAY; + return true; + } + + return false; + } + +#elif 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_F3 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F3)) + #define EN_REPRAPWORLD_KEYPAD_F2 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F2)) + #define EN_REPRAPWORLD_KEYPAD_F1 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F1)) + #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 REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F3) + #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F2) + #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN) + #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) + #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) + #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT) + + #define KEYPAD_HOME EN_REPRAPWORLD_KEYPAD_MIDDLE + #define KEYPAD_EN_C EN_REPRAPWORLD_KEYPAD_F1 + #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad & KEYPAD_HOME) + #define REPRAPWORLD_KEYPAD_MOVE_MENU (buttons_reprapworld_keypad & KEYPAD_EN_C) + + #define REPRAPWORLD_KEYPAD_PRESSED (buttons_reprapworld_keypad & ( \ + EN_REPRAPWORLD_KEYPAD_F3 | \ + EN_REPRAPWORLD_KEYPAD_F2 | \ + EN_REPRAPWORLD_KEYPAD_F1 | \ + EN_REPRAPWORLD_KEYPAD_DOWN | \ + EN_REPRAPWORLD_KEYPAD_RIGHT | \ + EN_REPRAPWORLD_KEYPAD_MIDDLE | \ + EN_REPRAPWORLD_KEYPAD_UP | \ + EN_REPRAPWORLD_KEYPAD_LEFT) \ + ) + + void _reprapworld_keypad_move(const AxisEnum axis, const int16_t dir) { + move_menu_scale = REPRAPWORLD_KEYPAD_MOVE_STEP; + encoderPosition = dir; + switch (axis) { + case X_AXIS: lcd_move_x(); break; + case Y_AXIS: lcd_move_y(); break; + case Z_AXIS: lcd_move_z(); + default: break; + } + } + inline void reprapworld_keypad_move_z_up() { _reprapworld_keypad_move(Z_AXIS, 1); } + inline void reprapworld_keypad_move_z_down() { _reprapworld_keypad_move(Z_AXIS, -1); } + inline void reprapworld_keypad_move_x_left() { _reprapworld_keypad_move(X_AXIS, -1); } + inline void reprapworld_keypad_move_x_right() { _reprapworld_keypad_move(X_AXIS, 1); } + inline void reprapworld_keypad_move_y_up() { _reprapworld_keypad_move(Y_AXIS, -1); } + inline void reprapworld_keypad_move_y_down() { _reprapworld_keypad_move(Y_AXIS, 1); } + inline void reprapworld_keypad_move_home() { enqueue_and_echo_commands_P(PSTR("G28")); } // move all axes home and wait + inline void reprapworld_keypad_move_menu() { lcd_goto_screen(menu_move); } + + inline void handle_reprapworld_keypad() { + + static uint8_t keypad_debounce = 0; + + if (!REPRAPWORLD_KEYPAD_PRESSED) { + if (keypad_debounce > 0) keypad_debounce--; + } + else if (!keypad_debounce) { + keypad_debounce = 2; + + if (REPRAPWORLD_KEYPAD_MOVE_MENU) reprapworld_keypad_move_menu(); + + #if DISABLED(DELTA) && Z_HOME_DIR == -1 + if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up(); + #endif + + if (all_axes_homed()) { + #if ENABLED(DELTA) || Z_HOME_DIR != -1 + if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up(); + #endif + if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) reprapworld_keypad_move_z_down(); + if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) reprapworld_keypad_move_x_left(); + if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) reprapworld_keypad_move_x_right(); + if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) reprapworld_keypad_move_y_down(); + if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) reprapworld_keypad_move_y_up(); + } + else { + if (REPRAPWORLD_KEYPAD_MOVE_HOME) reprapworld_keypad_move_home(); + } + } + } + +#endif // REPRAPWORLD_KEYPAD + +/** + * Status Screen + * + * This is very display-dependent, so the lcd implementation draws this. + */ + +#if LCD_INFO_SCREEN_STYLE == 0 + void lcd_impl_status_screen_0(); +#elif LCD_INFO_SCREEN_STYLE == 1 + void lcd_impl_status_screen_1(); +#endif + +void lcd_status_screen() { + + #if ENABLED(ULTIPANEL) + ENCODER_DIRECTION_NORMAL(); + ENCODER_RATE_MULTIPLY(false); + #endif + + #if ENABLED(LCD_SET_PROGRESS_MANUALLY) && ENABLED(SDSUPPORT) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD)) + // Progress bar % comes from SD when actively printing + if (IS_SD_PRINTING()) + progress_bar_percent = card.percentDone(); + #endif + + #if ENABLED(LCD_PROGRESS_BAR) + + // + // HD44780 implements the following message blinking and + // message expiration because Status Line and Progress Bar + // share the same line on the display. + // + + millis_t ms = millis(); + + // If the message will blink rather than expire... + #if DISABLED(PROGRESS_MSG_ONCE) + if (ELAPSED(ms, progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME)) + progress_bar_ms = ms; + #endif + + #if PROGRESS_MSG_EXPIRE > 0 + + // 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 (ELAPSED(ms, expire_status_ms)) { + lcd_status_message[0] = '\0'; + expire_status_ms = 0; + } + } + else { + // Defer message expiration before bar appears + // and during any pause (not just SD) + expire_status_ms += LCD_UPDATE_INTERVAL; + } + } + + #endif // PROGRESS_MSG_EXPIRE + + #endif // LCD_PROGRESS_BAR + + #if ENABLED(ULTIPANEL) + + if (use_click()) { + #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) + previous_lcd_status_ms = millis(); // get status message to show up for a while + #endif + lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. + #if ENABLED(LCD_PROGRESS_BAR) + CHARSET_MENU + #endif + ); + lcd_goto_screen(menu_main); + return; + } + + #if ENABLED(ULTIPANEL_FEEDMULTIPLY) + const int16_t new_frm = feedrate_percentage + (int32_t)encoderPosition; + // Dead zone at 100% feedrate + if ((feedrate_percentage < 100 && new_frm > 100) || (feedrate_percentage > 100 && new_frm < 100)) { + feedrate_percentage = 100; + encoderPosition = 0; + } + else if (feedrate_percentage == 100) { + if ((int32_t)encoderPosition > ENCODER_FEEDRATE_DEADZONE) { + feedrate_percentage += (int32_t)encoderPosition - (ENCODER_FEEDRATE_DEADZONE); + encoderPosition = 0; + } + else if ((int32_t)encoderPosition < -(ENCODER_FEEDRATE_DEADZONE)) { + feedrate_percentage += (int32_t)encoderPosition + ENCODER_FEEDRATE_DEADZONE; + encoderPosition = 0; + } + } + else { + feedrate_percentage = new_frm; + encoderPosition = 0; + } + #endif // ULTIPANEL_FEEDMULTIPLY + + feedrate_percentage = constrain(feedrate_percentage, 10, 999); + + #endif // ULTIPANEL + + #if LCD_INFO_SCREEN_STYLE == 0 + lcd_impl_status_screen_0(); + #elif LCD_INFO_SCREEN_STYLE == 1 + lcd_impl_status_screen_1(); + #endif +} + +/** + * 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 (card.sdprinting) + return lcd_setstatus(card.longest_filename(), true); + #endif + else if (print_job_timer.isRunning()) + msg = printing; + else + msg = welcome; + + lcd_setstatusPGM(msg, -1); +} + +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) { + + #if ENABLED(ULTIPANEL) + lcd_refresh(); + if (clear_buttons) buttons = 0; + next_button_update_ms = millis() + 500; + #else + UNUSED(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); + + #if ENABLED(ULTIPANEL) + #if ENABLED(LCD_USE_I2C_BUZZER) + delay(10); + #elif PIN_EXISTS(BEEPER) + for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } + #endif + #endif +} + +#if ENABLED(ULTIPANEL) + + extern bool no_reentry; // Flag to prevent recursion into menu handlers + + int8_t manual_move_axis = (int8_t)NO_AXIS; + millis_t manual_move_start_time = 0; + + #if IS_KINEMATIC + bool 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; + #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() { + + if (processing_manual_move) return; + + if (manual_move_axis != (int8_t)NO_AXIS && ELAPSED(millis(), manual_move_start_time) && !planner.is_full()) { + + #if IS_KINEMATIC + + const float old_feedrate = feedrate_mm_s; + feedrate_mm_s = MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]); + + #if EXTRUDERS > 1 + const int8_t old_extruder = active_extruder; + if (manual_move_axis == E_AXIS) active_extruder = manual_move_e_index; + #endif + + // Set movement on a single axis + set_destination_from_current(); + destination[manual_move_axis] += manual_move_offset; + + // Reset for the next move + manual_move_offset = 0; + manual_move_axis = (int8_t)NO_AXIS; + + // DELTA and SCARA machines use segmented moves, which could fill the planner during the call to + // move_to_destination. This will cause idle() to be called, which can then call this function while the + // previous invocation is being blocked. Modifications to manual_move_offset shouldn't be made while + // processing_manual_move is true or the planner will get out of sync. + processing_manual_move = true; + prepare_move_to_destination(); // will call set_current_from_destination() + processing_manual_move = false; + + feedrate_mm_s = old_feedrate; + #if EXTRUDERS > 1 + active_extruder = old_extruder; + #endif + + #else + + planner.buffer_line(current_position, MMM_TO_MMS(manual_feedrate_mm_m[manual_move_axis]), manual_move_axis == E_AXIS ? manual_move_e_index : active_extruder); + manual_move_axis = (int8_t)NO_AXIS; + + #endif + } + } + +#endif // ULTIPANEL + /** * Update the LCD, read encoder buttons, etc. * - Read button states @@ -5429,10 +634,24 @@ bool lcd_blink() { * - Clear the LCD if lcdDrawUpdate == LCDVIEW_CLEAR_CALL_REDRAW * - Update lcdDrawUpdate for the next loop (i.e., move one state down, usually) * - * No worries. This function is only called from the main thread. + * This function is only called from the main thread. */ + +LCDViewAction 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 + void lcd_update() { + static uint16_t max_display_update_time = 0; + static millis_t next_lcd_update_ms; + #if ENABLED(ULTIPANEL) static millis_t return_to_status_ms = 0; @@ -5473,7 +692,7 @@ void lcd_update() { #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) - const uint8_t sd_status = (uint8_t)IS_SD_INSERTED; + const uint8_t sd_status = (uint8_t)IS_SD_INSERTED(); if (sd_status != lcd_sd_status && lcd_detected()) { uint8_t old_sd_status = lcd_sd_status; // prevent re-entry to this block! @@ -5504,7 +723,7 @@ void lcd_update() { #if ENABLED(POWER_LOSS_RECOVERY) if (job_recovery_commands_count && job_recovery_phase == JOB_RECOVERY_IDLE) { - lcd_goto_screen(lcd_job_recovery_menu); + lcd_goto_screen(menu_job_recovery); job_recovery_phase = JOB_RECOVERY_MAYBE; // Waiting for a response } #endif @@ -5577,10 +796,11 @@ void lcd_update() { return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; lcdDrawUpdate = LCDVIEW_REDRAW_NOW; } + #endif // ULTIPANEL - // We arrive here every ~100ms when idling often enough. - // Instead of tracking the changes simply redraw the Info Screen ~1 time a second. + // This runs every ~100ms when idling often enough. + // Instead of tracking changes just redraw the Status Screen once per second. if ( #if ENABLED(ULTIPANEL) currentScreen == lcd_status_screen && @@ -5599,7 +819,7 @@ void lcd_update() { #if ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES) // If scrolling of long file names is enabled and we are in the sd card menu, // cause a refresh to occur until all the text has scrolled into view. - if (currentScreen == lcd_sdcard_menu && filename_scroll_pos < filename_scroll_max && !lcd_status_update_delay--) { + if (currentScreen == menu_sdcard && filename_scroll_pos < filename_scroll_max && !lcd_status_update_delay--) { lcd_status_update_delay = 6; lcdDrawUpdate = LCDVIEW_REDRAW_NOW; filename_scroll_pos++; @@ -5611,15 +831,15 @@ void lcd_update() { uint16_t bbr2 = planner.block_buffer_runtime() >> 1; #if ENABLED(DOGLCD) - #define IS_DRAWING drawing_screen + const bool &is_drawing = drawing_screen; #else - #define IS_DRAWING false + constexpr bool is_drawing = false; #endif - if ((lcdDrawUpdate || IS_DRAWING) && (!bbr2 || bbr2 > max_display_update_time)) { + if ((lcdDrawUpdate || is_drawing) && (!bbr2 || bbr2 > max_display_update_time)) { // Change state of drawing flag between screen updates - if (!IS_DRAWING) switch (lcdDrawUpdate) { + if (!is_drawing) switch (lcdDrawUpdate) { case LCDVIEW_CALL_NO_REDRAW: lcdDrawUpdate = LCDVIEW_NONE; break; @@ -5696,7 +916,7 @@ void lcd_update() { #endif // ULTIPANEL // Change state of drawing flag between screen updates - if (!IS_DRAWING) switch (lcdDrawUpdate) { + if (!is_drawing) switch (lcdDrawUpdate) { case LCDVIEW_CLEAR_CALL_REDRAW: lcd_implementation_clear(); break; case LCDVIEW_REDRAW_NOW: @@ -5810,13 +1030,42 @@ void lcd_setalertstatusPGM(PGM_P const message) { void lcd_reset_alert_level() { lcd_status_message_level = 0; } -#if HAS_LCD_CONTRAST +#if ENABLED(ADC_KEYPAD) - void set_lcd_contrast(const int16_t value) { - lcd_contrast = constrain(value, LCD_CONTRAST_MIN, LCD_CONTRAST_MAX); - u8g.setContrast(lcd_contrast); + typedef struct { + uint16_t ADCKeyValueMin, ADCKeyValueMax; + uint8_t ADCKeyNo; + } _stADCKeypadTable_; + + static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = { + // VALUE_MIN, VALUE_MAX, KEY + { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F1 + 1 }, // F1 + { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F2 + 1 }, // F2 + { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F3 + 1 }, // F3 + { 300, 500, BLEN_REPRAPWORLD_KEYPAD_LEFT + 1 }, // LEFT + { 1900, 2200, BLEN_REPRAPWORLD_KEYPAD_RIGHT + 1 }, // RIGHT + { 570, 870, BLEN_REPRAPWORLD_KEYPAD_UP + 1 }, // UP + { 2670, 2870, BLEN_REPRAPWORLD_KEYPAD_DOWN + 1 }, // DOWN + { 1150, 1450, BLEN_REPRAPWORLD_KEYPAD_MIDDLE + 1 }, // ENTER + }; + + uint8_t get_ADC_keyValue(void) { + if (thermalManager.ADCKey_count >= 16) { + const uint16_t currentkpADCValue = thermalManager.current_ADCKey_raw >> 2; + #if ENABLED(ADC_KEYPAD_DEBUG) + SERIAL_PROTOCOLLN(currentkpADCValue); + #endif + thermalManager.current_ADCKey_raw = 0; + thermalManager.ADCKey_count = 0; + if (currentkpADCValue < 4000) + for (uint8_t i = 0; i < ADC_KEY_NUM; i++) { + const uint16_t lo = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMin), + hi = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMax); + if (WITHIN(currentkpADCValue, lo, hi)) return pgm_read_byte(&stADCKeyTable[i].ADCKeyNo); + } + } + return 0; } - #endif #if ENABLED(ULTIPANEL) @@ -5845,6 +1094,25 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } } \ DST = ~new_##DST; //invert it, because a pressed switch produces a logical 0 + #if (ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008)) && ENABLED(DETECT_DEVICE) + bool lcd_detected() { return lcd.LcdDetected() == 1; } + #else + bool lcd_detected() { return true; } + #endif + + #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 @@ -5984,64 +1252,6 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; } } } - #if (ENABLED(LCD_I2C_TYPE_MCP23017) || ENABLED(LCD_I2C_TYPE_MCP23008)) && ENABLED(DETECT_DEVICE) - bool lcd_detected() { return lcd.LcdDetected() == 1; } - #else - bool lcd_detected() { return true; } - #endif - - #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 - #endif // ULTIPANEL -#if ENABLED(ADC_KEYPAD) - - typedef struct { - uint16_t ADCKeyValueMin, ADCKeyValueMax; - uint8_t ADCKeyNo; - } _stADCKeypadTable_; - - static const _stADCKeypadTable_ stADCKeyTable[] PROGMEM = { - // VALUE_MIN, VALUE_MAX, KEY - { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F1 + 1 }, // F1 - { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F2 + 1 }, // F2 - { 4000, 4096, BLEN_REPRAPWORLD_KEYPAD_F3 + 1 }, // F3 - { 300, 500, BLEN_REPRAPWORLD_KEYPAD_LEFT + 1 }, // LEFT - { 1900, 2200, BLEN_REPRAPWORLD_KEYPAD_RIGHT + 1 }, // RIGHT - { 570, 870, BLEN_REPRAPWORLD_KEYPAD_UP + 1 }, // UP - { 2670, 2870, BLEN_REPRAPWORLD_KEYPAD_DOWN + 1 }, // DOWN - { 1150, 1450, BLEN_REPRAPWORLD_KEYPAD_MIDDLE + 1 }, // ENTER - }; - - uint8_t get_ADC_keyValue(void) { - if (thermalManager.ADCKey_count >= 16) { - const uint16_t currentkpADCValue = thermalManager.current_ADCKey_raw >> 2; - #if ENABLED(ADC_KEYPAD_DEBUG) - SERIAL_PROTOCOLLN(currentkpADCValue); - #endif - thermalManager.current_ADCKey_raw = 0; - thermalManager.ADCKey_count = 0; - if (currentkpADCValue < 4000) - for (uint8_t i = 0; i < ADC_KEY_NUM; i++) { - const uint16_t lo = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMin), - hi = pgm_read_word(&stADCKeyTable[i].ADCKeyValueMax); - if (WITHIN(currentkpADCValue, lo, hi)) return pgm_read_byte(&stADCKeyTable[i].ADCKeyNo); - } - } - return 0; - } -#endif - #endif // ULTRA_LCD diff --git a/Marlin/src/lcd/ultralcd.h b/Marlin/src/lcd/ultralcd.h index 2b262f6af1..e24673c25c 100644 --- a/Marlin/src/lcd/ultralcd.h +++ b/Marlin/src/lcd/ultralcd.h @@ -19,17 +19,170 @@ * along with this program. If not, see . * */ - -#ifndef ULTRALCD_H -#define ULTRALCD_H +#pragma once #include "../inc/MarlinConfig.h" -#if ENABLED(ULTRA_LCD) || ENABLED(MALYAN_LCD) || ENABLED(EXTENSIBLE_UI) +#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; + + // DOGM font sizes + #define DOG_CHAR_WIDTH 6 + #define DOG_CHAR_HEIGHT 12 + #if ENABLED(USE_BIG_EDIT_FONT) + #define FONT_MENU_EDIT_NAME u8g_font_9x18 + #define DOG_CHAR_WIDTH_EDIT 9 + #define DOG_CHAR_HEIGHT_EDIT 18 + #else + #define FONT_MENU_EDIT_NAME FONT_MENU_NAME + #define DOG_CHAR_WIDTH_EDIT DOG_CHAR_WIDTH + #define DOG_CHAR_HEIGHT_EDIT DOG_CHAR_HEIGHT + #endif + + enum MarlinFont : uint8_t { + FONT_STATUSMENU = 1, + FONT_SPECIAL, + FONT_MENU_EDIT, + FONT_MENU, + }; + + // Only Western languages support big / small fonts + #if DISABLED(DISPLAY_CHARSET_ISO10646_1) + #undef USE_BIG_EDIT_FONT + #undef USE_SMALL_INFOFONT + #endif + + #if ENABLED(USE_SMALL_INFOFONT) + extern const u8g_fntpgm_uint8_t u8g_font_6x9[]; + #define INFO_FONT_HEIGHT 7 + #else + #define INFO_FONT_HEIGHT 8 + #endif + + // 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)) + + 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; } @@ -37,7 +190,7 @@ inline void lcd_setalertstatusPGM(PGM_P message) { UNUSED(message); } #endif -#if ENABLED(ULTRA_LCD) +#if HAS_SPI_LCD #include "../Marlin.h" @@ -70,6 +223,8 @@ #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 @@ -86,11 +241,19 @@ uint8_t get_ADC_keyValue(); #endif - #if ENABLED(DOGLCD) + #if HAS_LCD_CONTRAST extern int16_t lcd_contrast; void set_lcd_contrast(const int16_t value); #endif + #if ENABLED(DOGLCD) + #define SETCURSOR(col, row) lcd_moveto(col * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT)) + #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_PIXEL_WIDTH - len * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT)) + #else + #define SETCURSOR(col, row) lcd_moveto(col, row) + #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_WIDTH - len, row) + #endif + #if ENABLED(SHOW_BOOTSCREEN) void lcd_bootscreen(); #endif @@ -99,13 +262,14 @@ #define BUTTON_EXISTS(BN) (defined(BTN_## BN) && BTN_## BN >= 0) #define BUTTON_PRESSED(BN) !READ(BTN_## BN) - #if ENABLED(ULTIPANEL) // LCD with a click-wheel input + #if HAS_LCD_MENU - extern bool defer_return_to_status; - - // Function pointer to menu functions. typedef void (*screenFunc_t)(); typedef void (*menuAction_t)(); + extern screenFunc_t currentScreen; + void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder=0); + + extern bool lcd_clicked, defer_return_to_status; extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2]; extern uint8_t lcd_preheat_fan_speed[2]; @@ -122,9 +286,14 @@ constexpr bool lcd_wait_for_move = false; #endif - void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder=0); - - void lcd_completion_feedback(const bool good=true); + // 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, @@ -143,72 +312,29 @@ float lcd_z_offset_edit(); #endif - #endif + #if ENABLED(SCROLL_LONG_FILENAMES) + extern uint8_t filename_scroll_pos, filename_scroll_max; + #endif + + #endif // ULTIPANEL #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) extern millis_t previous_lcd_status_ms; #endif - bool lcd_blink(); - - #if ENABLED(REPRAPWORLD_KEYPAD) // is also ULTIPANEL and NEWPANEL - - #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_F3 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F3)) - #define EN_REPRAPWORLD_KEYPAD_F2 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F2)) - #define EN_REPRAPWORLD_KEYPAD_F1 (_BV(REPRAPWORLD_BTN_OFFSET + BLEN_REPRAPWORLD_KEYPAD_F1)) - #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 REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F3) - #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_F2) - #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_DOWN) - #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_RIGHT) - #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_UP) - #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad & EN_REPRAPWORLD_KEYPAD_LEFT) - - #if ENABLED(ADC_KEYPAD) - #define KEYPAD_HOME EN_REPRAPWORLD_KEYPAD_F1 - #define KEYPAD_EN_C EN_REPRAPWORLD_KEYPAD_MIDDLE - #else - #define KEYPAD_HOME EN_REPRAPWORLD_KEYPAD_MIDDLE - #define KEYPAD_EN_C EN_REPRAPWORLD_KEYPAD_F1 - #endif - #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad & KEYPAD_HOME) - #define REPRAPWORLD_KEYPAD_MOVE_MENU (buttons_reprapworld_keypad & KEYPAD_EN_C) - - #define REPRAPWORLD_KEYPAD_PRESSED (buttons_reprapworld_keypad & ( \ - EN_REPRAPWORLD_KEYPAD_F3 | \ - EN_REPRAPWORLD_KEYPAD_F2 | \ - EN_REPRAPWORLD_KEYPAD_F1 | \ - EN_REPRAPWORLD_KEYPAD_DOWN | \ - EN_REPRAPWORLD_KEYPAD_RIGHT | \ - EN_REPRAPWORLD_KEYPAD_MIDDLE | \ - EN_REPRAPWORLD_KEYPAD_UP | \ - EN_REPRAPWORLD_KEYPAD_LEFT) \ - ) - + #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); @@ -217,6 +343,7 @@ void lcd_refresh(); void lcd_reset_alert_level(); bool lcd_hasstatus(); + #else // MALYAN_LCD or no LCD constexpr bool lcd_wait_for_move = false; @@ -229,11 +356,11 @@ inline void lcd_reset_alert_level() {} inline void lcd_reset_status() {} -#endif // ULTRA_LCD +#endif -#if ENABLED(ULTIPANEL) +#if HAS_LCD_MENU - #if ENABLED(NEWPANEL) // Uses digital switches, not a shift register + #if HAS_DIGITAL_ENCODER // Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes) #define BLEN_A 0 @@ -264,6 +391,10 @@ #endif +#if ENABLED(LCD_HAS_SLOW_BUTTONS) + extern volatile uint8_t slow_buttons; +#endif + #if ENABLED(REPRAPWORLD_KEYPAD) #ifdef EN_C #define LCD_CLICKED ((buttons & EN_C) || REPRAPWORLD_KEYPAD_MOVE_MENU) @@ -276,6 +407,9 @@ #define LCD_CLICKED false #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)) @@ -288,10 +422,22 @@ void lcd_reselect_last_file(); #endif -#if (ENABLED(EXTENSIBLE_UI) || ENABLED(ULTIPANEL)) && ENABLED(SDSUPPORT) - extern bool abort_sd_printing; -#else - constexpr bool abort_sd_printing = false; +// LCD implementations +void lcd_implementation_clear(); +void lcd_implementation_init(); + +#if HAS_GRAPHICAL_LCD + extern bool drawing_screen, first_page; +#elif HAS_SPI_LCD + constexpr bool first_page = true; #endif -#endif // ULTRALCD_H +#if HAS_CHARACTER_LCD + + enum HD44780CharSet : uint8_t { + CHARSET_MENU, + CHARSET_INFO, + CHARSET_BOOT + }; + +#endif diff --git a/Marlin/src/libs/buzzer.h b/Marlin/src/libs/buzzer.h index 6661c10455..2da9b8dee7 100644 --- a/Marlin/src/libs/buzzer.h +++ b/Marlin/src/libs/buzzer.h @@ -28,7 +28,7 @@ // Make a buzzer and macro #if ENABLED(LCD_USE_I2C_BUZZER) // BUZZ() will be defined in ultralcd.h -#elif PIN_EXISTS(BEEPER) || ENABLED(EXTENSIBLE_UI) +#elif PIN_EXISTS(BEEPER) #include "circularqueue.h" diff --git a/Marlin/src/libs/duration_t.h b/Marlin/src/libs/duration_t.h index f38ab0224d..091bae0e57 100644 --- a/Marlin/src/libs/duration_t.h +++ b/Marlin/src/libs/duration_t.h @@ -19,9 +19,9 @@ * along with this program. If not, see . * */ +#pragma once -#ifndef __DURATION_T__ -#define __DURATION_T__ +#include struct duration_t { /** @@ -163,5 +163,3 @@ struct duration_t { } } }; - -#endif // __DURATION_T__ diff --git a/Marlin/src/libs/point_t.h b/Marlin/src/libs/point_t.h index 37ade7eba7..7a065cb33b 100644 --- a/Marlin/src/libs/point_t.h +++ b/Marlin/src/libs/point_t.h @@ -19,9 +19,9 @@ * along with this program. If not, see . * */ +#pragma once -#ifndef __POINT_T__ -#define __POINT_T__ +#include /** * @brief Cartesian Point @@ -53,5 +53,3 @@ struct point_t { point_t(const float x, const float y) : point_t(x, y, NAN) {} }; - -#endif // __POINT_T__ diff --git a/Marlin/src/libs/stopwatch.h b/Marlin/src/libs/stopwatch.h index 64099e7744..358f636ca2 100644 --- a/Marlin/src/libs/stopwatch.h +++ b/Marlin/src/libs/stopwatch.h @@ -27,7 +27,7 @@ //#define DEBUG_STOPWATCH #include "../core/macros.h" // for FORCE_INLINE -#include "../core/types.h" // for millis_t +#include "../core/millis_t.h" /** * @brief Stopwatch class diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index 150f562802..2e34fb3028 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 "V61" +#define EEPROM_VERSION "V62" #define EEPROM_OFFSET 100 // Check the integrity of data offsets. @@ -81,15 +81,10 @@ #include "../module/probe.h" #endif -#if ENABLED(FWRETRACT) - #include "../feature/fwretract.h" -#endif +#include "../feature/fwretract.h" +#include "../feature/pause.h" -#if ENABLED(ADVANCED_PAUSE_FEATURE) - #include "../feature/pause.h" -#endif - -#if ENABLED(SINGLENOZZLE) +#if EXTRUDERS > 1 #include "tool_change.h" void M217_report(const bool eeprom); #endif @@ -199,10 +194,8 @@ typedef struct SettingsDataStruct { #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS float x2_endstop_adj, // M666 X y2_endstop_adj, // M666 Y - z2_endstop_adj; // M666 Z - #if ENABLED(Z_TRIPLE_ENDSTOPS) - float z3_endstop_adj; // M666 Z - #endif + z2_endstop_adj, // M666 Z (S2) + z3_endstop_adj; // M666 Z (S3) #endif // @@ -275,8 +268,8 @@ typedef struct SettingsDataStruct { // // SINGLENOZZLE toolchange values // - #if ENABLED(SINGLENOZZLE) - singlenozzle_settings_t sn_settings; // M217 S P R + #if EXTRUDERS > 1 + toolchange_settings_t toolchange_settings; // M217 S P R #endif } SettingsData; @@ -934,7 +927,7 @@ void MarlinSettings::postprocess() { // { #if DISABLED(ADVANCED_PAUSE_FEATURE) - const fil_change_settings_t fc_settings[EXTRUDERS] = { { 0 } }; + const fil_change_settings_t fc_settings[EXTRUDERS] = { 0, 0 }; #endif _FIELD_TEST(fc_settings); EEPROM_WRITE(fc_settings); @@ -944,9 +937,9 @@ void MarlinSettings::postprocess() { // SINGLENOZZLE // - #if ENABLED(SINGLENOZZLE) - _FIELD_TEST(sn_settings); - EEPROM_WRITE(sn_settings); + #if EXTRUDERS > 1 + _FIELD_TEST(toolchange_settings); + EEPROM_WRITE(toolchange_settings); #endif // @@ -1313,6 +1306,9 @@ void MarlinSettings::postprocess() { #if ENABLED(FWRETRACT) EEPROM_READ(fwretract.settings); + #else + fwretract_settings_t fwretract_settings; + EEPROM_READ(fwretract_settings); #endif #if ENABLED(FWRETRACT) && ENABLED(FWRETRACT_AUTORETRACT) EEPROM_READ(fwretract.autoretract_enabled); @@ -1569,9 +1565,9 @@ void MarlinSettings::postprocess() { // // SINGLENOZZLE toolchange values // - #if ENABLED(SINGLENOZZLE) - _FIELD_TEST(sn_settings); - EEPROM_READ(sn_settings); + #if EXTRUDERS > 1 + _FIELD_TEST(toolchange_settings); + EEPROM_READ(toolchange_settings); #endif eeprom_error = size_error(eeprom_index - (EEPROM_OFFSET)); @@ -1832,10 +1828,16 @@ void MarlinSettings::reset(PORTARG_SOLO) { #endif #endif - #if ENABLED(SINGLENOZZLE) - sn_settings.swap_length = SINGLENOZZLE_SWAP_LENGTH; - sn_settings.prime_speed = SINGLENOZZLE_SWAP_PRIME_SPEED; - sn_settings.retract_speed = SINGLENOZZLE_SWAP_RETRACT_SPEED; + #if EXTRUDERS > 1 + #if ENABLED(SINGLENOZZLE) + toolchange_settings.swap_length = SINGLENOZZLE_SWAP_LENGTH; + toolchange_settings.prime_speed = SINGLENOZZLE_SWAP_PRIME_SPEED; + toolchange_settings.retract_speed = SINGLENOZZLE_SWAP_RETRACT_SPEED; + #if ENABLED(SINGLENOZZLE_SWAP_PARK) + toolchange_settings.change_point = SINGLENOZZLE_TOOLCHANGE_XY; + #endif + #endif + toolchange_settings.z_raise = TOOLCHANGE_ZRAISE; #endif // @@ -2096,15 +2098,11 @@ void MarlinSettings::reset(PORTARG_SOLO) { */ CONFIG_ECHO_START; #if ENABLED(INCH_MODE_SUPPORT) - #define LINEAR_UNIT(N) (float(N) / parser.linear_unit_factor) - #define VOLUMETRIC_UNIT(N) (float(N) / (parser.volumetric_enabled ? parser.volumetric_unit_factor : parser.linear_unit_factor)) SERIAL_ECHOPGM_P(port, " G2"); SERIAL_CHAR_P(port, parser.linear_unit_factor == 1.0 ? '1' : '0'); SERIAL_ECHOPGM_P(port, " ;"); SAY_UNITS_P(port, false); #else - #define LINEAR_UNIT(N) (N) - #define VOLUMETRIC_UNIT(N) (N) SERIAL_ECHOPGM_P(port, " G21 ; Units in mm"); SAY_UNITS_P(port, false); #endif @@ -2116,13 +2114,11 @@ void MarlinSettings::reset(PORTARG_SOLO) { CONFIG_ECHO_START; #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - #define TEMP_UNIT(N) parser.to_temp_units(N) SERIAL_ECHOPGM_P(port, " M149 "); SERIAL_CHAR_P(port, parser.temp_units_code()); SERIAL_ECHOPGM_P(port, " ; Units in "); serialprintPGM_P(port, parser.temp_units_name()); #else - #define TEMP_UNIT(N) (N) SERIAL_ECHOLNPGM_P(port, " M149 C ; Units in Celsius"); #endif @@ -2551,7 +2547,7 @@ void MarlinSettings::reset(PORTARG_SOLO) { 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_zlift)); + SERIAL_ECHOLNPAIR_P(port, " Z", LINEAR_UNIT(fwretract.settings.retract_zraise)); if (!forReplay) { CONFIG_ECHO_START; diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 0430abb268..7049edb07c 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -36,6 +36,10 @@ #include HAL_PATH(../HAL, endstop_interrupts.h) #endif +#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) && ENABLED(SDSUPPORT) + #include "../module/printcounter.h" // for print_job_timer +#endif + Endstops endstops; // public: @@ -274,17 +278,15 @@ void Endstops::enable(const bool onoff) { void Endstops::not_homing() { enabled = enabled_globally; - #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) - // Still 'enabled'? Then endstops are always on and kept in sync. - // Otherwise reset 'live's variables to let axes move in both directions. - if (!enabled) { - #if ENDSTOP_NOISE_THRESHOLD - endstop_poll_count = 0; // Stop filtering (MUST be done first to prevent race condition) - validated_live_state = 0; - #endif - live_state = 0; - } - #endif + // Still 'enabled'? Then endstops are always on and kept in sync. + // Otherwise reset 'live's variables to let axes move in both directions. + if (!enabled) { + #if ENDSTOP_NOISE_THRESHOLD + endstop_poll_count = 0; // Stop filtering (MUST be done first to prevent race condition) + validated_live_state = 0; + #endif + live_state = 0; + } } #if ENABLED(VALIDATE_HOMING_ENDSTOPS) @@ -359,7 +361,8 @@ void Endstops::event_handler() { card.sdprinting = false; card.closefile(); quickstop_stepper(); - thermalManager.disable_all_heaters(); // switch off all heaters. + thermalManager.disable_all_heaters(); + print_job_timer.stop(); } #endif } diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index bc28c778c3..22d071f65d 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1158,7 +1158,11 @@ void set_axis_is_at_home(const AxisEnum axis) { #if ENABLED(MORGAN_SCARA) scara_set_axis_is_at_home(axis); #elif ENABLED(DELTA) - current_position[axis] = (axis == Z_AXIS ? delta_height : base_home_pos(axis)); + current_position[axis] = (axis == Z_AXIS ? delta_height + #if HAS_BED_PROBE + - zprobe_zoffset + Z_PROBE_OFFSET_FROM_EXTRUDER + #endif + : base_home_pos(axis)); #else current_position[axis] = base_home_pos(axis); #endif @@ -1514,7 +1518,11 @@ void homeaxis(const AxisEnum axis) { } #elif ENABLED(DELTA) soft_endstop_min[axis] = base_min_pos(axis); - soft_endstop_max[axis] = (axis == Z_AXIS ? delta_height : base_max_pos(axis)); + soft_endstop_max[axis] = (axis == Z_AXIS ? delta_height + #if HAS_BED_PROBE + - zprobe_zoffset + Z_PROBE_OFFSET_FROM_EXTRUDER + #endif + : base_max_pos(axis)); #else soft_endstop_min[axis] = base_min_pos(axis); soft_endstop_max[axis] = base_max_pos(axis); diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 1b4f727c8e..b0e13dd0a4 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -108,7 +108,7 @@ XYZ_DEFS(signed char, home_dir, HOME_DIR); extern bool soft_endstops_enabled; void clamp_to_software_endstops(float target[XYZ]); #else - #define soft_endstops_enabled false + constexpr bool soft_endstops_enabled = false; #define clamp_to_software_endstops(x) NOOP #endif @@ -155,6 +155,14 @@ void do_blocking_move_to_x(const float &rx, const float &fr_mm_s=0); void do_blocking_move_to_z(const float &rz, const float &fr_mm_s=0); void do_blocking_move_to_xy(const float &rx, const float &ry, const float &fr_mm_s=0); +FORCE_INLINE void do_blocking_move_to(const float (&raw)[XYZ], const float &fr_mm_s) { + do_blocking_move_to(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], fr_mm_s); +} + +FORCE_INLINE void do_blocking_move_to(const float (&raw)[XYZE], const float &fr_mm_s) { + do_blocking_move_to(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], fr_mm_s); +} + void setup_for_endstop_or_probe_move(); void clean_up_after_endstop_or_probe_move(); diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 7d1f30f5d8..6181528c03 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -141,9 +141,6 @@ float Planner::steps_to_mm[XYZE_N]; // (mm) Millimeters per step #if ENABLED(DISTINCT_E_FACTORS) uint8_t Planner::last_extruder = 0; // Respond to extruder change - #define _EINDEX (E_AXIS + active_extruder) -#else - #define _EINDEX E_AXIS #endif int16_t Planner::flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100); // Extrusion factor for each extruder @@ -1749,10 +1746,8 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Bail if this is a zero-length block if (block->step_event_count < MIN_STEPS_PER_SEGMENT) return false; - // For a mixing extruder, get a magnified esteps for each #if ENABLED(MIXING_EXTRUDER) - for (uint8_t i = 0; i < MIXING_STEPPERS; i++) - block->mix_steps[i] = mixing_factor[i] * esteps; + MIXER_POPULATE_BLOCK(); #endif #if FAN_COUNT > 0 @@ -1765,7 +1760,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, #endif #if EXTRUDERS > 1 - block->active_extruder = extruder; + block->extruder = extruder; #endif #if ENABLED(AUTO_POWER_CONTROL) @@ -2066,15 +2061,14 @@ bool Planner::_populate_block(block_t * const block, bool split_move, // Calculate and limit speed in mm/sec for each axis float current_speed[NUM_AXIS], speed_factor = 1.0f; // factor <1 decreases speed LOOP_XYZE(i) { - #if ENABLED(MIXING_EXTRUDER) + #if ENABLED(MIXING_EXTRUDER) && ENABLED(RETRACT_SYNC_MIXING) + // In worst case, only one extruder running, no change is needed. + // In best case, all extruders run the same amount, we can divide by MIXING_STEPPERS float delta_mm_i = 0; - if (i == E_AXIS) { - for (uint8_t s = 0; s < MIXING_STEPPERS; s++) { - const float delta_mm_s = mixing_factor[s] * delta_mm[i]; - if (ABS(delta_mm_s) > ABS(delta_mm_i)) delta_mm_i = delta_mm_s; - } - } - else delta_mm_i = delta_mm[i]; + if (i == E_AXIS && mixer.get_current_v_tool() == MIXER_AUTORETRACT_TOOL) + delta_mm_i = delta_mm[i] / MIXING_STEPPERS; + else + delta_mm_i = delta_mm[i]; #else const float delta_mm_i = delta_mm[i]; #endif @@ -2699,7 +2693,7 @@ void Planner::set_machine_position_mm(const float &a, const float &b, const floa position[A_AXIS] = LROUND(a * settings.axis_steps_per_mm[A_AXIS]); position[B_AXIS] = LROUND(b * settings.axis_steps_per_mm[B_AXIS]); position[C_AXIS] = LROUND(c * settings.axis_steps_per_mm[C_AXIS]); - position[E_AXIS] = LROUND(e * settings.axis_steps_per_mm[_EINDEX]); + position[E_AXIS] = LROUND(e * settings.axis_steps_per_mm[E_AXIS_N(active_extruder)]); #if HAS_POSITION_FLOAT position_float[A_AXIS] = a; position_float[B_AXIS] = b; @@ -2741,11 +2735,9 @@ void Planner::set_position_mm(const float &rx, const float &ry, const float &rz, * Setters for planner position (also setting stepper position). */ void Planner::set_e_position_mm(const float &e) { + const uint8_t axis_index = E_AXIS_N(active_extruder); #if ENABLED(DISTINCT_E_FACTORS) - const uint8_t axis_index = E_AXIS + active_extruder; last_extruder = active_extruder; - #else - const uint8_t axis_index = E_AXIS; #endif #if ENABLED(FWRETRACT) float e_new = e - fwretract.current_retract[active_extruder]; @@ -2768,7 +2760,7 @@ void Planner::set_e_position_mm(const float &e) { // Recalculate the steps/s^2 acceleration rates, based on the mm/s^2 void Planner::reset_acceleration_rates() { #if ENABLED(DISTINCT_E_FACTORS) - #define AXIS_CONDITION (i < E_AXIS || i == E_AXIS + active_extruder) + #define AXIS_CONDITION (i < E_AXIS || i == E_AXIS_N(active_extruder)) #else #define AXIS_CONDITION true #endif diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index d3a0b1ee96..8cf37f0758 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -47,6 +47,10 @@ #include "../feature/fwretract.h" #endif +#if ENABLED(MIXING_EXTRUDER) + #include "../feature/mixing.h" +#endif + enum BlockFlagBit : char { // Recalculate trapezoids on entry junction. For optimization. BLOCK_BIT_RECALCULATE, @@ -79,7 +83,7 @@ enum BlockFlag : char { * The "nominal" values are as-specified by gcode, and * may never actually be reached due to acceleration limits. */ -typedef struct { +typedef struct block_t { volatile uint8_t flag; // Block flags (See BlockFlag enum above) - Modified by ISR and main thread! @@ -104,11 +108,13 @@ typedef struct { uint32_t step_event_count; // The number of step events required to complete this block #if EXTRUDERS > 1 - uint8_t active_extruder; // The extruder to move (if E move) + uint8_t extruder; // The extruder to move (if E move) + #else + static constexpr uint8_t extruder = 0; #endif #if ENABLED(MIXING_EXTRUDER) - uint32_t mix_steps[MIXING_STEPPERS]; // Scaled steps[E_AXIS] for the mixing steppers + MIXER_BLOCK_DEFINITION; // Normalized color for the mixing steppers #endif // Settings for the trapezoid generator diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index b19433b10f..61d7372247 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -94,10 +94,6 @@ float zprobe_zoffset; // Initialized by settings.load() #elif ENABLED(Z_PROBE_ALLEN_KEY) - FORCE_INLINE void do_blocking_move_to(const float (&raw)[XYZ], const float &fr_mm_s) { - do_blocking_move_to(raw[X_AXIS], raw[Y_AXIS], raw[Z_AXIS], fr_mm_s); - } - void run_deploy_moves_script() { #if defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_X) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Y) || defined(Z_PROBE_ALLEN_KEY_DEPLOY_1_Z) #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_X @@ -367,18 +363,53 @@ inline void do_probe_raise(const float z_raise) { do_blocking_move_to_z(z_dest); } +FORCE_INLINE void probe_specific_action(const bool deploy) { + #if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + + BUZZ(100, 659); + BUZZ(100, 698); + + PGM_P const ds_str = deploy ? PSTR(MSG_MANUAL_DEPLOY) : PSTR(MSG_MANUAL_STOW); + lcd_setstatusPGM(ds_str); + serialprintPGM(ds_str); + SERIAL_EOL(); + + KEEPALIVE_STATE(PAUSED_FOR_USER); + wait_for_user = true; + while (wait_for_user) idle(); + lcd_reset_status(); + KEEPALIVE_STATE(IN_HANDLER); + + #endif // PAUSE_BEFORE_DEPLOY_STOW + + #if ENABLED(SOLENOID_PROBE) + + #if HAS_SOLENOID_1 + WRITE(SOL1_PIN, deploy); + #endif + + #elif ENABLED(Z_PROBE_SLED) + + dock_sled(!deploy); + + #elif HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH) + + MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][deploy ? 0 : 1]); + + #elif ENABLED(Z_PROBE_ALLEN_KEY) + + deploy ? run_deploy_moves_script() : run_stow_moves_script(); + + #elif ENABLED(RACK_AND_PINION_PROBE) + + do_blocking_move_to_x(deploy ? Z_PROBE_DEPLOY_X : Z_PROBE_RETRACT_X); + + #endif +} + // returns false for ok and true for failure bool set_probe_deployed(const bool deploy) { - // Can be extended to servo probes, if needed. - #if ENABLED(PROBE_IS_TRIGGERED_WHEN_STOWED_TEST) - #if ENABLED(Z_MIN_PROBE_ENDSTOP) - #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING) - #else - #define _TRIGGERED_WHEN_STOWED_TEST (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) - #endif - #endif - #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { DEBUG_POS("set_probe_deployed", current_position); @@ -424,61 +455,24 @@ bool set_probe_deployed(const bool deploy) { const float oldXpos = current_position[X_AXIS], oldYpos = current_position[Y_AXIS]; - #ifdef _TRIGGERED_WHEN_STOWED_TEST - - // If endstop is already false, the Z probe is deployed - if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // closed after the probe specific actions. - // Would a goto be less ugly? - //while (!_TRIGGERED_WHEN_STOWED_TEST) idle(); // would offer the opportunity - // for a triggered when stowed manual probe. - - if (!deploy) endstops.enable_z_probe(false); // Switch off triggered when stowed probes early - // otherwise an Allen-Key probe can't be stowed. + #if ENABLED(PROBE_TRIGGERED_WHEN_STOWED_TEST) + #if ENABLED(Z_MIN_PROBE_ENDSTOP) + #define PROBE_STOWED() (READ(Z_MIN_PROBE_PIN) != Z_MIN_PROBE_ENDSTOP_INVERTING) + #else + #define PROBE_STOWED() (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING) + #endif #endif - #if ENABLED(PAUSE_BEFORE_DEPLOY_STOW) + #ifdef PROBE_STOWED - BUZZ(100, 659); - BUZZ(100, 698); - - PGM_P const ds_str = deploy ? PSTR(MSG_MANUAL_DEPLOY) : PSTR(MSG_MANUAL_STOW); - lcd_setstatusPGM(ds_str); - serialprintPGM(ds_str); - SERIAL_EOL(); - - KEEPALIVE_STATE(PAUSED_FOR_USER); - wait_for_user = true; - while (wait_for_user) idle(); - lcd_reset_status(); - KEEPALIVE_STATE(IN_HANDLER); - - #endif // PAUSE_BEFORE_DEPLOY_STOW - - #if ENABLED(SOLENOID_PROBE) - - #if HAS_SOLENOID_1 - WRITE(SOL1_PIN, deploy); - #endif - - #elif ENABLED(Z_PROBE_SLED) - - dock_sled(!deploy); - - #elif HAS_Z_SERVO_PROBE && DISABLED(BLTOUCH) - - MOVE_SERVO(Z_PROBE_SERVO_NR, servo_angles[Z_PROBE_SERVO_NR][deploy ? 0 : 1]); - - #elif ENABLED(Z_PROBE_ALLEN_KEY) - - deploy ? run_deploy_moves_script() : run_stow_moves_script(); - - #endif - - #ifdef _TRIGGERED_WHEN_STOWED_TEST - } // _TRIGGERED_WHEN_STOWED_TEST == deploy - - if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // State hasn't changed? + // Only deploy/stow if needed + if (PROBE_STOWED() == deploy) { + if (!deploy) endstops.enable_z_probe(false); // Switch off triggered when stowed probes early + // otherwise an Allen-Key probe can't be stowed. + probe_specific_action(deploy); + } + if (PROBE_STOWED() == deploy) { // Unchanged after deploy/stow action? if (IsRunning()) { SERIAL_ERROR_START(); SERIAL_ERRORLNPGM("Z-Probe failed"); @@ -486,8 +480,11 @@ bool set_probe_deployed(const bool deploy) { } stop(); return true; + } - } // _TRIGGERED_WHEN_STOWED_TEST == deploy + #else + + probe_specific_action(deploy); #endif diff --git a/Marlin/src/module/servo.h b/Marlin/src/module/servo.h index bd7e2acf5c..04582431dd 100644 --- a/Marlin/src/module/servo.h +++ b/Marlin/src/module/servo.h @@ -27,6 +27,7 @@ #ifndef _SERVO_H_ #define _SERVO_H_ +#include "../inc/MarlinConfig.h" #include "../HAL/shared/servo.h" extern HAL_SERVO_LIB servo[NUM_SERVOS]; @@ -35,8 +36,6 @@ extern void servo_init(); #define MOVE_SERVO(I, P) servo[I].move(P) -#include "../inc/MarlinConfig.h" - #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]) diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index e080bfb347..e8b9e42c3b 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -103,8 +103,16 @@ #include #endif +#if ENABLED(MIXING_EXTRUDER) + #include "../feature/mixing.h" +#endif + Stepper stepper; // Singleton +#if FILAMENT_RUNOUT_DISTANCE_MM > 0 + #include "../feature/runout.h" +#endif + // public: #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS @@ -158,12 +166,10 @@ uint32_t Stepper::advance_dividend[XYZE] = { 0 }, Stepper::decelerate_after, // The point from where we need to start decelerating Stepper::step_event_count; // The total event count for the current block -#if ENABLED(MIXING_EXTRUDER) - int32_t Stepper::delta_error_m[MIXING_STEPPERS]; - uint32_t Stepper::advance_dividend_m[MIXING_STEPPERS], - Stepper::advance_divisor_m; -#elif EXTRUDERS > 1 - uint8_t Stepper::active_extruder; // Active extruder +#if EXTRUDERS > 1 || ENABLED(MIXING_EXTRUDER) + uint8_t Stepper::stepper_extruder; +#else + constexpr uint8_t Stepper::stepper_extruder; #endif #if ENABLED(S_CURVE_ACCELERATION) @@ -301,7 +307,7 @@ int8_t Stepper::count_direction[NUM_AXIS] = { 0, 0, 0, 0 }; #endif #if DISABLED(MIXING_EXTRUDER) - #define E_APPLY_STEP(v,Q) E_STEP_WRITE(active_extruder, v) + #define E_APPLY_STEP(v,Q) E_STEP_WRITE(stepper_extruder, v) #endif void Stepper::wake_up() { @@ -340,21 +346,23 @@ void Stepper::set_directions() { #if DISABLED(LIN_ADVANCE) #if ENABLED(MIXING_EXTRUDER) + // Because this is valid for the whole block we don't know + // what e-steppers will step. Likely all. Set all. if (motor_direction(E_AXIS)) { - MIXING_STEPPERS_LOOP(j) REV_E_DIR(j); + MIXER_STEPPER_LOOP(j) REV_E_DIR(j); count_direction[E_AXIS] = -1; } else { - MIXING_STEPPERS_LOOP(j) NORM_E_DIR(j); + MIXER_STEPPER_LOOP(j) NORM_E_DIR(j); count_direction[E_AXIS] = 1; } #else if (motor_direction(E_AXIS)) { - REV_E_DIR(active_extruder); + REV_E_DIR(stepper_extruder); count_direction[E_AXIS] = -1; } else { - NORM_E_DIR(active_extruder); + NORM_E_DIR(stepper_extruder); count_direction[E_AXIS] = 1; } #endif @@ -1387,39 +1395,27 @@ void Stepper::stepper_pulse_phase_isr() { PULSE_START(Z); #endif - // Pulse E/Mixing extruders - #if ENABLED(LIN_ADVANCE) - // Tick the E axis, correct error term and update position + // Pulse Extruders + // Tick the E axis, correct error term and update position + #if ENABLED(LIN_ADVANCE) || ENABLED(MIXING_EXTRUDER) delta_error[E_AXIS] += advance_dividend[E_AXIS]; if (delta_error[E_AXIS] >= 0) { count_position[E_AXIS] += count_direction[E_AXIS]; - delta_error[E_AXIS] -= advance_divisor; - - // Don't step E here - But remember the number of steps to perform - motor_direction(E_AXIS) ? --LA_steps : ++LA_steps; - } - #else // !LIN_ADVANCE - use linear interpolation for E also - #if ENABLED(MIXING_EXTRUDER) - - // Tick the E axis - delta_error[E_AXIS] += advance_dividend[E_AXIS]; - if (delta_error[E_AXIS] >= 0) { - count_position[E_AXIS] += count_direction[E_AXIS]; + #if ENABLED(LIN_ADVANCE) delta_error[E_AXIS] -= advance_divisor; - } - - // Tick the counters used for this mix in proper proportion - MIXING_STEPPERS_LOOP(j) { - // Step mixing steppers (proportionally) - delta_error_m[j] += advance_dividend_m[j]; - // Step when the counter goes over zero - if (delta_error_m[j] >= 0) E_STEP_WRITE(j, !INVERT_E_STEP_PIN); - } - - #else // !MIXING_EXTRUDER + // Don't step E here - But remember the number of steps to perform + motor_direction(E_AXIS) ? --LA_steps : ++LA_steps; + #else // !LIN_ADVANCE && MIXING_EXTRUDER + // Don't adjust delta_error[E_AXIS] here! + // Being positive is the criteria for ending the pulse. + E_STEP_WRITE(mixer.get_next_stepper(), !INVERT_E_STEP_PIN); + #endif + } + #else // !LIN_ADVANCE && !MIXING_EXTRUDER + #if HAS_E0_STEP PULSE_START(E); #endif - #endif // !LIN_ADVANCE + #endif #if MINIMUM_STEPPER_PULSE // Just wait for the requested pulse duration @@ -1442,14 +1438,14 @@ void Stepper::stepper_pulse_phase_isr() { #if DISABLED(LIN_ADVANCE) #if ENABLED(MIXING_EXTRUDER) - MIXING_STEPPERS_LOOP(j) { - if (delta_error_m[j] >= 0) { - delta_error_m[j] -= advance_divisor_m; - E_STEP_WRITE(j, INVERT_E_STEP_PIN); - } + if (delta_error[E_AXIS] >= 0) { + delta_error[E_AXIS] -= advance_divisor; + E_STEP_WRITE(mixer.get_stepper(), INVERT_E_STEP_PIN); } #else // !MIXING_EXTRUDER - PULSE_STOP(E); + #if HAS_E0_STEP + PULSE_STOP(E); + #endif #endif #endif // !LIN_ADVANCE @@ -1483,6 +1479,9 @@ 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); + #endif axis_did_move = 0; current_block = NULL; planner.discard_current_block(); @@ -1717,27 +1716,18 @@ uint32_t Stepper::stepper_block_phase_isr() { decelerate_after = current_block->decelerate_after << oversampling; #if ENABLED(MIXING_EXTRUDER) - const uint32_t e_steps = ( - #if ENABLED(LIN_ADVANCE) - current_block->steps[E_AXIS] - #else - step_event_count - #endif - ); - MIXING_STEPPERS_LOOP(i) { - delta_error_m[i] = -int32_t(e_steps); - advance_dividend_m[i] = current_block->mix_steps[i] << 1; - } - advance_divisor_m = e_steps << 1; - #elif EXTRUDERS > 1 - active_extruder = current_block->active_extruder; + MIXER_STEPPER_SETUP(); + #endif + + #if EXTRUDERS > 1 + stepper_extruder = current_block->extruder; #endif // Initialize the trapezoid generator from the current block. #if ENABLED(LIN_ADVANCE) #if DISABLED(MIXING_EXTRUDER) && E_STEPPERS > 1 // If the now active extruder wasn't in use during the last move, its pressure is most likely gone. - if (active_extruder != last_moved_extruder) LA_current_adv_steps = 0; + if (stepper_extruder != last_moved_extruder) LA_current_adv_steps = 0; #endif if ((LA_use_advance_lead = current_block->use_advance_lead)) { @@ -1751,13 +1741,13 @@ uint32_t Stepper::stepper_block_phase_isr() { #endif if (current_block->direction_bits != last_direction_bits - #if DISABLED(MIXING_EXTRUDER) - || active_extruder != last_moved_extruder - #endif + #if DISABLED(MIXING_EXTRUDER) + || stepper_extruder != last_moved_extruder + #endif ) { last_direction_bits = current_block->direction_bits; - #if DISABLED(MIXING_EXTRUDER) && EXTRUDERS > 1 - last_moved_extruder = active_extruder; + #if EXTRUDERS > 1 + last_moved_extruder = stepper_extruder; #endif set_directions(); } @@ -1827,15 +1817,17 @@ uint32_t Stepper::stepper_block_phase_isr() { interval = LA_ADV_NEVER; #if ENABLED(MIXING_EXTRUDER) + // We don't know which steppers will be stepped because LA loop follows, + // with potentially multiple steps. Set all. if (LA_steps >= 0) - MIXING_STEPPERS_LOOP(j) NORM_E_DIR(j); + MIXER_STEPPER_LOOP(j) NORM_E_DIR(j); else - MIXING_STEPPERS_LOOP(j) REV_E_DIR(j); + MIXER_STEPPER_LOOP(j) REV_E_DIR(j); #else if (LA_steps >= 0) - NORM_E_DIR(active_extruder); + NORM_E_DIR(stepper_extruder); else - REV_E_DIR(active_extruder); + REV_E_DIR(stepper_extruder); #endif // Get the timer count and estimate the end of the pulse @@ -1848,14 +1840,9 @@ uint32_t Stepper::stepper_block_phase_isr() { // Set the STEP pulse ON #if ENABLED(MIXING_EXTRUDER) - MIXING_STEPPERS_LOOP(j) { - // Step mixing steppers (proportionally) - delta_error_m[j] += advance_dividend_m[j]; - // Step when the counter goes over zero - if (delta_error_m[j] >= 0) E_STEP_WRITE(j, !INVERT_E_STEP_PIN); - } + E_STEP_WRITE(mixer.get_next_stepper(), !INVERT_E_STEP_PIN); #else - E_STEP_WRITE(active_extruder, !INVERT_E_STEP_PIN); + E_STEP_WRITE(stepper_extruder, !INVERT_E_STEP_PIN); #endif // Enforce a minimum duration for STEP pulse ON @@ -1871,14 +1858,9 @@ uint32_t Stepper::stepper_block_phase_isr() { // Set the STEP pulse OFF #if ENABLED(MIXING_EXTRUDER) - MIXING_STEPPERS_LOOP(j) { - if (delta_error_m[j] >= 0) { - delta_error_m[j] -= advance_divisor_m; - E_STEP_WRITE(j, INVERT_E_STEP_PIN); - } - } + E_STEP_WRITE(mixer.get_stepper(), INVERT_E_STEP_PIN); #else - E_STEP_WRITE(active_extruder, INVERT_E_STEP_PIN); + E_STEP_WRITE(stepper_extruder, INVERT_E_STEP_PIN); #endif // For minimum pulse time wait before looping @@ -2106,8 +2088,7 @@ void Stepper::init() { endstops.enable(true); // Start with endstops active. After homing they can be disabled sei(); - - set_directions(); // Init directions to last_direction_bits = 0 + set_directions(); // Init directions to last_direction_bits = 0 Keeps Z from being reversed } /** diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 95f28dc914..b9e7ead995 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -150,7 +150,12 @@ #define ISR_E_STEPPER_CYCLES ISR_STEPPER_CYCLES // If linear advance is disabled, then the loop also handles them -#if DISABLED(LIN_ADVANCE) && ENABLED(MIXING_EXTRUDER) +#if DISABLED(LIN_ADVANCE) && ENABLED(MIXING_EXTRUDER) // ToDo: ??? + // HELP ME: What is what? + // Directions are set up for MIXING_STEPPERS - like before. + // Finding the right stepper may last up to MIXING_STEPPERS loops in get_next_stepper(). + // These loops are a bit faster than advancing a bresenham counter. + // Always only one e-stepper is stepped. #define ISR_START_MIXING_STEPPER_CYCLES ((MIXING_STEPPERS) * (ISR_START_STEPPER_CYCLES)) #define ISR_MIXING_STEPPER_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES)) #else @@ -188,7 +193,12 @@ #if ENABLED(LIN_ADVANCE) // Estimate the minimum LA loop time - #if ENABLED(MIXING_EXTRUDER) + #if ENABLED(MIXING_EXTRUDER) // ToDo: ??? + // HELP ME: What is what? + // Directions are set up for MIXING_STEPPERS - like before. + // Finding the right stepper may last up to MIXING_STEPPERS loops in get_next_stepper(). + // These loops are a bit faster than advancing a bresenham counter. + // Always only one e-stepper is stepped. #define MIN_ISR_LA_LOOP_CYCLES ((MIXING_STEPPERS) * (ISR_STEPPER_CYCLES)) #else #define MIN_ISR_LA_LOOP_CYCLES ISR_STEPPER_CYCLES @@ -292,17 +302,10 @@ class Stepper { decelerate_after, // The point from where we need to start decelerating step_event_count; // The total event count for the current block - // Mixing extruder mix delta_errors for bresenham tracing - #if ENABLED(MIXING_EXTRUDER) - static int32_t delta_error_m[MIXING_STEPPERS]; - static uint32_t advance_dividend_m[MIXING_STEPPERS], - advance_divisor_m; - #define MIXING_STEPPERS_LOOP(VAR) \ - for (uint8_t VAR = 0; VAR < MIXING_STEPPERS; VAR++) - #elif EXTRUDERS > 1 - static uint8_t active_extruder; + #if EXTRUDERS > 1 || ENABLED(MIXING_EXTRUDER) + static uint8_t stepper_extruder; #else - static constexpr uint8_t active_extruder = 0; + static constexpr uint8_t stepper_extruder = 0; #endif #if ENABLED(S_CURVE_ACCELERATION) diff --git a/Marlin/src/module/stepper_indirection.h b/Marlin/src/module/stepper_indirection.h index 6f75ef7153..0ca6aac9c6 100644 --- a/Marlin/src/module/stepper_indirection.h +++ b/Marlin/src/module/stepper_indirection.h @@ -60,8 +60,8 @@ #if HAS_TRINAMIC #include #include "../feature/tmc_util.h" - #if TMCSTEPPER_VERSION < 0x000001 - #error "Update TMCStepper library to 0.0.1 or newer." + #if TMCSTEPPER_VERSION < 0x000202 + #error "Update TMCStepper library to 0.2.2 or newer." #endif #define __TMC_CLASS(MODEL, A, I) TMCMarlin diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 322ba1c978..20d7b7c3ab 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -304,7 +304,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS]; SERIAL_ECHOLNPGM(MSG_PID_AUTOTUNE_START); - disable_all_heaters(); // switch off all heaters. + disable_all_heaters(); SHV(soft_pwm_amount, bias = d = (MAX_BED_POWER) >> 1, bias = d = (PID_MAX) >> 1); @@ -779,7 +779,7 @@ void Temperature::manage_heater() { #endif #if ENABLED(EMERGENCY_PARSER) - if (emergency_parser.killed_by_M112) kill(PSTR(MSG_KILLED)); + if (emergency_parser.killed_by_M112) kill(); #endif if (!temp_meas_ready) return; @@ -949,7 +949,7 @@ float Temperature::analog2temp(const int raw, const uint8_t e) { SERIAL_ERROR_START(); SERIAL_ERROR((int)e); SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER_NUM); - kill(PSTR(MSG_KILLED)); + kill(); return 0.0; } @@ -1551,9 +1551,6 @@ void Temperature::disable_all_heaters() { pause(false); #endif - // If all heaters go down then for sure our print job has stopped - print_job_timer.stop(); - #define DISABLE_HEATER(NR) { \ setTargetHotend(0, NR); \ soft_pwm_amount[NR] = 0; \ diff --git a/Marlin/src/module/thermistor/thermistor_75.h b/Marlin/src/module/thermistor/thermistor_75.h index 5d9350a9ce..488535aaad 100644 --- a/Marlin/src/module/thermistor/thermistor_75.h +++ b/Marlin/src/module/thermistor/thermistor_75.h @@ -20,51 +20,60 @@ * */ -// R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, -// Generic Silicon Heat Pad with NTC 100K thermistor -// -// Many of the generic silicon heat pads use the MGB18-104F39050L32 Thermistor It is used for various -// wattage and voltage heat pads. This table is correct if this part is used. It has been -// optimized to provide good granularity around the 60 C. and 110 C. which corrisponds to bed temperatures -// for PLA and ABS. If you are printing higher temperature filament such as nylon you can uncomment -// the higher earlier entries in the table to give better accuracy. But for speed reasons, if these -// temperatures are not going to be used, it is better to leave them commented out. +/** + * R25 = 100 kOhm, beta25 = 4100 K, 4.7 kOhm pull-up, + * Generic Silicon Heat Pad with NTC 100K thermistor + * + * Many generic silicone heat pads use the MGB18-104F39050L32 thermistor, applicable to various + * wattages and voltages. This table is correct if this part is used. It's been optimized + * to provide good granularity in the 60-110C range, good for PLA and ABS. For higher temperature + * filament (e.g., nylon) uncomment HIGH_TEMP_RANGE_75 for increased accuracy. If higher + * temperatures aren't used it can improve performance slightly to leave it commented out. + */ + +//#define HIGH_TEMP_RANGE_75 const short temptable_75[][2] PROGMEM = { // Generic Silicon Heat Pad with NTC 100K MGB18-104F39050L32 thermistor - { (short) ( 111.06 * OVERSAMPLENR ), 200 }, // v=0.542 r=571.747 res=0.501 degC/count -// { (short) ( 174.87 * OVERSAMPLENR ), 175 }, // v=0.854 r=967.950 res=0.311 degC/count These values are valid. But they serve no -// { (short) ( 191.64 * OVERSAMPLENR ), 170 }, // v=0.936 r=1082.139 res=0.284 degC/count purpose. It is better to delete them so -// { (short) ( 209.99 * OVERSAMPLENR ), 165 }, // v=1.025 r=1212.472 res=0.260 degC/count the search is quicker and get to the meaningful -// { (short) ( 230.02 * OVERSAMPLENR ), 160 }, // v=1.123 r=1361.590 res=0.239 degC/count part of the table sooner. -// { (short) ( 251.80 * OVERSAMPLENR ), 155 }, // v=1.230 r=1532.621 res=0.220 degC/count - { (short) ( 275.43 * OVERSAMPLENR ), 150 }, // v=1.345 r=1729.283 res=0.203 degC/count -// { (short) ( 300.92 * OVERSAMPLENR ), 145 }, // v=1.469 r=1956.004 res=0.189 degC/coun - { (short) ( 328.32 * OVERSAMPLENR ), 140 }, // v=1.603 r=2218.081 res=0.176 degC/count - { (short) ( 388.65 * OVERSAMPLENR ), 130 }, // v=1.898 r=2874.980 res=0.156 degC/count - { (short) ( 421.39 * OVERSAMPLENR ), 125 }, // v=2.058 r=3286.644 res=0.149 degC/count - { (short) ( 455.65 * OVERSAMPLENR ), 120 }, // v=2.225 r=3768.002 res=0.143 degC/count - { (short) ( 491.17 * OVERSAMPLENR ), 115 }, // v=2.398 r=4332.590 res=0.139 degC/count - { (short) ( 527.68 * OVERSAMPLENR ), 110 }, // v=2.577 r=4996.905 res=0.136 degC/count - { (short) ( 564.81 * OVERSAMPLENR ), 105 }, // v=2.758 r=5781.120 res=0.134 degC/count - { (short) ( 602.19 * OVERSAMPLENR ), 100 }, // v=2.940 r=6710.000 res=0.134 degC/count - { (short) ( 676.03 * OVERSAMPLENR ), 90 }, // v=3.301 r=9131.018 res=0.138 degC/count - { (short) ( 745.85 * OVERSAMPLENR ), 80 }, // v=3.642 r=12602.693 res=0.150 degC/count - { (short) ( 778.31 * OVERSAMPLENR ), 75 }, // v=3.800 r=14889.001 res=0.159 degC/count - { (short) ( 808.75 * OVERSAMPLENR ), 70 }, // v=3.949 r=17658.700 res=0.171 degC/count - { (short) ( 836.94 * OVERSAMPLENR ), 65 }, // v=4.087 r=21028.040 res=0.185 degC/count - { (short) ( 862.74 * OVERSAMPLENR ), 60 }, // v=4.213 r=25144.568 res=0.204 degC/count - { (short) ( 886.08 * OVERSAMPLENR ), 55 }, // v=4.327 r=30196.449 res=0.227 degC/count - { (short) ( 906.97 * OVERSAMPLENR ), 50 }, // v=4.429 r=36424.838 res=0.255 degC/count - { (short) ( 941.65 * OVERSAMPLENR ), 40 }, // v=4.598 r=53745.337 res=0.333 degC/count - { (short) ( 967.76 * OVERSAMPLENR ), 30 }, // v=4.725 r=80880.630 res=0.452 degC/count - { (short) ( 978.03 * OVERSAMPLENR ), 25 }, // v=4.776 r=100000.000 res=0.535 degC/count - { (short) ( 981.68 * OVERSAMPLENR ), 23 }, // v=4.793 r=109024.395 res=0.573 degC/count - { (short) ( 983.41 * OVERSAMPLENR ), 22 }, // v=4.802 r=113875.430 res=0.594 degC/count - { (short) ( 985.08 * OVERSAMPLENR ), 21 }, // v=4.810 r=118968.955 res=0.616 degC/count - { (short) ( 986.70 * OVERSAMPLENR ), 20 }, // v=4.818 r=124318.354 res=0.638 degC/count - { (short) ( 993.94 * OVERSAMPLENR ), 15 }, // v=4.853 r=155431.302 res=0.768 degC/count - { (short) ( 999.96 * OVERSAMPLENR ), 10 }, // v=4.883 r=195480.023 res=0.934 degC/count - { (short) (1008.95 * OVERSAMPLENR ), 0 } // v=4.926 r=314997.575 res=1.418 degC/count + { OV(111.06), 200 }, // v=0.542 r=571.747 res=0.501 degC/count + + #ifdef HIGH_TEMP_RANGE_75 + { OV(174.87), 175 }, // v=0.854 r=967.950 res=0.311 degC/count These values are valid. But they serve no + { OV(191.64), 170 }, // v=0.936 r=1082.139 res=0.284 degC/count purpose. It is better to delete them so + { OV(209.99), 165 }, // v=1.025 r=1212.472 res=0.260 degC/count the search is quicker and get to the meaningful + { OV(230.02), 160 }, // v=1.123 r=1361.590 res=0.239 degC/count part of the table sooner. + { OV(251.80), 155 }, // v=1.230 r=1532.621 res=0.220 degC/count + #endif + + { OV(275.43), 150 }, // v=1.345 r=1729.283 res=0.203 degC/count + + #ifdef HIGH_TEMP_RANGE_75 + { OV(300.92), 145 }, // v=1.469 r=1956.004 res=0.189 degC/coun + #endif + + { OV(328.32), 140 }, // v=1.603 r=2218.081 res=0.176 degC/count + { OV(388.65), 130 }, // v=1.898 r=2874.980 res=0.156 degC/count + { OV(421.39), 125 }, // v=2.058 r=3286.644 res=0.149 degC/count + { OV(455.65), 120 }, // v=2.225 r=3768.002 res=0.143 degC/count + { OV(491.17), 115 }, // v=2.398 r=4332.590 res=0.139 degC/count + { OV(527.68), 110 }, // v=2.577 r=4996.905 res=0.136 degC/count + { OV(564.81), 105 }, // v=2.758 r=5781.120 res=0.134 degC/count + { OV(602.19), 100 }, // v=2.940 r=6710.000 res=0.134 degC/count + { OV(676.03), 90 }, // v=3.301 r=9131.018 res=0.138 degC/count + { OV(745.85), 80 }, // v=3.642 r=12602.693 res=0.150 degC/count + { OV(778.31), 75 }, // v=3.800 r=14889.001 res=0.159 degC/count + { OV(808.75), 70 }, // v=3.949 r=17658.700 res=0.171 degC/count + { OV(836.94), 65 }, // v=4.087 r=21028.040 res=0.185 degC/count + { OV(862.74), 60 }, // v=4.213 r=25144.568 res=0.204 degC/count + { OV(886.08), 55 }, // v=4.327 r=30196.449 res=0.227 degC/count + { OV(906.97), 50 }, // v=4.429 r=36424.838 res=0.255 degC/count + { OV(941.65), 40 }, // v=4.598 r=53745.337 res=0.333 degC/count + { OV(967.76), 30 }, // v=4.725 r=80880.630 res=0.452 degC/count + { OV(978.03), 25 }, // v=4.776 r=100000.000 res=0.535 degC/count + { OV(981.68), 23 }, // v=4.793 r=109024.395 res=0.573 degC/count + { OV(983.41), 22 }, // v=4.802 r=113875.430 res=0.594 degC/count + { OV(985.08), 21 }, // v=4.810 r=118968.955 res=0.616 degC/count + { OV(986.70), 20 }, // v=4.818 r=124318.354 res=0.638 degC/count + { OV(993.94), 15 }, // v=4.853 r=155431.302 res=0.768 degC/count + { OV(999.96), 10 }, // v=4.883 r=195480.023 res=0.934 degC/count + { OV(008.95), 0 } // v=4.926 r=314997.575 res=1.418 degC/count }; - - diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 0116ea2afe..68864cb2ba 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -20,6 +20,8 @@ * */ +#include "../inc/MarlinConfigPre.h" + #include "tool_change.h" #include "probe.h" @@ -29,16 +31,15 @@ #include "../Marlin.h" +#if EXTRUDERS > 1 + toolchange_settings_t toolchange_settings; // Initialized by settings.load() +#endif + #if ENABLED(SINGLENOZZLE) - singlenozzle_settings_t sn_settings; // Initialized by settings.load() uint16_t singlenozzle_temp[EXTRUDERS]; #if FAN_COUNT > 0 uint8_t singlenozzle_fan_speed[EXTRUDERS]; #endif - #if ENABLED(SINGLENOZZLE_SWAP_PARK) - #include "../libs/point_t.h" - const point_t singlenozzle_change_point = SINGLENOZZLE_TOOLCHANGE_POSITION; - #endif #endif #if ENABLED(PARKING_EXTRUDER) && PARKING_EXTRUDER_SOLENOIDS_DELAY > 0 @@ -146,7 +147,7 @@ #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("Start Autopark", current_position); #endif - current_position[Z_AXIS] += PARKING_EXTRUDER_SECURITY_RAISE; + current_position[Z_AXIS] += toolchange_settings.z_raise; #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("(1) Raise Z-Axis", current_position); #endif @@ -253,7 +254,7 @@ #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("Starting Toolhead change", current_position); #endif - current_position[Z_AXIS] += SWITCHING_TOOLHEAD_SECURITY_RAISE; + current_position[Z_AXIS] += toolchange_settings.z_raise; #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("(1) Raise Z-Axis", current_position); #endif @@ -360,19 +361,6 @@ inline void invalid_extruder_error(const uint8_t e) { SERIAL_ECHOLNPGM(MSG_INVALID_EXTRUDER); } -#if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - - inline void mixing_tool_change(const uint8_t tmp_extruder) { - if (tmp_extruder >= MIXING_VIRTUAL_TOOLS) - return invalid_extruder_error(tmp_extruder); - - // T0-Tnnn: Switch virtual tool by changing the mix - for (uint8_t j = 0; j < MIXING_STEPPERS; j++) - mixing_factor[j] = mixing_virtual_tool_mix[tmp_extruder][j]; - } - -#endif // MIXING_EXTRUDER && MIXING_VIRTUAL_TOOLS > 1 - #if ENABLED(DUAL_X_CARRIAGE) inline void dualx_tool_change(const uint8_t tmp_extruder, bool &no_move) { @@ -391,9 +379,9 @@ inline void invalid_extruder_error(const uint8_t e) { const float xhome = x_home_pos(active_extruder); if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && IsRunning() - && (delayed_move_time || current_position[X_AXIS] != xhome) && ! no_move + && (delayed_move_time || current_position[X_AXIS] != xhome) ) { - float raised_z = current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT; + float raised_z = current_position[Z_AXIS] + toolchange_settings.z_raise; #if ENABLED(MAX_SOFTWARE_ENDSTOPS) NOMORE(raised_z, soft_endstop_max[Z_AXIS]); #endif @@ -413,6 +401,7 @@ inline void invalid_extruder_error(const uint8_t e) { planner.buffer_line(CUR_X, CUR_Y, raised_z, CUR_E, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder); planner.buffer_line(xhome, CUR_Y, raised_z, CUR_E, planner.settings.max_feedrate_mm_s[X_AXIS], active_extruder); + planner.buffer_line(xhome, CUR_Y, CUR_Z, CUR_E, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder); planner.synchronize(); } @@ -420,7 +409,7 @@ inline void invalid_extruder_error(const uint8_t e) { // Apply Y & Z extruder offset (X offset is used as home pos with Dual X) current_position[Y_AXIS] -= hotend_offset[Y_AXIS][active_extruder] - hotend_offset[Y_AXIS][tmp_extruder]; current_position[Z_AXIS] -= hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; - current_position[Z_AXIS] += TOOLCHANGE_PARK_ZLIFT; + // Activate the new extruder ahead of calling set_axis_is_at_home! active_extruder = tmp_extruder; @@ -442,8 +431,12 @@ inline void invalid_extruder_error(const uint8_t e) { inactive_extruder_x_pos = destination[X_AXIS]; break; case DXC_AUTO_PARK_MODE: - // record current raised toolhead position for use by unpark + // record raised toolhead position for use by unpark COPY(raised_parked_position, current_position); + raised_parked_position[Z_AXIS] += toolchange_settings.z_raise; + #if ENABLED(MAX_SOFTWARE_ENDSTOPS) + NOMORE(raised_parked_position[Z_AXIS], soft_endstop_max[Z_AXIS]); + #endif active_extruder_parked = true; delayed_move_time = 0; break; @@ -456,6 +449,7 @@ inline void invalid_extruder_error(const uint8_t e) { } #endif + // No extra case for HAS_ABL in DUAL_X_CARRIAGE. Does that mean they don't work together? } #endif // DUAL_X_CARRIAGE @@ -465,7 +459,9 @@ 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*/) { - planner.synchronize(); + #if DISABLED(MIXING_EXTRUDER) + planner.synchronize(); + #endif #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()) @@ -479,8 +475,12 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n #endif #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - - mixing_tool_change(tmp_extruder); + if (tmp_extruder >= MIXING_VIRTUAL_TOOLS) + return invalid_extruder_error(tmp_extruder); + // 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); #else // !MIXING_EXTRUDER || MIXING_VIRTUAL_TOOLS <= 1 @@ -547,8 +547,8 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n #else const float zdiff = hotend_offset[Z_AXIS][tmp_extruder] - hotend_offset[Z_AXIS][active_extruder]; #if ENABLED(SWITCHING_NOZZLE) - // Always raise by at least 1 to avoid workpiece - current_position[Z_AXIS] += MAX(-zdiff, 0.0) + 1; + // Always raise by a configured distance to avoid workpiece + current_position[Z_AXIS] += MAX(-zdiff, 0.0) + toolchange_settings.z_raise; planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder); move_nozzle_servo(tmp_extruder); #endif @@ -585,9 +585,9 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n // Raise, move, and lower again if (safe_to_move && !no_move && IsRunning()) { - #if DISABLED(SWITCHING_NOZZLE) && DISABLED(DUAL_X_CARRIAGE) + #if DISABLED(SWITCHING_NOZZLE) // Do a small lift to avoid the workpiece in the move back (below) - current_position[Z_AXIS] += 1.0; + current_position[Z_AXIS] += toolchange_settings.z_raise; planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder); #endif #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -640,9 +640,9 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n #if ENABLED(SINGLENOZZLE) #if ENABLED(PREVENT_COLD_EXTRUSION) - if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder) && sn_settings.swap_length) { + if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder) && toolchange_settings.swap_length) { SERIAL_ERROR_START(); - SERIAL_ERRORLNPGM(MSG_HOTEND_TOO_COLD); + SERIAL_ERRORLNPGM(MSG_ERR_HOTEND_TOO_COLD); active_extruder = tmp_extruder; return; } @@ -653,33 +653,35 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n fan_speed[0] = singlenozzle_fan_speed[tmp_extruder]; #endif - if (!no_move) set_destination_from_current(); - - if (sn_settings.swap_length) { + if (toolchange_settings.swap_length) { #if ENABLED(ADVANCED_PAUSE_FEATURE) - do_pause_e_move(-sn_settings.swap_length, MMM_TO_MMS(sn_settings.retract_speed)); + do_pause_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed)); #else - current_position[E_AXIS] -= sn_settings.swap_length / planner.e_factor[active_extruder]; - planner.buffer_line(current_position, MMM_TO_MMS(sn_settings.retract_speed), active_extruder); + current_position[E_AXIS] -= toolchange_settings.swap_length / planner.e_factor[active_extruder]; + planner.buffer_line(current_position, MMM_TO_MMS(toolchange_settings.retract_speed), active_extruder); #endif } - if (!no_move) { - current_position[Z_AXIS] += ( - #if ENABLED(SINGLENOZZLE_SWAP_PARK) - singlenozzle_change_point.z - #else - SINGLENOZZLE_TOOLCHANGE_ZRAISE - #endif - ); + constexpr float snfr = + #if ENABLED(SINGLENOZZLE_SWAP_PARK) + MMM_TO_MMS(SINGLENOZZLE_PARK_XY_FEEDRATE); + #else + 0 + #endif + ; - planner.buffer_line(current_position, planner.settings.max_feedrate_mm_s[Z_AXIS], active_extruder); + float old_pos[XYZ]; + + if (!no_move) { + COPY(old_pos, current_position); #if ENABLED(SINGLENOZZLE_SWAP_PARK) - current_position[X_AXIS] = singlenozzle_change_point.x; - current_position[Y_AXIS] = singlenozzle_change_point.y; - planner.buffer_line(current_position, MMM_TO_MMS(SINGLENOZZLE_PARK_XY_FEEDRATE), active_extruder); + current_position[X_AXIS] = toolchange_settings.change_point.x; + current_position[Y_AXIS] = toolchange_settings.change_point.y; #endif + current_position[Z_AXIS] += toolchange_settings.z_raise; + + do_blocking_move_to(current_position, snfr); } singlenozzle_temp[active_extruder] = thermalManager.target_temperature[0]; @@ -693,24 +695,16 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n active_extruder = tmp_extruder; - if (sn_settings.swap_length) { + if (toolchange_settings.swap_length) { #if ENABLED(ADVANCED_PAUSE_FEATURE) - do_pause_e_move(sn_settings.swap_length, sn_settings.prime_speed); + do_pause_e_move(toolchange_settings.swap_length, toolchange_settings.prime_speed); #else - current_position[E_AXIS] += sn_settings.swap_length / planner.e_factor[tmp_extruder]; - planner.buffer_line(current_position, sn_settings.prime_speed, tmp_extruder); + current_position[E_AXIS] += toolchange_settings.swap_length / planner.e_factor[tmp_extruder]; + planner.buffer_line(current_position, toolchange_settings.prime_speed, tmp_extruder); #endif } - if (!no_move) { - #if ENABLED(SINGLENOZZLE_SWAP_PARK) - current_position[X_AXIS] = destination[X_AXIS]; - current_position[Y_AXIS] = destination[Y_AXIS]; - planner.buffer_line(current_position, MMM_TO_MMS(SINGLENOZZLE_PARK_XY_FEEDRATE), active_extruder); - #endif - - do_blocking_move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]); - } + if (!no_move) do_blocking_move_to(old_pos, snfr); #elif EXTRUDERS > 1 diff --git a/Marlin/src/module/tool_change.h b/Marlin/src/module/tool_change.h index 39b8b0b683..2212347786 100644 --- a/Marlin/src/module/tool_change.h +++ b/Marlin/src/module/tool_change.h @@ -23,6 +23,23 @@ #include "../inc/MarlinConfigPre.h" +#if EXTRUDERS > 1 + + typedef struct { + #if ENABLED(SINGLENOZZLE) + float swap_length; + int16_t prime_speed, retract_speed; + #if ENABLED(SINGLENOZZLE_SWAP_PARK) + struct { float x, y; } change_point; + #endif + #endif + float z_raise; + } toolchange_settings_t; + + extern toolchange_settings_t toolchange_settings; + +#endif + #if DO_SWITCH_EXTRUDER void move_extruder_servo(const uint8_t e); #endif @@ -49,11 +66,6 @@ #endif // PARKING_EXTRUDER #if ENABLED(SINGLENOZZLE) - typedef struct { - float swap_length; - int16_t prime_speed, retract_speed; - } singlenozzle_settings_t; - extern singlenozzle_settings_t sn_settings; extern uint16_t singlenozzle_temp[EXTRUDERS]; #if FAN_COUNT > 0 extern uint8_t singlenozzle_fan_speed[EXTRUDERS]; diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index e8d9f4a7c8..9488dff741 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -148,6 +148,8 @@ #include "pins_TRIGORILLA_14.h" // ATmega2560 env:megaatmega2560 #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 #elif MB(FYSETC_F6_13) #include "pins_FYSETC_F6_13.h" // ATmega2560 env:megaatmega2560 @@ -299,19 +301,19 @@ #elif MB(AZSMZ_MINI) #include "pins_AZSMZ_MINI.h" // LPC1768 env:LPC1768 #elif MB(AZTEEG_X5_GT) - #include "pins_AZTEEG_X5_GT.h" // LPC1769 env:LPC1768 + #include "pins_AZTEEG_X5_GT.h" // LPC1769 env:LPC1769 #elif MB(AZTEEG_X5_MINI_WIFI) - #include "pins_AZTEEG_X5_MINI_WIFI.h" // LPC1769 env:LPC1768 + #include "pins_AZTEEG_X5_MINI_WIFI.h" // LPC1769 env:LPC1769 #elif MB(BIQU_BQ111_A4) #include "pins_BIQU_BQ111_A4.h" // LPC1768 env:LPC1768 #elif MB(SELENA_COMPACT) #include "pins_SELENA_COMPACT.h" // LPC1768 env:LPC1768 #elif MB(COHESION3D_REMIX) - #include "pins_COHESION3D_REMIX.h" // LPC1769 env:LPC1768 + #include "pins_COHESION3D_REMIX.h" // LPC1769 env:LPC1769 #elif MB(COHESION3D_MINI) - #include "pins_COHESION3D_MINI.h" // LPC1769 env:LPC1768 + #include "pins_COHESION3D_MINI.h" // LPC1769 env:LPC1769 #elif MB(SMOOTHIEBOARD) - #include "pins_SMOOTHIEBOARD.h" // LPC1769 env:LPC1768 + #include "pins_SMOOTHIEBOARD.h" // LPC1769 env:LPC1769 // // Other 32-bit Boards @@ -397,6 +399,8 @@ #include "pins_BEAST.h" // STM32F4 env:STM32F4 #elif MB(STM32F4) #include "pins_STM32F4.h" // STM32F4 env:STM32F4 +#elif MB(ARMED) + #include "pins_ARMED.h" // STM32F4 env:ARMED // // ARM Cortex M7 diff --git a/Marlin/src/pins/pins_ARMED.h b/Marlin/src/pins/pins_ARMED.h new file mode 100644 index 0000000000..dd4b73d99e --- /dev/null +++ b/Marlin/src/pins/pins_ARMED.h @@ -0,0 +1,174 @@ +/** + * 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 . + * + */ + +#ifndef STM32F4 + #error "Oops! Make sure you have an STM32F4 board selected from the 'Tools -> Boards' menu." +#endif + +#ifndef ARMED_V1_0 + #define ARMED_V1_1 +#endif + +#define DEFAULT_MACHINE_NAME "Arm'ed" +#define BOARD_NAME "Arm'ed" + +#define I2C_EEPROM + +#define E2END 0xFFF // EEPROM end address (4kB) + +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "Arm'ed supports up to 2 hotends / E-steppers." +#endif + +// +// Limit Switches +// +#define X_MIN_PIN PE0 +#define X_MAX_PIN -1 +#define Y_MIN_PIN PE1 +#define Y_MAX_PIN -1 +#define Z_MIN_PIN PE14 +#define Z_MAX_PIN -1 + +// +// Z Probe (when not Z_MIN_PIN) +// +// #ifndef Z_MIN_PROBE_PIN +// #define Z_MIN_PROBE_PIN PA4 +// #endif + +// +// Steppers +// + +#ifdef ARMED_SWAP_X_E1 + #define X_STEP_PIN PE4 + #define X_DIR_PIN PE2 + #define X_ENABLE_PIN PE3 + #define X_CS_PIN PE5 +#else + #define X_STEP_PIN PD3 + #define X_DIR_PIN PD2 + #define X_ENABLE_PIN PD0 + #define X_CS_PIN PD1 +#endif + +#define Y_STEP_PIN PE11 +#define Y_DIR_PIN PE10 +#define Y_ENABLE_PIN PE13 +#define Y_CS_PIN PE12 + +#define Z_STEP_PIN PD6 +#define Z_DIR_PIN PD7 +#define Z_ENABLE_PIN PD4 +#define Z_CS_PIN PD5 + +#define E0_STEP_PIN PB5 +#define E0_DIR_PIN PB6 +#define E0_CS_PIN PB4 + +#ifdef ARMED_V1_0 + #define E0_ENABLE_PIN PB3 +#else + #define E0_ENABLE_PIN PC12 +#endif + +#ifdef ARMED_SWAP_X_E1 + #define E1_STEP_PIN PD3 + #define E1_DIR_PIN PD2 + #define E1_ENABLE_PIN PD0 + #define E1_CS_PIN PD1 +#else + #define E1_STEP_PIN PE4 + #define E1_DIR_PIN PE2 + #define E1_ENABLE_PIN PE3 + #define E1_CS_PIN PE5 +#endif + +// +// SPI +// +#define SCK_PIN PA5 +#define MISO_PIN PA6 +#define MOSI_PIN PA7 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC0 // Analog Input +#define TEMP_1_PIN PC1 // Analog Input +#define TEMP_BED_PIN PC2 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA1 // PWM pin +#define HEATER_1_PIN PA2 // PWM pin +#define HEATER_BED_PIN PA0 // PWM pin + +#define FAN_PIN PC6 // PWM pin, Part cooling fan +#define FAN1_PIN PC7 // PWM pin, Extruder fan +#define FAN2_PIN PC8 // PWM pin, Controller fan + +// +// Misc functions +// +#define SDSS PE7 +#define SS_PIN PE7 +#define LED_PIN PB7 // Heart beat +#define PS_ON_PIN PA10 +#define KILL_PIN PA8 +#define PWR_LOSS PA4 // Power loss / nAC_FAULT + +// +// LCD / Controller +// +#define SD_DETECT_PIN PA15 +#define BEEPER_PIN PC9 +#define LCD_PINS_RS PE9 +#define LCD_PINS_ENABLE PE8 +#define LCD_PINS_D4 PB12 +#define LCD_PINS_D5 PB13 +#define LCD_PINS_D6 PB14 +#define LCD_PINS_D7 PB15 +#define BTN_EN1 PC4 +#define BTN_EN2 PC5 +#define BTN_ENC PC3 + +// +// Filament runout detection +// +#define FIL_RUNOUT_PIN PA3 + +// +// Extension pins +// +#define EXT0_PIN PB0 +#define EXT1_PIN PB1 +#define EXT2_PIN PB2 +#define EXT3_PIN PD8 +#define EXT4_PIN PD9 +#define EXT5_PIN PD10 +#define EXT6_PIN PD11 +#define EXT7_PIN PD12 +#define EXT8_PIN PB10 +#define EXT9_PIN PB11 diff --git a/Marlin/src/pins/pins_AZTEEG_X5_MINI_WIFI.h b/Marlin/src/pins/pins_AZTEEG_X5_MINI_WIFI.h index 78af567a35..f6bec28fda 100644 --- a/Marlin/src/pins/pins_AZTEEG_X5_MINI_WIFI.h +++ b/Marlin/src/pins/pins_AZTEEG_X5_MINI_WIFI.h @@ -35,15 +35,14 @@ #endif // -// Set CPU +// LED // -#undef F_CPU -#define F_CPU 120000000 +#define LED_PIN P1_18 // // Servo // -#define SERVO0_PIN P1_23 +#define SERVO0_PIN P1_29 // // Limit Switches @@ -163,11 +162,6 @@ #define DOGLCD_CS P0_16 // (16) #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 @@ -180,3 +174,38 @@ #endif #endif // ULTRA_LCD + +// +// SD Support +// +//#define USB_SD_DISABLED // Disable host access to SD card as mass storage device through USB +//#define USB_SD_ONBOARD // Enable host access to SD card as mass storage device through USB + +//#define LPC_SD_LCD // Marlin uses the SD drive attached to the LCD +#define LPC_SD_ONBOARD // Marlin uses the SD drive on the control board. There is no SD detect pin + // for the onboard card. Init card from LCD menu or send M21 whenever printer + // is powered on to enable SD access. + +#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 + +#elif ENABLED(LPC_SD_ONBOARD) + + #if ENABLED(USB_SD_ONBOARD) + // When sharing the SD card with a PC we want the menu options to + // mount/unmount the card and refresh it. So we disable card detect. + #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 + +#endif diff --git a/Marlin/src/pins/pins_FORMBOT_RAPTOR.h b/Marlin/src/pins/pins_FORMBOT_RAPTOR.h index 28c92394ad..8f8354b7de 100644 --- a/Marlin/src/pins/pins_FORMBOT_RAPTOR.h +++ b/Marlin/src/pins/pins_FORMBOT_RAPTOR.h @@ -28,7 +28,7 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif -#if E_STEPPERS > 3 || HOTENDS > 3 +#if HOTENDS > 3 || E_STEPPERS > 3 #error "Formbot supports up to 3 hotends / E-steppers. Comment this line to keep going." #endif diff --git a/Marlin/src/pins/pins_FORMBOT_TREX2PLUS.h b/Marlin/src/pins/pins_FORMBOT_TREX2PLUS.h index e02ee5e1f3..9c222bc642 100644 --- a/Marlin/src/pins/pins_FORMBOT_TREX2PLUS.h +++ b/Marlin/src/pins/pins_FORMBOT_TREX2PLUS.h @@ -28,7 +28,7 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif -#if E_STEPPERS > 2 || HOTENDS > 2 +#if HOTENDS > 2 || E_STEPPERS > 2 #error "Formbot supports up to 2 hotends / E-steppers. Comment this line to keep going." #endif diff --git a/Marlin/src/pins/pins_FORMBOT_TREX3.h b/Marlin/src/pins/pins_FORMBOT_TREX3.h index 5591edcbfe..ced55d1dcd 100644 --- a/Marlin/src/pins/pins_FORMBOT_TREX3.h +++ b/Marlin/src/pins/pins_FORMBOT_TREX3.h @@ -28,7 +28,7 @@ #error "Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu." #endif -#if E_STEPPERS > 2 || HOTENDS > 2 +#if HOTENDS > 2 || E_STEPPERS > 2 #error "Formbot supports up to 2 hotends / E-steppers. Comment this line to keep going." #endif @@ -160,10 +160,6 @@ // Use the RAMPS 1.4 Analog input 5 on the AUX2 connector #define FILWIDTH_PIN 5 // Analog Input -#ifndef PS_ON_PIN - #define PS_ON_PIN 12 -#endif - // // LCD / Controller // diff --git a/Marlin/src/pins/pins_MELZI_CREALITY.h b/Marlin/src/pins/pins_MELZI_CREALITY.h index 8bfd3b860a..3c86dcbbaa 100644 --- a/Marlin/src/pins/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/pins_MELZI_CREALITY.h @@ -53,6 +53,10 @@ #define LCD_PINS_D4 30 // ST9720 CLK #define FIL_RUNOUT_PIN -1 // Uses Beeper/LED Pin Pulled to GND +#if DISABLED(SPEAKER) && ENABLED(BLTOUCH) + #define SERVO0_PIN 27 +#endif + // Alter timing for graphical display #ifndef ST7920_DELAY_1 #define ST7920_DELAY_1 DELAY_NS(125) diff --git a/Marlin/src/pins/pins_MKS_SBASE.h b/Marlin/src/pins/pins_MKS_SBASE.h index 7a58198342..cfdab90a04 100644 --- a/Marlin/src/pins/pins_MKS_SBASE.h +++ b/Marlin/src/pins/pins_MKS_SBASE.h @@ -42,7 +42,10 @@ #define PIN_P0_03 P0_03 // AUX1 (Interrupt Capable/ADC/Serial Port 0) */ -#define LED_PIN P1_18 // LED2 P1_19, LED3 P1_20, LED4 P1_21 +#define LED_PIN P1_18 // Used as a status indicator +#define LED2_PIN P1_19 +#define LED3_PIN P1_20 +#define LED4_PIN P1_21 // // Servo pin @@ -141,8 +144,6 @@ // Misc. Functions // #define PS_ON_PIN P0_25 //TH3 Connector -#define LPC_SOFTWARE_SPI // MKS_SBASE needs a software SPI because the - // selected pins are not on a hardware SPI controller /** * Smart LCD adapter @@ -185,14 +186,75 @@ #define ENET_TXD0 P1_00 // J12-11 #define ENET_TXD1 P1_01 // J12-12 -// A custom cable is needed. See the README file in the -// Marlin\src\config\examples\Mks\Sbase directory -#define SCK_PIN P1_22 // J8-2 (moved from EXP2 P0.7) -#define MISO_PIN P1_23 // J8-3 (moved from EXP2 P0.8) -#define MOSI_PIN P2_12 // J8-4 (moved from EXP2 P0.5) -#define SS_PIN P0_28 -#define SDSS P0_06 +/* + * The SBase can share the on-board SD card with a PC via USB the following + * definitions control this feature: + */ +//#define USB_SD_DISABLED +#define USB_SD_ONBOARD // Provide the onboard SD card to the host as a USB mass storage device + +/* + * There are a number of configurations available for the SBase SD card reader. + * - A custom cable can be used to allow access to the LCD based SD card. + * - A standard cable can be used for access to the LCD SD card (but no SD detect). + * - The onboard SD card can be used and optionally shared with a PC via USB. + */ + +//#define LPC_SD_CUSTOM_CABLE // Use a custom cable to access the SD +//#define LPC_SD_LCD // Marlin uses the SD drive attached to the LCD +#define LPC_SD_ONBOARD // Marlin uses the SD drive attached to the control board + +#if ENABLED(LPC_SD_CUSTOM_CABLE) + + /** + * A custom cable is needed. See the README file in the + * Marlin\src\config\examples\Mks\Sbase directory + * P0.27 is on EXP2 and the on-board SD card's socket. That means it can't be + * used as the SD_DETECT for the LCD's SD card. + * + * The best solution is to use the custom cable to connect the LCD's SD_DETECT + * to a pin NOT on EXP2. + * + * If you can't find a pin to use for the LCD's SD_DETECT then comment out + * SD_DETECT_PIN entirely and remove that wire from the the custom cable. + */ + #define SD_DETECT_PIN P2_11 // J8-5 (moved from EXP2 P0.27) + #define SCK_PIN P1_22 // J8-2 (moved from EXP2 P0.7) + #define MISO_PIN P1_23 // J8-3 (moved from EXP2 P0.8) + #define MOSI_PIN P2_12 // J8-4 (moved from EXP2 P0.9) + #define SS_PIN P0_28 // Chip select for SD card used by Marlin + #define ONBOARD_SD_CS P0_06 // Chip select for "System" SD card + #define LPC_SOFTWARE_SPI // With a custom cable we need software SPI because the + // selected pins are not on a hardware SPI controller +#elif ENABLED(LPC_SD_LCD) + + // use standard cable and header, SPI and SD detect sre shared with on-board SD card + // hardware SPI is used for both SD cards. The detect pin is shred between the + // LCD and onboard SD readers so we disable it. + #define SCK_PIN P0_07 + #define MISO_PIN P0_08 + #define MOSI_PIN P0_09 + #define SS_PIN P0_28 // 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) + + // The external SD card is not used. Hardware SPI is used to access the card. + #if ENABLED(USB_SD_ONBOARD) + // When sharing the SD card with a PC we want the menu options to + // mount/unmount the card and refresh it. So we disable card detect. + #define SHARED_SD_CARD + #else + #define SD_DETECT_PIN P0_27 + #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 + +#endif /** * Example for trinamic drivers using the J8 connector on MKs Sbase. @@ -223,6 +285,7 @@ #endif #endif #endif + #if HAS_DRIVER(TMC2208) // The shortage of pins becomes apparent. // Worst case you may have to give up the LCD @@ -237,18 +300,6 @@ #define E0_SERIAL_RX_PIN P0_26 // TH4 #endif -/** - * P0.27 is on EXP2 and the on-board SD card's socket. That means it can't be - * used as the SD_DETECT for the LCD's SD card. - * - * The best solution is to use the custom cable to connect the LCD's SD_DETECT - * to a pin NOT on EXP2. - * - * If you can't find a pin to use for the LCD's SD_DETECT then comment out - * SD_DETECT_PIN entirely and remove that wire from the the custom cable. - */ -#define SD_DETECT_PIN P2_11 // J8-5 (moved from EXP2 P0.27) - /** * PWMs * diff --git a/Marlin/src/pins/pins_RAMPS_CREALITY.h b/Marlin/src/pins/pins_RAMPS_CREALITY.h new file mode 100644 index 0000000000..1365c29f54 --- /dev/null +++ b/Marlin/src/pins/pins_RAMPS_CREALITY.h @@ -0,0 +1,43 @@ +/** + * 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 . + * + */ + +#if HOTENDS > 2 || E_STEPPERS > 2 + #error "Creality3D RAMPS supports only 2 hotends / E-steppers. Comment out this line to continue." +#endif + +#define BOARD_NAME "Creality3D RAMPS" + +// +// Heaters / Fans +// + +// Power outputs EFBF or EFBE +#define MOSFET_D_PIN 7 + +#define FIL_RUNOUT_PIN 2 + +#include "pins_RAMPS.h" + +#define EXP1_PIN 65 // A11 +#define EXP2_PIN 66 // A12 +#define EXP3_PIN 11 // SERVO0_PIN +#define EXP4_PIN 12 // PS_ON_PIN diff --git a/Marlin/src/pins/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/pins_RAMPS_RE_ARM.h index 6f0c604ffb..988b1c82b6 100644 --- a/Marlin/src/pins/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/pins_RAMPS_RE_ARM.h @@ -198,7 +198,6 @@ // Misc. Functions // #define LED_PIN P4_28 // (13) -#define SDSS P1_23 // (53) // 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 @@ -364,8 +363,38 @@ #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 + +//#define LPC_SD_LCD // Marlin uses the SD drive attached to the LCD +#define LPC_SD_ONBOARD // Marlin uses the SD drive on the control board + +#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 + +#elif ENABLED(LPC_SD_ONBOARD) + + #if ENABLED(USB_SD_ONBOARD) + // When sharing the SD card with a PC we want the menu options to + // mount/unmount the card and refresh it. So we disable card detect. + #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 + +#endif + /** - * Fast PWMS + * Fast PWMs * * The LPC1768's hardware PWM controller has 6 channels. Each channel * can be setup to either control a dedicated pin directly or to generate @@ -390,7 +419,7 @@ */ /** - * special pins + * Special pins * P1_30 (37) - not 5V tolerant * P1_31 (49) - not 5V tolerant * P0_27 (57) - open collector diff --git a/Marlin/src/pins/pins_REMRAM_V1.h b/Marlin/src/pins/pins_REMRAM_V1.h index 193f567135..26f3dc1398 100644 --- a/Marlin/src/pins/pins_REMRAM_V1.h +++ b/Marlin/src/pins/pins_REMRAM_V1.h @@ -29,7 +29,7 @@ #define EEPROM_EMULATED_WITH_SRAM // Emulate the EEPROM using Backup SRAM -#if E_STEPPERS > 1 || HOTENDS > 1 +#if HOTENDS > 1 || E_STEPPERS > 1 #error "RemRam supports only one hotend / E-stepper." #endif @@ -106,9 +106,9 @@ #define SERVO0_PIN 26 // PWM_EXT1 #define SERVO1_PIN 27 // PWM_EXT2 -#define SDSS 9 +#define SDSS 57 // Onboard SD card reader +//#define SDSS 9 // LCD SD card reader #define LED_PIN 21 // STATUS_LED -#define KILL_PIN 57 // // LCD / Controller @@ -124,3 +124,9 @@ #define BTN_EN1 54 // BTN_EN1 #define BTN_EN2 55 // BTN_EN2 #define BTN_ENC 47 // BTN_ENC + +// +// Timers +// + +#define STEP_TIMER 2 diff --git a/Marlin/src/pins/pins_STM32F4.h b/Marlin/src/pins/pins_STM32F4.h index 22c8389635..f06340bcf4 100644 --- a/Marlin/src/pins/pins_STM32F4.h +++ b/Marlin/src/pins/pins_STM32F4.h @@ -34,7 +34,7 @@ // Ignore temp readings during develpment. //#define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE -#if E_STEPPERS > 2 || HOTENDS > 2 +#if HOTENDS > 2 || E_STEPPERS > 2 #error "STM32F4 supports up to 2 hotends / E-steppers." #endif diff --git a/Marlin/src/pins/pins_THE_BORG.h b/Marlin/src/pins/pins_THE_BORG.h index 8a762fba21..eb3a6d2f13 100644 --- a/Marlin/src/pins/pins_THE_BORG.h +++ b/Marlin/src/pins/pins_THE_BORG.h @@ -32,7 +32,7 @@ // Ignore temp readings during develpment. #define BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE -#if E_STEPPERS > 3 || HOTENDS > 3 +#if HOTENDS > 3 || E_STEPPERS > 3 #error "The-Borg supports up to 3 hotends / E-steppers." #endif diff --git a/Marlin/src/pins/pins_TRIGORILLA_14.h b/Marlin/src/pins/pins_TRIGORILLA_14.h index 3244cf278e..afadbe0d55 100644 --- a/Marlin/src/pins/pins_TRIGORILLA_14.h +++ b/Marlin/src/pins/pins_TRIGORILLA_14.h @@ -28,20 +28,44 @@ #define BOARD_NAME "Anycubic RAMPS 1.4" #endif -// Remap MOSFET pins to common usages -#if HOTENDS > 1 - #define RAMPS_D9_PIN 45 // EEB, EEF +// Labeled pins +#define TRIGORILLA_HEATER_BED_PIN 8 +#define TRIGORILLA_HEATER_0_PIN 10 +#define TRIGORILLA_HEATER_1_PIN 45 // Anycubic Kossel: Unused + +#define TRIGORILLA_FAN0_PIN 9 // Anycubic Kossel: Usually the part cooling fan +#define TRIGORILLA_FAN1_PIN 7 // Anycubic Kossel: Unused +#define TRIGORILLA_FAN2_PIN 44 // Anycubic Kossel: Hotend fan + +// Remap MOSFET pins to common usages: + +#define RAMPS_D10_PIN TRIGORILLA_HEATER_0_PIN // HEATER_0_PIN is always RAMPS_D10_PIN in pins_RAMPS.h + +#if HOTENDS > 1 // EEF and EEB + #define RAMPS_D9_PIN TRIGORILLA_HEATER_1_PIN #if !TEMP_SENSOR_BED - #define RAMPS_D8_PIN 9 // EEF + // EEF + #define RAMPS_D8_PIN TRIGORILLA_FAN0_PIN + #else + // EEB + #define RAMPS_D8_PIN TRIGORILLA_HEATER_BED_PIN + #define FAN_PIN TRIGORILLA_FAN0_PIN // Override pin 4 in pins_RAMPS.h #endif #elif TEMP_SENSOR_BED - #define FAN1_PIN 7 // EFB + // EFB (Anycubic Kossel default) + #define RAMPS_D9_PIN TRIGORILLA_FAN0_PIN + #define RAMPS_D8_PIN TRIGORILLA_HEATER_BED_PIN #else - #define FAN2_PIN 44 // EFF + // EFF + #define RAMPS_D9_PIN TRIGORILLA_FAN1_PIN + #define RAMPS_D8_PIN TRIGORILLA_FAN0_PIN #endif -// D44 - Typical Extruder Fan on Anycubic Delta devices -#define ORIG_E0_AUTO_FAN_PIN 44 +#if HOTENDS > 1 || TEMP_SENSOR_BED // EEF, EEB, EFB + #define FAN1_PIN TRIGORILLA_FAN1_PIN +#endif +#define FAN2_PIN TRIGORILLA_FAN2_PIN +#define ORIG_E0_AUTO_FAN_PIN TRIGORILLA_FAN2_PIN // Used in Anycubic Kossel example config #include "pins_RAMPS.h" diff --git a/Marlin/src/sd/Sd2Card.cpp b/Marlin/src/sd/Sd2Card.cpp index 153611d7ad..d1116cdb35 100644 --- a/Marlin/src/sd/Sd2Card.cpp +++ b/Marlin/src/sd/Sd2Card.cpp @@ -240,7 +240,7 @@ bool Sd2Card::init(uint8_t sckRateID, pin_t chipSelectPin) { errorCode_ = type_ = 0; chipSelectPin_ = chipSelectPin; // 16-bit init start time allows over a minute - uint16_t t0 = (uint16_t)millis(); + const millis_t init_timeout = millis() + SD_INIT_TIMEOUT; uint32_t arg; // If init takes more than 4s it could trigger @@ -268,7 +268,7 @@ bool Sd2Card::init(uint8_t sckRateID, pin_t chipSelectPin) { // Command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { - if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) { + if (ELAPSED(millis(), init_timeout)) { error(SD_CARD_ERROR_CMD0); goto FAIL; } @@ -297,7 +297,7 @@ bool Sd2Card::init(uint8_t sckRateID, pin_t chipSelectPin) { break; } - if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) { + if (ELAPSED(millis(), init_timeout)) { error(SD_CARD_ERROR_CMD8); goto FAIL; } @@ -312,7 +312,7 @@ bool Sd2Card::init(uint8_t sckRateID, pin_t chipSelectPin) { arg = type() == SD_CARD_TYPE_SD2 ? 0x40000000 : 0; while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { // check for timeout - if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) { + if (ELAPSED(millis(), init_timeout)) { error(SD_CARD_ERROR_ACMD41); goto FAIL; } @@ -449,9 +449,9 @@ bool Sd2Card::readData(uint8_t* dst) { bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token - uint16_t t0 = millis(); + const millis_t read_timeout = millis() + SD_READ_TIMEOUT; while ((status_ = spiRec()) == 0xFF) { - if (((uint16_t)millis() - t0) > SD_READ_TIMEOUT) { + if (ELAPSED(millis(), read_timeout)) { error(SD_CARD_ERROR_READ_TIMEOUT); goto FAIL; } @@ -553,10 +553,10 @@ bool Sd2Card::setSckRate(uint8_t sckRateID) { } // wait for card to go not busy -bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { - uint16_t t0 = millis(); +bool Sd2Card::waitNotBusy(const millis_t timeout_ms) { + const millis_t wait_timeout = millis() + timeout_ms; while (spiRec() != 0xFF) - if (((uint16_t)millis() - t0) >= timeoutMillis) return false; + if (ELAPSED(millis(), wait_timeout)) return false; return true; } diff --git a/Marlin/src/sd/Sd2Card.h b/Marlin/src/sd/Sd2Card.h index 2d9ebf33e3..d6d9af18ba 100644 --- a/Marlin/src/sd/Sd2Card.h +++ b/Marlin/src/sd/Sd2Card.h @@ -199,7 +199,7 @@ class Sd2Card { void chipDeselect(); void chipSelect(); void type(uint8_t value) { type_ = value; } - bool waitNotBusy(uint16_t timeoutMillis); + bool waitNotBusy(const millis_t timeout_ms); bool writeData(uint8_t token, const uint8_t* src); }; diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 9ba018a2cf..91a3a8d04c 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -351,7 +351,7 @@ void CardReader::stopSDPrint( #if ENABLED(ADVANCED_PAUSE_FEATURE) did_pause_print = 0; #endif - sdprinting = false; + sdprinting = abort_sd_printing = false; if (isFileOpen()) file.close(); #if SD_RESORT if (re_sort) presort(); @@ -394,7 +394,7 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall SERIAL_ERROR_START(); SERIAL_ERRORPGM("trying to call sub-gcode files with too many levels. MAX level is:"); SERIAL_ERRORLN((int)SD_PROCEDURE_DEPTH); - kill(PSTR(MSG_KILLED)); + kill(); return; } @@ -544,8 +544,8 @@ void CardReader::checkautostart() { && !jobRecoverFileExists() // Don't run auto#.g when a resume file exists #endif ) { - char autoname[10]; - sprintf_P(autoname, PSTR("auto%i.g"), int(autostart_index)); + char autoname[8]; + sprintf_P(autoname, PSTR("auto%c.g"), autostart_index + '0'); dir_t p; root.rewind(); while (root.readDir(&p, NULL) > 0) { diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index b975d053f4..a92196f986 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -149,7 +149,7 @@ public: FORCE_INLINE char* longest_filename() { return longFilename[0] ? longFilename : filename; } public: - bool saving, logging, sdprinting, cardOK, filenameIsDir; + bool saving, logging, sdprinting, cardOK, filenameIsDir, abort_sd_printing; char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH]; int8_t autostart_index; private: @@ -244,16 +244,16 @@ private: }; #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #define IS_SD_INSERTED Sd2Card::isInserted() + #define IS_SD_INSERTED() Sd2Card::isInserted() #elif PIN_EXISTS(SD_DETECT) #if ENABLED(SD_DETECT_INVERTED) - #define IS_SD_INSERTED (READ(SD_DETECT_PIN) == HIGH) + #define IS_SD_INSERTED() READ(SD_DETECT_PIN) #else - #define IS_SD_INSERTED (READ(SD_DETECT_PIN) == LOW) + #define IS_SD_INSERTED() !READ(SD_DETECT_PIN) #endif #else // No card detect line? Assume the card is inserted. - #define IS_SD_INSERTED true + #define IS_SD_INSERTED() true #endif extern CardReader card; @@ -261,11 +261,11 @@ extern CardReader card; #endif // SDSUPPORT #if ENABLED(SDSUPPORT) - #define IS_SD_PRINTING (card.sdprinting) - #define IS_SD_FILE_OPEN (card.isFileOpen()) + #define IS_SD_PRINTING() card.sdprinting + #define IS_SD_FILE_OPEN() card.isFileOpen() #else - #define IS_SD_PRINTING (false) - #define IS_SD_FILE_OPEN (false) + #define IS_SD_PRINTING() false + #define IS_SD_FILE_OPEN() false #endif #endif // _CARDREADER_H_ diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp index 369b3d38d4..f4fda4b3c9 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.cpp @@ -24,49 +24,22 @@ #if ENABLED(USB_FLASH_DRIVE_SUPPORT) +#include "../../core/serial.h" + #include "lib/Usb.h" #include "lib/masstorage.h" #include "Sd2Card_FlashDrive.h" -#include - -#include "../../core/serial.h" - USB usb; BulkOnly bulk(&usb); Sd2Card::state_t Sd2Card::state; -uint32_t Sd2Card::block; -bool Sd2Card::usbHostReady() { - return state == USB_HOST_INITIALIZED; -} - -bool Sd2Card::isInserted() { - return usb.getUsbTaskState() == USB_STATE_RUNNING; -} - -// Marlin calls this whenever an SD card is detected, so this method -// should not be used to initialize the USB host library -bool Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) { - if (!usbHostReady()) return false; - - if (!bulk.LUNIsGood(0)) { - SERIAL_ECHOLNPGM("LUN zero is not good\n"); - return false; - } - - SERIAL_ECHOLNPAIR("LUN Capacity: ",bulk.GetCapacity(0)); - - const uint32_t sectorSize = bulk.GetSectorSize(0); - if (sectorSize != 512) { - SERIAL_ECHOLNPAIR("Expecting sector size of 512, got: ",sectorSize); - return false; - } - - return true; -} +// The USB library needs to be called periodically to detect USB thumbdrive +// insertion and removals. Call this idle() function periodically to allow +// the USB library to monitor for such events. This function also takes care +// of initializing the USB library for the first time. void Sd2Card::idle() { static uint32_t next_retry; @@ -77,7 +50,7 @@ void Sd2Card::idle() { state = USB_HOST_WAITING; break; case USB_HOST_WAITING: - if (millis() > next_retry) { + if (ELAPSED(millis(), next_retry)) { next_retry = millis() + 10000; state = USB_HOST_UNINITIALIZED; } @@ -100,60 +73,84 @@ void Sd2Card::idle() { if (lastUsbTaskState == USB_STATE_RUNNING && newUsbTaskState != USB_STATE_RUNNING) { // the user pulled the flash drive. Make sure the bulk storage driver releases the address - SERIAL_ECHOLNPGM("Drive removed\n"); + #ifdef USB_DEBUG + SERIAL_ECHOLNPGM("USB drive removed"); + #endif //bulk.Release(); } - if (lastUsbTaskState != USB_STATE_RUNNING && newUsbTaskState == USB_STATE_RUNNING) - SERIAL_ECHOLNPGM("Drive inserted\n"); + if (lastUsbTaskState != USB_STATE_RUNNING && newUsbTaskState == USB_STATE_RUNNING) { + #ifdef USB_DEBUG + SERIAL_ECHOLNPGM("USB drive inserted"); + #endif + } break; } } -uint32_t Sd2Card::cardSize() { - if (!usbHostReady()) return 0; - return bulk.GetCapacity(0); -} +// Marlin calls this function to check whether an USB drive is inserted. +// This is equivalent to polling the SD_DETECT when using SD cards. +bool Sd2Card::isInserted() { + return usb.getUsbTaskState() == USB_STATE_RUNNING; +}; -bool Sd2Card::readData(uint8_t* dst) { - return readBlock(block++, dst); -} +// Marlin calls this to initialize an SD card once it is inserted. +bool Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) { + if (!ready()) return false; -bool Sd2Card::readStart(uint32_t blockNumber) { - block = blockNumber; + if (!bulk.LUNIsGood(0)) { + SERIAL_ECHOLNPGM("LUN zero is not good"); + return false; + } + + const uint32_t sectorSize = bulk.GetSectorSize(0); + if (sectorSize != 512) { + SERIAL_ECHOLNPAIR("Expecting sector size of 512, got:", sectorSize); + return false; + } + + #ifdef USB_DEBUG + lun0_capacity = bulk.GetCapacity(0); + SERIAL_ECHOLNPAIR("LUN Capacity (in blocks): ", lun0_capacity); + #endif return true; } -bool Sd2Card::readStop() { - return usbHostReady(); +// Returns the capacity of the card in blocks. +uint32_t Sd2Card::cardSize() { + if (!ready()) return 0; + #ifndef USB_DEBUG + const uint32_t + #endif + lun0_capacity = bulk.GetCapacity(0); + return lun0_capacity; } bool Sd2Card::readBlock(uint32_t block, uint8_t* dst) { - if (!usbHostReady()) { - SERIAL_ECHOLNPGM("Read from uninitalized USB host"); - return false; - } + if (!ready()) return false; + #ifdef USB_DEBUG + if (block >= lun0_capacity) { + SERIAL_ECHOLNPAIR("Attempt to read past end of LUN: ", block); + return false; + } + #if USB_DEBUG > 1 + SERIAL_ECHOLNPAIR("Read block ", block); + #endif + #endif return bulk.Read(0, block, 512, 1, dst) == 0; } -bool Sd2Card::writeData(const uint8_t* src) { - return writeBlock(block++, src); -} - -bool Sd2Card::writeStart(uint32_t blockNumber, uint32_t eraseCount) { - block = blockNumber; - return true; -} - -bool Sd2Card::writeStop() { - return usbHostReady(); -} - -bool Sd2Card::writeBlock(uint32_t blockNumber, const uint8_t* src) { - if (!usbHostReady()) { - SERIAL_ECHOLNPGM("Write to uninitalized USB host"); - return false; - } - return bulk.Write(0, blockNumber, 512, 1, src) == 0; +bool Sd2Card::writeBlock(uint32_t block, const uint8_t* src) { + if (!ready()) return false; + #ifdef USB_DEBUG + if (block >= lun0_capacity) { + SERIAL_ECHOLNPAIR("Attempt to write past end of LUN: ", block); + return false; + } + #if USB_DEBUG > 1 + SERIAL_ECHOLNPAIR("Write block ", block); + #endif + #endif + return bulk.Write(0, block, 512, 1, src) == 0; } #endif // USB_FLASH_DRIVE_SUPPORT diff --git a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h index c364063156..3b5a5fcba3 100644 --- a/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h +++ b/Marlin/src/sd/usb_flashdrive/Sd2Card_FlashDrive.h @@ -28,6 +28,13 @@ #ifndef _SD2CARD_FLASHDRIVE_H_ #define _SD2CARD_FLASHDRIVE_H_ +/* Uncomment USB_DEBUG to enable debugging. + * 1 - basic debugging and bounds checking + * 2 - print each block access + */ +//#define USB_DEBUG 1 + + #include "../SdFatConfig.h" #include "../SdInfo.h" @@ -63,29 +70,34 @@ class Sd2Card { USB_HOST_INITIALIZED } state_t; - static state_t state; - static uint32_t block; + static state_t state; - static bool usbHostReady(); + uint32_t pos; + #ifdef USB_DEBUG + uint32_t lun0_capacity; + #endif + + static inline bool ready() {return state == USB_HOST_INITIALIZED;} public: - static void idle(); - - static bool isInserted(); - - uint32_t cardSize(); - bool init(uint8_t sckRateID = 0, uint8_t chipSelectPin = SD_CHIP_SELECT_PIN); - bool readData(uint8_t* dst); - bool readStart(uint32_t blockNumber); - bool readStop(); - bool readBlock(uint32_t block, uint8_t* dst); + static void idle(); - bool writeData(const uint8_t* src); - bool writeStart(uint32_t blockNumber, uint32_t eraseCount); - bool writeStop(); + bool readStart(uint32_t block) { pos = block; return ready(); } + bool readData(uint8_t* dst) { return readBlock(pos++, dst); } + bool readStop() { return true; } + + bool writeStart(uint32_t block, uint32_t eraseCount) { pos = block; return ready(); } + bool writeData(uint8_t* src) { return writeBlock(pos++, src); } + bool writeStop() { return true; } + + + bool readBlock(uint32_t block, uint8_t* dst); bool writeBlock(uint32_t blockNumber, const uint8_t* src); + + uint32_t cardSize(); + static bool isInserted(); }; #endif // _SD2CARD_FLASHDRIVE_H_ diff --git a/Marlin/src/sd/usb_flashdrive/usb_host.cpp b/Marlin/src/sd/usb_flashdrive/usb_host.cpp index 75a2dc7bba..71155b82ac 100644 --- a/Marlin/src/sd/usb_flashdrive/usb_host.cpp +++ b/Marlin/src/sd/usb_flashdrive/usb_host.cpp @@ -109,8 +109,8 @@ bool MAX3421e::reset() { bool MAX3421e::start() { // Initialize pins and SPI bus - SET_OUTPUT(SDSS); - SET_INPUT(USB_INTR_PIN); + SET_OUTPUT(USB_CS_PIN); + SET_INPUT_PULLUP(USB_INTR_PIN); ncs(); spiBegin();