diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 36dee3dbb6..8979d10a1e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -380,7 +380,7 @@ #if NONE(ABL_NCSW, ABL_EZABL, ABL_BLTOUCH) #define ABL_BLTOUCH #endif - #if NONE(SKR13, SKR14, SKR14Turbo, SKRPRO11, SKRE3Turbo, SKRMiniE3V2) + #if NONE(SKR13, SKR14, SKR14Turbo, SKRPRO11, SKRE3Turbo, SKRMiniE3V2, Creality422, Creality427) #define Y_STOP_PIN 14 #define X_STOP_PIN 3 #endif @@ -545,7 +545,7 @@ */ #if ANY(SKR13, SKR14, SKR14Turbo, SKRPRO11, SKRMiniE3V2, SKRE3Turbo) #define SERIAL_PORT -1 - #elif ANY(MachineEnder3V2, MachineEnder3Pro422, MachineEnder3Pro427) + #elif ANY(MachineEnder3V2, MachineEnder3Pro422, MachineEnder3Pro427, Creality422, Creality427) #define SERIAL_PORT 1 #else #define SERIAL_PORT 0 @@ -557,10 +557,12 @@ * :[-2, -1, 0, 1, 2, 3, 4, 5, 6, 7] */ -#if ANY(SKR13, SKR14, SKR14Turbo, SKRPRO11, SKRE3Turbo) && (NONE(MachineCR10SPro, MachineCRX, MachineEnder5Plus, MachineCR10Max) || (ENABLED(GraphicLCD) && NONE(Force10SProDisplay, ForceCRXDisplay))) +#if ANY(SKR13, SKR14, SKR14Turbo, SKRPRO11, SKRE3Turbo) && (NONE(MachineCR10SPro, MachineCRX, MachineEnder5Plus, MachineCR10Max, MachineEnder3V2) || (ENABLED(GraphicLCD) && NONE(Force10SProDisplay, ForceCRXDisplay))) #define SERIAL_PORT_2 0 #elif ENABLED(SKRMiniE3V2) #define SERIAL_PORT_2 2 +#elif BOTH(MachineEnder3V2, SKRE3Turbo) + #define LCD_SERIAL_PORT 1 #elif ANY(SKR13, SKR14, SKR14Turbo, SKRE3Turbo) #define LCD_SERIAL_PORT 0 #elif ANY(MachineEnder3Pro422, MachineEnder3Pro427)&& DISABLED(MachineEnder3V2) @@ -1436,7 +1438,7 @@ // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. -#if ENABLED(MachineEnder3V2) +#if ENABLED(MachineEnder3V2) && NONE(SKRE3Turbo, SKR14Turbo, SKR14, SKR13) #define ENDSTOP_INTERRUPTS_FEATURE #endif @@ -3020,9 +3022,6 @@ #if DISABLED(MelziHostOnly) #define SDSUPPORT #endif -#if ENABLED(MachineEnder3V2) - #define SDIO_SUPPORT -#endif /** * SD CARD: ENABLE CRC diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index e40aebebb8..a7960b3c84 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1331,7 +1331,7 @@ // The standard SD detect circuit reads LOW when media is inserted and HIGH when empty. // Enable this option and set to HIGH if your SD cards are incorrectly detected. - #if NONE(MachineCR10SPro, MachineCRX, MachineEnder5Plus, MachineCR10Max, MachineEnder3V2, MachineEnder3Pro422, MachineEnder3Pro427, SKR14Turbo, SKR14) + #if NONE(MachineCR10SPro, MachineCRX, MachineEnder5Plus, MachineCR10Max, MachineEnder3V2, MachineEnder3Pro422, MachineEnder3Pro427, SKR14Turbo, SKR14, , Creality422, Creality427) #define SD_DETECT_STATE HIGH #endif @@ -3609,11 +3609,11 @@ #endif #if ENABLED(CUSTOM_MENU_MAIN) - #define CUSTOM_MENU_CONFIG_TITLE "Leveling Tools" - //#define CUSTOM_MENU_CONFIG_SCRIPT_DONE "M117 Wireless Script Done" - #define CUSTOM_MENU_CONFIG_SCRIPT_AUDIBLE_FEEDBACK - #define CUSTOM_MENU_CONFIG_SCRIPT_RETURN // Return to status screen after a script - #define CUSTOM_MENU_CONFIG_ONLY_IDLE // Only show custom menu when the machine is idle + #define CUSTOM_MENU_MAIN_TITLE "Leveling Tools" + //#define CUSTOM_MENU_MAIN_SCRIPT_DONE "M117 Wireless Script Done" + #define CUSTOM_MENU_MAIN_SCRIPT_AUDIBLE_FEEDBACK + #define CUSTOM_MENU_MAIN_SCRIPT_RETURN // Return to status screen after a script + #define CUSTOM_MENU_MAIN_ONLY_IDLE // Only show custom menu when the machine is idle #if ENABLED(BedDC) #define CommBedTmp "55" diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index 45a1ab012e..72754aa06f 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -63,7 +63,7 @@ extern uint8_t marlin_debug_flags; // Serial redirection // // Step 1: Find what's the first serial leaf -#if BOTH(HAS_MULTI_SERIAL, SERIAL_CATCHALL) +#if ENABLED(HAS_MULTI_SERIAL) && defined(SERIAL_CATCHALL) #define _SERIAL_LEAF_1 MYSERIAL #else #define _SERIAL_LEAF_1 MYSERIAL1 diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index c6543bee86..dd6c261341 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -142,19 +142,19 @@ public: } static int8_t cell_index_x_valid(const_float_t x) { - return WITHIN(cell_index_x_raw(x), 0, (GRID_MAX_POINTS_X - 2)); + return WITHIN(cell_index_x_raw(x), 0, GRID_MAX_CELLS_X - 1); } static int8_t cell_index_y_valid(const_float_t y) { - return WITHIN(cell_index_y_raw(y), 0, (GRID_MAX_POINTS_Y - 2)); + return WITHIN(cell_index_y_raw(y), 0, GRID_MAX_CELLS_Y - 1); } static int8_t cell_index_x(const_float_t x) { - return constrain(cell_index_x_raw(x), 0, (GRID_MAX_POINTS_X) - 2); + return constrain(cell_index_x_raw(x), 0, GRID_MAX_CELLS_X - 1); } static int8_t cell_index_y(const_float_t y) { - return constrain(cell_index_y_raw(y), 0, (GRID_MAX_POINTS_Y) - 2); + return constrain(cell_index_y_raw(y), 0, GRID_MAX_CELLS_Y - 1); } static inline xy_int8_t cell_indexes(const_float_t x, const_float_t y) { @@ -204,7 +204,7 @@ public: * the case where the printer is making a vertical line that only crosses horizontal mesh lines. */ static inline float z_correction_for_x_on_horizontal_mesh_line(const_float_t rx0, const int x1_i, const int yi) { - if (!WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(yi, 0, GRID_MAX_POINTS_Y - 1)) { + if (!WITHIN(x1_i, 0, (GRID_MAX_POINTS_X) - 1) || !WITHIN(yi, 0, (GRID_MAX_POINTS_Y) - 1)) { if (DEBUGGING(LEVELING)) { if (WITHIN(x1_i, 0, (GRID_MAX_POINTS_X) - 1)) DEBUG_ECHOPGM("yi"); else DEBUG_ECHOPGM("x1_i"); @@ -227,7 +227,7 @@ public: // See comments above for z_correction_for_x_on_horizontal_mesh_line // static inline float z_correction_for_y_on_vertical_mesh_line(const_float_t ry0, const int xi, const int y1_i) { - if (!WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(y1_i, 0, GRID_MAX_POINTS_Y - 1)) { + if (!WITHIN(xi, 0, (GRID_MAX_POINTS_X) - 1) || !WITHIN(y1_i, 0, (GRID_MAX_POINTS_Y) - 1)) { if (DEBUGGING(LEVELING)) { if (WITHIN(xi, 0, (GRID_MAX_POINTS_X) - 1)) DEBUG_ECHOPGM("y1_i"); else DEBUG_ECHOPGM("xi"); diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 105102abcf..657f906c14 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -171,40 +171,6 @@ float g26_random_deviation = 0.0; #endif -mesh_index_pair find_closest_circle_to_print(const xy_pos_t &pos) { - float closest = 99999.99; - mesh_index_pair out_point; - - out_point.pos = -1; - - GRID_LOOP(i, j) { - if (!circle_flags.marked(i, j)) { - // We found a circle that needs to be printed - const xy_pos_t m = { _GET_MESH_X(i), _GET_MESH_Y(j) }; - - // Get the distance to this intersection - float f = (pos - m).magnitude(); - - // It is possible that we are being called with the values - // to let us find the closest circle to the start position. - // But if this is not the case, add a small weighting to the - // distance calculation to help it choose a better place to continue. - //f += (g26_xy_pos - m).magnitude() / 15.0f; - - // Add the specified amount of Random Noise to our search - if (g26_random_deviation > 1.0) f += random(0.0, g26_random_deviation); - - if (f < closest) { - closest = f; // Found a closer un-printed location - out_point.pos.set(i, j); // Save its data - out_point.distance = closest; - } - } - } - circle_flags.mark(out_point); // Mark this location as done. - return out_point; -} - void move_to(const_float_t rx, const_float_t ry, const_float_t z, const_float_t e_delta) { static float last_z = -999.99; @@ -231,7 +197,7 @@ void move_to(const_float_t rx, const_float_t ry, const_float_t z, const_float_t prepare_internal_move_to_destination(fr_mm_s); } -FORCE_INLINE void move_to(const xyz_pos_t &where, const_float_t de) { move_to(where.x, where.y, where.z, de); } +void move_to(const xyz_pos_t &where, const_float_t de) { move_to(where.x, where.y, where.z, de); } typedef struct { float extrusion_multiplier = EXTRUSION_MULTIPLIER, diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 7ae1d8dccd..b387096319 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -952,7 +952,7 @@ // #ifdef SERIAL_PORT_2 #define NUM_SERIAL 2 - #define HAS_MULTI_SERIAL 1 + //#define HAS_MULTI_SERIAL 1 #elif defined(SERIAL_PORT) #define NUM_SERIAL 1 #else @@ -967,7 +967,7 @@ #endif #if ENABLED(DWIN_CREALITY_LCD) - #define SERIAL_CATCHALL 0 + #define SERIAL_CATCHALL -1 #ifndef LCD_SERIAL_PORT #define LCD_SERIAL_PORT 3 // Creality 4.x board #endif diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.cpp b/Marlin/src/lcd/dwin/e3v2/dwin.cpp index 25a7c9d680..df42e9d7a2 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.cpp +++ b/Marlin/src/lcd/dwin/e3v2/dwin.cpp @@ -1230,7 +1230,7 @@ void HMI_Move_X() { } } -void HMI_Move_Y(void) { +void HMI_Move_Y() { ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); if (encoder_diffState != ENCODER_DIFF_NO) { if (Apply_Encoder(encoder_diffState, HMI_ValueStruct.Move_Y_scaled)) @@ -1243,7 +1243,7 @@ void HMI_Move_Y(void) { } } -void HMI_Move_Z(void) { +void HMI_Move_Z() { ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); if (encoder_diffState != ENCODER_DIFF_NO) { if (Apply_Encoder(encoder_diffState, HMI_ValueStruct.Move_Z_scaled)) @@ -1258,7 +1258,7 @@ void HMI_Move_Z(void) { #if HAS_HOTEND - void HMI_Move_E(void) { + void HMI_Move_E() { static float last_E_scaled = 0; ENCODER_DiffState encoder_diffState = Encoder_ReceiveAnalyze(); if (encoder_diffState != ENCODER_DIFF_NO) { @@ -1275,6 +1275,7 @@ void HMI_Move_Z(void) { } #endif + #if HAS_ZOFFSET_ITEM bool printer_busy() { return planner.movesplanned() || printingIsActive(); } @@ -2333,6 +2334,7 @@ void Draw_Move_Menu() { #include "../../../libs/buzzer.h" void HMI_AudioFeedback(const bool success=true) { + #if USE_BEEPER if (success) { buzzer.tone(100, 659); buzzer.tone(10, 0); @@ -2340,6 +2342,7 @@ void HMI_AudioFeedback(const bool success=true) { } else buzzer.tone(40, 440); + #endif } /* Prepare */ @@ -2644,8 +2647,8 @@ void HMI_Control() { void HMI_Leveling() { Popup_Window_Leveling(); DWIN_UpdateLCD(); - #if DEFINED(MAIN_MENU_ITEM_1_GCODE) - queue_inject_P(PSTR(MAIN_MENU_ITEM_1_GCODE)); + #if defined(MAIN_MENU_ITEM_1_GCODE) + queue.inject_P(PSTR(MAIN_MENU_ITEM_1_GCODE)); #else queue.inject_P(PSTR("G28O\nG29\nG28\nG1Z0")); #endif diff --git a/Marlin/src/lcd/dwin/e3v2/dwin.h b/Marlin/src/lcd/dwin/e3v2/dwin.h index b68d0724cf..7f7c007eed 100644 --- a/Marlin/src/lcd/dwin/e3v2/dwin.h +++ b/Marlin/src/lcd/dwin/e3v2/dwin.h @@ -75,11 +75,11 @@ enum processID : uint8_t { Move_X, Move_Y, Move_Z, - Extruder, - Homeoffset, #if HAS_HOTEND + Extruder, ETemp, #endif + Homeoffset, #if HAS_HEATED_BED BedTemp, #endif diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 2eecda9df0..2cac0f8e77 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -859,7 +859,7 @@ namespace ExtUI { bed_mesh_t& getMeshArray() { return Z_VALUES_ARR; } float getMeshPoint(const xy_uint8_t &pos) { return Z_VALUES(pos.x, pos.y); } void setMeshPoint(const xy_uint8_t &pos, const_float_t zoff) { - if (WITHIN(pos.x, 0, GRID_MAX_POINTS_X) && WITHIN(pos.y, 0, GRID_MAX_POINTS_Y)) { + if (WITHIN(pos.x, 0, (GRID_MAX_POINTS_X) - 1) && WITHIN(pos.y, 0, (GRID_MAX_POINTS_Y) - 1)) { Z_VALUES(pos.x, pos.y) = zoff; TERN_(ABL_BILINEAR_SUBDIVISION, bed_level_virt_interpolate()); } diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 319755d909..992681632d 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -3502,7 +3502,6 @@ void Temperature::tick() { #if ENABLED(AUTO_REPORT_TEMPERATURES) AutoReporter Temperature::auto_reporter; void Temperature::AutoReportTemp::report() { - PORT_REDIRECT(SERIAL_ALL); print_heater_states(active_extruder); SERIAL_EOL(); } diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h index 2e1e02f991..bdb3c3ff63 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -246,8 +246,13 @@ #endif -#endif // HAS_WIRED_LCD - +#elif ENABLED(DWIN_CREALITY_LCD) + #define BEEPER_PIN EXP1_10_PIN + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_06_PIN + #define BTN_ENC EXP1_09_PIN + #undef SPEAKER +#endif // // SD Support //