2016-07-26 01:07:15 +00:00
|
|
|
/**
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
2018-11-03 07:13:10 +00:00
|
|
|
#pragma once
|
2016-07-26 01:07:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Conditionals_LCD.h
|
2016-08-22 20:02:19 +00:00
|
|
|
* Conditionals that need to be set before Configuration_adv.h or pins.h
|
2016-07-26 01:07:15 +00:00
|
|
|
*/
|
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#if ENABLED(CARTESIO_UI)
|
2017-06-24 18:56:07 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define DOGLCD
|
|
|
|
#define ULTIPANEL
|
|
|
|
#define DEFAULT_LCD_CONTRAST 90
|
|
|
|
#define LCD_CONTRAST_MIN 60
|
|
|
|
#define LCD_CONTRAST_MAX 140
|
2016-07-26 01:07:15 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#elif ENABLED(MAKRPANEL)
|
2017-08-15 00:34:31 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define U8GLIB_ST7565_64128N
|
2017-06-10 05:12:18 +00:00
|
|
|
|
2017-12-16 01:05:57 +00:00
|
|
|
#elif ENABLED(ZONESTAR_LCD)
|
2017-06-10 05:12:18 +00:00
|
|
|
|
2018-11-03 03:29:32 +00:00
|
|
|
#define ADC_KEYPAD
|
2017-10-19 05:43:07 +00:00
|
|
|
#define REPRAPWORLD_KEYPAD
|
|
|
|
#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0
|
|
|
|
#define ADC_KEY_NUM 8
|
|
|
|
#define ULTIPANEL
|
2017-06-10 05:12:18 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
// this helps to implement ADC_KEYPAD menus
|
2018-11-22 12:00:00 +00:00
|
|
|
#define REVERSE_MENU_DIRECTION
|
2017-10-19 05:43:07 +00:00
|
|
|
#define ENCODER_PULSES_PER_STEP 1
|
|
|
|
#define ENCODER_STEPS_PER_MENU_ITEM 1
|
2017-11-05 02:22:53 +00:00
|
|
|
#define ENCODER_FEEDRATE_DEADZONE 2
|
2017-06-24 18:56:07 +00:00
|
|
|
|
2018-01-05 16:10:55 +00:00
|
|
|
#elif ENABLED(RADDS_DISPLAY)
|
2017-12-23 20:23:05 +00:00
|
|
|
#define ULTIPANEL
|
|
|
|
#define ENCODER_PULSES_PER_STEP 2
|
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#elif ENABLED(ANET_FULL_GRAPHICS_LCD)
|
2017-06-24 18:56:07 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
|
2017-06-24 18:56:07 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#elif ENABLED(BQ_LCD_SMART_CONTROLLER)
|
2016-07-26 01:07:15 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
|
2016-07-26 01:07:15 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#elif ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) || ENABLED(AZSMZ_12864)
|
2017-06-24 18:56:07 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define ULTRA_LCD //general LCD support, also 16x2
|
|
|
|
#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
|
|
|
|
#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
|
2017-06-24 18:56:07 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#if ENABLED(miniVIKI)
|
2017-12-17 02:20:06 +00:00
|
|
|
#define LCD_CONTRAST_MIN 75
|
|
|
|
#define LCD_CONTRAST_MAX 115
|
|
|
|
#define DEFAULT_LCD_CONTRAST 95
|
2017-10-19 05:43:07 +00:00
|
|
|
#define U8GLIB_ST7565_64128N
|
|
|
|
#elif ENABLED(VIKI2)
|
2017-12-17 02:20:06 +00:00
|
|
|
#define LCD_CONTRAST_MIN 0
|
|
|
|
#define LCD_CONTRAST_MAX 255
|
2017-10-19 05:43:07 +00:00
|
|
|
#define DEFAULT_LCD_CONTRAST 140
|
|
|
|
#define U8GLIB_ST7565_64128N
|
|
|
|
#elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
|
2017-12-17 02:20:06 +00:00
|
|
|
#define LCD_CONTRAST_MIN 90
|
|
|
|
#define LCD_CONTRAST_MAX 130
|
2017-10-19 05:43:07 +00:00
|
|
|
#define DEFAULT_LCD_CONTRAST 110
|
|
|
|
#define U8GLIB_LM6059_AF
|
|
|
|
#define SD_DETECT_INVERTED
|
|
|
|
#elif ENABLED(AZSMZ_12864)
|
|
|
|
#define LCD_CONTRAST_MIN 120
|
|
|
|
#define LCD_CONTRAST_MAX 255
|
|
|
|
#define DEFAULT_LCD_CONTRAST 190
|
|
|
|
#define U8GLIB_ST7565_64128N
|
|
|
|
#endif
|
2017-06-24 18:56:07 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#elif ENABLED(OLED_PANEL_TINYBOY2)
|
2017-06-24 18:56:07 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define U8GLIB_SSD1306
|
|
|
|
#define ULTIPANEL
|
|
|
|
#define REVERSE_ENCODER_DIRECTION
|
|
|
|
#define REVERSE_MENU_DIRECTION
|
2017-06-24 18:56:07 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#elif ENABLED(RA_CONTROL_PANEL)
|
2017-10-09 20:58:02 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define LCD_I2C_TYPE_PCA8574
|
|
|
|
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
|
|
|
|
#define ULTIPANEL
|
2017-10-09 20:58:02 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
|
2017-10-09 20:58:02 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define DOGLCD
|
|
|
|
#define U8GLIB_ST7920
|
|
|
|
#define ULTIPANEL
|
2017-10-09 20:58:02 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#elif ENABLED(CR10_STOCKDISPLAY)
|
2017-10-09 20:58:02 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
|
|
|
|
#ifndef ST7920_DELAY_1
|
2018-05-12 13:34:04 +00:00
|
|
|
#define ST7920_DELAY_1 DELAY_NS(125)
|
2017-10-09 20:58:02 +00:00
|
|
|
#endif
|
2017-10-19 05:43:07 +00:00
|
|
|
#ifndef ST7920_DELAY_2
|
2018-05-12 13:34:04 +00:00
|
|
|
#define ST7920_DELAY_2 DELAY_NS(125)
|
2017-03-09 01:56:01 +00:00
|
|
|
#endif
|
2017-10-19 05:43:07 +00:00
|
|
|
#ifndef ST7920_DELAY_3
|
2018-05-12 13:34:04 +00:00
|
|
|
#define ST7920_DELAY_3 DELAY_NS(125)
|
2016-07-26 01:07:15 +00:00
|
|
|
#endif
|
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#elif ENABLED(MKS_12864OLED)
|
2017-10-09 20:58:02 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define REPRAP_DISCOUNT_SMART_CONTROLLER
|
|
|
|
#define U8GLIB_SH1106
|
2017-10-09 20:58:02 +00:00
|
|
|
|
2017-12-17 00:47:04 +00:00
|
|
|
#elif ENABLED(MKS_12864OLED_SSD1306)
|
|
|
|
|
|
|
|
#define REPRAP_DISCOUNT_SMART_CONTROLLER
|
|
|
|
#define U8GLIB_SSD1306
|
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#elif ENABLED(MKS_MINI_12864)
|
2017-10-09 20:58:02 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define MINIPANEL
|
2017-10-09 20:58:02 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#endif
|
2016-07-26 01:07:15 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#if ENABLED(MAKRPANEL) || ENABLED(MINIPANEL)
|
|
|
|
#define DOGLCD
|
|
|
|
#define ULTIPANEL
|
|
|
|
#define DEFAULT_LCD_CONTRAST 17
|
|
|
|
#endif
|
2016-07-26 01:07:15 +00:00
|
|
|
|
2018-02-06 04:25:49 +00:00
|
|
|
#if ENABLED(ULTI_CONTROLLER)
|
|
|
|
#define U8GLIB_SSD1309
|
|
|
|
#define REVERSE_ENCODER_DIRECTION
|
|
|
|
#define LCD_RESET_PIN LCD_PINS_D6 // This controller need a reset pin
|
|
|
|
#define LCD_CONTRAST_MIN 0
|
|
|
|
#define LCD_CONTRAST_MAX 254
|
|
|
|
#define DEFAULT_LCD_CONTRAST 127
|
|
|
|
#define ENCODER_PULSES_PER_STEP 2
|
|
|
|
#define ENCODER_STEPS_PER_MENU_ITEM 2
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Generic support for SSD1306 / SSD1309 / SH1106 OLED based LCDs.
|
|
|
|
#if ENABLED(U8GLIB_SSD1306) || ENABLED(U8GLIB_SSD1309) || ENABLED(U8GLIB_SH1106)
|
2017-10-19 05:43:07 +00:00
|
|
|
#define ULTRA_LCD //general LCD support, also 16x2
|
2018-02-06 04:25:49 +00:00
|
|
|
#define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 / SSD1309 / SH1106 graphic Display Family)
|
2017-10-19 05:43:07 +00:00
|
|
|
#endif
|
2016-07-26 01:07:15 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#if ENABLED(PANEL_ONE) || ENABLED(U8GLIB_SH1106)
|
2017-06-01 04:36:39 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define ULTIMAKERCONTROLLER
|
2016-07-26 01:07:15 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#elif ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602)
|
2017-06-24 18:56:07 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define REPRAP_DISCOUNT_SMART_CONTROLLER
|
|
|
|
#define LCD_WIDTH 16
|
|
|
|
#define LCD_HEIGHT 2
|
2017-06-24 18:56:07 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#endif
|
2016-07-26 01:07:15 +00:00
|
|
|
|
2017-10-27 08:42:04 +00:00
|
|
|
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) || ENABLED(LCD_FOR_MELZI) || ENABLED(SILVER_GATE_GLCD_CONTROLLER)
|
2017-10-19 05:43:07 +00:00
|
|
|
#define DOGLCD
|
|
|
|
#define U8GLIB_ST7920
|
|
|
|
#define REPRAP_DISCOUNT_SMART_CONTROLLER
|
|
|
|
#endif
|
2017-06-24 18:56:07 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#if ENABLED(ULTIMAKERCONTROLLER) \
|
|
|
|
|| ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
|
|
|
|
|| ENABLED(G3D_PANEL) \
|
2018-02-06 04:25:49 +00:00
|
|
|
|| ENABLED(RIGIDBOT_PANEL) \
|
|
|
|
|| ENABLED(ULTI_CONTROLLER)
|
2017-10-19 05:43:07 +00:00
|
|
|
#define ULTIPANEL
|
|
|
|
#endif
|
2017-06-24 18:56:07 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#if ENABLED(REPRAPWORLD_KEYPAD)
|
|
|
|
#define NEWPANEL
|
|
|
|
#if ENABLED(ULTIPANEL) && !defined(REPRAPWORLD_KEYPAD_MOVE_STEP)
|
|
|
|
#define REPRAPWORLD_KEYPAD_MOVE_STEP 1.0
|
|
|
|
#endif
|
|
|
|
#endif
|
2016-07-26 01:07:15 +00:00
|
|
|
|
2018-07-26 10:52:22 +00:00
|
|
|
/**
|
|
|
|
* SPI PANELS
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Einstart OLED has Cardinal nav via pins defined in pins_EINSTART-S.h
|
|
|
|
#if ENABLED(U8GLIB_SH1106_EINSTART)
|
|
|
|
#define ULTRA_LCD
|
|
|
|
#define DOGLCD
|
|
|
|
#define ULTIPANEL
|
|
|
|
#define NEWPANEL
|
|
|
|
#endif
|
|
|
|
|
2019-01-03 16:38:39 +00:00
|
|
|
/**
|
|
|
|
* FSMC/SPI TFT PANELS
|
|
|
|
*/
|
|
|
|
#if ENABLED(MKS_ROBIN_TFT)
|
|
|
|
#define ULTRA_LCD
|
|
|
|
#define DOGLCD
|
|
|
|
#define ULTIPANEL
|
|
|
|
#endif
|
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
/**
|
|
|
|
* I2C PANELS
|
|
|
|
*/
|
2017-06-24 18:56:07 +00:00
|
|
|
|
2018-02-21 06:46:25 +00:00
|
|
|
#if ENABLED(LCD_SAINSMART_I2C_1602) || ENABLED(LCD_SAINSMART_I2C_2004)
|
2016-08-02 22:54:33 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define LCD_I2C_TYPE_PCF8575
|
|
|
|
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
|
2018-02-21 06:46:25 +00:00
|
|
|
|
|
|
|
#if ENABLED(LCD_SAINSMART_I2C_2004)
|
|
|
|
#define LCD_WIDTH 20
|
|
|
|
#define LCD_HEIGHT 4
|
|
|
|
#endif
|
2017-09-27 04:34:09 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#elif ENABLED(LCD_I2C_PANELOLU2)
|
2017-09-27 04:34:09 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
// PANELOLU2 LCD with status LEDs, separate encoder and click inputs
|
2017-09-27 04:34:09 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define LCD_I2C_TYPE_MCP23017
|
|
|
|
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
|
2018-02-21 06:46:25 +00:00
|
|
|
#define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (optional)
|
2017-10-19 05:43:07 +00:00
|
|
|
#define ULTIPANEL
|
2016-07-26 01:07:15 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#elif ENABLED(LCD_I2C_VIKI)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
|
|
|
|
*
|
|
|
|
* This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
|
|
|
|
* Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
|
|
|
|
* Note: The pause/stop/resume LCD button pin should be connected to the Arduino
|
|
|
|
* BTN_ENC pin (or set BTN_ENC to -1 if not used)
|
|
|
|
*/
|
|
|
|
#define LCD_I2C_TYPE_MCP23017
|
|
|
|
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
|
2018-02-21 06:46:25 +00:00
|
|
|
#define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
|
2017-10-19 05:43:07 +00:00
|
|
|
#define ULTIPANEL
|
|
|
|
|
|
|
|
#define ENCODER_FEEDRATE_DEADZONE 4
|
|
|
|
|
|
|
|
#define STD_ENCODER_PULSES_PER_STEP 1
|
|
|
|
#define STD_ENCODER_STEPS_PER_MENU_ITEM 2
|
|
|
|
|
|
|
|
#elif ENABLED(G3D_PANEL)
|
|
|
|
|
|
|
|
#define STD_ENCODER_PULSES_PER_STEP 2
|
|
|
|
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
|
|
|
|
|
|
|
|
#elif ENABLED(miniVIKI) || ENABLED(VIKI2) \
|
|
|
|
|| ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
|
|
|
|
|| ENABLED(AZSMZ_12864) \
|
|
|
|
|| ENABLED(OLED_PANEL_TINYBOY2) \
|
|
|
|
|| ENABLED(BQ_LCD_SMART_CONTROLLER) \
|
|
|
|
|| ENABLED(LCD_I2C_PANELOLU2) \
|
|
|
|
|| ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
|
|
|
|
#define STD_ENCODER_PULSES_PER_STEP 4
|
|
|
|
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef STD_ENCODER_PULSES_PER_STEP
|
|
|
|
#define STD_ENCODER_PULSES_PER_STEP 5
|
|
|
|
#endif
|
|
|
|
#ifndef STD_ENCODER_STEPS_PER_MENU_ITEM
|
|
|
|
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
|
|
|
|
#endif
|
|
|
|
#ifndef ENCODER_PULSES_PER_STEP
|
|
|
|
#define ENCODER_PULSES_PER_STEP STD_ENCODER_PULSES_PER_STEP
|
|
|
|
#endif
|
|
|
|
#ifndef ENCODER_STEPS_PER_MENU_ITEM
|
|
|
|
#define ENCODER_STEPS_PER_MENU_ITEM STD_ENCODER_STEPS_PER_MENU_ITEM
|
|
|
|
#endif
|
|
|
|
#ifndef ENCODER_FEEDRATE_DEADZONE
|
|
|
|
#define ENCODER_FEEDRATE_DEADZONE 6
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Shift register panels
|
|
|
|
// ---------------------
|
|
|
|
// 2 wire Non-latching LCD SR from:
|
|
|
|
// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
|
|
|
|
|
|
|
|
#if ENABLED(SAV_3DLCD)
|
|
|
|
#define SR_LCD_2W_NL // Non latching 2 wire shift register
|
|
|
|
#define ULTIPANEL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ENABLED(ULTIPANEL)
|
|
|
|
#define NEWPANEL // Disable this if you actually have no click-encoder panel
|
|
|
|
#define ULTRA_LCD
|
|
|
|
#endif
|
|
|
|
|
2018-10-23 21:00:34 +00:00
|
|
|
// Aliases for LCD features
|
|
|
|
#define HAS_SPI_LCD ENABLED(ULTRA_LCD)
|
2018-11-11 18:16:24 +00:00
|
|
|
#define HAS_GRAPHICAL_LCD ENABLED(DOGLCD)
|
|
|
|
#define HAS_CHARACTER_LCD (HAS_SPI_LCD && !HAS_GRAPHICAL_LCD)
|
2018-11-09 06:07:16 +00:00
|
|
|
#define HAS_LCD_MENU (ENABLED(ULTIPANEL) && DISABLED(NO_LCD_MENUS))
|
2018-11-19 02:39:49 +00:00
|
|
|
|
|
|
|
#define HAS_ADC_BUTTONS ENABLED(ADC_KEYPAD)
|
|
|
|
#define HAS_DIGITAL_BUTTONS (!HAS_ADC_BUTTONS && ENABLED(NEWPANEL))
|
|
|
|
#define HAS_SHIFT_ENCODER (!HAS_ADC_BUTTONS && (ENABLED(REPRAPWORLD_KEYPAD) || (HAS_SPI_LCD && DISABLED(NEWPANEL))))
|
|
|
|
#define HAS_ENCODER_WHEEL (!HAS_ADC_BUTTONS && ENABLED(NEWPANEL))
|
2018-10-23 21:00:34 +00:00
|
|
|
|
2018-11-21 03:39:30 +00:00
|
|
|
// I2C buttons must be read in the main thread
|
|
|
|
#define HAS_SLOW_BUTTONS (ENABLED(LCD_I2C_VIKI) || ENABLED(LCD_I2C_PANELOLU2))
|
|
|
|
|
2018-10-23 21:00:34 +00:00
|
|
|
#if HAS_GRAPHICAL_LCD
|
2018-11-11 18:16:24 +00:00
|
|
|
/**
|
2018-11-14 19:13:51 +00:00
|
|
|
* Default LCD contrast for Graphical LCD displays
|
2018-11-11 18:16:24 +00:00
|
|
|
*/
|
|
|
|
#define HAS_LCD_CONTRAST ( \
|
|
|
|
ENABLED(MAKRPANEL) \
|
|
|
|
|| ENABLED(CARTESIO_UI) \
|
|
|
|
|| ENABLED(VIKI2) \
|
|
|
|
|| ENABLED(AZSMZ_12864) \
|
|
|
|
|| ENABLED(miniVIKI) \
|
|
|
|
|| ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
|
2017-10-19 05:43:07 +00:00
|
|
|
)
|
|
|
|
#if HAS_LCD_CONTRAST
|
|
|
|
#ifndef LCD_CONTRAST_MIN
|
|
|
|
#define LCD_CONTRAST_MIN 0
|
2016-07-26 01:07:15 +00:00
|
|
|
#endif
|
2017-10-19 05:43:07 +00:00
|
|
|
#ifndef LCD_CONTRAST_MAX
|
|
|
|
#define LCD_CONTRAST_MAX 63
|
2017-10-09 20:58:02 +00:00
|
|
|
#endif
|
2017-10-19 05:43:07 +00:00
|
|
|
#ifndef DEFAULT_LCD_CONTRAST
|
|
|
|
#define DEFAULT_LCD_CONTRAST 32
|
2016-07-26 01:07:15 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
2017-10-19 05:43:07 +00:00
|
|
|
#endif
|
2016-07-26 01:07:15 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
// Boot screens
|
2018-10-23 21:00:34 +00:00
|
|
|
#if !HAS_SPI_LCD
|
2017-10-19 05:43:07 +00:00
|
|
|
#undef SHOW_BOOTSCREEN
|
|
|
|
#elif !defined(BOOTSCREEN_TIMEOUT)
|
|
|
|
#define BOOTSCREEN_TIMEOUT 2500
|
|
|
|
#endif
|
2016-07-26 01:07:15 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
/**
|
|
|
|
* Extruders have some combination of stepper motors and hotends
|
|
|
|
* so we separate these concepts into the defines:
|
|
|
|
*
|
|
|
|
* EXTRUDERS - Number of Selectable Tools
|
|
|
|
* HOTENDS - Number of hotends, whether connected or separate
|
|
|
|
* E_STEPPERS - Number of actual E stepper motors
|
|
|
|
* E_MANUAL - Number of E steppers for LCD move options
|
|
|
|
*
|
|
|
|
*/
|
2018-02-19 16:59:23 +00:00
|
|
|
#if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS
|
|
|
|
#if EXTRUDERS > 4
|
|
|
|
#define E_STEPPERS 3
|
|
|
|
#elif EXTRUDERS > 2
|
|
|
|
#define E_STEPPERS 2
|
2017-09-06 11:28:32 +00:00
|
|
|
#else
|
2018-02-19 16:59:23 +00:00
|
|
|
#define E_STEPPERS 1
|
2017-09-06 11:28:32 +00:00
|
|
|
#endif
|
2018-05-29 16:05:52 +00:00
|
|
|
#if DISABLED(SWITCHING_NOZZLE)
|
|
|
|
#define HOTENDS E_STEPPERS
|
|
|
|
#endif
|
2018-02-19 16:59:23 +00:00
|
|
|
#elif ENABLED(MIXING_EXTRUDER)
|
|
|
|
#define E_STEPPERS MIXING_STEPPERS
|
|
|
|
#define E_MANUAL 1
|
2018-09-08 06:43:24 +00:00
|
|
|
#elif ENABLED(SWITCHING_TOOLHEAD)
|
2018-02-19 16:59:23 +00:00
|
|
|
#define E_STEPPERS EXTRUDERS
|
|
|
|
#define E_MANUAL EXTRUDERS
|
2017-10-19 05:43:07 +00:00
|
|
|
#endif
|
2017-09-06 11:28:32 +00:00
|
|
|
|
2018-07-02 21:54:52 +00:00
|
|
|
// No inactive extruders with MK2_MULTIPLEXER or SWITCHING_NOZZLE
|
|
|
|
#if ENABLED(MK2_MULTIPLEXER) || ENABLED(SWITCHING_NOZZLE)
|
|
|
|
#undef DISABLE_INACTIVE_EXTRUDER
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// MK2 Multiplexer forces SINGLENOZZLE
|
|
|
|
#if ENABLED(MK2_MULTIPLEXER)
|
|
|
|
#define SINGLENOZZLE
|
|
|
|
#endif
|
|
|
|
|
2018-05-27 22:56:21 +00:00
|
|
|
#if ENABLED(SINGLENOZZLE) || ENABLED(MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset
|
|
|
|
#undef HOTENDS
|
|
|
|
#define HOTENDS 1
|
|
|
|
#undef TEMP_SENSOR_1_AS_REDUNDANT
|
|
|
|
#undef HOTEND_OFFSET_X
|
|
|
|
#undef HOTEND_OFFSET_Y
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HOTENDS
|
|
|
|
#define HOTENDS EXTRUDERS
|
|
|
|
#endif
|
|
|
|
|
2018-09-08 06:43:24 +00:00
|
|
|
#ifndef E_STEPPERS
|
|
|
|
#define E_STEPPERS EXTRUDERS
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef E_MANUAL
|
|
|
|
#define E_MANUAL EXTRUDERS
|
|
|
|
#endif
|
|
|
|
|
2018-07-02 21:54:52 +00:00
|
|
|
#define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++)
|
|
|
|
|
2018-05-18 18:16:59 +00:00
|
|
|
#define DO_SWITCH_EXTRUDER (ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR))
|
|
|
|
|
2018-08-25 02:26:29 +00:00
|
|
|
#define HAS_HOTEND_OFFSET (HOTENDS > 1)
|
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
/**
|
|
|
|
* DISTINCT_E_FACTORS affects how some E factors are accessed
|
|
|
|
*/
|
|
|
|
#if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1
|
|
|
|
#define XYZE_N (XYZ + E_STEPPERS)
|
2018-11-22 11:34:58 +00:00
|
|
|
#define E_AXIS_N(E) (uint8_t(E_AXIS) + E)
|
2017-10-19 05:43:07 +00:00
|
|
|
#else
|
|
|
|
#undef DISTINCT_E_FACTORS
|
|
|
|
#define XYZE_N XYZE
|
2018-11-22 11:34:58 +00:00
|
|
|
#define E_AXIS_N(E) uint8_t(E_AXIS)
|
2017-10-19 05:43:07 +00:00
|
|
|
#endif
|
2016-08-02 04:13:13 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
/**
|
|
|
|
* The BLTouch Probe emulates a servo probe
|
|
|
|
* and uses "special" angles for its state.
|
|
|
|
*/
|
|
|
|
#if ENABLED(BLTOUCH)
|
2018-04-02 04:54:12 +00:00
|
|
|
#ifndef Z_PROBE_SERVO_NR
|
|
|
|
#define Z_PROBE_SERVO_NR 0
|
2016-12-04 04:02:27 +00:00
|
|
|
#endif
|
2017-10-19 05:43:07 +00:00
|
|
|
#ifndef NUM_SERVOS
|
2018-04-02 04:54:12 +00:00
|
|
|
#define NUM_SERVOS (Z_PROBE_SERVO_NR + 1)
|
2016-09-19 05:24:54 +00:00
|
|
|
#endif
|
2017-10-19 05:43:07 +00:00
|
|
|
#undef DEACTIVATE_SERVOS_AFTER_MOVE
|
|
|
|
#if NUM_SERVOS == 1
|
|
|
|
#undef SERVO_DELAY
|
|
|
|
#define SERVO_DELAY { 50 }
|
|
|
|
#endif
|
|
|
|
#ifndef BLTOUCH_DELAY
|
|
|
|
#define BLTOUCH_DELAY 375
|
2017-05-19 11:50:01 +00:00
|
|
|
#endif
|
2017-10-19 05:43:07 +00:00
|
|
|
#undef Z_SERVO_ANGLES
|
|
|
|
#define Z_SERVO_ANGLES { BLTOUCH_DEPLOY, BLTOUCH_STOW }
|
|
|
|
|
|
|
|
#define BLTOUCH_DEPLOY 10
|
|
|
|
#define BLTOUCH_STOW 90
|
|
|
|
#define BLTOUCH_SELFTEST 120
|
|
|
|
#define BLTOUCH_RESET 160
|
|
|
|
#define _TEST_BLTOUCH(P) (READ(P##_PIN) != P##_ENDSTOP_INVERTING)
|
|
|
|
|
|
|
|
// Always disable probe pin inverting for BLTouch
|
|
|
|
#undef Z_MIN_PROBE_ENDSTOP_INVERTING
|
|
|
|
#define Z_MIN_PROBE_ENDSTOP_INVERTING false
|
|
|
|
|
|
|
|
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
|
|
|
|
#undef Z_MIN_ENDSTOP_INVERTING
|
2018-02-05 20:38:09 +00:00
|
|
|
#define Z_MIN_ENDSTOP_INVERTING Z_MIN_PROBE_ENDSTOP_INVERTING
|
2017-10-19 05:43:07 +00:00
|
|
|
#define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN)
|
|
|
|
#else
|
|
|
|
#define TEST_BLTOUCH() _TEST_BLTOUCH(Z_MIN_PROBE)
|
|
|
|
#endif
|
|
|
|
#endif
|
2017-05-19 11:50:01 +00:00
|
|
|
|
2018-10-23 05:57:19 +00:00
|
|
|
#ifndef PREHEAT_1_LABEL
|
|
|
|
#define PREHEAT_1_LABEL "PLA"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef PREHEAT_2_LABEL
|
2018-10-23 20:38:17 +00:00
|
|
|
#define PREHEAT_2_LABEL "ABS"
|
2018-10-23 05:57:19 +00:00
|
|
|
#endif
|
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
/**
|
|
|
|
* Set a flag for a servo probe
|
|
|
|
*/
|
2018-04-02 04:54:12 +00:00
|
|
|
#define HAS_Z_SERVO_PROBE (defined(Z_PROBE_SERVO_NR) && Z_PROBE_SERVO_NR >= 0)
|
2016-08-22 20:02:19 +00:00
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
/**
|
2018-04-27 05:44:47 +00:00
|
|
|
* Set flags for enabled probes
|
2017-10-19 05:43:07 +00:00
|
|
|
*/
|
2018-10-26 21:47:38 +00:00
|
|
|
#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))
|
2018-07-13 02:36:24 +00:00
|
|
|
#define PROBE_SELECTED (HAS_BED_PROBE || ENABLED(PROBE_MANUALLY) || ENABLED(MESH_BED_LEVELING))
|
2016-09-19 04:28:11 +00:00
|
|
|
|
2018-11-05 06:20:13 +00:00
|
|
|
#if HAS_BED_PROBE
|
|
|
|
#ifndef Z_PROBE_LOW_POINT
|
|
|
|
#define Z_PROBE_LOW_POINT -5
|
|
|
|
#endif
|
|
|
|
#if ENABLED(Z_PROBE_ALLEN_KEY)
|
|
|
|
#define PROBE_TRIGGERED_WHEN_STOWED_TEST // Extra test for Allen Key Probe
|
|
|
|
#endif
|
|
|
|
#else
|
2018-04-27 05:44:47 +00:00
|
|
|
// Clear probe pin settings when no probe is selected
|
2017-10-19 05:43:07 +00:00
|
|
|
#undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
|
|
|
|
#undef Z_MIN_PROBE_ENDSTOP
|
|
|
|
#endif
|
|
|
|
|
2018-04-27 05:44:47 +00:00
|
|
|
#define HOMING_Z_WITH_PROBE (HAS_BED_PROBE && Z_HOME_DIR < 0 && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN))
|
|
|
|
|
2018-11-03 07:13:10 +00:00
|
|
|
#ifdef GRID_MAX_POINTS_X
|
|
|
|
#define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y))
|
|
|
|
#endif
|
|
|
|
|
2017-10-19 05:43:07 +00:00
|
|
|
#define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS))
|
2018-10-08 20:44:05 +00:00
|
|
|
#define HAS_RESUME_CONTINUE (ENABLED(EXTENSIBLE_UI) || ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER))
|
2017-10-19 05:43:07 +00:00
|
|
|
#define HAS_COLOR_LEDS (ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED))
|
2018-10-11 02:25:43 +00:00
|
|
|
#define HAS_LEDS_OFF_FLAG (ENABLED(PRINTER_EVENT_LEDS) && ENABLED(SDSUPPORT) && HAS_RESUME_CONTINUE)
|
2018-10-18 16:34:52 +00:00
|
|
|
#define HAS_PRINT_PROGRESS (ENABLED(SDSUPPORT) || ENABLED(LCD_SET_PROGRESS_MANUALLY))
|
2017-03-16 22:20:24 +00:00
|
|
|
|
2018-06-19 16:55:49 +00:00
|
|
|
#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))
|
|
|
|
|
2018-11-03 07:13:10 +00:00
|
|
|
#define IS_SCARA (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA))
|
|
|
|
#define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA)
|
|
|
|
#define IS_CARTESIAN !IS_KINEMATIC
|