Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marlin into bugfix-2.1.x

This commit is contained in:
InsanityAutomation
2023-02-03 15:20:56 -05:00
291 changed files with 26748 additions and 5432 deletions
+92 -27
View File
@@ -35,7 +35,7 @@
*
* Advanced settings can be found in Configuration_adv.h
*/
#define CONFIGURATION_H_VERSION 02010200
#define CONFIGURATION_H_VERSION 02010300
//===========================================================================
//============================= Getting Started =============================
@@ -878,8 +878,9 @@
// Enable for Polargraph Kinematics
//#define POLARGRAPH
#if ENABLED(POLARGRAPH)
#define POLARGRAPH_MAX_BELT_LEN 1035.0
#define DEFAULT_SEGMENTS_PER_SECOND 5
#define POLARGRAPH_MAX_BELT_LEN 1035.0 // (mm) Belt length at full extension. Override with M665 H.
#define DEFAULT_SEGMENTS_PER_SECOND 5 // Move segmentation based on duration
#define PEN_UP_DOWN_MENU // Add "Pen Up" and "Pen Down" to the MarlinUI menu
#endif
// @section delta
@@ -915,7 +916,7 @@
#endif
// Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
#define DELTA_PRINTABLE_RADIUS 140.0 // (mm)
#define PRINTABLE_RADIUS 140.0 // (mm)
// Maximum reachable area
#define DELTA_MAX_RADIUS 140.0 // (mm)
@@ -969,7 +970,7 @@
#if ENABLED(MORGAN_SCARA)
//#define DEBUG_SCARA_KINEMATICS
#define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
#define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
// Radius around the center where the arm cannot reach
#define MIDDLE_DEAD_ZONE_R 0 // (mm)
@@ -1004,7 +1005,7 @@
#define TPARA_OFFSET_Y 0 // (mm)
#define TPARA_OFFSET_Z 0 // (mm)
#define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
#define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
// Radius around the center where the arm cannot reach
#define MIDDLE_DEAD_ZONE_R 0 // (mm)
@@ -1014,6 +1015,59 @@
#define PSI_HOMING_OFFSET 0
#endif
// @section polar
/**
* POLAR Kinematics
* developed by Kadir ilkimen for PolarBear CNC and babyBear
* https://github.com/kadirilkimen/Polar-Bear-Cnc-Machine
* https://github.com/kadirilkimen/babyBear-3D-printer
*
* A polar machine can have different configurations.
* This kinematics is only compatible with the following configuration:
* X : Independent linear
* Y or B : Polar
* Z : Independent linear
*
* For example, PolarBear has CoreXZ plus Polar Y or B.
*
* Motion problem for Polar axis near center / origin:
*
* 3D printing:
* Movements very close to the center of the polar axis take more time than others.
* This brief delay results in more material deposition due to the pressure in the nozzle.
*
* Current Kinematics and feedrate scaling deals with this by making the movement as fast
* as possible. It works for slow movements but doesn't work well with fast ones. A more
* complicated extrusion compensation must be implemented.
*
* Ideally, it should estimate that a long rotation near the center is ahead and will cause
* unwanted deposition. Therefore it can compensate the extrusion beforehand.
*
* Laser cutting:
* Same thing would be a problem for laser engraving too. As it spends time rotating at the
* center point, more likely it will burn more material than it should. Therefore similar
* compensation would be implemented for laser-cutting operations.
*
* Milling:
* This shouldn't be a problem for cutting/milling operations.
*/
//#define POLAR
#if ENABLED(POLAR)
#define DEFAULT_SEGMENTS_PER_SECOND 180 // If movement is choppy try lowering this value
#define PRINTABLE_RADIUS 82.0f // (mm) Maximum travel of X axis
// Movements fall inside POLAR_FAST_RADIUS are assigned the highest possible feedrate
// to compensate unwanted deposition related to the near-origin motion problem.
#define POLAR_FAST_RADIUS 3.0f // (mm)
// Radius which is unreachable by the tool.
// Needed if the tool is not perfectly aligned to the center of the polar axis.
#define POLAR_CENTER_OFFSET 0.0f // (mm)
#define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
#endif
// @section machine
// Articulated robot (arm). Joints are directly mapped to axes with no kinematics.
@@ -1420,13 +1474,13 @@
// 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
// if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.
#define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 }
#define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, PRINTABLE_RADIUS, 100.0 }
#define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_FEEDRATE
#define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 }
#define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, PRINTABLE_RADIUS, 100.0 }
#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_FEEDRATE)/10
#define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 }
#define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (PRINTABLE_RADIUS) * 0.75, 100.0 }
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_FEEDRATE
#define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position
@@ -1966,7 +2020,7 @@
//#define EXTRAPOLATE_BEYOND_GRID
//
// Experimental Subdivision of the grid by Catmull-Rom method.
// Subdivision of the grid by Catmull-Rom method.
// Synthesizes intermediate points to produce a more detailed mesh.
//
//#define ABL_BILINEAR_SUBDIVISION
@@ -2251,7 +2305,7 @@
#endif
/**
* Clean Nozzle Feature -- EXPERIMENTAL
* Clean Nozzle Feature
*
* Adds the G12 command to perform a nozzle cleaning process.
*
@@ -2285,7 +2339,6 @@
* 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
@@ -2939,23 +2992,16 @@
/**
* DGUS Touch Display with DWIN OS. (Choose one.)
* ORIGIN : https://www.aliexpress.com/item/32993409517.html
* FYSETC : https://www.aliexpress.com/item/32961471929.html
* MKS : https://www.aliexpress.com/item/1005002008179262.html
*
* Flash display with DGUS Displays for Marlin:
* - Format the SD card to FAT32 with an allocation size of 4kb.
* - Download files as specified for your type of display.
* - Plug the microSD card into the back of the display.
* - Boot the display and wait for the update to complete.
*
* ORIGIN (Marlin DWIN_SET)
* - Download https://github.com/coldtobi/Marlin_DGUS_Resources
* - Copy the downloaded DWIN_SET folder to the SD card.
* - Product: https://www.aliexpress.com/item/32993409517.html
*
* FYSETC (Supplier default)
* - Download https://github.com/FYSETC/FYSTLCD-2.0
* - Copy the downloaded SCREEN folder to the SD card.
* - Product: https://www.aliexpress.com/item/32961471929.html
*
* HIPRECY (Supplier default)
* - Download https://github.com/HiPrecy/Touch-Lcd-LEO
@@ -2964,17 +3010,24 @@
* MKS (MKS-H43) (Supplier default)
* - Download https://github.com/makerbase-mks/MKS-H43
* - Copy the downloaded DWIN_SET folder to the SD card.
* - Product: https://www.aliexpress.com/item/1005002008179262.html
*
* RELOADED (T5UID1)
* - Download https://github.com/Desuuuu/DGUS-reloaded/releases
* - Copy the downloaded DWIN_SET folder to the SD card.
*
* IA_CREALITY (T5UID1)
* - Download https://github.com/InsanityAutomation/Marlin/raw/CrealityDwin2.0_Bleeding/TM3D_Combined480272_Landscape_V7.7z
* - Copy the downloaded DWIN_SET folder to the SD card.
*
* Flash display with DGUS Displays for Marlin:
* - Format the SD card to FAT32 with an allocation size of 4kb.
* - Download files as specified for your type of display.
* - Plug the microSD card into the back of the display.
* - Boot the display and wait for the update to complete.
*/
//#define DGUS_LCD_UI_ORIGIN
//#define DGUS_LCD_UI_FYSETC
//#define DGUS_LCD_UI_HIPRECY
//#define DGUS_LCD_UI_MKS
//#define DGUS_LCD_UI_RELOADED
#if ENABLED(DGUS_LCD_UI_MKS)
//#define DGUS_LCD_UI ORIGIN
#if DGUS_UI_IS(MKS)
#define USE_MKS_GREEN_UI
#endif
@@ -3133,6 +3186,15 @@
//#define TFT_LVGL_UI
#if ENABLED(TFT_COLOR_UI)
/**
* TFT Font for Color_UI. Choose one of the following:
*
* NOTOSANS - Default font with antialiasing. Supports Latin Extended and non-Latin characters.
* UNIFONT - Lightweight font, no antialiasing. Supports Latin Extended and non-Latin characters.
* HELVETICA - Lightweight font, no antialiasing. Supports Basic Latin (0x0020-0x007F) and Latin-1 Supplement (0x0080-0x00FF) characters only.
*/
#define TFT_FONT NOTOSANS
//#define TFT_SHARED_SPI // SPI is shared between TFT display and other devices. Disable async data transfer
#endif
@@ -3284,6 +3346,9 @@
//#define RGB_LED_G_PIN 43
//#define RGB_LED_B_PIN 35
//#define RGB_LED_W_PIN -1
#endif
#if ANY(RGB_LED, RGBW_LED, PCA9632)
//#define RGB_STARTUP_TEST // For PWM pins, fade between all colors
#if ENABLED(RGB_STARTUP_TEST)
#define RGB_STARTUP_TEST_INNER_MS 10 // (ms) Reduce or increase fading speed
+23 -19
View File
@@ -30,7 +30,7 @@
*
* Basic settings can be found in Configuration.h
*/
#define CONFIGURATION_ADV_H_VERSION 02010200
#define CONFIGURATION_ADV_H_VERSION 02010300
// @section develop
@@ -304,8 +304,8 @@
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
//#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops
#if BOTH(ADAPTIVE_FAN_SLOWING, PIDTEMP)
//#define NO_FAN_SLOWING_IN_PID_TUNING // Don't slow fan speed during M303
#if ENABLED(ADAPTIVE_FAN_SLOWING) && EITHER(MPCTEMP, PIDTEMP)
//#define TEMP_TUNING_MAINTAIN_FAN // Don't slow fan speed during M303 or M306 T
#endif
/**
@@ -375,7 +375,7 @@
#endif
#if ENABLED(PIDTEMP)
// Add an experimental additional term to the heater power, proportional to the extrusion speed.
// Add an additional term to the heater power, proportional to the extrusion speed.
// A well-chosen Kc value should add just enough power to melt the increased material volume.
//#define PID_EXTRUSION_SCALING
#if ENABLED(PID_EXTRUSION_SCALING)
@@ -384,7 +384,7 @@
#endif
/**
* Add an experimental additional term to the heater power, proportional to the fan speed.
* Add an additional term to the heater power, proportional to the fan speed.
* A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan.
* You can either just add a constant compensation with the DEFAULT_Kf value
* or follow the instruction below to get speed-dependent compensation.
@@ -450,6 +450,9 @@
#define AUTOTEMP
#if ENABLED(AUTOTEMP)
#define AUTOTEMP_OLDWEIGHT 0.98 // Factor used to weight previous readings (0.0 < value < 1.0)
#define AUTOTEMP_MIN 210
#define AUTOTEMP_MAX 250
#define AUTOTEMP_FACTOR 0.1f
// Turn on AUTOTEMP on M104/M109 by default using proportions set here
//#define AUTOTEMP_PROPORTIONAL
#if ENABLED(AUTOTEMP_PROPORTIONAL)
@@ -469,10 +472,10 @@
* Thermistors able to support high temperature tend to have a hard time getting
* good readings at room and lower temperatures. This means TEMP_SENSOR_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
* preheating process, which will trigger a MINTEMP 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
* MINTEMP 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)
@@ -480,7 +483,7 @@
*/
// The number of consecutive low temperature errors that can occur
// before a min_temp_error is triggered. (Shouldn't be more than 10.)
// before a MINTEMP error is triggered. (Shouldn't be more than 10.)
//#define MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED 0
/**
@@ -490,7 +493,8 @@
* 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
//#define PREHEAT_TIME_HOTEND_MS 0
//#define PREHEAT_TIME_BED_MS 0
// @section extruder
@@ -839,20 +843,20 @@
//#define Z_MULTI_ENDSTOPS // Other Z axes have their own endstops
#if ENABLED(Z_MULTI_ENDSTOPS)
#define Z2_USE_ENDSTOP _XMAX_ // Z2 endstop board plug. Don't forget to enable USE_*_PLUG.
#define Z2_ENDSTOP_ADJUSTMENT 0 // Z2 offset relative to Y endstop
#define Z2_ENDSTOP_ADJUSTMENT 0 // Z2 offset relative to Z endstop
#endif
#ifdef Z3_DRIVER_TYPE
//#define INVERT_Z3_VS_Z_DIR // Z3 direction signal is the opposite of Z
#if ENABLED(Z_MULTI_ENDSTOPS)
#define Z3_USE_ENDSTOP _YMAX_ // Z3 endstop board plug. Don't forget to enable USE_*_PLUG.
#define Z3_ENDSTOP_ADJUSTMENT 0 // Z3 offset relative to Y endstop
#define Z3_ENDSTOP_ADJUSTMENT 0 // Z3 offset relative to Z endstop
#endif
#endif
#ifdef Z4_DRIVER_TYPE
//#define INVERT_Z4_VS_Z_DIR // Z4 direction signal is the opposite of Z
#if ENABLED(Z_MULTI_ENDSTOPS)
#define Z4_USE_ENDSTOP _ZMAX_ // Z4 endstop board plug. Don't forget to enable USE_*_PLUG.
#define Z4_ENDSTOP_ADJUSTMENT 0 // Z4 offset relative to Y endstop
#define Z4_ENDSTOP_ADJUSTMENT 0 // Z4 offset relative to Z endstop
#endif
#endif
#endif
@@ -1414,6 +1418,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif
// Add 50/100mm moves to MarlinUI even with a smaller bed
//#define LARGE_MOVE_ITEMS
// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM
@@ -1422,12 +1429,10 @@
#endif // HAS_MARLINUI_MENU
#if ANY(HAS_DISPLAY, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
#if HAS_DISPLAY
//#define SOUND_MENU_ITEM // Add a mute option to the LCD menu
#define SOUND_ON_DEFAULT // Buzzer/speaker default enabled state
#endif
#if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI)
// The timeout to return to the status screen from sub-menus
//#define LCD_TIMEOUT_TO_STATUS 15000 // (ms)
@@ -1476,7 +1481,7 @@
#endif
#endif
#endif // HAS_DISPLAY || DWIN_LCD_PROUI
#endif // HAS_DISPLAY
// Add 'M73' to set print job progress, overrides Marlin's built-in estimate
//#define SET_PROGRESS_MANUALLY
@@ -1864,11 +1869,11 @@
#define DGUS_UPDATE_INTERVAL_MS 500 // (ms) Interval between automatic screen updates
#if ANY(DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_MKS, DGUS_LCD_UI_HIPRECY)
#if DGUS_UI_IS(FYSETC, MKS, HIPRECY)
#define DGUS_PRINT_FILENAME // Display the filename during printing
#define DGUS_PREHEAT_UI // Display a preheat screen during heatup
#if EITHER(DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_MKS)
#if DGUS_UI_IS(FYSETC, MKS)
//#define DGUS_UI_MOVE_DIS_OPTION // Disabled by default for FYSETC and MKS
#else
#define DGUS_UI_MOVE_DIS_OPTION // Enabled by default for UI_HIPRECY
@@ -2114,7 +2119,6 @@
#endif
//#define ADVANCE_K_EXTRA // Add a second linear advance constant, configurable with M900 L.
//#define LA_DEBUG // Print debug information to serial during operation. Disable for production use.
//#define EXPERIMENTAL_SCURVE // Allow S-Curve Acceleration to be used with LA.
//#define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends.
//#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz.
#endif
+1 -1
View File
@@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2022-12-18"
//#define STRING_DISTRIBUTION_DATE "2023-02-03"
/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
+3 -3
View File
@@ -293,11 +293,11 @@ enum ClockSource2 : uint8_t {
#if HAS_MOTOR_CURRENT_PWM
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z || P == MOTOR_CURRENT_PWM_XY)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN || P == MOTOR_CURRENT_PWM_Z_PIN || P == MOTOR_CURRENT_PWM_XY_PIN)
#elif PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1 || P == MOTOR_CURRENT_PWM_Z)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN || P == MOTOR_CURRENT_PWM_Z_PIN)
#else
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E || P == MOTOR_CURRENT_PWM_E0 || P == MOTOR_CURRENT_PWM_E1)
#define PWM_CHK_MOTOR_CURRENT(P) (P == MOTOR_CURRENT_PWM_E_PIN || P == MOTOR_CURRENT_PWM_E0_PIN || P == MOTOR_CURRENT_PWM_E1_PIN)
#endif
#else
#define PWM_CHK_MOTOR_CURRENT(P) false
+17 -19
View File
@@ -149,30 +149,28 @@ void stepperTask(void *parameter) {
dma.rw_pos = 0;
while (dma.rw_pos < DMA_SAMPLE_COUNT) {
// Fill with the port data post pulse_phase until the next step
if (nextMainISR && TERN1(LIN_ADVANCE, nextAdvanceISR))
i2s_push_sample();
// i2s_push_sample() is also called from Stepper::pulse_phase_isr() and Stepper::advance_isr()
// in a rare case where both are called, we need to double decrement the counters
const uint8_t push_count = 1 + (!nextMainISR && TERN0(LIN_ADVANCE, !nextAdvanceISR));
#if ENABLED(LIN_ADVANCE)
if (!nextAdvanceISR) {
Stepper::advance_isr();
nextAdvanceISR = Stepper::la_interval;
}
else if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
nextAdvanceISR = Stepper::la_interval;
#endif
if (!nextMainISR) {
Stepper::pulse_phase_isr();
nextMainISR = Stepper::block_phase_isr();
}
#if ENABLED(LIN_ADVANCE)
else if (!nextAdvanceISR) {
Stepper::advance_isr();
nextAdvanceISR = Stepper::la_interval;
}
#endif
else
i2s_push_sample();
nextMainISR -= push_count;
TERN_(LIN_ADVANCE, nextAdvanceISR -= push_count);
nextMainISR--;
#if ENABLED(LIN_ADVANCE)
if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
nextAdvanceISR = Stepper::la_interval;
if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER)
nextAdvanceISR--;
#endif
}
}
}
+2 -2
View File
@@ -208,8 +208,8 @@ public:
MarlinHAL() {}
// Watchdog
static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {});
static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {});
static void watchdog_init();
static void watchdog_refresh();
static void init() {} // Called early in setup()
static void init_board() {} // Called less early in setup()
+7 -4
View File
@@ -31,10 +31,11 @@
#endif
#define DATASIZE_8BIT 8
#define DATASIZE_16BIT 16
#define TFT_IO_DRIVER TFT_SPI
#define DATASIZE_16BIT 16
#define TFT_IO_DRIVER TFT_SPI
#define DMA_MAX_SIZE 0xFFFF
#define DMA_MINC_ENABLE 1
#define DMA_MINC_ENABLE 1
#define DMA_MINC_DISABLE 0
class TFT_SPI {
@@ -58,7 +59,9 @@ public:
static void WriteData(uint16_t Data);
static void WriteReg(uint16_t Reg);
static void WriteSequence_DMA(uint16_t *Data, uint16_t Count) { WriteSequence(Data, Count); }
static void WriteMultiple_DMA(uint16_t Color, uint16_t Count) { WriteMultiple(Color, Count); }
static void WriteSequence(uint16_t *Data, uint16_t Count);
// static void WriteMultiple(uint16_t Color, uint16_t Count);
static void WriteMultiple(uint16_t Color, uint32_t Count);
};
+6 -6
View File
@@ -47,11 +47,11 @@ const tTimerConfig timer_config[NUM_HARDWARE_TIMERS] = {
{ {.pTcc=TCC0}, TimerType::tcc, TCC0_IRQn, TC_PRIORITY(0) }, // 0 - stepper (assigned priority 2)
{ {.pTcc=TCC1}, TimerType::tcc, TCC1_IRQn, TC_PRIORITY(1) }, // 1 - stepper (needed by 32 bit timers)
{ {.pTcc=TCC2}, TimerType::tcc, TCC2_IRQn, 5 }, // 2 - tone (reserved by framework and fixed assigned priority 5)
{ {.pTc=TC3}, TimerType::tc, TC3_IRQn, TC_PRIORITY(3) }, // 3 - servo (assigned priority 1)
{ {.pTc=TC4}, TimerType::tc, TC4_IRQn, TC_PRIORITY(4) }, // 4 - software serial (no interrupts used)
{ {.pTc=TC5}, TimerType::tc, TC5_IRQn, TC_PRIORITY(5) },
{ {.pTc=TC6}, TimerType::tc, TC6_IRQn, TC_PRIORITY(6) },
{ {.pTc=TC7}, TimerType::tc, TC7_IRQn, TC_PRIORITY(7) },
{ {.pTc=TC3}, TimerType::tc, TC3_IRQn, TC_PRIORITY(3) }, // 3 - servo (assigned priority 1)
{ {.pTc=TC4}, TimerType::tc, TC4_IRQn, TC_PRIORITY(4) }, // 4 - software serial (no interrupts used)
{ {.pTc=TC5}, TimerType::tc, TC5_IRQn, TC_PRIORITY(5) },
{ {.pTc=TC6}, TimerType::tc, TC6_IRQn, TC_PRIORITY(6) },
{ {.pTc=TC7}, TimerType::tc, TC7_IRQn, TC_PRIORITY(7) },
{ {.pRtc=RTC}, TimerType::rtc, RTC_IRQn, TC_PRIORITY(8) } // 8 - temperature (assigned priority 6)
};
@@ -135,7 +135,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
}
else if (timer_config[timer_num].type==TimerType::tcc) {
Tcc * const tc = timer_config[timer_num].pTcc;
PM->APBCMASK.reg |= PM_APBCMASK_TCC0;
+7 -1
View File
@@ -286,6 +286,9 @@ void HAL_SD_MspInit(SD_HandleTypeDef *hsd) {
go_to_transfer_speed();
hsd.Init.ClockPowerSave = SDIO_CLOCK_POWER_SAVE_ENABLE;
hsd.Init.ClockDiv = 8;
#if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // go to 4 bit wide mode if pins are defined
retry_Cnt = retryCnt;
for (;;) {
@@ -433,7 +436,10 @@ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
#else
uint8_t retries = SDIO_READ_RETRIES;
while (retries--) if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true;
while (retries--) {
if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true;
delay(10);
}
return false;
#endif
+26 -6
View File
@@ -1,11 +1,31 @@
/*-----------------------------------------------------------------------
/ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
/ * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech]
/ * Low level disk interface module include file (C)ChaN, 2015
/-----------------------------------------------------------------------*/
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.
*
*/
#pragma once
/*-----------------------------------------------------------------------
/ * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech]
/ * Low level disk interface module include file (c) ChaN, 2015
/-----------------------------------------------------------------------*/
#define _DISKIO_WRITE 1 /* 1: Enable disk_write function */
#define _DISKIO_IOCTL 1 /* 1: Enable disk_ioctl function */
#define _DISKIO_ISDIO 0 /* 1: Enable iSDIO control function */
+3 -1
View File
@@ -168,6 +168,8 @@
#include "module/polargraph.h"
#elif IS_SCARA
#include "module/scara.h"
#elif ENABLED(POLAR)
#include "module/polar.h"
#endif
#if HAS_LEVELING
@@ -232,7 +234,7 @@
#include "feature/password/password.h"
#endif
#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
#include "lcd/extui/dgus/DGUSScreenHandler.h"
#endif
+1
View File
@@ -279,6 +279,7 @@
#define STR_S_SEG_PER_SEC "S<seg-per-sec>"
#define STR_DELTA_SETTINGS "Delta (L<diagonal-rod> R<radius> H<height> S<seg-per-sec> XYZ<tower-angle-trim> ABC<rod-trim>)"
#define STR_SCARA_SETTINGS "SCARA"
#define STR_POLAR_SETTINGS "Polar"
#define STR_POLARGRAPH_SETTINGS "Polargraph"
#define STR_SCARA_P_T_Z "P<theta-psi-offset> T<theta-offset> Z<home-offset>"
#define STR_ENDSTOP_ADJUSTMENT "Endstop adjustment"
+10
View File
@@ -742,3 +742,13 @@
#define _HAS_E_TEMP(N) || TEMP_SENSOR(N)
#define HAS_E_TEMP_SENSOR (0 REPEAT(EXTRUDERS, _HAS_E_TEMP))
#define TEMP_SENSOR_IS_MAX_TC(T) (TEMP_SENSOR(T) == -5 || TEMP_SENSOR(T) == -3 || TEMP_SENSOR(T) == -2)
#define _UI_NONE 0
#define _UI_ORIGIN 101
#define _UI_FYSETC 102
#define _UI_HIPRECY 103
#define _UI_MKS 104
#define _UI_RELOADED 105
#define _UI_IA_CREALITY 106
#define _DGUS_UI_IS(N) || (CAT(_UI_, DGUS_LCD_UI) == CAT(_UI_, N))
#define DGUS_UI_IS(V...) (0 MAP(_DGUS_UI_IS, V))
+2 -2
View File
@@ -337,8 +337,8 @@ void serial_offset(const_float_t v, const uint8_t sp=0); // For v==0 draw space
void print_bin(const uint16_t val);
void print_pos(NUM_AXIS_ARGS(const_float_t), FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr);
inline void print_pos(const xyz_pos_t &xyz, FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr) {
print_pos(NUM_AXIS_ELEM(xyz), prefix, suffix);
inline void print_pos(const xyze_pos_t &xyze, FSTR_P const prefix=nullptr, FSTR_P const suffix=nullptr) {
print_pos(NUM_AXIS_ELEM(xyze), prefix, suffix);
}
#define SERIAL_POS(SUFFIX,VAR) do { print_pos(VAR, F(" " STRINGIFY(VAR) "="), F(" : " SUFFIX "\n")); }while(0)
+67 -50
View File
@@ -430,21 +430,24 @@ struct XYval {
FI XYval<T>& operator+=(const XYval<T> &rs) { x += rs.x; y += rs.y; return *this; }
FI XYval<T>& operator-=(const XYval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
FI XYval<T>& operator*=(const XYval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
FI XYval<T>& operator+=(const XYZval<T> &rs) { x += rs.x; y += rs.y; return *this; }
FI XYval<T>& operator-=(const XYZval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
FI XYval<T>& operator*=(const XYZval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
FI XYval<T>& operator+=(const XYZEval<T> &rs) { x += rs.x; y += rs.y; return *this; }
FI XYval<T>& operator-=(const XYZEval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
FI XYval<T>& operator*=(const XYZEval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
FI XYval<T>& operator/=(const XYval<T> &rs) { x /= rs.x; y /= rs.y; return *this; }
FI XYval<T>& operator+=(const XYZval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator-=(const XYZval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator*=(const XYZval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator/=(const XYZval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator+=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator-=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator*=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator/=(const XYZEval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; }
FI XYval<T>& operator*=(const float &p) { x *= p; y *= p; return *this; }
FI XYval<T>& operator*=(const int &p) { x *= p; y *= p; return *this; }
FI XYval<T>& operator>>=(const int &p) { _RS(x); _RS(y); return *this; }
FI XYval<T>& operator<<=(const int &p) { _LS(x); _LS(y); return *this; }
// Exact comparisons. For floats a "NEAR" operation may be better.
FI bool operator==(const XYval<T> &rs) const { return x == rs.x && y == rs.y; }
FI bool operator==(const XYZval<T> &rs) const { return x == rs.x && y == rs.y; }
FI bool operator==(const XYZEval<T> &rs) const { return x == rs.x && y == rs.y; }
FI bool operator==(const XYval<T> &rs) const { return NUM_AXIS_GANG(x == rs.x, && y == rs.y,,,,,,, ); }
FI bool operator==(const XYZval<T> &rs) const { return NUM_AXIS_GANG(x == rs.x, && y == rs.y,,,,,,, ); }
FI bool operator==(const XYZEval<T> &rs) const { return NUM_AXIS_GANG(x == rs.x, && y == rs.y,,,,,,, ); }
FI bool operator!=(const XYval<T> &rs) const { return !operator==(rs); }
FI bool operator!=(const XYZval<T> &rs) const { return !operator==(rs); }
FI bool operator!=(const XYZEval<T> &rs) const { return !operator==(rs); }
@@ -465,15 +468,9 @@ struct XYZval {
FI void reset() { NUM_AXIS_GANG(x =, y =, z =, i =, j =, k =, u =, v =, w =) 0; }
// Setters taking struct types and arrays
FI void set(const T px) { x = px; }
FI void set(const T px, const T py) { x = px; y = py; }
FI void set(const XYval<T> pxy) { x = pxy.x; y = pxy.y; }
FI void set(const XYval<T> pxy, const T pz) { NUM_AXIS_CODE(x = pxy.x, y = pxy.y, z = pz, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP); }
FI void set(const T (&arr)[XY]) { x = arr[0]; y = arr[1]; }
#if HAS_Z_AXIS
FI void set(const T (&arr)[NUM_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); }
FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w ); }
#endif
FI void set(const XYval<T> pxy) { NUM_AXIS_CODE(x = pxy.x, y = pxy.y,,,,,,,); }
FI void set(const XYval<T> pxy, const T pz) { NUM_AXIS_CODE(x = pxy.x, y = pxy.y, z = pz,,,,,,); }
FI void set(const T (&arr)[NUM_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); }
#if LOGICAL_AXES > NUM_AXES
FI void set(const T (&arr)[LOGICAL_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); }
FI void set(LOGICAL_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w ); }
@@ -481,6 +478,17 @@ struct XYZval {
FI void set(const T (&arr)[DISTINCT_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); }
#endif
#endif
// Setter for all individual args
FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); }
// Setters with fewer elements leave the rest untouched
#if HAS_Y_AXIS
FI void set(const T px) { x = px; }
#endif
#if HAS_Z_AXIS
FI void set(const T px, const T py) { x = px; y = py; }
#endif
#if HAS_I_AXIS
FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; }
#endif
@@ -545,14 +553,14 @@ struct XYZval {
FI XYZval<T>& operator= (const XYZEval<T> &rs) { set(NUM_AXIS_ELEM(rs)); return *this; }
// Override other operators to get intuitive behaviors
FI XYZval<T> operator+ (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator+ (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator- (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator- (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator* (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator* (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator/ (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator/ (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y, NOOP , NOOP , NOOP , NOOP , NOOP , NOOP , NOOP ); return ls; }
FI XYZval<T> operator+ (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator+ (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator- (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator- (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator* (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator* (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x *= rs.x, ls.y *= rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator/ (const XYval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator/ (const XYval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x /= rs.x, ls.y /= rs.y,,,,,,, ); return ls; }
FI XYZval<T> operator+ (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
FI XYZval<T> operator+ (const XYZval<T> &rs) { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x += rs.x, ls.y += rs.y, ls.z += rs.z, ls.i += rs.i, ls.j += rs.j, ls.k += rs.k, ls.u += rs.u, ls.v += rs.v, ls.w += rs.w); return ls; }
FI XYZval<T> operator- (const XYZval<T> &rs) const { XYZval<T> ls = *this; NUM_AXIS_CODE(ls.x -= rs.x, ls.y -= rs.y, ls.z -= rs.z, ls.i -= rs.i, ls.j -= rs.j, ls.k -= rs.k, ls.u -= rs.u, ls.v -= rs.v, ls.w -= rs.w); return ls; }
@@ -585,10 +593,10 @@ struct XYZval {
FI XYZval<T> operator-() { XYZval<T> o = *this; NUM_AXIS_CODE(o.x = -x, o.y = -y, o.z = -z, o.i = -i, o.j = -j, o.k = -k, o.u = -u, o.v = -v, o.w = -w); return o; }
// Modifier operators
FI XYZval<T>& operator+=(const XYval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; }
FI XYZval<T>& operator-=(const XYval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; }
FI XYZval<T>& operator*=(const XYval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; }
FI XYZval<T>& operator/=(const XYval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, NOOP ); return *this; }
FI XYZval<T>& operator+=(const XYval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; }
FI XYZval<T>& operator-=(const XYval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; }
FI XYZval<T>& operator*=(const XYval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; }
FI XYZval<T>& operator/=(const XYval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; }
FI XYZval<T>& operator+=(const XYZval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; }
FI XYZval<T>& operator-=(const XYZval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; }
FI XYZval<T>& operator*=(const XYZval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; }
@@ -620,9 +628,31 @@ struct XYZEval {
// Reset all to 0
FI void reset() { LOGICAL_AXIS_GANG(e =, x =, y =, z =, i =, j =, k =, u =, v =, w =) 0; }
// Setters for some number of linear axes, not all
FI void set(const T px) { x = px; }
FI void set(const T px, const T py) { x = px; y = py; }
// Setters taking struct types and arrays
FI void set(const XYval<T> pxy) { x = pxy.x; OPTCODE(HAS_Y_AXIS, y = pxy.y) }
FI void set(const XYZval<T> pxyz) { set(NUM_AXIS_ELEM(pxyz)); }
FI void set(const XYval<T> pxy, const T pz) { set(pxy); TERN_(HAS_Z_AXIS, z = pz); }
FI void set(const T (&arr)[NUM_AXES]) { NUM_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); }
#if LOGICAL_AXES > NUM_AXES
FI void set(const T (&arr)[LOGICAL_AXES]) { LOGICAL_AXIS_CODE(e = arr[LOGICAL_AXES-1], x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); }
FI void set(const XYval<T> pxy, const T pz, const T pe) { set(pxy, pz); e = pe; }
FI void set(const XYZval<T> pxyz, const T pe) { set(pxyz); e = pe; }
FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); }
#if DISTINCT_AXES > LOGICAL_AXES
FI void set(const T (&arr)[DISTINCT_AXES]) { LOGICAL_AXIS_CODE(e = arr[LOGICAL_AXES-1], x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5], u = arr[6], v = arr[7], w = arr[8]); }
#endif
#endif
// Setter for all individual args
FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); }
// Setters with fewer elements leave the rest untouched
#if HAS_Y_AXIS
FI void set(const T px) { x = px; }
#endif
#if HAS_Z_AXIS
FI void set(const T px, const T py) { x = px; y = py; }
#endif
#if HAS_I_AXIS
FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; }
#endif
@@ -642,19 +672,6 @@ struct XYZEval {
FI void set(const T px, const T py, const T pz, const T pi, const T pj, const T pk, const T pu, const T pv) { x = px; y = py; z = pz; i = pi; j = pj; k = pk; u = pu; v = pv; }
#endif
// Setters taking struct types and arrays
FI void set(const XYval<T> pxy) { x = pxy.x; y = pxy.y; }
FI void set(const XYZval<T> pxyz) { set(NUM_AXIS_ELEM(pxyz)); }
#if HAS_Z_AXIS
FI void set(NUM_AXIS_ARGS(const T)) { NUM_AXIS_CODE(a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); }
#endif
FI void set(const XYval<T> pxy, const T pz) { set(pxy); TERN_(HAS_Z_AXIS, z = pz); }
#if LOGICAL_AXES > NUM_AXES
FI void set(const XYval<T> pxy, const T pz, const T pe) { set(pxy, pz); e = pe; }
FI void set(const XYZval<T> pxyz, const T pe) { set(pxyz); e = pe; }
FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, _i = i, _j = j, _k = k, _u = u, _v = v, _w = w); }
#endif
// Length reduced to one dimension
FI T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)); }
// Pointer to the data as a simple array
@@ -739,10 +756,10 @@ struct XYZEval {
FI XYZEval<T> operator-() { return LOGICAL_AXIS_ARRAY(-e, -x, -y, -z, -i, -j, -k, -u, -v, -w); }
// Modifier operators
FI XYZEval<T>& operator+=(const XYval<T> &rs) { x += rs.x; y += rs.y; return *this; }
FI XYZEval<T>& operator-=(const XYval<T> &rs) { x -= rs.x; y -= rs.y; return *this; }
FI XYZEval<T>& operator*=(const XYval<T> &rs) { x *= rs.x; y *= rs.y; return *this; }
FI XYZEval<T>& operator/=(const XYval<T> &rs) { x /= rs.x; y /= rs.y; return *this; }
FI XYZEval<T>& operator+=(const XYval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y,,,,,,, ); return *this; }
FI XYZEval<T>& operator-=(const XYval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y,,,,,,, ); return *this; }
FI XYZEval<T>& operator*=(const XYval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y,,,,,,, ); return *this; }
FI XYZEval<T>& operator/=(const XYval<T> &rs) { NUM_AXIS_CODE(x /= rs.x, y /= rs.y,,,,,,, ); return *this; }
FI XYZEval<T>& operator+=(const XYZval<T> &rs) { NUM_AXIS_CODE(x += rs.x, y += rs.y, z += rs.z, i += rs.i, j += rs.j, k += rs.k, u += rs.u, v += rs.v, w += rs.w); return *this; }
FI XYZEval<T>& operator-=(const XYZval<T> &rs) { NUM_AXIS_CODE(x -= rs.x, y -= rs.y, z -= rs.z, i -= rs.i, j -= rs.j, k -= rs.k, u -= rs.u, v -= rs.v, w -= rs.w); return *this; }
FI XYZEval<T>& operator*=(const XYZval<T> &rs) { NUM_AXIS_CODE(x *= rs.x, y *= rs.y, z *= rs.z, i *= rs.i, j *= rs.j, k *= rs.k, u *= rs.u, v *= rs.v, w *= rs.w); return *this; }
@@ -109,7 +109,7 @@ public:
static float get_z_correction(const xy_pos_t &pos) {
const xy_int8_t ind = cell_indexes(pos);
const float x1 = index_to_xpos[ind.x], x2 = index_to_xpos[ind.x+1],
y1 = index_to_xpos[ind.y], y2 = index_to_xpos[ind.y+1],
y1 = index_to_ypos[ind.y], y2 = index_to_ypos[ind.y+1],
z1 = calc_z0(pos.x, x1, z_values[ind.x][ind.y ], x2, z_values[ind.x+1][ind.y ]),
z2 = calc_z0(pos.x, x1, z_values[ind.x][ind.y+1], x2, z_values[ind.x+1][ind.y+1]),
zf = calc_z0(pos.y, y1, z1, y2, z2);
+15 -17
View File
@@ -334,16 +334,14 @@
#else // UBL_SEGMENTED
#if IS_SCARA
#define DELTA_SEGMENT_MIN_LENGTH 0.25 // SCARA minimum segment size is 0.25mm
#elif ENABLED(DELTA)
#define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DEFAULT_SEGMENTS_PER_SECOND)
#elif ENABLED(POLARGRAPH)
#define DELTA_SEGMENT_MIN_LENGTH 0.10 // mm (still subject to DEFAULT_SEGMENTS_PER_SECOND)
#define SEGMENT_MIN_LENGTH 0.25 // SCARA minimum segment size is 0.25mm
#elif IS_KINEMATIC
#define SEGMENT_MIN_LENGTH 0.10 // (mm) Still subject to DEFAULT_SEGMENTS_PER_SECOND
#else // CARTESIAN
#ifdef LEVELED_SEGMENT_LENGTH
#define DELTA_SEGMENT_MIN_LENGTH LEVELED_SEGMENT_LENGTH
#define SEGMENT_MIN_LENGTH LEVELED_SEGMENT_LENGTH
#else
#define DELTA_SEGMENT_MIN_LENGTH 1.00 // mm (similar to G2/G3 arc segmentation)
#define SEGMENT_MIN_LENGTH 1.00 // (mm) Similar to G2/G3 arc segmentation
#endif
#endif
@@ -361,23 +359,23 @@
const xyze_pos_t total = destination - current_position;
const float cart_xy_mm_2 = HYPOT2(total.x, total.y),
cart_xy_mm = SQRT(cart_xy_mm_2); // Total XY distance
cart_xy_mm = SQRT(cart_xy_mm_2); // Total XY distance
#if IS_KINEMATIC
const float seconds = cart_xy_mm / scaled_fr_mm_s; // Duration of XY move at requested rate
uint16_t segments = LROUND(segments_per_second * seconds), // Preferred number of segments for distance @ feedrate
seglimit = LROUND(cart_xy_mm * RECIPROCAL(DELTA_SEGMENT_MIN_LENGTH)); // Number of segments at minimum segment length
NOMORE(segments, seglimit); // Limit to minimum segment length (fewer segments)
const float seconds = cart_xy_mm / scaled_fr_mm_s; // Duration of XY move at requested rate
uint16_t segments = LROUND(segments_per_second * seconds), // Preferred number of segments for distance @ feedrate
seglimit = LROUND(cart_xy_mm * RECIPROCAL(SEGMENT_MIN_LENGTH)); // Number of segments at minimum segment length
NOMORE(segments, seglimit); // Limit to minimum segment length (fewer segments)
#else
uint16_t segments = LROUND(cart_xy_mm * RECIPROCAL(DELTA_SEGMENT_MIN_LENGTH)); // Cartesian fixed segment length
uint16_t segments = LROUND(cart_xy_mm * RECIPROCAL(SEGMENT_MIN_LENGTH)); // Cartesian fixed segment length
#endif
NOLESS(segments, 1U); // Must have at least one segment
const float inv_segments = 1.0f / segments; // Reciprocal to save calculation
NOLESS(segments, 1U); // Must have at least one segment
const float inv_segments = 1.0f / segments; // Reciprocal to save calculation
// Add hints to help optimize the move
PlannerHints hints(SQRT(cart_xy_mm_2 + sq(total.z)) * inv_segments); // Length of each segment
#if ENABLED(SCARA_FEEDRATE_SCALING)
PlannerHints hints(SQRT(cart_xy_mm_2 + sq(total.z)) * inv_segments); // Length of each segment
#if ENABLED(FEEDRATE_SCALING)
hints.inv_duration = scaled_fr_mm_s / hints.millimeters;
#endif
+56 -1
View File
@@ -95,7 +95,62 @@ void LEDLights::setup() {
delay(500);
}
#endif // RGB_STARTUP_TEST
#endif
#elif BOTH(PCA9632, RGB_STARTUP_TEST) // PCA9632 RGB_STARTUP_TEST
constexpr int8_t led_pin_count = TERN(HAS_WHITE_LED, 4, 3);
// Startup animation
LEDColor curColor = LEDColorOff();
PCA9632_set_led_color(curColor); // blackout
delay(200);
/*
* LED Pin Counter steps -> events
* | 0-100 | 100-200 | 200-300 | 300-400 |
* fade in steady | fade out
* start next pin fade in
*/
uint16_t led_pin_counters[led_pin_count] = { 1, 0, 0 };
bool canEnd = false;
while (led_pin_counters[0] != 99 || !canEnd) {
if (led_pin_counters[0] == 99) // End loop next time pin0 counter is 99
canEnd = true;
LOOP_L_N(i, led_pin_count) {
if (led_pin_counters[i] > 0) {
if (++led_pin_counters[i] == 400) // turn off current pin counter in led_pin_counters
led_pin_counters[i] = 0;
else if (led_pin_counters[i] == 201) { // start next pin pwm
led_pin_counters[i + 1 == led_pin_count ? 0 : i + 1] = 1;
i++; // skip next pin in this loop so it doesn't increment twice
}
}
}
uint16_t r, g, b;
r = led_pin_counters[0]; curColor.r = r <= 100 ? r : r <= 300 ? 100 : 400 - r;
g = led_pin_counters[1]; curColor.g = g <= 100 ? g : g <= 300 ? 100 : 400 - g;
b = led_pin_counters[2]; curColor.b = b <= 100 ? b : b <= 300 ? 100 : 400 - b;
#if HAS_WHITE_LED
const uint16_t w = led_pin_counters[3]; curColor.w = w <= 100 ? w : w <= 300 ? 100 : 400 - w;
#endif
PCA9632_set_led_color(curColor);
delay(RGB_STARTUP_TEST_INNER_MS);
}
// Fade to white
LOOP_LE_N(led_pwm, 100) {
NOLESS(curColor.r, led_pwm);
NOLESS(curColor.g, led_pwm);
NOLESS(curColor.b, led_pwm);
TERN_(HAS_WHITE_LED, NOLESS(curColor.w, led_pwm));
PCA9632_set_led_color(curColor);
delay(RGB_STARTUP_TEST_INNER_MS);
}
#endif // PCA9632 && RGB_STARTUP_TEST
TERN_(NEOPIXEL_LED, neo.init());
TERN_(PCA9533, PCA9533_init());
TERN_(LED_USER_PRESET_STARTUP, set_default());
+1 -1
View File
@@ -108,7 +108,7 @@ void Marlin_NeoPixel::init() {
set_color(adaneo1.Color
TERN(LED_USER_PRESET_STARTUP,
(LED_USER_PRESET_RED, LED_USER_PRESET_GREEN, LED_USER_PRESET_BLUE, LED_USER_PRESET_WHITE),
(255, 255, 255, 255))
(0, 0, 0, 0))
);
}
+4 -9
View File
@@ -211,7 +211,7 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
while (wait_for_user) {
impatient_beep(max_beep_count);
#if BOTH(FILAMENT_CHANGE_RESUME_ON_INSERT, FILAMENT_RUNOUT_SENSOR)
#if ENABLED(MULTI_FILAMENT_SENSOR)
#if MULTI_FILAMENT_SENSOR
#define _CASE_INSERTED(N) case N-1: if (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) wait_for_user = false; break;
switch (active_extruder) {
REPEAT_1(NUM_RUNOUT_SENSORS, _CASE_INSERTED)
@@ -410,7 +410,6 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
#endif
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_open(PROMPT_INFO, F("Pause"), FPSTR(DISMISS_STR)));
TERN_(DWIN_LCD_PROUI, DWIN_Print_Pause());
// Indicate that the printer is paused
++did_pause_print;
@@ -461,6 +460,7 @@ bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const bool
// If axes don't need to home then the nozzle can park
if (do_park) nozzle.park(0, park_point); // Park the nozzle by doing a Minimum Z Raise followed by an XY Move
TERN_(DWIN_LCD_PROUI, if (!do_park) ui.set_status(GET_TEXT_F(MSG_PARK_FAILED)));
#if ENABLED(DUAL_X_CARRIAGE)
const int8_t saved_ext = active_extruder;
@@ -710,13 +710,8 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
TERN_(HAS_FILAMENT_SENSOR, runout.reset());
#if ENABLED(DWIN_LCD_PROUI)
DWIN_Print_Resume();
HMI_ReturnScreen();
#else
ui.reset_status();
ui.return_to_status();
#endif
ui.reset_status();
ui.return_to_status();
}
#endif // ADVANCED_PAUSE_FEATURE
+1 -1
View File
@@ -43,7 +43,7 @@ void stepper_driver_backward_check() {
SET_INPUT(AXIS##_ENABLE_PIN); \
OUT_WRITE(AXIS##_STEP_PIN, false); \
delay(20); \
if (READ(AXIS##_ENABLE_PIN) == false) { \
if (READ(AXIS##_ENABLE_PIN) == LOW) { \
SBI(axis_plug_backward, BIT); \
stepper_driver_backward_error(F(STRINGIFY(AXIS))); \
} \
+13 -6
View File
@@ -403,6 +403,9 @@ void GcodeSuite::G28() {
UNUSED(needZ); UNUSED(homeZZ);
#else
constexpr bool doZ = false;
#if !HAS_Y_AXIS
constexpr bool doY = false;
#endif
#endif
TERN_(HOME_Z_FIRST, if (doZ) homeaxis(Z_AXIS));
@@ -420,9 +423,11 @@ void GcodeSuite::G28() {
// Diagonal move first if both are homing
TERN_(QUICK_HOME, if (doX && doY) quick_home_xy());
// Home Y (before X)
if (ENABLED(HOME_Y_BEFORE_X) && (doY || TERN0(CODEPENDENT_XY_HOMING, doX)))
homeaxis(Y_AXIS);
#if HAS_Y_AXIS
// Home Y (before X)
if (ENABLED(HOME_Y_BEFORE_X) && (doY || TERN0(CODEPENDENT_XY_HOMING, doX)))
homeaxis(Y_AXIS);
#endif
// Home X
if (doX || (doY && ENABLED(CODEPENDENT_XY_HOMING) && DISABLED(HOME_Y_BEFORE_X))) {
@@ -455,9 +460,11 @@ void GcodeSuite::G28() {
if (doI) homeaxis(I_AXIS);
#endif
// Home Y (after X)
if (DISABLED(HOME_Y_BEFORE_X) && doY)
homeaxis(Y_AXIS);
#if HAS_Y_AXIS
// Home Y (after X)
if (DISABLED(HOME_Y_BEFORE_X) && doY)
homeaxis(Y_AXIS);
#endif
#if BOTH(FOAMCUTTER_XYUV, HAS_J_AXIS)
// Home J (after Y)
+2 -2
View File
@@ -407,12 +407,12 @@ void GcodeSuite::G33() {
towers_set = !parser.seen_test('T');
// The calibration radius is set to a calculated value
float dcr = probe_at_offset ? DELTA_PRINTABLE_RADIUS : DELTA_PRINTABLE_RADIUS - PROBING_MARGIN;
float dcr = probe_at_offset ? PRINTABLE_RADIUS : PRINTABLE_RADIUS - PROBING_MARGIN;
#if HAS_PROBE_XY_OFFSET
const float total_offset = HYPOT(probe.offset_xy.x, probe.offset_xy.y);
dcr -= probe_at_offset ? _MAX(total_offset, PROBING_MARGIN) : total_offset;
#endif
NOMORE(dcr, DELTA_PRINTABLE_RADIUS);
NOMORE(dcr, PRINTABLE_RADIUS);
if (parser.seenval('R')) dcr -= _MAX(parser.value_float(), 0.0f);
TERN_(HAS_DELTA_SENSORLESS_PROBING, dcr *= sensorless_radius_factor);
+2 -2
View File
@@ -162,8 +162,8 @@ void GcodeSuite::M48() {
float angle = random(0, 360);
const float radius = random(
#if ENABLED(DELTA)
int(0.1250000000 * (DELTA_PRINTABLE_RADIUS)),
int(0.3333333333 * (DELTA_PRINTABLE_RADIUS))
int(0.1250000000 * (PRINTABLE_RADIUS)),
int(0.3333333333 * (PRINTABLE_RADIUS))
#else
int(5), int(0.125 * _MIN(X_BED_SIZE, Y_BED_SIZE))
#endif
+19
View File
@@ -181,6 +181,25 @@
);
}
#elif ENABLED(POLAR)
#include "../../module/polar.h"
/**
* M665: Set POLAR settings
* Parameters:
* S[segments] - Segments-per-second
*/
void GcodeSuite::M665() {
if (!parser.seen_any()) return M665_report();
if (parser.seenval('S')) segments_per_second = parser.value_float();
}
void GcodeSuite::M665_report(const bool forReplay/*=true*/) {
report_heading_etc(forReplay, F(STR_POLAR_SETTINGS));
SERIAL_ECHOLNPGM_P(PSTR(" M665 S"), segments_per_second);
}
#endif
#endif // IS_KINEMATIC
+7 -8
View File
@@ -36,16 +36,15 @@
* R : Flag to restore the last-saved factor
*/
void GcodeSuite::M220() {
if (!parser.seen_any()) {
SERIAL_ECHOLNPGM("FR:", feedrate_percentage, "%");
return;
}
static int16_t backup_feedrate_percentage = 100;
if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage;
if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage;
const int16_t now_feedrate_perc = feedrate_percentage;
if (parser.seen_test('R')) feedrate_percentage = backup_feedrate_percentage;
if (parser.seen_test('B')) backup_feedrate_percentage = now_feedrate_perc;
if (parser.seenval('S')) feedrate_percentage = parser.value_int();
if (!parser.seen_any()) {
SERIAL_ECHOPGM("FR:", feedrate_percentage);
SERIAL_CHAR('%');
SERIAL_EOL();
}
}
+1 -1
View File
@@ -28,7 +28,7 @@
#include "../../module/temperature.h"
#if ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/e3v2/proui/dwin_defines.h"
#include "../../lcd/e3v2/proui/dwin.h"
#endif
/**
+1 -1
View File
@@ -169,7 +169,7 @@
if (parser.seen("EPS")) {
planner.synchronize();
if (parser.seenval('P')) duplication_e_mask = parser.value_int(); // Set the mask directly
else if (parser.seenval('E')) duplication_e_mask = pow(2, parser.value_int() + 1) - 1; // Set the mask by E index
else if (parser.seenval('E')) duplication_e_mask = _BV(parser.value_int() + 1) - 1; // Set the mask by E index
ena = (2 == parser.intval('S', extruder_duplication_enabled ? 2 : 0));
set_duplication_enabled(ena && (duplication_e_mask >= 3));
}
@@ -49,8 +49,8 @@ void GcodeSuite::M593_report(const bool forReplay/*=true*/) {
* D<factor> Set the zeta/damping factor. If axes (X, Y, etc.) are not specified, set for all axes.
* F<frequency> Set the frequency. If axes (X, Y, etc.) are not specified, set for all axes.
* T[map] Input Shaping type, 0:ZV, 1:EI, 2:2H EI (not implemented yet)
* X<1> Set the given parameters only for the X axis.
* Y<1> Set the given parameters only for the Y axis.
* X Set the given parameters only for the X axis.
* Y Set the given parameters only for the Y axis.
*/
void GcodeSuite::M593() {
if (!parser.seen_any()) return M593_report();
@@ -72,13 +72,13 @@ void GcodeSuite::M593() {
if (parser.seen('F')) {
const float freq = parser.value_float();
constexpr float max_freq = float(uint32_t(STEPPER_TIMER_RATE) / 2) / shaping_time_t(-2);
if (WITHIN(freq, 0.0f, max_freq)) {
constexpr float min_freq = float(uint32_t(STEPPER_TIMER_RATE) / 2) / shaping_time_t(-2);
if (freq == 0.0f || freq > min_freq) {
if (for_X) stepper.set_shaping_frequency(X_AXIS, freq);
if (for_Y) stepper.set_shaping_frequency(Y_AXIS, freq);
}
else
SERIAL_ECHOLNPGM("?Frequency (F) must be greater than ", max_freq, " or 0 to disable");
SERIAL_ECHOLNPGM("?Frequency (F) must be greater than ", min_freq, " or 0 to disable");
}
}
+18 -5
View File
@@ -35,11 +35,24 @@
/**
* G61: Return to saved position
*
* F<rate> - Feedrate (optional) for the move back.
* S<slot> - Slot # (0-based) to restore from (default 0).
* X Y Z E - Axes to restore. At least one is required.
* F<rate> - Feedrate (optional) for the move back.
* S<slot> - Slot # (0-based) to restore from (default 0).
* X<offset> - Restore X axis, applying the given offset (default 0)
* Y<offset> - Restore Y axis, applying the given offset (default 0)
* Z<offset> - Restore Z axis, applying the given offset (default 0)
*
* If XYZE are not given, default restore uses the smart blocking move.
* If there is an Extruder:
* E<offset> - Restore E axis, applying the given offset (default 0)
*
* With extra axes using default names:
* A<offset> - Restore 4th axis, applying the given offset (default 0)
* B<offset> - Restore 5th axis, applying the given offset (default 0)
* C<offset> - Restore 6th axis, applying the given offset (default 0)
* U<offset> - Restore 7th axis, applying the given offset (default 0)
* V<offset> - Restore 8th axis, applying the given offset (default 0)
* W<offset> - Restore 9th axis, applying the given offset (default 0)
*
* If no axes are specified then all axes are restored.
*/
void GcodeSuite::G61() {
@@ -71,7 +84,7 @@ void GcodeSuite::G61() {
if (parser.seen(STR_AXES_MAIN)) {
DEBUG_ECHOPGM(STR_RESTORING_POS " S", slot);
LOOP_NUM_AXES(i) {
destination[i] = parser.seenval(AXIS_CHAR(i))
destination[i] = parser.seen(AXIS_CHAR(i))
? stored_position[slot][i] + parser.value_axis_units((AxisEnum)i)
: current_position[i];
DEBUG_CHAR(' ', AXIS_CHAR(i));
+1 -1
View File
@@ -1081,7 +1081,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 1001: M1001(); break; // M1001: [INTERNAL] Handle SD completion
#endif
#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
case 1002: M1002(); break; // M1002: [INTERNAL] Tool-change and Relative E Move
#endif
+2 -2
View File
@@ -335,7 +335,7 @@
#include "../feature/encoder_i2c.h"
#endif
#if IS_SCARA || defined(G0_FEEDRATE)
#if EITHER(IS_SCARA, POLAR) || defined(G0_FEEDRATE)
#define HAS_FAST_MOVES 1
#endif
@@ -1226,7 +1226,7 @@ private:
static void M1001();
#endif
#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
static void M1002();
#endif
+6 -5
View File
@@ -156,20 +156,21 @@ void GcodeSuite::D(const int16_t dcode) {
} break;
case 5: { // D5 Read / Write onboard Flash
#define FLASH_SIZE 1024
// This will overwrite program and data, so don't use it.
#define ONBOARD_FLASH_SIZE 1024 // 0x400
uint8_t *pointer = parser.hex_adr_val('A');
uint16_t len = parser.ushortval('C', 1);
uintptr_t addr = (uintptr_t)pointer;
NOMORE(addr, size_t(FLASH_SIZE - 1));
NOMORE(len, FLASH_SIZE - addr);
NOMORE(addr, size_t(ONBOARD_FLASH_SIZE - 1));
NOMORE(len, ONBOARD_FLASH_SIZE - addr);
if (parser.seenval('X')) {
// TODO: Write the hex bytes after the X
//while (len--) {}
}
else {
//while (len--) {
//// TODO: Read bytes from EEPROM
// print_hex_byte(eeprom_read_byte(adr++));
//// TODO: Read bytes from FLASH
// print_hex_byte(flash_read_byte(adr++));
//}
SERIAL_EOL();
}
+1 -1
View File
@@ -91,7 +91,7 @@ void GcodeSuite::M428() {
diff[i] = -current_position[i];
if (!WITHIN(diff[i], -20, 20)) {
SERIAL_ERROR_MSG(STR_ERR_M428_TOO_FAR);
LCD_ALERTMESSAGE_F("Err: Too far!");
LCD_ALERTMESSAGE(MSG_ERR_M428_TOO_FAR);
ERR_BUZZ();
return;
}
+1 -1
View File
@@ -71,7 +71,7 @@
#if IS_KINEMATIC
// Kinematics applied to the leveled position
SERIAL_ECHOPGM(TERN(IS_SCARA, "ScaraK: ", "DeltaK: "));
SERIAL_ECHOPGM(TERN(POLAR, "Polar", TERN(IS_SCARA, "Scara", "Delta")) "K: " );
inverse_kinematics(leveled); // writes delta[]
report_linear_axis_pos(delta);
#endif
+3 -1
View File
@@ -232,7 +232,7 @@ void GcodeSuite::M115() {
const xyz_pos_t lmin = dmin.asLogical(), lmax = dmax.asLogical(),
wmin = cmin.asLogical(), wmax = cmax.asLogical();
SERIAL_ECHOLNPGM(
SERIAL_ECHOPGM(
"area:{"
"full:{"
"min:{"
@@ -249,6 +249,8 @@ void GcodeSuite::M115() {
),
"}" // max
"}," // full
);
SERIAL_ECHOLNPGM(
"work:{"
"min:{"
LIST_N(DOUBLE(NUM_AXES),
+1
View File
@@ -161,6 +161,7 @@ void GcodeSuite::M360() {
SERIAL_ECHOLNPGM(
TERN_(DELTA, "Delta")
TERN_(IS_SCARA, "SCARA")
TERN_(POLAR, "Polar")
TERN_(IS_CORE, "Core")
TERN_(MARKFORGED_XY, "MarkForgedXY")
TERN_(MARKFORGED_YX, "MarkForgedYX")
+1 -1
View File
@@ -47,7 +47,7 @@ void GcodeSuite::M145() {
preheat_t &mat = ui.material_preset[material];
#if HAS_HOTEND
if (parser.seenval('H'))
mat.hotend_temp = constrain(parser.value_int(), EXTRUDE_MINTEMP, thermalManager.hotend_max_target(0));
mat.hotend_temp = constrain(parser.value_int(), thermalManager.extrude_min_temp, thermalManager.hotend_max_target(0));
#endif
#if HAS_HEATED_BED
if (parser.seenval('B'))
+1 -1
View File
@@ -106,7 +106,7 @@ void GcodeSuite::G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move/*=false*/)) {
#endif // FWRETRACT
#if IS_SCARA
#if EITHER(IS_SCARA, POLAR)
fast_move ? prepare_fast_move_to_destination() : prepare_line_to_destination();
#else
prepare_line_to_destination();
+1 -1
View File
@@ -218,7 +218,7 @@ void plan_arc(
// Add hints to help optimize the move
PlannerHints hints;
#if ENABLED(SCARA_FEEDRATE_SCALING)
#if ENABLED(FEEDRATE_SCALING)
hints.inv_duration = (scaled_fr_mm_s / flat_mm) * segments;
#endif
-1
View File
@@ -109,7 +109,6 @@ void GcodeSuite::M1001() {
#endif
TERN_(EXTENSIBLE_UI, ExtUI::onPrintDone());
TERN_(DWIN_LCD_PROUI, DWIN_Print_Finished());
// Re-select the last printed file in the UI
TERN_(SD_REPRINT_LAST_SELECTED_FILE, ui.reselect_last_file());
+2 -2
View File
@@ -41,7 +41,7 @@
#include "../../feature/powerloss.h"
#endif
#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
#include "../../lcd/extui/dgus/DGUSDisplayDef.h"
#endif
@@ -52,7 +52,7 @@
*/
void GcodeSuite::M24() {
#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
if ((print_job_timer.isPaused() || print_job_timer.isRunning()) && !parser.seen("ST"))
MKS_resume_print_move();
#endif
+2 -2
View File
@@ -28,7 +28,7 @@
#include "../../sd/cardreader.h"
#if ENABLED(DWIN_LCD_PROUI)
#include "../../lcd/e3v2/proui/dwin.h"
#include "../../lcd/marlinui.h"
#endif
/**
@@ -38,7 +38,7 @@ void GcodeSuite::M524() {
#if ENABLED(DWIN_LCD_PROUI)
HMI_flag.abort_flag = true; // The LCD will handle it
ui.abort_print();
#else
+1 -4
View File
@@ -39,7 +39,6 @@
void GcodeSuite::M75() {
startOrResumeJob();
#if ENABLED(DWIN_LCD_PROUI)
DWIN_Print_Started(false);
if (!IS_SD_PRINTING()) DWIN_Print_Header(parser.string_arg && parser.string_arg[0] ? parser.string_arg : GET_TEXT(MSG_HOST_START_PRINT));
#endif
}
@@ -48,9 +47,8 @@ void GcodeSuite::M75() {
* M76: Pause print timer
*/
void GcodeSuite::M76() {
print_job_timer.pause();
TERN(DWIN_LCD_PROUI, ui.pause_print(), print_job_timer.pause());
TERN_(HOST_PAUSE_M76, hostui.pause());
TERN_(DWIN_LCD_PROUI, DWIN_Print_Pause());
}
/**
@@ -58,7 +56,6 @@ void GcodeSuite::M76() {
*/
void GcodeSuite::M77() {
print_job_timer.stop();
TERN_(DWIN_LCD_PROUI, DWIN_Print_Finished());
}
#if ENABLED(PRINTCOUNTER)
+7 -18
View File
@@ -61,20 +61,14 @@ void GcodeSuite::M303() {
const heater_id_t hid = (heater_id_t)parser.intval('E');
celsius_t default_temp;
switch (hid) {
#if ENABLED(PIDTEMP)
case 0 ... HOTENDS - 1: default_temp = PREHEAT_1_TEMP_HOTEND; break;
#endif
#if ENABLED(PIDTEMPBED)
case H_BED: default_temp = PREHEAT_1_TEMP_BED; break;
#endif
#if ENABLED(PIDTEMPCHAMBER)
case H_CHAMBER: default_temp = PREHEAT_1_TEMP_CHAMBER; break;
#endif
OPTCODE(PIDTEMP, case 0 ... HOTENDS - 1: default_temp = PREHEAT_1_TEMP_HOTEND; break)
OPTCODE(PIDTEMPBED, case H_BED: default_temp = PREHEAT_1_TEMP_BED; break)
OPTCODE(PIDTEMPCHAMBER, case H_CHAMBER: default_temp = PREHEAT_1_TEMP_CHAMBER; break)
default:
SERIAL_ECHOPGM(STR_PID_AUTOTUNE);
SERIAL_ECHOLNPGM(STR_PID_BAD_HEATER_ID);
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_EXTRUDER_NUM));
TERN_(DWIN_LCD_PROUI, DWIN_PidTuning(PID_BAD_EXTRUDER_NUM));
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_HEATER_ID));
TERN_(DWIN_PID_TUNE, DWIN_PidTuning(PID_BAD_HEATER_ID));
return;
}
@@ -84,14 +78,9 @@ void GcodeSuite::M303() {
const celsius_t temp = seenS ? parser.value_celsius() : default_temp;
const bool u = parser.boolval('U');
#if ENABLED(DWIN_LCD_PROUI)
if (seenC) HMI_data.PidCycles = c;
if (seenS) { if (hid == H_BED) HMI_data.BedPidT = temp; else HMI_data.HotendPidT = temp; }
#endif
TERN_(DWIN_PID_TUNE, DWIN_StartM303(seenC, c, seenS, hid, temp));
#if DISABLED(BUSY_WHILE_HEATING)
KEEPALIVE_STATE(NOT_BUSY);
#endif
IF_DISABLED(BUSY_WHILE_HEATING, KEEPALIVE_STATE(NOT_BUSY));
LCD_MESSAGE(MSG_PID_AUTOTUNE);
thermalManager.PID_autotune(temp, hid, c, u);
+14 -14
View File
@@ -52,15 +52,15 @@ void GcodeSuite::M306() {
if (parser.seen("ACFPRH")) {
const heater_id_t hid = (heater_id_t)parser.intval('E', 0);
MPC_t &constants = thermalManager.temp_hotend[hid].constants;
if (parser.seenval('P')) constants.heater_power = parser.value_float();
if (parser.seenval('C')) constants.block_heat_capacity = parser.value_float();
if (parser.seenval('R')) constants.sensor_responsiveness = parser.value_float();
if (parser.seenval('A')) constants.ambient_xfer_coeff_fan0 = parser.value_float();
MPC_t &mpc = thermalManager.temp_hotend[hid].mpc;
if (parser.seenval('P')) mpc.heater_power = parser.value_float();
if (parser.seenval('C')) mpc.block_heat_capacity = parser.value_float();
if (parser.seenval('R')) mpc.sensor_responsiveness = parser.value_float();
if (parser.seenval('A')) mpc.ambient_xfer_coeff_fan0 = parser.value_float();
#if ENABLED(MPC_INCLUDE_FAN)
if (parser.seenval('F')) constants.fan255_adjustment = parser.value_float() - constants.ambient_xfer_coeff_fan0;
if (parser.seenval('F')) mpc.applyFanAdjustment(parser.value_float());
#endif
if (parser.seenval('H')) constants.filament_heat_capacity_permm = parser.value_float();
if (parser.seenval('H')) mpc.filament_heat_capacity_permm = parser.value_float();
return;
}
@@ -71,16 +71,16 @@ void GcodeSuite::M306_report(const bool forReplay/*=true*/) {
report_heading(forReplay, F("Model predictive control"));
HOTEND_LOOP() {
report_echo_start(forReplay);
MPC_t& constants = thermalManager.temp_hotend[e].constants;
MPC_t &mpc = thermalManager.temp_hotend[e].mpc;
SERIAL_ECHOPGM(" M306 E", e);
SERIAL_ECHOPAIR_F(" P", constants.heater_power, 2);
SERIAL_ECHOPAIR_F(" C", constants.block_heat_capacity, 2);
SERIAL_ECHOPAIR_F(" R", constants.sensor_responsiveness, 4);
SERIAL_ECHOPAIR_F(" A", constants.ambient_xfer_coeff_fan0, 4);
SERIAL_ECHOPAIR_F(" P", mpc.heater_power, 2);
SERIAL_ECHOPAIR_F(" C", mpc.block_heat_capacity, 2);
SERIAL_ECHOPAIR_F(" R", mpc.sensor_responsiveness, 4);
SERIAL_ECHOPAIR_F(" A", mpc.ambient_xfer_coeff_fan0, 4);
#if ENABLED(MPC_INCLUDE_FAN)
SERIAL_ECHOPAIR_F(" F", constants.ambient_xfer_coeff_fan0 + constants.fan255_adjustment, 4);
SERIAL_ECHOPAIR_F(" F", mpc.fanCoefficient(), 4);
#endif
SERIAL_ECHOPAIR_F(" H", constants.filament_heat_capacity_permm, 4);
SERIAL_ECHOPAIR_F(" H", mpc.filament_heat_capacity_permm, 4);
SERIAL_EOL();
}
}
+89 -69
View File
@@ -36,6 +36,21 @@
#define FYSETC_MINI_12864_2_1
#endif
// Old settings are now conditional on DGUS_LCD_UI
#if DGUS_UI_IS(ORIGIN)
#define DGUS_LCD_UI_ORIGIN 1
#elif DGUS_UI_IS(FYSETC)
#define DGUS_LCD_UI_FYSETC 1
#elif DGUS_UI_IS(HIPRECY)
#define DGUS_LCD_UI_HIPRECY 1
#elif DGUS_UI_IS(MKS)
#define DGUS_LCD_UI_MKS 1
#elif DGUS_UI_IS(RELOADED)
#define DGUS_LCD_UI_RELOADED 1
#elif DGUS_UI_IS(IA_CREALITY)
#define DGUS_LCD_UI_IA_CREALITY 1
#endif
/**
* General Flags that may be set below by specific LCDs
*
@@ -309,7 +324,7 @@
#define IS_ULTIPANEL 1
#endif
// TFT Compatibility
// TFT Legacy Compatibility
#if ANY(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI)
#define IS_LEGACY_TFT 1
#define TFT_GENERIC
@@ -462,12 +477,11 @@
#endif
// Aliases for LCD features
#if ANY(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_MKS)
#define HAS_DGUS_LCD_CLASSIC 1
#endif
#if EITHER(HAS_DGUS_LCD_CLASSIC, DGUS_LCD_UI_RELOADED)
#if !DGUS_UI_IS(NONE)
#define HAS_DGUS_LCD 1
#if DGUS_UI_IS(ORIGIN, FYSETC, HIPRECY, MKS)
#define HAS_DGUS_LCD_CLASSIC 1
#endif
#endif
// Extensible UI serial touch screens. (See src/lcd/extui)
@@ -589,12 +603,26 @@
#else
#undef EXTRUDERS
#define EXTRUDERS 0
#undef TEMP_SENSOR_0
#undef TEMP_SENSOR_1
#undef TEMP_SENSOR_2
#undef TEMP_SENSOR_3
#undef TEMP_SENSOR_4
#undef TEMP_SENSOR_5
#undef TEMP_SENSOR_6
#undef TEMP_SENSOR_7
#undef SINGLENOZZLE
#undef SWITCHING_EXTRUDER
#undef SWITCHING_NOZZLE
#undef MIXING_EXTRUDER
#undef HOTEND_IDLE_TIMEOUT
#undef DISABLE_E
#undef THERMAL_PROTECTION_HOTENDS
#undef PREVENT_COLD_EXTRUSION
#undef PREVENT_LENGTHY_EXTRUDE
#undef FILAMENT_RUNOUT_SENSOR
#undef FILAMENT_RUNOUT_DISTANCE_MM
#undef DISABLE_INACTIVE_EXTRUDER
#endif
#define E_OPTARG(N) OPTARG(HAS_MULTI_EXTRUDER, N)
@@ -668,20 +696,28 @@
#if E_STEPPERS <= 7
#undef INVERT_E7_DIR
#undef E7_DRIVER_TYPE
#if E_STEPPERS <= 6
#undef INVERT_E6_DIR
#undef E6_DRIVER_TYPE
#if E_STEPPERS <= 5
#undef INVERT_E5_DIR
#undef E5_DRIVER_TYPE
#if E_STEPPERS <= 4
#undef INVERT_E4_DIR
#undef E4_DRIVER_TYPE
#if E_STEPPERS <= 3
#undef INVERT_E3_DIR
#undef E3_DRIVER_TYPE
#if E_STEPPERS <= 2
#undef INVERT_E2_DIR
#undef E2_DRIVER_TYPE
#if E_STEPPERS <= 1
#undef INVERT_E1_DIR
#undef E1_DRIVER_TYPE
#if E_STEPPERS == 0
#undef INVERT_E0_DIR
#undef E0_DRIVER_TYPE
#endif
#endif
#endif
@@ -719,6 +755,7 @@
#else
#define NUM_AXES 1
#endif
#define HAS_X_AXIS 1
#if NUM_AXES >= XY
#define HAS_Y_AXIS 1
#if NUM_AXES >= XYZ
@@ -753,31 +790,6 @@
#endif
#endif
#if E_STEPPERS <= 0
#undef E0_DRIVER_TYPE
#endif
#if E_STEPPERS <= 1
#undef E1_DRIVER_TYPE
#endif
#if E_STEPPERS <= 2
#undef E2_DRIVER_TYPE
#endif
#if E_STEPPERS <= 3
#undef E3_DRIVER_TYPE
#endif
#if E_STEPPERS <= 4
#undef E4_DRIVER_TYPE
#endif
#if E_STEPPERS <= 5
#undef E5_DRIVER_TYPE
#endif
#if E_STEPPERS <= 6
#undef E6_DRIVER_TYPE
#endif
#if E_STEPPERS <= 7
#undef E7_DRIVER_TYPE
#endif
#if !HAS_Y_AXIS
#undef ENDSTOPPULLUP_YMIN
#undef ENDSTOPPULLUP_YMAX
@@ -793,7 +805,6 @@
#undef MANUAL_Y_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_Y
#undef MAX_SOFTWARE_ENDSTOP_Y
#undef SAFE_BED_LEVELING_START_Y
#endif
#if !HAS_Z_AXIS
@@ -813,7 +824,6 @@
#undef MANUAL_Z_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_Z
#undef MAX_SOFTWARE_ENDSTOP_Z
#undef SAFE_BED_LEVELING_START_Z
#endif
#if !HAS_I_AXIS
@@ -830,7 +840,6 @@
#undef MANUAL_I_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_I
#undef MAX_SOFTWARE_ENDSTOP_I
#undef SAFE_BED_LEVELING_START_I
#endif
#if !HAS_J_AXIS
@@ -847,7 +856,6 @@
#undef MANUAL_J_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_J
#undef MAX_SOFTWARE_ENDSTOP_J
#undef SAFE_BED_LEVELING_START_J
#endif
#if !HAS_K_AXIS
@@ -864,7 +872,6 @@
#undef MANUAL_K_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_K
#undef MAX_SOFTWARE_ENDSTOP_K
#undef SAFE_BED_LEVELING_START_K
#endif
#if !HAS_U_AXIS
@@ -881,7 +888,6 @@
#undef MANUAL_U_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_U
#undef MAX_SOFTWARE_ENDSTOP_U
#undef SAFE_BED_LEVELING_START_U
#endif
#if !HAS_V_AXIS
@@ -898,7 +904,6 @@
#undef MANUAL_V_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_V
#undef MAX_SOFTWARE_ENDSTOP_V
#undef SAFE_BED_LEVELING_START_V
#endif
#if !HAS_W_AXIS
@@ -915,7 +920,6 @@
#undef MANUAL_W_HOME_POS
#undef MIN_SOFTWARE_ENDSTOP_W
#undef MAX_SOFTWARE_ENDSTOP_W
#undef SAFE_BED_LEVELING_START_W
#endif
#ifdef X2_DRIVER_TYPE
@@ -1087,10 +1091,10 @@
/**
* Set flags for any form of bed probe
*/
#if ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, SOLENOID_PROBE, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE)
#if ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, HAS_Z_SERVO_PROBE, SOLENOID_PROBE, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE)
#define HAS_STOWABLE_PROBE 1
#endif
#if ANY(HAS_STOWABLE_PROBE, HAS_Z_SERVO_PROBE, FIX_MOUNTED_PROBE, BD_SENSOR, NOZZLE_AS_PROBE)
#if ANY(HAS_STOWABLE_PROBE, FIX_MOUNTED_PROBE, BD_SENSOR, NOZZLE_AS_PROBE)
#define HAS_BED_PROBE 1
#endif
@@ -1284,6 +1288,7 @@
// Clear probe pin settings when no probe is selected
#undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
#undef USE_PROBE_FOR_Z_HOMING
#undef Z_MIN_PROBE_REPEATABILITY_TEST
#endif
#if ENABLED(BELTPRINTER) && !defined(HOME_Y_BEFORE_X)
@@ -1392,7 +1397,7 @@
#if ANY(MORGAN_SCARA, MP_SCARA, AXEL_TPARA)
#define IS_SCARA 1
#define IS_KINEMATIC 1
#elif EITHER(DELTA, POLARGRAPH)
#elif ANY(DELTA, POLARGRAPH, POLAR)
#define IS_KINEMATIC 1
#else
#define IS_CARTESIAN 1
@@ -1510,30 +1515,6 @@
#endif
#endif
#if ENABLED(TFT_RES_320x240)
#define TFT_WIDTH 320
#define TFT_HEIGHT 240
#define GRAPHICAL_TFT_UPSCALE 2
#elif ENABLED(TFT_RES_480x272)
#define TFT_WIDTH 480
#define TFT_HEIGHT 272
#define GRAPHICAL_TFT_UPSCALE 2
#elif ENABLED(TFT_RES_480x320)
#define TFT_WIDTH 480
#define TFT_HEIGHT 320
#define GRAPHICAL_TFT_UPSCALE 3
#elif ENABLED(TFT_RES_1024x600)
#define TFT_WIDTH 1024
#define TFT_HEIGHT 600
#if ENABLED(TOUCH_SCREEN)
#define GRAPHICAL_TFT_UPSCALE 6
#define TFT_PIXEL_OFFSET_X 120
#else
#define GRAPHICAL_TFT_UPSCALE 8
#define TFT_PIXEL_OFFSET_X 0
#endif
#endif
// FSMC/SPI TFT Panels using standard HAL/tft/tft_(fsmc|spi|ltdc).h
#if ENABLED(TFT_INTERFACE_FSMC)
#define HAS_FSMC_TFT 1
@@ -1558,8 +1539,41 @@
#endif
#endif
#if ANY(HAS_SPI_TFT, HAS_FSMC_TFT, HAS_LTDC_TFT)
#include "../lcd/tft_io/tft_orientation.h"
#endif
#if ENABLED(TFT_RES_320x240)
#if ENABLED(TFT_COLOR_UI_PORTRAIT)
#define TFT_WIDTH 240
#define TFT_HEIGHT 320
#else
#define TFT_WIDTH 320
#define TFT_HEIGHT 240
#endif
#define GRAPHICAL_TFT_UPSCALE 2
#elif ENABLED(TFT_RES_480x272)
#define TFT_WIDTH 480
#define TFT_HEIGHT 272
#define GRAPHICAL_TFT_UPSCALE 2
#elif ENABLED(TFT_RES_480x320)
#define TFT_WIDTH 480
#define TFT_HEIGHT 320
#define GRAPHICAL_TFT_UPSCALE 3
#elif ENABLED(TFT_RES_1024x600)
#define TFT_WIDTH 1024
#define TFT_HEIGHT 600
#if ENABLED(TOUCH_SCREEN)
#define GRAPHICAL_TFT_UPSCALE 6
#define TFT_PIXEL_OFFSET_X 120
#else
#define GRAPHICAL_TFT_UPSCALE 8
#define TFT_PIXEL_OFFSET_X 0
#endif
#endif
#if ENABLED(TFT_COLOR_UI)
#if TFT_HEIGHT == 240
#if (TFT_WIDTH == 320 && TFT_HEIGHT == 240) || (TFT_WIDTH == 240 && TFT_HEIGHT == 320)
#if ENABLED(TFT_INTERFACE_SPI)
#define TFT_320x240_SPI
#elif ENABLED(TFT_INTERFACE_FSMC)
@@ -1596,7 +1610,11 @@
#define HAS_UI_1024x600 1
#endif
#if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272)
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen
#if ENABLED(TFT_COLOR_UI_PORTRAIT)
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 8, 9) // Fewer lines with touch buttons onscreen
#else
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen
#endif
#elif HAS_UI_1024x600
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 12, 13) // Fewer lines with touch buttons onscreen
#endif
@@ -1637,7 +1655,9 @@
#endif
#endif
#if X_HOME_DIR || (HAS_Y_AXIS && Y_HOME_DIR) || (HAS_Z_AXIS && Z_HOME_DIR) || (HAS_I_AXIS && I_HOME_DIR) || (HAS_J_AXIS && J_HOME_DIR) || (HAS_K_AXIS && K_HOME_DIR)
#if X_HOME_DIR || (HAS_Y_AXIS && Y_HOME_DIR) || (HAS_Z_AXIS && Z_HOME_DIR) \
|| (HAS_I_AXIS && I_HOME_DIR) || (HAS_J_AXIS && J_HOME_DIR) || (HAS_K_AXIS && K_HOME_DIR) \
|| (HAS_U_AXIS && U_HOME_DIR) || (HAS_V_AXIS && V_HOME_DIR) || (HAS_W_AXIS && W_HOME_DIR)
#define HAS_ENDSTOPS 1
#define COORDINATE_OKAY(N,L,H) WITHIN(N,L,H)
#else
+38 -20
View File
@@ -79,35 +79,54 @@
#define SERVO_DELAY { 50 }
#endif
#if !HAS_BED_PROBE
#undef BABYSTEP_ZPROBE_OFFSET
#endif
#if !HAS_STOWABLE_PROBE
#undef PROBE_DEPLOY_STOW_MENU
#endif
// Some options are disallowed without required axes
#if !HAS_Y_AXIS
#undef SAFE_BED_LEVELING_START_Y
#undef ARC_SUPPORT
#undef INPUT_SHAPING_Y
#undef SHAPING_FREQ_Y
#undef SHAPING_BUFFER_Y
#endif
#if !HAS_Z_AXIS
#undef SAFE_BED_LEVELING_START_Z
#endif
#if !HAS_I_AXIS
#undef SAFE_BED_LEVELING_START_I
#endif
#if !HAS_J_AXIS
#undef SAFE_BED_LEVELING_START_J
#endif
#if !HAS_K_AXIS
#undef SAFE_BED_LEVELING_START_K
#endif
#if !HAS_U_AXIS
#undef SAFE_BED_LEVELING_START_U
#endif
#if !HAS_V_AXIS
#undef SAFE_BED_LEVELING_START_V
#endif
#if !HAS_W_AXIS
#undef SAFE_BED_LEVELING_START_W
#endif
// Disallowed with no extruders
#if !HAS_EXTRUDERS
#define NO_VOLUMETRICS
#undef TEMP_SENSOR_0
#undef TEMP_SENSOR_1
#undef TEMP_SENSOR_2
#undef TEMP_SENSOR_3
#undef TEMP_SENSOR_4
#undef TEMP_SENSOR_5
#undef TEMP_SENSOR_6
#undef TEMP_SENSOR_7
#undef FWRETRACT
#undef PIDTEMP
#undef AUTOTEMP
#undef PID_EXTRUSION_SCALING
#undef LIN_ADVANCE
#undef FILAMENT_RUNOUT_SENSOR
#undef ADVANCED_PAUSE_FEATURE
#undef FILAMENT_RUNOUT_DISTANCE_MM
#undef FILAMENT_LOAD_UNLOAD_GCODES
#undef DISABLE_INACTIVE_EXTRUDER
#undef FILAMENT_LOAD_UNLOAD_GCODES
#undef EXTRUDER_RUNOUT_PREVENT
#undef PREVENT_COLD_EXTRUSION
#undef PREVENT_LENGTHY_EXTRUDE
#undef THERMAL_PROTECTION_HOTENDS
#undef THERMAL_PROTECTION_PERIOD
#undef WATCH_TEMP_PERIOD
#undef SHOW_TEMP_ADC_VALUES
@@ -653,6 +672,10 @@
#define HAS_MEDIA_SUBCALLS 1
#endif
#if ANY(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME)
#define HAS_EXTRA_PROGRESS 1
#endif
#if HAS_PRINT_PROGRESS && EITHER(PRINT_PROGRESS_SHOW_DECIMALS, SHOW_REMAINING_TIME)
#define HAS_PRINT_PROGRESS_PERMYRIAD 1
#endif
@@ -1120,11 +1143,6 @@
#endif
// Input shaping
#if !HAS_Y_AXIS
#undef INPUT_SHAPING_Y
#undef SHAPING_FREQ_Y
#undef SHAPING_BUFFER_Y
#endif
#if EITHER(INPUT_SHAPING_X, INPUT_SHAPING_Y)
#define HAS_SHAPING 1
#endif
+21 -9
View File
@@ -267,6 +267,7 @@
*/
#if IS_KINEMATIC
#undef LCD_BED_TRAMMING
#undef SLOWDOWN
#endif
/**
@@ -274,12 +275,11 @@
* Printable radius assumes joints can fully extend
*/
#if IS_SCARA
#undef SLOWDOWN
#if ENABLED(AXEL_TPARA)
#define SCARA_PRINTABLE_RADIUS (TPARA_LINKAGE_1 + TPARA_LINKAGE_2)
#define PRINTABLE_RADIUS (TPARA_LINKAGE_1 + TPARA_LINKAGE_2)
#else
#define QUICK_HOME
#define SCARA_PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2)
#define PRINTABLE_RADIUS (SCARA_LINKAGE_1 + SCARA_LINKAGE_2)
#endif
#endif
@@ -378,7 +378,6 @@
*/
#if ENABLED(DELTA)
#undef Z_SAFE_HOMING
#undef SLOWDOWN
#endif
#ifndef MESH_INSET
@@ -2251,7 +2250,7 @@
#define IS_Z3_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 3 && Z3_USE_ENDSTOP == _##A##M##_)
#define IS_Z4_ENDSTOP(A,M) (ENABLED(Z_MULTI_ENDSTOPS) && NUM_Z_STEPPERS >= 4 && Z4_USE_ENDSTOP == _##A##M##_)
#define _HAS_STOP(A,M) (PIN_EXISTS(A##_##M) && !IS_PROBE_PIN(A,M) && !IS_X2_ENDSTOP(A,M) && !IS_Y2_ENDSTOP(A,M) && !IS_Z2_ENDSTOP(A,M) && !IS_Z3_ENDSTOP(A,M) && !IS_Z4_ENDSTOP(A,M))
#define _HAS_STOP(A,M) (HAS_##A##_AXIS && PIN_EXISTS(A##_##M) && !IS_PROBE_PIN(A,M) && !IS_X2_ENDSTOP(A,M) && !IS_Y2_ENDSTOP(A,M) && !IS_Z2_ENDSTOP(A,M) && !IS_Z3_ENDSTOP(A,M) && !IS_Z4_ENDSTOP(A,M))
#if _HAS_STOP(X,MIN)
#define HAS_X_MIN 1
#endif
@@ -2472,6 +2471,7 @@
#define BED_MAX_TARGET (BED_MAXTEMP - (BED_OVERSHOOT))
#else
#undef PIDTEMPBED
#undef PREHEAT_BEFORE_LEVELING
#endif
#if HAS_TEMP_COOLER && PIN_EXISTS(COOLER)
@@ -2506,6 +2506,15 @@
#define HAS_PID_HEATING 1
#endif
#if ENABLED(DWIN_LCD_PROUI)
#if EITHER(PIDTEMP, PIDTEMPBED)
#define DWIN_PID_TUNE 1
#endif
#if EITHER(DWIN_PID_TUNE, MPCTEMP) && DISABLED(DISABLE_TUNING_GRAPH)
#define SHOW_TUNING_GRAPH 1
#endif
#endif
// Thermal protection
#if !HAS_HEATED_BED
#undef THERMAL_PROTECTION_BED
@@ -3045,7 +3054,7 @@
*/
#if !HAS_FAN
#undef ADAPTIVE_FAN_SLOWING
#undef NO_FAN_SLOWING_IN_PID_TUNING
#undef TEMP_TUNING_MAINTAIN_FAN
#endif
#if !BOTH(HAS_BED_PROBE, HAS_FAN)
#undef PROBING_FANS_OFF
@@ -3082,7 +3091,10 @@
/**
* Only constrain Z on DELTA / SCARA machines
*/
#if IS_KINEMATIC
#if ENABLED(POLAR)
#undef MIN_SOFTWARE_ENDSTOP_Y
#undef MAX_SOFTWARE_ENDSTOP_Y
#elif IS_KINEMATIC
#undef MIN_SOFTWARE_ENDSTOP_X
#undef MIN_SOFTWARE_ENDSTOP_Y
#undef MAX_SOFTWARE_ENDSTOP_X
@@ -3153,7 +3165,7 @@
#if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
#if IS_KINEMATIC
// Probing points may be verified at compile time within the radius
// using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(DELTA_PRINTABLE_RADIUS),"bad probe point!")
// using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(PRINTABLE_RADIUS),"bad probe point!")
// so that may be added to SanityCheck.h in the future.
#define _MESH_MIN_X (X_MIN_BED + MESH_INSET)
#define _MESH_MIN_Y (Y_MIN_BED + MESH_INSET)
@@ -3327,7 +3339,7 @@
#endif
// Number of VFAT entries used. Each entry has 13 UTF-16 characters
#if EITHER(SCROLL_LONG_FILENAMES, HAS_DWIN_E3V2)
#if ANY(SCROLL_LONG_FILENAMES, HAS_DWIN_E3V2, TFT_COLOR_UI)
#define MAX_VFAT_ENTRIES (5)
#else
#define MAX_VFAT_ENTRIES (2)
+152 -70
View File
@@ -88,7 +88,7 @@
* Warnings for old configurations
*/
#ifndef MOTHERBOARD
#error "MOTHERBOARD is required."
#error "MOTHERBOARD is required. You must '#define MOTHERBOARD BOARD_MYNAME' (not just '#define BOARD_MYNAME')."
#elif !defined(X_BED_SIZE) || !defined(Y_BED_SIZE)
#error "X_BED_SIZE and Y_BED_SIZE are now required!"
#elif WATCH_TEMP_PERIOD > 500
@@ -97,6 +97,8 @@
#error "Thermal Runaway Protection for hotends is now enabled with THERMAL_PROTECTION_HOTENDS."
#elif DISABLED(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
#error "Thermal Runaway Protection for the bed is now enabled with THERMAL_PROTECTION_BED."
#elif defined(NO_FAN_SLOWING_IN_PID_TUNING)
#error "NO_FAN_SLOWING_IN_PID_TUNING is now TEMP_TUNING_MAINTAIN_FAN."
#elif (CORE_IS_XZ || CORE_IS_YZ) && ENABLED(Z_LATE_ENABLE)
#error "Z_LATE_ENABLE can't be used with COREXZ, COREZX, COREYZ, or COREZY."
#elif defined(X_HOME_RETRACT_MM)
@@ -513,7 +515,7 @@
#elif defined(HOME_USING_SPREADCYCLE)
#error "HOME_USING_SPREADCYCLE is now obsolete. Please remove it."
#elif defined(DGUS_LCD)
#error "DGUS_LCD is now DGUS_LCD_UI_(ORIGIN|FYSETC|HIPRECY)."
#error "DGUS_LCD is now DGUS_LCD_UI ORIGIN|FYSETC|HIPRECY)."
#elif defined(DGUS_SERIAL_PORT)
#error "DGUS_SERIAL_PORT is now LCD_SERIAL_PORT."
#elif defined(DGUS_BAUDRATE)
@@ -656,6 +658,18 @@
#error "EXTRA_LIN_ADVANCE_K is now ADVANCE_K_EXTRA."
#elif defined(POLAR_SEGMENTS_PER_SECOND) || defined(DELTA_SEGMENTS_PER_SECOND) || defined(SCARA_SEGMENTS_PER_SECOND) || defined(TPARA_SEGMENTS_PER_SECOND)
#error "(POLAR|DELTA|SCARA|TPARA)_SEGMENTS_PER_SECOND is now DEFAULT_SEGMENTS_PER_SECOND."
#elif ANY(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_MKS, DGUS_LCD_UI_RELOADED) && !defined(DGUS_LCD_UI)
#error "DGUS_LCD_UI_[TYPE] is now set using DGUS_LCD_UI TYPE."
#elif defined(DELTA_PRINTABLE_RADIUS)
#error "DELTA_PRINTABLE_RADIUS is now PRINTABLE_RADIUS."
#elif defined(SCARA_PRINTABLE_RADIUS)
#error "SCARA_PRINTABLE_RADIUS is now PRINTABLE_RADIUS."
#elif defined(SCARA_FEEDRATE_SCALING)
#error "SCARA_FEEDRATE_SCALING is now FEEDRATE_SCALING."
#elif defined(MILLISECONDS_PREHEAT_TIME)
#error "MILLISECONDS_PREHEAT_TIME is now PREHEAT_TIME_HOTEND_MS."
#elif defined(EXPERIMENTAL_SCURVE)
#error "EXPERIMENTAL_SCURVE is no longer needed and should be removed."
#endif
// L64xx stepper drivers have been removed
@@ -837,7 +851,9 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L
* Validate that the bed size fits
*/
static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS) are too narrow to contain X_BED_SIZE.");
static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE.");
#if HAS_Y_AXIS
static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS) are too narrow to contain Y_BED_SIZE.");
#endif
/**
* Granular software endstops (Marlin >= 1.1.7)
@@ -932,7 +948,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "SET_PROGRESS_MANUALLY requires at least one of SET_PROGRESS_PERCENT, SET_REMAINING_TIME, SET_INTERACTION_TIME to be enabled."
#endif
#if HAS_LCDPRINT && LCD_HEIGHT < 4 && ANY(SHOW_PROGRESS_PERCENT, SHOW_ELAPSED_TIME, SHOW_REMAINING_TIME, SHOW_INTERACTION_TIME)
#if HAS_LCDPRINT && HAS_EXTRA_PROGRESS && LCD_HEIGHT < 4
#error "Displays with fewer than 4 rows of text can't show progress values."
#endif
@@ -940,8 +956,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "SD_REPRINT_LAST_SELECTED_FILE currently requires a Marlin-native LCD menu."
#endif
#if ANY(HAS_MARLINUI_MENU, TOUCH_UI_FTDI_EVE, EXTENSIBLE_UI) && !defined(MANUAL_FEEDRATE)
#error "MANUAL_FEEDRATE is required for MarlinUI, ExtUI, or FTDI EVE Touch UI."
#if ANY(HAS_MARLINUI_MENU, TOUCH_UI_FTDI_EVE, EXTENSIBLE_UI, DWIN_LCD_PROUI) && !defined(MANUAL_FEEDRATE)
#error "MANUAL_FEEDRATE is required for ProUI, MarlinUI, ExtUI, or FTDI EVE Touch UI."
#endif
/**
@@ -978,12 +994,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "SDSORT_LIMIT must be 256 or smaller."
#elif SDSORT_LIMIT < 10
#error "SDSORT_LIMIT should be greater than 9 to be useful."
#elif DISABLED(SDSORT_USES_RAM)
#if ENABLED(SDSORT_DYNAMIC_RAM)
#error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)."
#elif ENABLED(SDSORT_CACHE_NAMES)
#error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)."
#endif
#elif ENABLED(SDSORT_DYNAMIC_RAM) && DISABLED(SDSORT_USES_RAM)
#error "SDSORT_DYNAMIC_RAM requires SDSORT_USES_RAM (which reads the directory into RAM)."
#elif ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_USES_RAM)
#error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)."
#elif ENABLED(SDSORT_DYNAMIC_RAM) && DISABLED(SDSORT_CACHE_NAMES)
#error "SDSORT_DYNAMIC_RAM requires SDSORT_CACHE_NAMES."
#endif
#if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)
@@ -1360,10 +1376,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#else
static_assert(WITHIN(ADVANCE_K, 0, 10), "ADVANCE_K must be from 0 to 10 (Changed in LIN_ADVANCE v1.5, Marlin 1.1.9).");
#endif
#if ENABLED(S_CURVE_ACCELERATION) && DISABLED(EXPERIMENTAL_SCURVE)
#error "LIN_ADVANCE and S_CURVE_ACCELERATION may not play well together! Enable EXPERIMENTAL_SCURVE to continue."
#elif ENABLED(DIRECT_STEPPING)
#error "DIRECT_STEPPING is incompatible with LIN_ADVANCE. Enable in external planner if possible."
#if ENABLED(DIRECT_STEPPING)
#error "DIRECT_STEPPING is incompatible with LIN_ADVANCE. (Extrusion is controlled externally by the Step Daemon.)"
#elif NONE(HAS_JUNCTION_DEVIATION, ALLOW_LOW_EJERK) && defined(DEFAULT_EJERK)
static_assert(DEFAULT_EJERK >= 10, "It is strongly recommended to set DEFAULT_EJERK >= 10 when using LIN_ADVANCE. Enable ALLOW_LOW_EJERK to bypass this alert (e.g., for direct drive).");
#endif
@@ -1549,6 +1564,21 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "To use CHAMBER_LIMIT_SWITCHING you must disable PIDTEMPCHAMBER."
#endif
/**
* AUTOTEMP
*/
#if ENABLED(AUTOTEMP)
#ifndef AUTOTEMP_MIN
#error "AUTOTEMP requires AUTOTEMP_MIN."
#elif !defined(AUTOTEMP_MAX)
#error "AUTOTEMP requires AUTOTEMP_MAX."
#elif !defined(AUTOTEMP_FACTOR)
#error "AUTOTEMP requires AUTOTEMP_FACTOR."
#elif AUTOTEMP_MAX < AUTOTEMP_MIN
#error "AUTOTEMP_MAX must be greater than or equal to AUTOTEMP_MIN."
#endif
#endif
/**
* Features that require a min/max/specific NUM_AXES
*/
@@ -1649,8 +1679,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
/**
* Allow only one kinematic type to be defined
*/
#if MANY(DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, MARKFORGED_YX, ARTICULATED_ROBOT_ARM, FOAMCUTTER_XYUV)
#error "Please enable only one of DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, MARKFORGED_YX, ARTICULATED_ROBOT_ARM, or FOAMCUTTER_XYUV."
#if MANY(DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, MARKFORGED_YX, ARTICULATED_ROBOT_ARM, FOAMCUTTER_XYUV, POLAR)
#error "Please enable only one of DELTA, MORGAN_SCARA, MP_SCARA, AXEL_TPARA, COREXY, COREXZ, COREYZ, COREYX, COREZX, COREZY, MARKFORGED_XY, MARKFORGED_YX, ARTICULATED_ROBOT_ARM, FOAMCUTTER_XYUV, or POLAR."
#endif
/**
@@ -1678,7 +1708,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
* Junction deviation is incompatible with kinematic systems.
*/
#if HAS_JUNCTION_DEVIATION && IS_KINEMATIC
#error "CLASSIC_JERK is required for DELTA and SCARA."
#error "CLASSIC_JERK is required for DELTA, SCARA, and POLAR."
#endif
/**
@@ -1782,7 +1812,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "BLTOUCH requires DEACTIVATE_SERVOS_AFTER_MOVE to be to disabled. Please update your Configuration.h file."
#endif
#if HAS_INVERTED_PROBE
#if ENABLED(INVERTED_PROBE_STATE)
#if !Z_MIN_PROBE_ENDSTOP_INVERTING
#error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to true."
#endif
@@ -1790,7 +1820,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "BLTOUCH requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false."
#endif
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#if HAS_INVERTED_PROBE
#if ENABLED(INVERTED_PROBE_STATE)
#if !Z_MIN_ENDSTOP_INVERTING
#error "BLTOUCH requires Z_MIN_ENDSTOP_INVERTING set to true."
#endif
@@ -1822,7 +1852,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#elif !HAS_RESUME_CONTINUE
#error "TOUCH_MI_PROBE currently requires an LCD controller or EMERGENCY_PARSER."
#endif
#if HAS_INVERTED_PROBE
#if ENABLED(INVERTED_PROBE_STATE)
#if !Z_MIN_PROBE_ENDSTOP_INVERTING
#error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING set to true."
#endif
@@ -1830,7 +1860,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "TOUCH_MI_PROBE requires Z_MIN_PROBE_ENDSTOP_INVERTING set to false."
#endif
#if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
#if HAS_INVERTED_PROBE
#if ENABLED(INVERTED_PROBE_STATE)
#if !Z_MIN_ENDSTOP_INVERTING
#error "TOUCH_MI_PROBE requires Z_MIN_ENDSTOP_INVERTING set to true."
#endif
@@ -1896,7 +1926,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
static_assert(PROBING_MARGIN_RIGHT >= 0, "PROBING_MARGIN_RIGHT must be >= 0.");
#endif
#define _MARGIN(A) TERN(IS_SCARA, SCARA_PRINTABLE_RADIUS, TERN(DELTA, DELTA_PRINTABLE_RADIUS, ((A##_BED_SIZE) / 2)))
#define _MARGIN(A) TERN(IS_KINEMATIC, PRINTABLE_RADIUS, ((A##_BED_SIZE) / 2))
static_assert(PROBING_MARGIN < _MARGIN(X), "PROBING_MARGIN is too large.");
static_assert(PROBING_MARGIN_BACK < _MARGIN(Y), "PROBING_MARGIN_BACK is too large.");
static_assert(PROBING_MARGIN_FRONT < _MARGIN(Y), "PROBING_MARGIN_FRONT is too large.");
@@ -1908,15 +1938,17 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
* Make sure Z raise values are set
*/
#ifndef Z_CLEARANCE_DEPLOY_PROBE
#error "You must define Z_CLEARANCE_DEPLOY_PROBE in your configuration."
#elif !defined(Z_CLEARANCE_BETWEEN_PROBES)
#error "You must define Z_CLEARANCE_BETWEEN_PROBES in your configuration."
#elif Z_CLEARANCE_DEPLOY_PROBE < 0
#error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0."
#elif Z_CLEARANCE_BETWEEN_PROBES < 0
#error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
#elif Z_AFTER_PROBING < 0
#error "Probes need Z_AFTER_PROBING >= 0."
#error "Z_CLEARANCE_DEPLOY_PROBE is required for bed probes."
#else
static_assert(Z_CLEARANCE_DEPLOY_PROBE >= 0, "Probes require Z_CLEARANCE_DEPLOY_PROBE >= 0.");
#endif
#ifndef Z_CLEARANCE_BETWEEN_PROBES
#error "Z_CLEARANCE_BETWEEN_PROBES is required for bed probes."
#else
static_assert(Z_CLEARANCE_BETWEEN_PROBES >= 0, "Probes require Z_CLEARANCE_BETWEEN_PROBES >= 0.");
#endif
#ifdef Z_AFTER_PROBING
static_assert(Z_AFTER_PROBING >= 0, "Probes require Z_AFTER_PROBING >= 0.");
#endif
#if MULTIPLE_PROBING > 0 || EXTRA_PROBING > 0
@@ -1987,6 +2019,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#if IS_SCARA
#error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers."
#elif ENABLED(POLAR)
#error "AUTO_BED_LEVELING_UBL does not yet support POLAR printers."
#elif DISABLED(EEPROM_SETTINGS)
#error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS."
#elif !WITHIN(GRID_MAX_POINTS_X, 3, 15) || !WITHIN(GRID_MAX_POINTS_Y, 3, 15)
@@ -2366,12 +2400,16 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#endif
#if MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED < 5
#error "Thermistor 66 requires MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED ≥ 5."
#elif MILLISECONDS_PREHEAT_TIME < 15000
#error "Thermistor 66 requires MILLISECONDS_PREHEAT_TIME ≥ 15000, but 30000 or higher is recommended."
#elif PREHEAT_TIME_HOTEND_MS < 15000
#error "Thermistor 66 requires PREHEAT_TIME_HOTEND_MS ≥ 15000, but 30000 or higher is recommended."
#endif
#undef _BAD_MINTEMP
#endif
#if TEMP_SENSOR_BED == 66 && PREHEAT_TIME_BED_MS < 15000
#error "Thermistor 66 requires PREHEAT_TIME_BED_MS ≥ 15000, but 30000 or higher is recommended."
#endif
/**
* Required MAX31865 settings
*/
@@ -3009,7 +3047,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
+ (DISABLED(IS_LEGACY_TFT) && ENABLED(TFT_GENERIC)) \
+ (ENABLED(IS_LEGACY_TFT) && COUNT_ENABLED(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)) \
+ COUNT_ENABLED(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_TFT35) \
+ COUNT_ENABLED(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_MKS, DGUS_LCD_UI_RELOADED) \
+ DGUS_UI_IS(ORIGIN) + DGUS_UI_IS(FYSETC) + DGUS_UI_IS(HIPRECY) + DGUS_UI_IS(MKS) + DGUS_UI_IS(RELOADED) + DGUS_UI_IS(IA_CREALITY) \
+ COUNT_ENABLED(ENDER2_STOCKDISPLAY, CR10_STOCKDISPLAY) \
+ COUNT_ENABLED(DWIN_CREALITY_LCD, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI, DWIN_MARLINUI_PORTRAIT, DWIN_MARLINUI_LANDSCAPE) \
+ COUNT_ENABLED(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_GENERIC_12864_1_1) \
@@ -4270,34 +4308,53 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
#undef _BAD_DRIVER
/**
* Require certain features for DGUS_LCD_UI_RELOADED.
* Require certain features for DGUS_LCD_UI RELOADED.
*/
#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_UI_IS(RELOADED)
#if BUFSIZE < 4
#error "DGUS_LCD_UI_RELOADED requires a BUFSIZE of at least 4."
#error "DGUS_LCD_UI RELOADED requires a BUFSIZE of at least 4."
#elif HOTENDS < 1
#error "DGUS_LCD_UI_RELOADED requires at least 1 hotend."
#error "DGUS_LCD_UI RELOADED requires at least 1 hotend."
#elif EXTRUDERS < 1
#error "DGUS_LCD_UI_RELOADED requires at least 1 extruder."
#error "DGUS_LCD_UI RELOADED requires at least 1 extruder."
#elif !HAS_HEATED_BED
#error "DGUS_LCD_UI_RELOADED requires a heated bed."
#error "DGUS_LCD_UI RELOADED requires a heated bed."
#elif FAN_COUNT < 1
#error "DGUS_LCD_UI_RELOADED requires a fan."
#error "DGUS_LCD_UI RELOADED requires a fan."
#elif !HAS_BED_PROBE
#error "DGUS_LCD_UI_RELOADED requires a bed probe."
#error "DGUS_LCD_UI RELOADED requires a bed probe."
#elif !HAS_MESH
#error "DGUS_LCD_UI_RELOADED requires mesh leveling."
#error "DGUS_LCD_UI RELOADED requires mesh leveling."
#elif DISABLED(LCD_BED_TRAMMING)
#error "DGUS_LCD_UI_RELOADED requires LCD_BED_TRAMMING."
#error "DGUS_LCD_UI RELOADED requires LCD_BED_TRAMMING."
#elif DISABLED(BABYSTEP_ALWAYS_AVAILABLE)
#error "DGUS_LCD_UI_RELOADED requires BABYSTEP_ALWAYS_AVAILABLE."
#error "DGUS_LCD_UI RELOADED requires BABYSTEP_ALWAYS_AVAILABLE."
#elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
#error "DGUS_LCD_UI_RELOADED requires BABYSTEP_ZPROBE_OFFSET."
#error "DGUS_LCD_UI RELOADED requires BABYSTEP_ZPROBE_OFFSET."
#elif ENABLED(AUTO_BED_LEVELING_UBL) && DISABLED(UBL_SAVE_ACTIVE_ON_M500)
#warning "Without UBL_SAVE_ACTIVE_ON_M500, your mesh will not be saved when using the touchscreen."
#endif
#endif
/**
* Require certain features for DGUS_LCD_UI IA_CREALITY.
*/
#if DGUS_UI_IS(IA_CREALITY)
#if DISABLED(ADVANCED_PAUSE_FEATURE)
#error "DGUS_LCD_UI IA_CREALITY requires ADVANCED_PAUSE_FEATURE."
#elif DISABLED(LCD_BED_TRAMMING)
#error "DGUS_LCD_UI IA_CREALITY requires LCD_BED_TRAMMING."
#elif DISABLED(CLASSIC_JERK)
#error "DGUS_LCD_UI IA_CREALITY requires CLASSIC_JERK."
#elif DISABLED(BABYSTEPPING)
#error "DGUS_LCD_UI IA_CREALITY requires BABYSTEPPING."
#elif NUM_RUNOUT_SENSORS > 1
#error "DGUS_LCD_UI IA_CREALITY requires NUM_RUNOUT_SENSORS < 2."
#elif NONE(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING)
#error "DGUS_LCD_UI IA_CREALITY requires AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, or MESH_BED_LEVELING."
#endif
#endif
// JTAG support in the HAL
#if ENABLED(DISABLE_DEBUG) && !defined(JTAGSWD_DISABLE)
#error "DISABLE_DEBUG is not supported for the selected MCU/Board."
@@ -4310,32 +4367,57 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
#error "BINARY_FILE_TRANSFER and CUSTOM_FIRMWARE_UPLOAD are required for custom upload."
#endif
// Check requirements for Input Shaping
#if HAS_SHAPING && defined(__AVR__)
#ifdef SHAPING_MIN_FREQ
static_assert((SHAPING_MIN_FREQ) > 0, "SHAPING_MIN_FREQ must be > 0.");
#else
TERN_(INPUT_SHAPING_X, static_assert((SHAPING_FREQ_X) > 0, "SHAPING_FREQ_X must be > 0 or SHAPING_MIN_FREQ must be set."));
TERN_(INPUT_SHAPING_Y, static_assert((SHAPING_FREQ_Y) > 0, "SHAPING_FREQ_Y must be > 0 or SHAPING_MIN_FREQ must be set."));
#endif
#if ENABLED(INPUT_SHAPING_X)
#if F_CPU > 16000000
static_assert((SHAPING_FREQ_X) == 0 || (SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (20) for AVR 20MHz.");
/**
* Input Shaping requirements
*/
#if HAS_SHAPING
#if ENABLED(DELTA)
#error "Input Shaping is not compatible with DELTA kinematics."
#elif ENABLED(SCARA)
#error "Input Shaping is not compatible with SCARA kinematics."
#elif ENABLED(TPARA)
#error "Input Shaping is not compatible with TPARA kinematics."
#elif ENABLED(POLAR)
#error "Input Shaping is not compatible with POLAR kinematics."
#elif ENABLED(POLARGRAPH)
#error "Input Shaping is not compatible with POLARGRAPH kinematics."
#elif ENABLED(DIRECT_STEPPING)
#error "Input Shaping is not compatible with DIRECT_STEPPING."
#elif BOTH(INPUT_SHAPING_X, CORE_IS_XZ)
#error "INPUT_SHAPING_X is not supported with COREXZ."
#elif BOTH(INPUT_SHAPING_Y, CORE_IS_YZ)
#error "INPUT_SHAPING_Y is not supported with COREYZ."
#elif ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
#if !BOTH(INPUT_SHAPING_X, INPUT_SHAPING_Y)
#error "INPUT_SHAPING_X and INPUT_SHAPING_Y must both be enabled for COREXY, COREYX, or MARKFORGED_*."
#else
static_assert((SHAPING_FREQ_X) == 0 || (SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (16) for AVR 16MHz.");
static_assert(SHAPING_FREQ_X == SHAPING_FREQ_Y, "SHAPING_FREQ_X and SHAPING_FREQ_Y must be the same for COREXY / COREYX / MARKFORGED_*.");
static_assert(SHAPING_ZETA_X == SHAPING_ZETA_Y, "SHAPING_ZETA_X and SHAPING_ZETA_Y must be the same for COREXY / COREYX / MARKFORGED_*.");
#endif
#endif
#if ENABLED(INPUT_SHAPING_Y)
#if F_CPU > 16000000
static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (20) for AVR 20MHz.");
#else
static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (16) for AVR 16MHz.");
#endif
#endif
#endif
#if BOTH(HAS_SHAPING, DIRECT_STEPPING)
#error "INPUT_SHAPING_[XY] cannot currently be used with DIRECT_STEPPING."
#ifdef __AVR__
#ifdef SHAPING_MIN_FREQ
static_assert((SHAPING_MIN_FREQ) > 0, "SHAPING_MIN_FREQ must be > 0.");
#else
TERN_(INPUT_SHAPING_X, static_assert((SHAPING_FREQ_X) > 0, "SHAPING_FREQ_X must be > 0 or SHAPING_MIN_FREQ must be set."));
TERN_(INPUT_SHAPING_Y, static_assert((SHAPING_FREQ_Y) > 0, "SHAPING_FREQ_Y must be > 0 or SHAPING_MIN_FREQ must be set."));
#endif
#if ENABLED(INPUT_SHAPING_X)
#if F_CPU > 16000000
static_assert((SHAPING_FREQ_X) == 0 || (SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (20) for AVR 20MHz.");
#else
static_assert((SHAPING_FREQ_X) == 0 || (SHAPING_FREQ_X) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_X is below the minimum (16) for AVR 16MHz.");
#endif
#endif
#if ENABLED(INPUT_SHAPING_Y)
#if F_CPU > 16000000
static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (20) for AVR 20MHz.");
#else
static_assert((SHAPING_FREQ_Y) == 0 || (SHAPING_FREQ_Y) * 2 * 0x10000 >= (STEPPER_TIMER_RATE), "SHAPING_FREQ_Y is below the minimum (16) for AVR 16MHz.");
#endif
#endif
#endif
#endif
// Misc. Cleanup
+2 -2
View File
@@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2022-12-18"
#define STRING_DISTRIBUTION_DATE "2023-02-03"
#endif
/**
@@ -52,7 +52,7 @@
* to alert users to major changes.
*/
#define MARLIN_HEX_VERSION 02010200
#define MARLIN_HEX_VERSION 02010300
#ifndef REQUIRED_CONFIGURATION_H_VERSION
#define REQUIRED_CONFIGURATION_H_VERSION MARLIN_HEX_VERSION
#endif
+15 -1
View File
@@ -712,7 +712,7 @@
#endif
#if ENABLED(EMIT_CREALITY_422_WARNING) && DISABLED(NO_CREALITY_422_DRIVER_WARNING)
#warning "Creality 4.2.2 boards come with a variety of stepper drivers. Check the board label and set the correct *_DRIVER_TYPE! (C=HR4988, E=A4988, A=TMC2208, B=TMC2209, H=TMC2225). (Define NO_CREALITY_422_DRIVER_WARNING to suppress this warning.)"
#warning "Creality 4.2.2 boards come with a variety of stepper drivers. Check the board label (typically on SD Card module) and set the correct *_DRIVER_TYPE! (C=HR4988, E=A4988, A=TMC2208, B=TMC2209, H=TMC2225, H8=HR4988). (Define NO_CREALITY_422_DRIVER_WARNING to suppress this warning.)"
#endif
#if PRINTCOUNTER_SYNC
@@ -783,3 +783,17 @@
#if ENABLED(BD_SENSOR) && DISABLED(BABYSTEPPING)
#warning "BABYSTEPPING is recommended with BD_SENSOR."
#endif
/**
* POLAR warnings
*/
#if BOTH(POLAR, S_CURVE_ACCELERATION)
#warning "POLAR kinematics may not work well with S_CURVE_ACCELERATION."
#endif
/**
* Input Shaping
*/
#if HAS_SHAPING && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
#warning "Input Shaping for CORE / MARKFORGED kinematic axes is still experimental."
#endif
+6 -2
View File
@@ -444,9 +444,12 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
}
// Prepare strings for progress display
#if HAS_PRINT_PROGRESS
#if EITHER(HAS_EXTRA_PROGRESS, HAS_PRINT_PROGRESS)
static MarlinUI::progress_t progress = 0;
static char bufferc[13];
#endif
#if HAS_EXTRA_PROGRESS
static void prepare_time_string(const duration_t &time, char prefix) {
char str[13];
@@ -484,7 +487,8 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
if (printJobOngoing())
prepare_time_string(print_job_timer.duration(), 'E'); }
#endif
#endif // HAS_PRINT_PROGRESS
#endif // HAS_EXTRA_PROGRESS
/**
* Draw the Status Screen for a 128x64 DOGM (U8glib) display.
@@ -705,7 +705,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
void ST7920_Lite_Status_Screen::drawRemain() {
const duration_t remaint = TERN0(SET_REMAINING_TIME, ui.get_remaining_time());
if (printJobOngoing() && remaint.value) {
draw_progress_string( PPOS, prepare_time_string(remaint, 'R'));
draw_progress_string(PPOS, prepare_time_string(remaint, 'R'));
}
}
#endif
@@ -714,7 +714,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
void ST7920_Lite_Status_Screen::drawInter() {
const duration_t interactt = ui.interaction_time;
if (printingIsActive() && interactt.value) {
draw_progress_string( PPOS, prepare_time_string(interactt, 'C'));
draw_progress_string(PPOS, prepare_time_string(interactt, 'C'));
}
}
#endif
@@ -723,7 +723,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
void ST7920_Lite_Status_Screen::drawElapsed() {
if (printJobOngoing()) {
const duration_t elapsedt = print_job_timer.duration();
draw_progress_string( PPOS, prepare_time_string(elapsedt, 'E'));
draw_progress_string(PPOS, prepare_time_string(elapsedt, 'E'));
}
}
#endif
+6 -6
View File
@@ -1213,7 +1213,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp)
Popup_Handler(ETemp);
else {
if (thermalManager.temp_hotend[0].is_below_target(-2)) {
if (thermalManager.temp_hotend[0].is_below_target(2)) {
Popup_Handler(Heating);
thermalManager.wait_for_hotend(0);
}
@@ -1356,7 +1356,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
Popup_Handler(ETemp);
}
else {
if (thermalManager.temp_hotend[0].is_below_target(-2)) {
if (thermalManager.temp_hotend[0].is_below_target(2)) {
Popup_Handler(Heating);
thermalManager.wait_for_hotend(0);
Redraw_Menu();
@@ -1743,7 +1743,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp)
Popup_Handler(ETemp);
else {
if (thermalManager.temp_hotend[0].is_below_target(-2)) {
if (thermalManager.temp_hotend[0].is_below_target(2)) {
Popup_Handler(Heating);
thermalManager.wait_for_hotend(0);
}
@@ -1762,7 +1762,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
Popup_Handler(ETemp);
}
else {
if (thermalManager.temp_hotend[0].is_below_target(-2)) {
if (thermalManager.temp_hotend[0].is_below_target(2)) {
Popup_Handler(Heating);
thermalManager.wait_for_hotend(0);
}
@@ -1780,7 +1780,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp)
Popup_Handler(ETemp);
else {
if (thermalManager.temp_hotend[0].is_below_target(-2)) {
if (thermalManager.temp_hotend[0].is_below_target(2)) {
Popup_Handler(Heating);
thermalManager.wait_for_hotend(0);
}
@@ -4505,7 +4505,7 @@ void CrealityDWINClass::Popup_Control() {
if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp)
Popup_Handler(ETemp);
else {
if (thermalManager.temp_hotend[0].is_below_target(-2)) {
if (thermalManager.temp_hotend[0].is_below_target(2)) {
Popup_Handler(Heating);
thermalManager.wait_for_hotend(0);
}
@@ -315,7 +315,7 @@ void MarlinUI::draw_status_screen() {
// Draw a frame around the x/y/z values
DWIN_Draw_Rectangle(0, Select_Color,
#if ENABLED(DWIN_MARLINUI_PORTRAIT)
0, 193, LCD_PIXEL_WIDTH, 260
0, 193, LCD_PIXEL_WIDTH - 1, 260
#else
0, 115, LCD_PIXEL_WIDTH - 1, 152
#endif
+41 -24
View File
@@ -23,23 +23,33 @@
/**
* Bed Level Tools for Pro UI
* Extended by: Miguel A. Risco-Castillo (MRISCOC)
* Version: 2.0.0
* Date: 2022/05/23
* Version: 2.1.0
* Date: 2022/08/27
*
* Based on the original work of: Henri-J-Norden
* https://github.com/Jyers/Marlin/pull/126
*
* 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 <https://www.gnu.org/licenses/>.
*
*/
#include "../../../inc/MarlinConfigPre.h"
#include "bedlevel_tools.h"
#if BOTH(DWIN_LCD_PROUI, HAS_LEVELING)
#include "../../marlinui.h"
#include "../../../core/types.h"
#include "dwin.h"
#include "dwinui.h"
#include "dwin_popup.h"
#include "../../../feature/bedlevel/bedlevel.h"
#include "../../../module/probe.h"
#include "../../../gcode/gcode.h"
@@ -48,9 +58,14 @@
#include "../../../libs/least_squares_fit.h"
#include "../../../libs/vector_3.h"
BedLevelToolsClass BedLevelTools;
#include "dwin.h"
#include "dwinui.h"
#include "dwin_popup.h"
#include "bedlevel_tools.h"
#if USE_UBL_VIEWER
BedLevelToolsClass bedLevelTools;
#if ENABLED(USE_UBL_VIEWER)
bool BedLevelToolsClass::viewer_asymmetric_range = false;
bool BedLevelToolsClass::viewer_print_value = false;
#endif
@@ -153,26 +168,30 @@ void BedLevelToolsClass::manual_move(const uint8_t mesh_x, const uint8_t mesh_y,
}
}
// Move / Probe methods. As examples, not yet used.
void BedLevelToolsClass::MoveToXYZ() {
BedLevelTools.goto_mesh_value = true;
BedLevelTools.manual_move(BedLevelTools.mesh_x, BedLevelTools.mesh_y, false);
bedLevelTools.goto_mesh_value = true;
bedLevelTools.manual_move(bedLevelTools.mesh_x, bedLevelTools.mesh_y, false);
}
void BedLevelToolsClass::MoveToXY() {
BedLevelTools.goto_mesh_value = false;
BedLevelTools.manual_move(BedLevelTools.mesh_x, BedLevelTools.mesh_y, false);
bedLevelTools.goto_mesh_value = false;
bedLevelTools.manual_move(bedLevelTools.mesh_x, bedLevelTools.mesh_y, false);
}
void BedLevelToolsClass::MoveToZ() {
BedLevelTools.goto_mesh_value = true;
BedLevelTools.manual_move(BedLevelTools.mesh_x, BedLevelTools.mesh_y, true);
bedLevelTools.goto_mesh_value = true;
bedLevelTools.manual_move(bedLevelTools.mesh_x, bedLevelTools.mesh_y, true);
}
void BedLevelToolsClass::ProbeXY() {
sprintf_P(cmd, PSTR("G30X%sY%s"),
dtostrf(bedlevel.get_mesh_x(BedLevelTools.mesh_x), 1, 2, str_1),
dtostrf(bedlevel.get_mesh_y(BedLevelTools.mesh_y), 1, 2, str_2)
const uint16_t Clear = Z_CLEARANCE_DEPLOY_PROBE;
sprintf_P(cmd, PSTR("G0Z%i\nG30X%sY%s"),
Clear,
dtostrf(bedlevel.get_mesh_x(bedLevelTools.mesh_x), 1, 2, str_1),
dtostrf(bedlevel.get_mesh_y(bedLevelTools.mesh_y), 1, 2, str_2)
);
gcode.process_subcommands_now(cmd);
}
// Accessors
float BedLevelToolsClass::get_max_value() {
float max = __FLT_MAX__ * -1;
GRID_LOOP(x, y) {
@@ -191,18 +210,16 @@ float BedLevelToolsClass::get_min_value() {
return min;
}
// Return 'true' if mesh is good and within LCD limits
bool BedLevelToolsClass::meshvalidate() {
float min = __FLT_MAX__, max = __FLT_MAX__ * -1;
GRID_LOOP(x, y) {
if (isnan(bedlevel.z_values[x][y])) return false;
if (bedlevel.z_values[x][y] < min) min = bedlevel.z_values[x][y];
if (bedlevel.z_values[x][y] > max) max = bedlevel.z_values[x][y];
const float v = bedlevel.z_values[x][y];
if (isnan(v) || !WITHIN(v, UBL_Z_OFFSET_MIN, UBL_Z_OFFSET_MAX)) return false;
}
return WITHIN(max, MESH_Z_OFFSET_MIN, MESH_Z_OFFSET_MAX);
return true;
}
#if USE_UBL_VIEWER
#if ENABLED(USE_UBL_VIEWER)
void BedLevelToolsClass::Draw_Bed_Mesh(int16_t selected /*= -1*/, uint8_t gridline_width /*= 1*/, uint16_t padding_x /*= 8*/, uint16_t padding_y_top /*= 40 + 53 - 7*/) {
drawing_mesh = true;
+22 -13
View File
@@ -23,27 +23,38 @@
/**
* Bed Level Tools for Pro UI
* Extended by: Miguel A. Risco-Castillo (MRISCOC)
* Version: 2.0.0
* Date: 2022/05/23
* Version: 2.1.0
* Date: 2022/08/27
*
* Based on the original work of: Henri-J-Norden
* https://github.com/Jyers/Marlin/pull/126
*
* 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 <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(AUTO_BED_LEVELING_UBL)
//#define USE_UBL_VIEWER 1
#endif
//#define USE_UBL_VIEWER 1
#define MESH_Z_OFFSET_MIN -3.0
#define MESH_Z_OFFSET_MAX 3.0
#define UBL_Z_OFFSET_MIN -3.0
#define UBL_Z_OFFSET_MAX 3.0
class BedLevelToolsClass {
public:
#if USE_UBL_VIEWER
#if ENABLED(USE_UBL_VIEWER)
static bool viewer_asymmetric_range;
static bool viewer_print_value;
#endif
@@ -66,12 +77,10 @@ public:
static float get_max_value();
static float get_min_value();
static bool meshvalidate();
#if USE_UBL_VIEWER
#if ENABLED(USE_UBL_VIEWER)
static void Draw_Bed_Mesh(int16_t selected = -1, uint8_t gridline_width = 1, uint16_t padding_x = 8, uint16_t padding_y_top = 40 + 53 - 7);
static void Set_Mesh_Viewer_Status();
#endif
};
extern BedLevelToolsClass BedLevelTools;
void Goto_MeshViewer();
extern BedLevelToolsClass bedLevelTools;
File diff suppressed because it is too large Load Diff
+137 -42
View File
@@ -24,16 +24,32 @@
/**
* DWIN Enhanced implementation for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.17.2
* Date: 2022/04/08
* Version: 3.21.2
* Date: 2022/12/02
*/
#include "../../../inc/MarlinConfig.h"
#include "dwin_defines.h"
#include "dwinui.h"
#include "../common/encoder.h"
#include "../../../libs/BL24CXX.h"
#include "../../../inc/MarlinConfig.h"
#if EITHER(BABYSTEPPING, HAS_BED_PROBE)
#define HAS_ZOFFSET_ITEM 1
#if !HAS_BED_PROBE
#define JUST_BABYSTEP 1
#endif
#endif
namespace GET_LANG(LCD_LANGUAGE) {
#define _MSG_PREHEAT(N) \
LSTR MSG_PREHEAT_##N = _UxGT("Preheat ") PREHEAT_## N ##_LABEL; \
LSTR MSG_PREHEAT_## N ##_SETTINGS = _UxGT("Preheat ") PREHEAT_## N ##_LABEL _UxGT(" Conf");
#if PREHEAT_COUNT > 3
REPEAT_S(4, PREHEAT_COUNT, _MSG_PREHEAT)
#endif
}
enum processID : uint8_t {
// Process ID
@@ -44,7 +60,6 @@ enum processID : uint8_t {
SetIntNoDraw,
SetFloat,
SetPFloat,
SelectFile,
PrintProcess,
Popup,
Leveling,
@@ -55,37 +70,104 @@ enum processID : uint8_t {
WaitResponse,
Homing,
PidProcess,
MPCProcess,
NothingToDo
};
enum pidresult_t : uint8_t {
PID_BAD_EXTRUDER_NUM,
PID_TEMP_TOO_HIGH,
PID_TUNING_TIMEOUT,
PID_EXTR_START,
PID_BED_START,
PID_DONE
};
#if EITHER(DWIN_PID_TUNE, MPCTEMP)
enum tempcontrol_t : uint8_t {
#if DWIN_PID_TUNE
PID_DONE,
PIDTEMP_START,
PIDTEMPBED_START,
PID_BAD_HEATER_ID,
PID_TEMP_TOO_HIGH,
PID_TUNING_TIMEOUT,
#endif
#if ENABLED(MPCTEMP)
MPC_DONE,
MPCTEMP_START,
MPC_TEMP_ERROR,
MPC_INTERRUPTED
#endif
};
#endif
#define DWIN_CHINESE 123
#define DWIN_ENGLISH 0
typedef struct {
// Color settings
uint16_t Background_Color;
uint16_t Cursor_Color;
uint16_t TitleBg_Color;
uint16_t TitleTxt_Color;
uint16_t Text_Color;
uint16_t Selected_Color;
uint16_t SplitLine_Color;
uint16_t Highlight_Color;
uint16_t StatusBg_Color;
uint16_t StatusTxt_Color;
uint16_t PopupBg_Color;
uint16_t PopupTxt_Color;
uint16_t AlertBg_Color;
uint16_t AlertTxt_Color;
uint16_t PercentTxt_Color;
uint16_t Barfill_Color;
uint16_t Indicator_Color;
uint16_t Coordinate_Color;
// Temperatures
#if DWIN_PID_TUNE
int16_t PidCycles = DEF_PIDCYCLES;
#if ENABLED(PIDTEMP)
int16_t HotendPidT = DEF_HOTENDPIDT;
#endif
#if ENABLED(PIDTEMPBED)
int16_t BedPidT = DEF_BEDPIDT;
#endif
#endif
#if ENABLED(PREVENT_COLD_EXTRUSION)
int16_t ExtMinT = EXTRUDE_MINTEMP;
#endif
#if ENABLED(PREHEAT_BEFORE_LEVELING)
int16_t BedLevT = LEVELING_BED_TEMP;
#endif
#if ENABLED(BAUD_RATE_GCODE)
bool Baud115K = false;
#endif
bool FullManualTramming = false;
bool MediaAutoMount = ENABLED(HAS_SD_EXTENDER);
#if BOTH(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING)
uint8_t z_after_homing = DEF_Z_AFTER_HOMING;
#endif
#if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS)
LEDColor Led_Color = Def_Leds_Color;
#endif
} HMI_data_t;
extern HMI_data_t HMI_data;
static constexpr size_t eeprom_data_size = sizeof(HMI_data_t);
typedef struct {
int8_t Color[3]; // Color components
pidresult_t pidresult = PID_DONE;
#if DWIN_PID_TUNE
tempcontrol_t pidresult = PID_DONE;
#endif
uint8_t Select = 0; // Auxiliary selector variable
AxisEnum axis = X_AXIS; // Axis Select
} HMI_value_t;
typedef struct {
uint8_t language;
bool printing_flag:1; // sd or host printing
bool abort_flag:1; // sd or host was aborted
bool pause_flag:1; // printing is paused
bool percent_flag:1; // percent was override by M73
bool remain_flag:1; // remain was override by M73
bool pause_flag:1; // printing is paused
bool pause_action:1; // flag a pause action
bool abort_flag:1; // printing is aborting
bool abort_action:1; // flag a aborting action
bool print_finish:1; // print was finished
bool select_flag:1; // Popup button selected
bool home_flag:1; // homing in course
bool heat_flag:1; // 0: heating done 1: during heating
@@ -105,6 +187,7 @@ extern millis_t dwin_heat_time;
#endif
// Tool Functions
uint32_t GetHash(char * str);
#if ENABLED(EEPROM_SETTINGS)
void WriteEeprom();
void ReadEeprom();
@@ -118,15 +201,14 @@ void DisableMotors();
void AutoLev();
void AutoHome();
#if HAS_PREHEAT
void DoPreheat0();
void DoPreheat1();
void DoPreheat2();
#define _DOPREHEAT(N) void DoPreheat##N();
REPEAT_1(PREHEAT_COUNT, _DOPREHEAT)
#endif
void DoCoolDown();
#if HAS_HOTEND
#if ENABLED(PIDTEMP)
void HotendPID();
#endif
#if HAS_HEATED_BED
#if ENABLED(PIDTEMPBED)
void BedPID();
#endif
#if ENABLED(BAUD_RATE_GCODE)
@@ -146,10 +228,16 @@ void ParkHead();
void ApplyLEDColor();
#endif
#if ENABLED(AUTO_BED_LEVELING_UBL)
void UBLTiltMesh();
void UBLMeshTilt();
bool UBLValidMesh();
void UBLSaveMesh();
void UBLLoadMesh();
void UBLMeshSave();
void UBLMeshLoad();
#endif
#if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION)
void HostShutDown();
#endif
#if !HAS_BED_PROBE
void HomeZandDisable();
#endif
// Other
@@ -160,7 +248,7 @@ void Goto_PowerLossRecovery();
void Goto_ConfirmToPrint();
void DWIN_Draw_Dashboard(const bool with_update); // Status Area
void Draw_Main_Area(); // Redraw main area
void DWIN_DrawStatusLine(); // Draw simple status text
void DWIN_DrawStatusLine(const char *text = ""); // Draw simple status text
void DWIN_RedrawDash(); // Redraw Dash and Status line
void DWIN_RedrawScreen(); // Redraw all screen elements
void HMI_MainMenu(); // Main process screen
@@ -169,7 +257,6 @@ void HMI_Printing(); // Print page
void HMI_ReturnScreen(); // Return to previous screen before popups
void HMI_WaitForUser();
void HMI_SaveProcessID(const uint8_t id);
void HMI_SDCardInit();
void HMI_SDCardUpdate();
void EachMomentUpdate();
void update_variable();
@@ -179,12 +266,11 @@ void DWIN_CheckStatusMessage();
void DWIN_HomingStart();
void DWIN_HomingDone();
#if HAS_MESH
void DWIN_MeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval);
void DWIN_MeshUpdate(const int8_t cpos, const int8_t tpos, const_float_t zval);
#endif
void DWIN_LevelingStart();
void DWIN_LevelingDone();
void DWIN_PidTuning(pidresult_t result);
void DWIN_Print_Started(const bool sd=false);
void DWIN_Print_Started();
void DWIN_Print_Pause();
void DWIN_Print_Resume();
void DWIN_Print_Finished();
@@ -228,6 +314,7 @@ void DWIN_RebootScreen();
#endif
// Menu drawing functions
void Draw_Print_File_Menu();
void Draw_Control_Menu();
void Draw_AdvancedSettings_Menu();
void Draw_Prepare_Menu();
@@ -260,14 +347,6 @@ void Draw_Motion_Menu();
#if ENABLED(MESH_BED_LEVELING)
void Draw_ManualMesh_Menu();
#endif
#if HAS_HOTEND
void Draw_Preheat1_Menu();
void Draw_Preheat2_Menu();
void Draw_Preheat3_Menu();
#if ENABLED(PIDTEMP)
void Draw_HotendPID_Menu();
#endif
#endif
void Draw_Temperature_Menu();
void Draw_MaxSpeed_Menu();
void Draw_MaxAccel_Menu();
@@ -275,9 +354,6 @@ void Draw_MaxAccel_Menu();
void Draw_MaxJerk_Menu();
#endif
void Draw_Steps_Menu();
#if ENABLED(PIDTEMPBED)
void Draw_BedPID_Menu();
#endif
#if EITHER(HAS_BED_PROBE, BABYSTEPPING)
void Draw_ZOffsetWiz_Menu();
#endif
@@ -293,3 +369,22 @@ void Draw_Steps_Menu();
void Draw_EditMesh_Menu();
#endif
#endif
// PID
#if DWIN_PID_TUNE
#include "../../../module/temperature.h"
void DWIN_StartM303(const bool seenC, const int c, const bool seenS, const heater_id_t hid, const celsius_t temp);
void DWIN_PidTuning(tempcontrol_t result);
#if ENABLED(PIDTEMP)
void Draw_HotendPID_Menu();
#endif
#if ENABLED(PIDTEMPBED)
void Draw_BedPID_Menu();
#endif
#endif
// MPC
#if ENABLED(MPCTEMP)
void DWIN_MPCTuning(tempcontrol_t result);
void Draw_HotendMPC_Menu();
#endif
+29 -68
View File
@@ -24,39 +24,40 @@
/**
* DWIN general defines and data structs for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.11.2
* Date: 2022/02/28
* Version: 3.12.2
* Date: 2022/08/08
*/
#define HAS_GCODE_PREVIEW 1
#define HAS_PIDPLOT 1
#define HAS_ESDIAG 1
#define HAS_LOCKSCREEN 1
//#define DEBUG_DWIN 1
//#define NEED_HEX_PRINT 1
#include "../../../inc/MarlinConfigPre.h"
#include "../common/dwin_color.h"
#if ENABLED(LED_CONTROL_MENU)
#include "../../../feature/leds/leds.h"
#endif
#include <stddef.h>
#if defined(__STM32F1__) || defined(STM32F1)
#define DASH_REDRAW 1
#endif
#if DISABLED(PROBE_MANUALLY) && ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL)
#define HAS_ONESTEP_LEVELING 1
#endif
#if !HAS_BED_PROBE && ENABLED(BABYSTEPPING)
#define JUST_BABYSTEP 1
#endif
#if ANY(BABYSTEPPING, HAS_BED_PROBE, HAS_WORKSPACE_OFFSET)
#define HAS_ZOFFSET_ITEM 1
#endif
#define Def_Background_Color RGB( 1, 12, 8)
#define Def_Cursor_color RGB(20, 49, 31)
#define Def_TitleBg_color RGB( 0, 23, 16)
#define Def_TitleTxt_color Color_White
#define Def_Cursor_Color RGB(20, 49, 31)
#define Def_TitleBg_Color RGB( 0, 23, 16)
#define Def_TitleTxt_Color Color_White
#define Def_Text_Color Color_White
#define Def_Selected_Color Select_Color
#define Def_SplitLine_Color RGB( 0, 23, 16)
#define Def_Highlight_Color Color_White
#define Def_StatusBg_Color RGB( 0, 23, 16)
#define Def_StatusTxt_Color Color_Yellow
#define Def_PopupBg_color Color_Bg_Window
#define Def_PopupBg_Color Color_Bg_Window
#define Def_PopupTxt_Color Popup_Text_Color
#define Def_AlertBg_Color Color_Bg_Red
#define Def_AlertTxt_Color Color_Yellow
@@ -68,55 +69,15 @@
#if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS)
#define Def_Leds_Color LEDColorWhite()
#endif
#if ENABLED(CASELIGHT_USES_BRIGHTNESS)
#define Def_CaseLight_Brightness 255
#endif
#ifdef Z_AFTER_HOMING
#define DEF_Z_AFTER_HOMING Z_AFTER_HOMING
#else
#define DEF_Z_AFTER_HOMING 0
#endif
#define DEF_HOTENDPIDT TERN(PREHEAT_1_TEMP_BED, PREHEAT_1_TEMP_HOTEND, 195)
#define DEF_BEDPIDT TERN(PREHEAT_1_TEMP_BED, PREHEAT_1_TEMP_HOTEND, 60)
#define DEF_PIDCYCLES 5
typedef struct {
// Color settings
uint16_t Background_Color = Def_Background_Color;
uint16_t Cursor_color = Def_Cursor_color;
uint16_t TitleBg_color = Def_TitleBg_color;
uint16_t TitleTxt_color = Def_TitleTxt_color;
uint16_t Text_Color = Def_Text_Color;
uint16_t Selected_Color = Def_Selected_Color;
uint16_t SplitLine_Color = Def_SplitLine_Color;
uint16_t Highlight_Color = Def_Highlight_Color;
uint16_t StatusBg_Color = Def_StatusBg_Color;
uint16_t StatusTxt_Color = Def_StatusTxt_Color;
uint16_t PopupBg_color = Def_PopupBg_color;
uint16_t PopupTxt_Color = Def_PopupTxt_Color;
uint16_t AlertBg_Color = Def_AlertBg_Color;
uint16_t AlertTxt_Color = Def_AlertTxt_Color;
uint16_t PercentTxt_Color = Def_PercentTxt_Color;
uint16_t Barfill_Color = Def_Barfill_Color;
uint16_t Indicator_Color = Def_Indicator_Color;
uint16_t Coordinate_Color = Def_Coordinate_Color;
// Temperatures
#if HAS_HOTEND && defined(PREHEAT_1_TEMP_HOTEND)
int16_t HotendPidT = PREHEAT_1_TEMP_HOTEND;
#endif
#if HAS_HEATED_BED && defined(PREHEAT_1_TEMP_BED)
int16_t BedPidT = PREHEAT_1_TEMP_BED;
#endif
#if HAS_HOTEND || HAS_HEATED_BED
int16_t PidCycles = 10;
#endif
#if ENABLED(PREVENT_COLD_EXTRUSION)
int16_t ExtMinT = EXTRUDE_MINTEMP;
#endif
#if BOTH(HAS_HEATED_BED, PREHEAT_BEFORE_LEVELING)
int16_t BedLevT = LEVELING_BED_TEMP;
#endif
#if ENABLED(BAUD_RATE_GCODE)
bool Baud115K = false;
#endif
bool FullManualTramming = false;
#if ENABLED(MESH_BED_LEVELING)
float ManualZOffset = 0;
#endif
// Led
#if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS)
LEDColor Led_Color = Def_Leds_Color;
#endif
} HMI_data_t;
static constexpr size_t eeprom_data_size = sizeof(HMI_data_t);
extern HMI_data_t HMI_data;
+2 -2
View File
@@ -46,8 +46,8 @@ uint16_t HighlightYPos = 280;
void Draw_Select_Highlight(const bool sel, const uint16_t ypos) {
HighlightYPos = ypos;
HMI_flag.select_flag = sel;
const uint16_t c1 = sel ? HMI_data.Highlight_Color : HMI_data.PopupBg_color,
c2 = sel ? HMI_data.PopupBg_color : HMI_data.Highlight_Color;
const uint16_t c1 = sel ? HMI_data.Highlight_Color : HMI_data.PopupBg_Color,
c2 = sel ? HMI_data.PopupBg_Color : HMI_data.Highlight_Color;
DWIN_Draw_Rectangle(0, c1, 25, ypos - 1, 126, ypos + 38);
DWIN_Draw_Rectangle(0, c1, 24, ypos - 2, 127, ypos + 39);
DWIN_Draw_Rectangle(0, c2, 145, ypos - 1, 246, ypos + 38);
+1 -1
View File
@@ -44,7 +44,7 @@ void Goto_Popup(const popupDrawFunc_t fnDraw, const popupClickFunc_t fnClick=nul
void HMI_Popup();
inline void Draw_Popup_Bkgd() {
DWIN_Draw_Rectangle(1, HMI_data.PopupBg_color, 14, 60, 258, 330);
DWIN_Draw_Rectangle(1, HMI_data.PopupBg_Color, 14, 60, 258, 330);
DWIN_Draw_Rectangle(0, HMI_data.Highlight_Color, 14, 60, 258, 330);
}
+20 -18
View File
@@ -23,21 +23,17 @@
/**
* DWIN Enhanced implementation for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 3.18.1
* Date: 2022/07/05
* Version: 3.20.1
* Date: 2022/10/25
*/
#include "../../../inc/MarlinConfigPre.h"
#include "../../../inc/MarlinConfig.h"
#if ENABLED(DWIN_LCD_PROUI)
#include "../../../inc/MarlinConfig.h"
#include "dwin_defines.h"
#include "dwin_lcd.h"
#include "dwinui.h"
#include "dwin_defines.h"
//#define DEBUG_OUT 1
#include "../../../core/debug_out.h"
xy_int_t DWINUI::cursor = { 0 };
uint16_t DWINUI::pencolor = Color_White;
@@ -50,13 +46,6 @@ FSTR_P const DWINUI::Author = F(STRING_CONFIG_H_AUTHOR);
void (*DWINUI::onTitleDraw)(TitleClass* title) = nullptr;
void DWINUI::init() {
delay(750); // Delay for wait to wakeup screen
const bool hs = DWIN_Handshake(); UNUSED(hs);
#if ENABLED(DEBUG_DWIN)
SERIAL_ECHOPGM("DWIN_Handshake ");
SERIAL_ECHOLNF(hs ? F("ok.") : F("error."));
#endif
DWIN_Frame_SetDir(1);
cursor.reset();
pencolor = Color_White;
textcolor = Def_Text_Color;
@@ -210,6 +199,19 @@ void DWINUI::Draw_Float(uint8_t bShow, bool signedMode, fontid_t fid, uint16_t c
DWIN_Draw_String(bShow, fid, color, bColor, x, y, dtostrf(value, iNum + (signedMode ? 2:1) + fNum, fNum, nstr));
}
// ------------------------- Icons -------------------------------//
// Draw an Icon and select library automatically
// BG: The icon background display: false=Background filtering is not displayed, true=Background display
// libID: Icon library ID
// picID: Icon ID
// x/y: Upper-left point
void DWINUI::ICON_Show(bool BG, uint8_t icon, uint16_t x, uint16_t y) {
const uint8_t libID = ICON TERN_(HAS_CUSTOMICONS, + (icon / 100));
const uint8_t picID = icon TERN_(HAS_CUSTOMICONS, % 100);
DWIN_ICON_Show(BG, false, !BG, libID, picID, x, y);
}
// ------------------------- Buttons ------------------------------//
void DWINUI::Draw_Button(uint16_t color, uint16_t bcolor, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, const char * const caption) {
@@ -279,7 +281,7 @@ void DWINUI::Draw_FillCircle(uint16_t bcolor, uint16_t x,uint16_t y,uint8_t r) {
// color2 : End color
uint16_t DWINUI::ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2) {
uint8_t B, G, R;
const float n = (float)(val - minv) / (maxv - minv);
const float n = float(val - minv) / (maxv - minv);
R = (1 - n) * GetRColor(color1) + n * GetRColor(color2);
G = (1 - n) * GetGColor(color1) + n * GetGColor(color2);
B = (1 - n) * GetBColor(color1) + n * GetBColor(color2);
@@ -294,7 +296,7 @@ uint16_t DWINUI::RainbowInt(int16_t val, int16_t minv, int16_t maxv) {
uint8_t B, G, R;
const uint8_t maxB = 28, maxR = 28, maxG = 38;
const int16_t limv = _MAX(abs(minv), abs(maxv));
float n = minv >= 0 ? (float)(val - minv) / (maxv - minv) : (float)val / limv;
float n = minv >= 0 ? float(val - minv) / (maxv - minv) : (float)val / limv;
LIMIT(n, -1, 1);
if (n < 0) {
R = 0;
@@ -320,8 +322,8 @@ uint16_t DWINUI::RainbowInt(int16_t val, int16_t minv, int16_t maxv) {
// x/y: Upper-left point
// mode : 0 : unchecked, 1 : checked
void DWINUI::Draw_Checkbox(uint16_t color, uint16_t bcolor, uint16_t x, uint16_t y, bool checked=false) {
DWIN_Draw_String(true, font8x16, color, bcolor, x + 4, y, checked ? F("x") : F(" "));
DWIN_Draw_Rectangle(0, color, x + 2, y + 2, x + 17, y + 17);
DWIN_Draw_Rectangle(1, checked ? color : bcolor, x + 6, y + 6, x + 13, y + 13);
}
// Clear Menu by filling the menu area with background color
+53 -5
View File
@@ -28,10 +28,12 @@
* Date: 2022/07/05
*/
#include "dwin_lcd.h"
#include "../../../inc/MarlinConfigPre.h"
#include "../common/dwin_set.h"
#include "../common/dwin_font.h"
#include "../common/dwin_color.h"
#include "dwin_lcd.h"
// Extra Icons
#define ICON_AdvSet ICON_Language
@@ -74,6 +76,10 @@
#define ICON_MaxPosX ICON_MoveX
#define ICON_MaxPosY ICON_MoveY
#define ICON_MaxPosZ ICON_MoveZ
#define ICON_MeshEdit ICON_Homing
#define ICON_MeshEditX ICON_MoveX
#define ICON_MeshEditY ICON_MoveY
#define ICON_MeshEditZ ICON_MoveZ
#define ICON_MeshNext ICON_Axis
#define ICON_MeshPoints ICON_SetEndTemp
#define ICON_MeshSave ICON_WriteEEPROM
@@ -85,11 +91,22 @@
#define ICON_ParkPosY ICON_StepY
#define ICON_ParkPosZ ICON_StepZ
#define ICON_PhySet ICON_PrintSize
#define ICON_PIDbed ICON_SetBedTemp
#define ICON_PIDcycles ICON_ResumeEEPROM
#define ICON_PIDNozzle ICON_SetEndTemp
#define ICON_PIDBed ICON_SetBedTemp
#define ICON_PIDCycles ICON_ResumeEEPROM
#define ICON_PIDValue ICON_Contact
#define ICON_PrintStats ICON_PrintTime
#define ICON_PrintStatsReset ICON_RemainTime
#define ICON_Preheat1 ICON_PLAPreheat
#define ICON_Preheat2 ICON_ABSPreheat
#define ICON_Preheat3 ICON_CustomPreheat
#define ICON_Preheat4 ICON_CustomPreheat
#define ICON_Preheat5 ICON_CustomPreheat
#define ICON_Preheat6 ICON_CustomPreheat
#define ICON_Preheat7 ICON_CustomPreheat
#define ICON_Preheat8 ICON_CustomPreheat
#define ICON_Preheat9 ICON_CustomPreheat
#define ICON_Preheat10 ICON_CustomPreheat
#define ICON_ProbeDeploy ICON_SetEndTemp
#define ICON_ProbeMargin ICON_PrintSize
#define ICON_ProbeOffsetX ICON_StepX
@@ -105,13 +122,37 @@
#define ICON_Scolor ICON_MaxSpeed
#define ICON_SetBaudRate ICON_Setspeed
#define ICON_SetCustomPreheat ICON_SetEndTemp
#define ICON_SetPreheat1 ICON_SetPLAPreheat
#define ICON_SetPreheat2 ICON_SetABSPreheat
#define ICON_SetPreheat3 ICON_SetCustomPreheat
#define ICON_SetPreheat4 ICON_SetCustomPreheat
#define ICON_SetPreheat5 ICON_SetCustomPreheat
#define ICON_SetPreheat6 ICON_SetCustomPreheat
#define ICON_SetPreheat7 ICON_SetCustomPreheat
#define ICON_SetPreheat8 ICON_SetCustomPreheat
#define ICON_SetPreheat9 ICON_SetCustomPreheat
#define ICON_SetPreheat10 ICON_SetCustomPreheat
#define ICON_Sound ICON_Cool
#define ICON_TBSetup ICON_Contact
#define ICON_UBLActive ICON_HotendTemp
#define ICON_UBLActive ICON_HotendTemp
#define ICON_UBLSlot ICON_ResumeEEPROM
#define ICON_UBLMeshSave ICON_WriteEEPROM
#define ICON_UBLMeshLoad ICON_ReadEEPROM
#define ICON_UBLTiltGrid ICON_PrintSize
#define ICON_UBLSmartFill ICON_StockConfiguration
#define ICON_ZAfterHome ICON_SetEndTemp
#define ICON_CaseLight ICON_Motion
#define ICON_LedControl ICON_Motion
// MPC
#define ICON_MPCNozzle ICON_SetEndTemp
#define ICON_MPCValue ICON_Contact
#define ICON_MPCHeater ICON_Temperature
#define ICON_MPCHeatCap ICON_SetBedTemp
#define ICON_MPCFan ICON_FanSpeed
// Buttons
#define BTN_Continue 85
#define BTN_Cancel 87
@@ -262,18 +303,25 @@ namespace DWINUI {
return t;
}
// Draw an Icon and select library automatically
// BG: The icon background display: false=Background filtering is not displayed, true=Background display
// libID: Icon library ID
// picID: Icon ID
// x/y: Upper-left point
void ICON_Show(bool BG, uint8_t icon, uint16_t x, uint16_t y);
// Draw an Icon with transparent background from the library ICON
// icon: Icon ID
// x/y: Upper-left point
inline void Draw_Icon(uint8_t icon, uint16_t x, uint16_t y) {
DWIN_ICON_Show(ICON, icon, x, y);
ICON_Show(false, icon, x, y);
}
// Draw an Icon from the library ICON with its background
// icon: Icon ID
// x/y: Upper-left point
inline void Draw_IconWB(uint8_t icon, uint16_t x, uint16_t y) {
DWIN_ICON_Show(true, false, false, ICON, icon, x, y);
ICON_Show(true, icon, x, y);
}
// Draw a numeric integer value
+5 -10
View File
@@ -23,17 +23,13 @@
/**
* DWIN Endstops diagnostic page for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 1.2.2
* Date: 2022/02/24
* Version: 1.3.3
* Date: 2022/10/07
*/
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(DWIN_LCD_PROUI)
#include "dwin_defines.h"
#if HAS_ESDIAG
#if BOTH(DWIN_LCD_PROUI, HAS_ESDIAG)
#include "endstop_diag.h"
@@ -64,7 +60,7 @@ void draw_es_label(FSTR_P const flabel=nullptr) {
void draw_es_state(const bool is_hit) {
const uint8_t LM = 130;
DWINUI::cursor.x = LM;
DWIN_Draw_Rectangle(1, HMI_data.PopupBg_color, LM, DWINUI::cursor.y, LM + 100, DWINUI::cursor.y + 20);
DWIN_Draw_Rectangle(1, HMI_data.PopupBg_Color, LM, DWINUI::cursor.y, LM + 100, DWINUI::cursor.y + 20);
is_hit ? DWINUI::Draw_String(RGB(31,31,16), F(STR_ENDSTOP_HIT)) : DWINUI::Draw_String(RGB(16,63,16), F(STR_ENDSTOP_OPEN));
DWINUI::MoveBy(0, 25);
}
@@ -109,5 +105,4 @@ void ESDiagClass::Update() {
DWIN_UpdateLCD();
}
#endif // HAS_ESDIAG
#endif // DWIN_LCD_PROUI
#endif // DWIN_LCD_PROUI && HAS_ESDIAG
+2 -2
View File
@@ -24,8 +24,8 @@
/**
* DWIN End Stops diagnostic page for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 1.2.3
* Date: 2022/02/24
* Version: 1.3.2
* Date: 2022/10/07
*/
class ESDiagClass {
+9 -24
View File
@@ -21,33 +21,15 @@
*/
/**
* DWIN g-code thumbnail preview
* DWIN G-code thumbnail preview
* Author: Miguel A. Risco-Castillo
* version: 2.1
* Date: 2021/06/19
*
* This program 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 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 Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* For commercial applications additional licenses can be requested
* version: 3.1.2
* Date: 2022/09/03
*/
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(DWIN_LCD_PROUI)
#include "dwin_defines.h"
#if HAS_GCODE_PREVIEW
#if BOTH(DWIN_LCD_PROUI, HAS_GCODE_PREVIEW)
#include "../../../core/types.h"
#include "../../marlinui.h"
@@ -246,6 +228,10 @@ void Preview_DrawFromSD() {
}
}
void Preview_Invalidate() {
fileprop.thumbstart = 0;
}
bool Preview_Valid() {
return !!fileprop.thumbstart;
}
@@ -254,5 +240,4 @@ void Preview_Reset() {
fileprop.thumbsize = 0;
}
#endif // HAS_GCODE_PREVIEW
#endif // DWIN_LCD_PROUI
#endif // HAS_GCODE_PREVIEW && DWIN_LCD_PROUI
+16 -9
View File
@@ -1,12 +1,13 @@
/**
* DWIN g-code thumbnail preview
* Author: Miguel A. Risco-Castillo
* version: 2.1
* Date: 2021/06/19
* Marlin 3D Printer Firmware
* Copyright (c) 2022 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 Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the License, or
* 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,
@@ -14,14 +15,20 @@
* 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 Lesser General Public License
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* For commercial applications additional licenses can be requested
*/
#pragma once
/**
* DWIN G-code thumbnail preview
* Author: Miguel A. Risco-Castillo
* version: 3.1.2
* Date: 2022/09/03
*/
void Preview_DrawFromSD();
void Preview_Invalidate();
bool Preview_Valid();
void Preview_Reset();
+4 -9
View File
@@ -23,18 +23,15 @@
/**
* Lock screen implementation for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 2.2.0
* Date: 2022/04/11
* Version: 2.3.2
* Date: 2022/11/20
*/
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(DWIN_LCD_PROUI)
#if BOTH(DWIN_LCD_PROUI, HAS_LOCKSCREEN)
#include "dwin_defines.h"
#if HAS_LOCKSCREEN
#include "dwinui.h"
#include "dwin.h"
#include "lockscreen.h"
@@ -75,6 +72,4 @@ void LockScreenClass::onEncoder(EncoderState encoder_diffState) {
DWIN_UpdateLCD();
}
#endif // HAS_LOCKSCREEN
#endif // DWIN_LCD_PROUI
#endif // DWIN_LCD_PROUI && HAS_LOCKSCREEN
+2 -2
View File
@@ -24,8 +24,8 @@
/**
* Lock screen implementation for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 2.2.0
* Date: 2022/04/11
* Version: 2.3.2
* Date: 2022/11/20
*/
#include "../common/encoder.h"
+147 -154
View File
@@ -23,22 +23,8 @@
/**
* Menu functions for ProUI
* Author: Miguel A. Risco-Castillo
* Version: 1.5.1
* Date: 2022/05/23
*
* This program 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 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 Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* Version: 1.9.1
* Date: 2022/12/02
*/
#include "../../../inc/MarlinConfigPre.h"
@@ -53,22 +39,23 @@
int8_t MenuItemTotal = 0;
int8_t MenuItemCount = 0;
MenuItemClass** MenuItems = nullptr;
CustomMenuItemClass** MenuItems = nullptr;
MenuClass *CurrentMenu = nullptr;
MenuClass *PreviousMenu = nullptr;
void (*onMenuDraw)(MenuClass* menu) = nullptr;
void (*onCursorErase)(const int8_t line) = nullptr;
void (*onCursorDraw)(const int8_t line) = nullptr;
MenuData_t MenuData;
// Menuitem Drawing functions =================================================
void Draw_Title(TitleClass* title) {
DWIN_Draw_Rectangle(1, HMI_data.TitleBg_color, 0, 0, DWIN_WIDTH - 1, TITLE_HEIGHT - 1);
DWIN_Draw_Rectangle(1, HMI_data.TitleBg_Color, 0, 0, DWIN_WIDTH - 1, TITLE_HEIGHT - 1);
if (title->frameid)
DWIN_Frame_AreaCopy(title->frameid, title->frame.left, title->frame.top, title->frame.right, title->frame.bottom, 14, (TITLE_HEIGHT - (title->frame.bottom - title->frame.top)) / 2 - 1);
else
DWIN_Draw_String(false, DWIN_FONT_HEAD, HMI_data.TitleTxt_color, HMI_data.TitleBg_color, 14, (TITLE_HEIGHT - DWINUI::fontHeight(DWIN_FONT_HEAD)) / 2 - 1, title->caption);
#if ENABLED(TITLE_CENTERED)
DWINUI::Draw_CenteredString(false, DWIN_FONT_HEAD, HMI_data.TitleTxt_Color, HMI_data.TitleBg_Color, (TITLE_HEIGHT - DWINUI::fontHeight(DWIN_FONT_HEAD)) / 2 - 1, title->caption);
#else
DWIN_Draw_String(false, DWIN_FONT_HEAD, HMI_data.TitleTxt_Color, HMI_data.TitleBg_Color, 14, (TITLE_HEIGHT - DWINUI::fontHeight(DWIN_FONT_HEAD)) / 2 - 1, title->caption);
#endif
}
void Draw_Menu(MenuClass* menu) {
@@ -78,7 +65,7 @@ void Draw_Menu(MenuClass* menu) {
void Draw_Menu_Cursor(const int8_t line) {
const uint16_t ypos = MYPOS(line);
DWINUI::Draw_Box(1, HMI_data.Cursor_color, {0, ypos, 15, MLINE - 1});
DWINUI::Draw_Box(1, HMI_data.Cursor_Color, {0, ypos, 15, MLINE - 1});
}
void Erase_Menu_Cursor(const int8_t line) {
@@ -86,17 +73,39 @@ void Erase_Menu_Cursor(const int8_t line) {
DWINUI::Draw_Box(1, HMI_data.Background_Color, {0, ypos, 15, MLINE - 1});
}
void Draw_Menu_Line(const uint8_t line, const uint8_t icon /*=0*/, const char * const label /*=nullptr*/, bool more /*=false*/) {
void Erase_Menu_Text(const int8_t line) {
if (line < 0 || line >= TROWS) return;
const uint16_t ypos = MYPOS(line) + 1;
DWINUI::Draw_Box(1, HMI_data.Background_Color, {LBLX, ypos, DWIN_WIDTH - LBLX, MLINE - 2});
}
void Draw_Menu_Line(const uint8_t line, const uint8_t icon /*=0*/, const char * const label /*=nullptr*/, bool more /*=false*/, bool selected /*=false*/) {
if (icon) DWINUI::Draw_Icon(icon, ICOX, MBASE(line) - 3);
if (label) DWINUI::Draw_String(LBLX, MBASE(line) - 1, (char*)label);
if (more) DWINUI::Draw_Icon(ICON_More, VALX + 16, MBASE(line) - 3);
if (selected) Draw_Menu_Cursor(line);
DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240);
}
void Draw_Menu_Line(const uint8_t line, const uint8_t icon /*=0*/, FSTR_P label /*=nullptr*/, bool more /*=false*/, bool selected /*=false*/) {
Draw_Menu_Line(line, icon, FTOP(label), more, selected);
}
void Draw_Chkb_Line(const uint8_t line, const bool checked) {
DWINUI::Draw_Checkbox(HMI_data.Text_Color, HMI_data.Background_Color, VALX + 3 * DWINUI::fontWidth(), MBASE(line) - 1, checked);
}
void Show_Chkb_Line(const bool checked) {
const uint8_t line = CurrentMenu->line();
DWINUI::Draw_Checkbox(HMI_data.Text_Color, HMI_data.Background_Color, VALX + 3 * DWINUI::fontWidth(), MBASE(line) - 1, checked);
DWIN_UpdateLCD();
}
void Toggle_Chkb_Line(bool &checked) {
checked = !checked;
Show_Chkb_Line(checked);
}
void Draw_Menu_IntValue(uint16_t bcolor, const uint8_t line, uint8_t iNum, const int32_t value /*=0*/) {
DWINUI::Draw_Signed_Int(HMI_data.Text_Color, bcolor, iNum , VALX, MBASE(line) - 1, value);
}
@@ -140,22 +149,11 @@ void onDrawFloatMenu(MenuItemClass* menuitem, int8_t line, uint8_t dp, const flo
DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Background_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(line), value);
}
void onDrawPFloatMenu(MenuItemClass* menuitem, int8_t line) {
void onDrawPFloatMenu(MenuItemClass* menuitem, int8_t line, uint8_t dp) {
const float value = *(float*)static_cast<MenuItemPtrClass*>(menuitem)->value;
const int8_t dp = UNITFDIGITS;
onDrawFloatMenu(menuitem, line, dp, value);
}
void onDrawPFloat2Menu(MenuItemClass* menuitem, int8_t line) {
const float value = *(float*)static_cast<MenuItemPtrClass*>(menuitem)->value;
onDrawFloatMenu(menuitem, line, 2, value);
}
void onDrawPFloat3Menu(MenuItemClass* menuitem, int8_t line) {
const float value = *(float*)static_cast<MenuItemPtrClass*>(menuitem)->value;
onDrawFloatMenu(menuitem, line, 3, value);
}
void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line, bool checked) {
onDrawMenuItem(menuitem, line);
Draw_Chkb_Line(line, checked);
@@ -166,13 +164,15 @@ void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line) {
onDrawChkbMenu(menuitem, line, val);
}
void DrawItemEdit() {
void DrawItemEdit(const bool selected) {
const uint16_t bcolor = selected ? HMI_data.Selected_Color : HMI_data.Background_Color;
const uint8_t iNum = 4 - ((MenuData.dp > 0) ? (MenuData.dp - 1) : 0);
switch (checkkey) {
case SetIntNoDraw: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break;
case SetInt:
case SetPInt: DWINUI::Draw_Signed_Int(HMI_data.Text_Color, HMI_data.Selected_Color, 4 , VALX, MBASE(CurrentMenu->line()) - 1, MenuData.Value); break;
case SetPInt: DWINUI::Draw_Signed_Int(HMI_data.Text_Color, bcolor, iNum , VALX, MBASE(CurrentMenu->line()) - 1, MenuData.Value); break;
case SetFloat:
case SetPFloat: DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Selected_Color, 3, MenuData.dp, VALX - MenuData.dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), MenuData.Value / POW(10, MenuData.dp)); break;
case SetPFloat: DWINUI::Draw_Signed_Float(HMI_data.Text_Color, bcolor, iNum, MenuData.dp, VALX - 2 * DWINUI::fontWidth(), MBASE(CurrentMenu->line()), MenuData.Value / POW(10, MenuData.dp)); break;
default: break;
}
}
@@ -209,7 +209,7 @@ void SetOnClick(uint8_t process, const int32_t lo, const int32_t hi, uint8_t dp,
// Apply: update function when the encoder is pressed
void SetValueOnClick(uint8_t process, const int32_t lo, const int32_t hi, const int32_t val, void (*Apply)() /*= nullptr*/, void (*LiveUpdate)() /*= nullptr*/) {
SetOnClick(process, lo, hi, 0, val, Apply, LiveUpdate);
Draw_Menu_IntValue(HMI_data.Selected_Color, CurrentMenu->line(), 4, MenuData.Value);
DrawItemEdit(true);
}
// Generic onclick event for float values
@@ -222,7 +222,7 @@ void SetValueOnClick(uint8_t process, const int32_t lo, const int32_t hi, const
void SetValueOnClick(uint8_t process, const float lo, const float hi, uint8_t dp, const float val, void (*Apply)() /*= nullptr*/, void (*LiveUpdate)() /*= nullptr*/) {
const int32_t value = round(val * POW(10, dp));
SetOnClick(process, lo * POW(10, dp), hi * POW(10, dp), dp, value, Apply, LiveUpdate);
DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Selected_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), val);
DrawItemEdit(true);
}
// Generic onclick event for integer values
@@ -271,8 +271,8 @@ void SetPFloatOnClick(const float lo, const float hi, uint8_t dp, void (*Apply)(
// Generic menu control using the encoder
void HMI_Menu() {
EncoderState encoder_diffState = get_encoder_state();
if (encoder_diffState == ENCODER_DIFF_NO) return;
if (CurrentMenu) {
if (encoder_diffState == ENCODER_DIFF_NO) return;
if (encoder_diffState == ENCODER_DIFF_ENTER)
CurrentMenu->onClick();
else
@@ -280,65 +280,46 @@ void HMI_Menu() {
}
}
// Get an integer value using the encoder without draw anything
// lo: low limit
// hi: high limit
// Get a value using the encoder
// draw : draw the value
// Return value:
// 0 : no change
// 1 : live change
// 2 : apply change
int8_t HMI_GetIntNoDraw(const int32_t lo, const int32_t hi) {
int8_t HMI_Get(bool draw) {
const int32_t lo = MenuData.MinValue;
const int32_t hi = MenuData.MaxValue;
const int32_t cval = MenuData.Value;
EncoderState encoder_diffState = Encoder_ReceiveAnalyze();
EncoderState encoder_diffState = get_encoder_state();
if (encoder_diffState != ENCODER_DIFF_NO) {
if (Apply_Encoder(encoder_diffState, MenuData.Value)) {
EncoderRate.enabled = false;
if (draw) DrawItemEdit(false);
checkkey = Menu;
return 2;
}
LIMIT(MenuData.Value, lo, hi);
}
return int8_t(cval != MenuData.Value);
const bool change = cval != MenuData.Value;
if (change) DrawItemEdit(true);
return int8_t(change);
}
// Get an integer value using the encoder
// lo: low limit
// hi: high limit
// Return value:
// 0 : no change
// 1 : live change
// 2 : apply change
int8_t HMI_GetInt(const int32_t lo, const int32_t hi) {
EncoderState encoder_diffState = Encoder_ReceiveAnalyze();
if (encoder_diffState != ENCODER_DIFF_NO) {
if (Apply_Encoder(encoder_diffState, MenuData.Value)) {
EncoderRate.enabled = false;
DWINUI::Draw_Signed_Int(HMI_data.Text_Color, HMI_data.Background_Color, 4 , VALX, MBASE(CurrentMenu->line()) - 1, MenuData.Value);
checkkey = Menu;
return 2;
}
LIMIT(MenuData.Value, lo, hi);
DrawItemEdit();
return 1;
}
return 0;
}
// Set an integer using the encoder
void HMI_SetInt() {
int8_t val = HMI_GetInt(MenuData.MinValue, MenuData.MaxValue);
// Set and draw a value using the encoder
void HMI_SetDraw() {
int8_t val = HMI_Get(true);
switch (val) {
case 0: return; break;
case 0: return;
case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break;
case 2: if (MenuData.Apply) MenuData.Apply(); break;
}
}
// Set an integer without drawing
void HMI_SetIntNoDraw() {
int8_t val = HMI_GetIntNoDraw(MenuData.MinValue, MenuData.MaxValue);
// Set an value without drawing
void HMI_SetNoDraw() {
int8_t val = HMI_Get(false);
switch (val) {
case 0: return; break;
case 0: return;
case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break;
case 2: if (MenuData.Apply) MenuData.Apply(); break;
}
@@ -346,7 +327,7 @@ void HMI_SetIntNoDraw() {
// Set an integer pointer variable using the encoder
void HMI_SetPInt() {
int8_t val = HMI_GetInt(MenuData.MinValue, MenuData.MaxValue);
int8_t val = HMI_Get(true);
switch (val) {
case 0: return;
case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break;
@@ -354,43 +335,9 @@ void HMI_SetPInt() {
}
}
// Get a scaled float value using the encoder
// dp: decimal places
// lo: scaled low limit
// hi: scaled high limit
// Return value:
// 0 : no change
// 1 : live change
// 2 : apply change
int8_t HMI_GetFloat(uint8_t dp, int32_t lo, int32_t hi) {
EncoderState encoder_diffState = Encoder_ReceiveAnalyze();
if (encoder_diffState != ENCODER_DIFF_NO) {
if (Apply_Encoder(encoder_diffState, MenuData.Value)) {
EncoderRate.enabled = false;
DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Background_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), MenuData.Value / POW(10, dp));
checkkey = Menu;
return 2;
}
LIMIT(MenuData.Value, lo, hi);
DrawItemEdit();
return 1;
}
return 0;
}
// Set a scaled float using the encoder
void HMI_SetFloat() {
const int8_t val = HMI_GetFloat(MenuData.dp, MenuData.MinValue, MenuData.MaxValue);
switch (val) {
case 0: return;
case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break;
case 2: if (MenuData.Apply) MenuData.Apply(); break;
}
}
// Set a scaled float pointer variable using the encoder
void HMI_SetPFloat() {
const int8_t val = HMI_GetFloat(MenuData.dp, MenuData.MinValue, MenuData.MaxValue);
const int8_t val = HMI_Get(true);
switch (val) {
case 0: return;
case 1: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break;
@@ -398,7 +345,7 @@ void HMI_SetPFloat() {
}
}
// Menu Classes ===============================================================
// Menu Class ===============================================================
MenuClass::MenuClass() {
selected = 0;
@@ -407,10 +354,10 @@ MenuClass::MenuClass() {
void MenuClass::draw() {
MenuTitle.draw();
if (onMenuDraw != nullptr) onMenuDraw(this);
Draw_Menu(this);
for (int8_t i = 0; i < MenuItemCount; i++)
MenuItems[i]->draw(i - topline);
if (onCursorDraw != nullptr) onCursorDraw(line());
Draw_Menu_Cursor(line());
DWIN_UpdateLCD();
}
@@ -419,7 +366,7 @@ void MenuClass::onScroll(bool dir) {
if (dir) sel++; else sel--;
LIMIT(sel, 0, MenuItemCount - 1);
if (sel != selected) {
if (onCursorErase != nullptr) onCursorErase(line());
Erase_Menu_Cursor(line());
DWIN_UpdateLCD();
if ((sel - topline) == TROWS) {
DWIN_Frame_AreaMove(1, DWIN_SCROLL_UP, MLINE, DWINUI::backcolor, 0, TITLE_HEIGHT + 1, DWIN_WIDTH, STATUS_Y - 1);
@@ -432,7 +379,7 @@ void MenuClass::onScroll(bool dir) {
MenuItems[sel]->draw(0);
}
selected = sel;
if (onCursorDraw != nullptr) onCursorDraw(line());
Draw_Menu_Cursor(line());
DWIN_UpdateLCD();
}
}
@@ -441,11 +388,11 @@ void MenuClass::onClick() {
if (MenuItems[selected]->onClick != nullptr) (*MenuItems[selected]->onClick)();
}
MenuItemClass *MenuClass::SelectedItem() {
CustomMenuItemClass *MenuClass::SelectedItem() {
return MenuItems[selected];
}
MenuItemClass** MenuClass::Items() {
CustomMenuItemClass** MenuClass::Items() {
return MenuItems;
}
@@ -455,40 +402,47 @@ int8_t MenuClass::count() {
/* MenuItem Class ===========================================================*/
MenuItemClass::MenuItemClass(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)()) {
icon = cicon;
onClick = onclick;
onDraw = ondraw;
const uint8_t len = _MIN(sizeof(caption) - 1, strlen(text));
memcpy(&caption[0], text, len);
caption[len] = '\0';
void CustomMenuItemClass::draw(int8_t line) {
if (line < 0 || line >= TROWS) return;
if (onDraw != nullptr) (*onDraw)(static_cast<MenuItemClass*>(this), line);
};
void CustomMenuItemClass::redraw(bool erase /*=false*/) {
const int8_t line = CurrentMenu->line(this->pos);
if (erase) Erase_Menu_Text(line);
draw(line);
}
MenuItemClass::MenuItemClass(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)()) {
icon = cicon;
CustomMenuItemClass::CustomMenuItemClass(OnDrawItem ondraw, OnClickItem onclick) {
onClick = onclick;
onDraw = ondraw;
onDraw = ondraw;
}
MenuItemClass::MenuItemClass(uint8_t cicon, const char * const text, OnDrawItem ondraw, OnClickItem onclick) : CustomMenuItemClass(ondraw, onclick) {
icon = cicon;
SetCaption(text);
}
MenuItemClass::MenuItemClass(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, OnDrawItem ondraw, OnClickItem onclick) : CustomMenuItemClass(ondraw, onclick) {
icon = cicon;
caption[0] = '\0';
frameid = id;
frame = { x1, y1, x2, y2 };
}
void MenuItemClass::SetCaption(const char * const text) {
const uint8_t len = _MIN(sizeof(caption) - 1, strlen(text));
memcpy(&caption[0], text, len);
caption[len] = '\0';
}
void MenuItemClass::SetFrame(uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) {
caption[0] = '\0';
frameid = id;
frame = { x1, y1, x2, y2 };
}
void MenuItemClass::draw(int8_t line) {
if (!WITHIN(line, 0, TROWS - 1)) return;
if (onDraw != nullptr) (*onDraw)(this, line);
};
void MenuItemClass::redraw() {
draw(CurrentMenu->line(this->pos));
}
MenuItemPtrClass::MenuItemPtrClass(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val) : MenuItemClass(cicon, text, ondraw, onclick) {
MenuItemPtrClass::MenuItemPtrClass(uint8_t cicon, const char * const text, OnDrawItem ondraw, OnClickItem onclick, void* val) : MenuItemClass(cicon, text, ondraw, onclick) {
value = val;
};
@@ -505,40 +459,58 @@ void MenuItemsClear() {
void MenuItemsPrepare(int8_t totalitems) {
MenuItemsClear();
MenuItemTotal = totalitems;
MenuItems = new MenuItemClass*[totalitems];
MenuItemTotal = _MIN(totalitems, MENU_MAX_ITEMS);
MenuItems = new CustomMenuItemClass*[totalitems];
}
MenuItemClass* MenuItemsAdd(MenuItemClass* menuitem) {
bool IsMenu(MenuClass* _menu) {
return ((checkkey == Menu) && !!CurrentMenu && (CurrentMenu == _menu));
}
template<typename T>
T* MenuItemAdd(T* menuitem) {
MenuItems[MenuItemCount] = menuitem;
menuitem->pos = MenuItemCount++;
return menuitem;
}
MenuItemClass* MenuItemsAdd(uint8_t cicon, const char * const text/*=nullptr*/, void (*ondraw)(MenuItemClass* menuitem, int8_t line)/*=nullptr*/, void (*onclick)()/*=nullptr*/) {
CustomMenuItemClass* MenuItemAdd(OnDrawItem ondraw/*=nullptr*/, OnClickItem onclick/*=nullptr*/) {
if (MenuItemCount < MenuItemTotal) {
CustomMenuItemClass* menuitem = new CustomMenuItemClass(ondraw, onclick);
return MenuItemAdd(menuitem);
}
else return nullptr;
}
MenuItemClass* MenuItemAdd(uint8_t cicon, const char * const text/*=nullptr*/, OnDrawItem ondraw/*=nullptr*/, OnClickItem onclick/*=nullptr*/) {
if (MenuItemCount < MenuItemTotal) {
MenuItemClass* menuitem = new MenuItemClass(cicon, text, ondraw, onclick);
return MenuItemsAdd(menuitem);
return MenuItemAdd(menuitem);
}
else return nullptr;
}
MenuItemClass* MenuItemsAdd(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void (*ondraw)(MenuItemClass* menuitem, int8_t line)/*=nullptr*/, void (*onclick)()/*=nullptr*/) {
MenuItemClass* MenuItemAdd(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, OnDrawItem ondraw/*=nullptr*/, OnClickItem onclick/*=nullptr*/) {
if (MenuItemCount < MenuItemTotal) {
MenuItemClass* menuitem = new MenuItemClass(cicon, id, x1, y1, x2, y2, ondraw, onclick);
return MenuItemsAdd(menuitem);
return MenuItemAdd(menuitem);
}
else return nullptr;
}
MenuItemClass* MenuItemsAdd(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val) {
MenuItemClass* EditItemAdd(uint8_t cicon, const char * const text, OnDrawItem ondraw, OnClickItem onclick, void* val) {
if (MenuItemCount < MenuItemTotal) {
MenuItemClass* menuitem = new MenuItemPtrClass(cicon, text, ondraw, onclick, val);
return MenuItemsAdd(menuitem);
return MenuItemAdd(menuitem);
}
else return nullptr;
}
void InitMenu() {
PreviousMenu = nullptr;
InvalidateMenu();
}
bool SetMenu(MenuClass* &menu, FSTR_P title, int8_t totalitems) {
if (!menu) menu = new MenuClass();
const bool NotCurrent = (CurrentMenu != menu);
@@ -549,6 +521,27 @@ bool SetMenu(MenuClass* &menu, FSTR_P title, int8_t totalitems) {
return NotCurrent;
}
bool SetMenu(MenuClass* &menu, frame_rect_t cn, FSTR_P title, int8_t totalitems) {
if (!menu) menu = new MenuClass();
const bool NotCurrent = (CurrentMenu != menu);
if (NotCurrent) {
if (cn.w != 0)
menu->MenuTitle.SetFrame(cn.x, cn.y, cn.w, cn.h);
else
menu->MenuTitle.SetCaption(title);
MenuItemsPrepare(totalitems);
}
return NotCurrent;
}
void InvalidateMenu() {
if (CurrentMenu) {
CurrentMenu->topline = 0;
CurrentMenu->selected = 0;
CurrentMenu = nullptr;
}
}
void UpdateMenu(MenuClass* &menu) {
if (!menu) return;
if (CurrentMenu != menu) {
@@ -558,9 +551,9 @@ void UpdateMenu(MenuClass* &menu) {
menu->draw();
}
void ReDrawMenu(const bool force/*=false*/) {
if (CurrentMenu && (force || checkkey == Menu)) CurrentMenu->draw();
if (force) DrawItemEdit();
void ReDrawMenu(bool force /*= false*/) {
if (CurrentMenu && (force || checkkey==Menu)) CurrentMenu->draw();
if (force) DrawItemEdit(true);
}
#endif // DWIN_LCD_PROUI
+74 -56
View File
@@ -19,31 +19,20 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* Menu functions for ProUI
* Author: Miguel A. Risco-Castillo
* Version: 1.5.1
* Date: 2022/05/23
*
* This program 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 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 Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* Version: 1.9.1
* Date: 2022/12/02
*/
#pragma once
#include "dwinui.h"
#define MENU_CHAR_LIMIT 24
#define MENU_MAX_ITEMS TERN(SDSORT_LIMIT, SDSORT_LIMIT, 64)
typedef struct {
int32_t MaxValue = 0; // Auxiliar max integer/scaled float value
int32_t MinValue = 0; // Auxiliar min integer/scaled float value
@@ -56,46 +45,60 @@ typedef struct {
} MenuData_t;
extern MenuData_t MenuData;
extern void (*onCursorErase)(const int8_t line);
extern void (*onCursorDraw)(const int8_t line);
// Auxiliary Macros ===========================================================
// Create and add a MenuItem object to the menu array
#define BACK_ITEM(H) MenuItemsAdd(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, H)
#define MENU_ITEM(V...) MenuItemsAdd(V)
#define EDIT_ITEM(V...) MenuItemsAdd(V)
#define MENU_ITEM_F(I,L,V...) MenuItemsAdd(I, GET_TEXT_F(L), V)
#define EDIT_ITEM_F(I,L,V...) MenuItemsAdd(I, GET_TEXT_F(L), V)
#define SET_MENU(I,L,V) SetMenu(I, GET_TEXT_F(L), V)
#define SET_MENU_F(I,L,V) SetMenu(I, F(L), V)
#define SET_MENU_R(I,R,L,V) SetMenu(I, R, GET_TEXT_F(L), V)
#define BACK_ITEM(H) MenuItemAdd(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, H)
#define MENU_ITEM(I,L,V...) MenuItemAdd(I, GET_TEXT_F(L), V)
#define EDIT_ITEM(I,L,V...) EditItemAdd(I, GET_TEXT_F(L), V)
#define MENU_ITEM_F(I,L,V...) MenuItemAdd(I, F(L), V)
#define EDIT_ITEM_F(I,L,V...) EditItemAdd(I, F(L), V)
// Menu Classes ===============================================================
class MenuItemClass {
protected:
class CustomMenuItemClass;
class MenuItemClass;
typedef void (*OnDrawCustomItem)(CustomMenuItemClass* menuitem, int8_t line);
typedef void (*OnDrawItem)(MenuItemClass* menuitem, int8_t line);
typedef void (*OnClickItem)();
class CustomMenuItemClass {
public:
int8_t pos = 0;
OnDrawItem onDraw = nullptr;
void (*onClick)() = nullptr;
CustomMenuItemClass() {};
CustomMenuItemClass(OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr);
virtual ~CustomMenuItemClass(){};
virtual void draw(int8_t line);
void redraw(bool erase=false);
};
class MenuItemClass: public CustomMenuItemClass {
public:
uint8_t icon = 0;
char caption[32] = "";
char caption[MENU_CHAR_LIMIT] = "";
uint8_t frameid = 0;
rect_t frame = {0};
void (*onDraw)(MenuItemClass* menuitem, int8_t line) = nullptr;
void (*onClick)() = nullptr;
MenuItemClass() {};
MenuItemClass(uint8_t cicon, const char * const text=nullptr, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr);
// MenuItemClass(uint8_t cicon, FSTR_P text = nullptr, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr) : MenuItemClass(cicon, FTOP(text), ondraw, onclick){}
MenuItemClass(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr);
using CustomMenuItemClass::CustomMenuItemClass;
MenuItemClass(uint8_t cicon, const char * const text=nullptr, OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr);
MenuItemClass(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr);
void SetFrame(uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
virtual ~MenuItemClass(){};
virtual void draw(int8_t line);
void redraw();
void SetCaption(const char * const text = nullptr);
};
class MenuItemPtrClass: public MenuItemClass {
public:
void *value = nullptr;
using MenuItemClass::MenuItemClass;
MenuItemPtrClass(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val);
MenuItemPtrClass(uint8_t cicon, FSTR_P text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val) : MenuItemPtrClass(cicon, FTOP(text), ondraw, onclick, val){}
MenuItemPtrClass(uint8_t cicon, const char * const text, OnDrawItem ondraw, OnClickItem onclick, void* val);
MenuItemPtrClass(uint8_t cicon, FSTR_P text, OnDrawItem ondraw, OnClickItem onclick, void* val) : MenuItemPtrClass(cicon, FTOP(text), ondraw, onclick, val){}
};
class MenuClass {
@@ -111,12 +114,11 @@ public:
virtual void draw();
virtual void onScroll(bool dir);
void onClick();
MenuItemClass* SelectedItem();
static MenuItemClass** Items();
CustomMenuItemClass* SelectedItem();
static CustomMenuItemClass** Items();
};
extern MenuClass *CurrentMenu;
extern MenuClass *PreviousMenu;
extern void (*onMenuDraw)(MenuClass* menu);
// Menuitem Drawing functions =================================================
@@ -124,8 +126,12 @@ void Draw_Title(TitleClass* title);
void Draw_Menu(MenuClass* menu);
void Draw_Menu_Cursor(const int8_t line);
void Erase_Menu_Cursor(const int8_t line);
void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char * const label=nullptr, bool more=false);
void Erase_Menu_Text(const int8_t line);
void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char * const label=nullptr, bool more=false, bool selected=false);
void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, FSTR_P label=nullptr, bool more=false, bool selected=false);
void Draw_Chkb_Line(const uint8_t line, const bool checked);
void Show_Chkb_Line(const bool checked);
void Toggle_Chkb_Line(bool &checked);
void Draw_Menu_IntValue(uint16_t bcolor, const uint8_t line, uint8_t iNum, const int32_t value=0);
void onDrawMenuItem(MenuItemClass* menuitem, int8_t line);
void onDrawSubMenu(MenuItemClass* menuitem, int8_t line);
@@ -134,9 +140,11 @@ void onDrawPIntMenu(MenuItemClass* menuitem, int8_t line);
void onDrawPInt8Menu(MenuItemClass* menuitem, int8_t line);
void onDrawPInt32Menu(MenuItemClass* menuitem, int8_t line);
void onDrawFloatMenu(MenuItemClass* menuitem, int8_t line, uint8_t dp, const float value);
void onDrawPFloatMenu(MenuItemClass* menuitem, int8_t line);
void onDrawPFloat2Menu(MenuItemClass* menuitem, int8_t line);
void onDrawPFloat3Menu(MenuItemClass* menuitem, int8_t line);
void onDrawPFloatMenu(MenuItemClass* menuitem, int8_t line, uint8_t dp);
inline void onDrawPFloatMenu(MenuItemClass* menuitem, int8_t line) { onDrawPFloatMenu(menuitem, line, UNITFDIGITS); };
inline void onDrawPFloat2Menu(MenuItemClass* menuitem, int8_t line) { onDrawPFloatMenu(menuitem, line, 2); };
inline void onDrawPFloat3Menu(MenuItemClass* menuitem, int8_t line) { onDrawPFloatMenu(menuitem, line, 3); };
inline void onDrawPFloat4Menu(MenuItemClass* menuitem, int8_t line) { onDrawPFloatMenu(menuitem, line, 4); };
void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line, bool checked);
void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line);
@@ -153,22 +161,28 @@ void SetPFloatOnClick(const float lo, const float hi, uint8_t dp, void (*Apply)(
// HMI user control functions =================================================
void HMI_Menu();
void HMI_SetInt();
void HMI_SetDraw();
void HMI_SetNoDraw();
void HMI_SetPInt();
void HMI_SetIntNoDraw();
void HMI_SetFloat();
void HMI_SetPFloat();
// Menu auxiliary functions ===================================================
// Initialize menu
void InitMenu();
// Create a new menu
bool SetMenu(MenuClass* &menu, FSTR_P title, int8_t totalitems);
bool SetMenu(MenuClass* &menu, frame_rect_t cn, FSTR_P title, int8_t totalitems);
// Invalidate CurrentMenu to prepare for full menu drawing
void InvalidateMenu();
//Update the Menu and Draw if it is valid
void UpdateMenu(MenuClass* &menu);
//Redraw the current Menu if it is valid
void ReDrawMenu(const bool force=false);
void ReDrawMenu(bool force = false);
// Clear MenuItems array and free MenuItems elements
void MenuItemsClear();
@@ -176,13 +190,17 @@ void MenuItemsClear();
// Prepare MenuItems array
void MenuItemsPrepare(int8_t totalitems);
// Is the current menu = menu?
bool IsMenu(MenuClass* menu);
// Add elements to the MenuItems array
MenuItemClass* MenuItemsAdd(uint8_t cicon, const char * const text=nullptr, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr);
inline MenuItemClass* MenuItemsAdd(uint8_t cicon, FSTR_P text = nullptr, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr) {
return MenuItemsAdd(cicon, FTOP(text), ondraw, onclick);
CustomMenuItemClass* MenuItemAdd(OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr);
MenuItemClass* MenuItemAdd(uint8_t cicon, const char * const text=nullptr, OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr);
inline MenuItemClass* MenuItemAdd(uint8_t cicon, FSTR_P text = nullptr, OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr) {
return MenuItemAdd(cicon, FTOP(text), ondraw, onclick);
}
MenuItemClass* MenuItemsAdd(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, void (*ondraw)(MenuItemClass* menuitem, int8_t line)=nullptr, void (*onclick)()=nullptr);
MenuItemClass* MenuItemsAdd(uint8_t cicon, const char * const text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val);
inline MenuItemClass* MenuItemsAdd(uint8_t cicon, FSTR_P text, void (*ondraw)(MenuItemClass* menuitem, int8_t line), void (*onclick)(), void* val) {
return MenuItemsAdd(cicon, FTOP(text), ondraw, onclick, val);
MenuItemClass* MenuItemAdd(uint8_t cicon, uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, OnDrawItem ondraw=nullptr, OnClickItem onclick=nullptr);
MenuItemClass* EditItemAdd(uint8_t cicon, const char * const text, OnDrawItem ondraw, OnClickItem onclick, void* val);
inline MenuItemClass* EditItemAdd(uint8_t cicon, FSTR_P text, OnDrawItem ondraw, OnClickItem onclick, void* val) {
return EditItemAdd(cicon, FTOP(text), ondraw, onclick, val);
}
+3 -3
View File
@@ -113,8 +113,8 @@ void MeshViewerClass::Draw(bool withsave /*= false*/) {
Title.ShowCaption(GET_TEXT_F(MSG_MESH_VIEWER));
#if USE_UBL_VIEWER
DWINUI::ClearMainArea();
BedLevelTools.viewer_print_value = true;
BedLevelTools.Draw_Bed_Mesh(-1, 1, 8, 10 + TITLE_HEIGHT);
bedLevelTools.viewer_print_value = true;
bedLevelTools.Draw_Bed_Mesh(-1, 1, 8, 10 + TITLE_HEIGHT);
#else
DrawMesh(bedlevel.z_values, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y);
#endif
@@ -127,7 +127,7 @@ void MeshViewerClass::Draw(bool withsave /*= false*/) {
DWINUI::Draw_Button(BTN_Continue, 86, 305);
#if USE_UBL_VIEWER
BedLevelTools.Set_Mesh_Viewer_Status();
bedLevelTools.Set_Mesh_Viewer_Status();
#else
char str_1[6], str_2[6] = "";
ui.status_printf(0, F("Mesh minZ: %s, maxZ: %s"),
+10 -32
View File
@@ -23,35 +23,15 @@
/**
* DWIN Single var plot
* Author: Miguel A. Risco-Castillo
* Version: 2.0
* Date: 2022/01/31
*
* This program 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 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 Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* For commercial applications additional licenses can be requested
* Version: 2.1.2
* Date: 2022/11/20
*/
#include "../../../inc/MarlinConfigPre.h"
#include "../../../inc/MarlinConfig.h"
#ifdef DWIN_LCD_PROUI
#include "dwin_defines.h"
#if HAS_PIDPLOT
#if BOTH(DWIN_LCD_PROUI, SHOW_TUNING_GRAPH)
#include "plot.h"
#include "../../../core/types.h"
#include "../../marlinui.h"
#include "dwin_lcd.h"
@@ -60,13 +40,13 @@
#define Plot_Bg_Color RGB( 1, 12, 8)
PlotClass Plot;
PlotClass plot;
uint16_t grphpoints, r, x2, y2 = 0;
frame_rect_t grphframe = {0};
float scale = 0;
void PlotClass::Draw(const frame_rect_t frame, const float max, const float ref) {
void PlotClass::Draw(const frame_rect_t &frame, const celsius_t max, const_float_t ref/*=0*/) {
grphframe = frame;
grphpoints = 0;
scale = frame.h / max;
@@ -74,14 +54,14 @@ void PlotClass::Draw(const frame_rect_t frame, const float max, const float ref)
y2 = frame.y + frame.h - 1;
r = round((y2) - ref * scale);
DWINUI::Draw_Box(1, Plot_Bg_Color, frame);
for (uint8_t i = 1; i < 4; i++) if (i * 50 < frame.w) DWIN_Draw_VLine(Line_Color, i * 50 + frame.x, frame.y, frame.h);
for (uint8_t i = 1; i < 4; i++) if (i * 50 < frame.w) DWIN_Draw_VLine(Line_Color, i * 50 + frame.x, frame.y, frame.h);
DWINUI::Draw_Box(0, Color_White, DWINUI::ExtendFrame(frame, 1));
DWIN_Draw_HLine(Color_Red, frame.x, r, frame.w);
}
void PlotClass::Update(const float value) {
void PlotClass::Update(const_float_t value) {
if (!scale) return;
uint16_t y = round((y2) - value * scale);
const uint16_t y = round((y2) - value * scale);
if (grphpoints < grphframe.w) {
DWIN_Draw_Point(Color_Yellow, 1, 1, grphpoints + grphframe.x, y);
}
@@ -94,6 +74,4 @@ void PlotClass::Update(const float value) {
grphpoints++;
}
#endif // HAS_PIDPLOT
#endif // DWIN_LCD_PROUI
#endif // DWIN_LCD_PROUI && SHOW_TUNING_GRAPH
+6 -21
View File
@@ -19,36 +19,21 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* DWIN Single var plot
* Author: Miguel A. Risco-Castillo
* Version: 1.0
* Date: 2022/01/30
*
* This program 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 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 Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* For commercial applications additional licenses can be requested
* Version: 2.1.2
* Date: 2022/11/20
*/
#pragma once
#include "dwinui.h"
class PlotClass {
public:
void Draw(frame_rect_t frame, float max, float ref = 0);
void Update(float value);
static void Draw(const frame_rect_t &frame, const celsius_t max, const_float_t ref=0);
static void Update(const_float_t value);
};
extern PlotClass Plot;
extern PlotClass plot;
+10 -2
View File
@@ -23,8 +23,8 @@
/**
* Print Stats page for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 1.3.0
* Date: 2022/02/24
* Version: 1.4.2
* Date: 2022/12/03
*/
#include "../../../inc/MarlinConfigPre.h"
@@ -79,4 +79,12 @@ void Goto_PrintStats() {
HMI_SaveProcessID(WaitResponse);
}
// Print Stats Reset popup
void Popup_ResetStats() { DWIN_Popup_ConfirmCancel(ICON_Info_0, GET_TEXT_F(MSG_RESET_STATS)); }
void OnClick_ResetStats() {
if (HMI_flag.select_flag) PrintStatsClass::Reset();
HMI_ReturnScreen();
}
void PrintStatsReset() { Goto_Popup(Popup_ResetStats, OnClick_ResetStats); }
#endif // DWIN_LCD_PROUI && PRINTCOUNTER
+3 -2
View File
@@ -24,8 +24,8 @@
/**
* Print Stats page for PRO UI
* Author: Miguel A. Risco-Castillo (MRISCOC)
* Version: 1.3.0
* Date: 2022/02/24
* Version: 1.4.2
* Date: 2022/12/03
*/
class PrintStatsClass {
@@ -37,3 +37,4 @@ public:
extern PrintStatsClass PrintStats;
void Goto_PrintStats();
void PrintStatsReset();
+4 -4
View File
@@ -46,12 +46,12 @@ extern const struct DGUS_VP_Variable ListOfVP[];
#include "../../../inc/MarlinConfig.h"
#if ENABLED(DGUS_LCD_UI_ORIGIN)
#if DGUS_LCD_UI_ORIGIN
#include "origin/DGUSDisplayDef.h"
#elif ENABLED(DGUS_LCD_UI_MKS)
#elif DGUS_LCD_UI_MKS
#include "mks/DGUSDisplayDef.h"
#elif ENABLED(DGUS_LCD_UI_FYSETC)
#elif DGUS_LCD_UI_FYSETC
#include "fysetc/DGUSDisplayDef.h"
#elif ENABLED(DGUS_LCD_UI_HIPRECY)
#elif DGUS_LCD_UI_HIPRECY
#include "hiprecy/DGUSDisplayDef.h"
#endif
@@ -295,11 +295,11 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var)
// Don't let the user in the dark why there is no reaction.
if (!ExtUI::isMediaInserted()) {
setstatusmessagePGM(GET_TEXT(MSG_NO_MEDIA));
setstatusmessage(GET_TEXT_F(MSG_NO_MEDIA));
return;
}
if (card.flag.abort_sd_printing) {
setstatusmessagePGM(GET_TEXT(MSG_MEDIA_ABORTING));
setstatusmessage(GET_TEXT_F(MSG_MEDIA_ABORTING));
return;
}
}
@@ -46,13 +46,13 @@
#define BE16_P(V) ( ((uint8_t*)(V))[0] << 8U | ((uint8_t*)(V))[1] )
#define BE32_P(V) ( ((uint8_t*)(V))[0] << 24U | ((uint8_t*)(V))[1] << 16U | ((uint8_t*)(V))[2] << 8U | ((uint8_t*)(V))[3] )
#if ENABLED(DGUS_LCD_UI_ORIGIN)
#if DGUS_LCD_UI_ORIGIN
#include "origin/DGUSScreenHandler.h"
#elif ENABLED(DGUS_LCD_UI_MKS)
#elif DGUS_LCD_UI_MKS
#include "mks/DGUSScreenHandler.h"
#elif ENABLED(DGUS_LCD_UI_FYSETC)
#elif DGUS_LCD_UI_FYSETC
#include "fysetc/DGUSScreenHandler.h"
#elif ENABLED(DGUS_LCD_UI_HIPRECY)
#elif DGUS_LCD_UI_HIPRECY
#include "hiprecy/DGUSScreenHandler.h"
#endif
@@ -51,6 +51,7 @@ public:
static void setstatusmessage(const char *msg);
// The same for messages from Flash
static void setstatusmessagePGM(PGM_P const msg);
static void setstatusmessage(FSTR_P const fmsg) { setstatusmessagePGM(FTOP(fmsg)); }
// Callback for VP "Display wants to change screen on idle printer"
static void ScreenChangeHookIfIdle(DGUS_VP_Variable &var, void *val_ptr);
// Callback for VP "Screen has been changed"
+6 -6
View File
@@ -137,19 +137,19 @@ namespace ExtUI {
// Called for temperature PID tuning result
switch (rst) {
case PID_STARTED:
ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_AUTOTUNE));
ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_AUTOTUNE));
break;
case PID_BAD_EXTRUDER_NUM:
ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM));
case PID_BAD_HEATER_ID:
ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_BAD_HEATER_ID));
break;
case PID_TEMP_TOO_HIGH:
ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_TEMP_TOO_HIGH));
ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH));
break;
case PID_TUNING_TIMEOUT:
ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_TIMEOUT));
ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_TIMEOUT));
break;
case PID_DONE:
ScreenHandler.setstatusmessagePGM(GET_TEXT(MSG_PID_AUTOTUNE_DONE));
ScreenHandler.setstatusmessage(GET_TEXT_F(MSG_PID_AUTOTUNE_DONE));
break;
}
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_MAIN);
@@ -24,7 +24,7 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_FYSETC)
#if DGUS_LCD_UI_FYSETC
#include "DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
@@ -22,7 +22,7 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_FYSETC)
#if DGUS_LCD_UI_FYSETC
#include "../DGUSScreenHandler.h"
@@ -24,7 +24,7 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_HIPRECY)
#if DGUS_LCD_UI_HIPRECY
#include "DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
@@ -22,7 +22,7 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_HIPRECY)
#if DGUS_LCD_UI_HIPRECY
#include "../DGUSScreenHandler.h"
@@ -22,7 +22,7 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
#include "DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
@@ -22,7 +22,7 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
#include "../DGUSScreenHandler.h"
@@ -26,7 +26,7 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_ORIGIN)
#if DGUS_LCD_UI_ORIGIN
#include "DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
@@ -22,7 +22,7 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_ORIGIN)
#if DGUS_LCD_UI_ORIGIN
#include "../DGUSScreenHandler.h"
@@ -24,7 +24,7 @@
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED
#include "DGUSDisplay.h"
@@ -22,7 +22,7 @@
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED
#include "DGUSRxHandler.h"
@@ -22,7 +22,7 @@
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED
#include "DGUSScreenHandler.h"
@@ -325,8 +325,8 @@ void DGUSScreenHandler::FilamentRunout(const ExtUI::extruder_t extruder) {
case ExtUI::PID_STARTED:
SetStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE));
break;
case ExtUI::PID_BAD_EXTRUDER_NUM:
SetStatusMessage(GET_TEXT_F(MSG_PID_BAD_EXTRUDER_NUM));
case ExtUI::PID_BAD_HEATER_ID:
SetStatusMessage(GET_TEXT_F(MSG_PID_BAD_HEATER_ID));
break;
case ExtUI::PID_TEMP_TOO_HIGH:
SetStatusMessage(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH));
@@ -72,10 +72,10 @@ public:
static void SetMessageLine(const char* msg, uint8_t line);
static void SetMessageLinePGM(PGM_P msg, uint8_t line);
static void SetStatusMessage(const char* msg, const millis_t duration = DGUS_STATUS_EXPIRATION_MS);
static void SetStatusMessage(FSTR_P const msg, const millis_t duration = DGUS_STATUS_EXPIRATION_MS);
static void SetStatusMessage(const char* msg, const millis_t duration=DGUS_STATUS_EXPIRATION_MS);
static void SetStatusMessage(FSTR_P const msg, const millis_t duration=DGUS_STATUS_EXPIRATION_MS);
static void ShowWaitScreen(DGUS_Screen return_screen, bool has_continue = false);
static void ShowWaitScreen(DGUS_Screen return_screen, bool has_continue=false);
static DGUS_Screen GetCurrentScreen();
static void TriggerScreenChange(DGUS_Screen screen);
@@ -115,7 +115,7 @@ private:
static const DGUS_Addr* FindScreenAddrList(DGUS_Screen screen);
static bool CallScreenSetup(DGUS_Screen screen);
static void MoveToScreen(DGUS_Screen screen, bool abort_wait = false);
static void MoveToScreen(DGUS_Screen screen, bool abort_wait=false);
static bool SendScreenVPData(DGUS_Screen screen, bool complete_update);
static bool settings_ready;
@@ -22,7 +22,7 @@
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED
#include "DGUSSetupHandler.h"
@@ -22,7 +22,7 @@
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED
#include "DGUSTxHandler.h"
@@ -22,7 +22,7 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED
#include "DGUS_ScreenAddrList.h"
@@ -22,7 +22,7 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED
#include "DGUS_ScreenSetup.h"
@@ -22,7 +22,7 @@
#include "../../../../inc/MarlinConfigPre.h"
#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED
#include "DGUS_VPList.h"

Some files were not shown because too many files have changed in this diff Show More