From a506701a8b3db72316c0914919c0da706341b807 Mon Sep 17 00:00:00 2001 From: Sylvain <67423638+Le-Syl21@users.noreply.github.com> Date: Sat, 4 Oct 2025 21:23:40 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20WANHAO=5FD9=20(need=20EXP)=20(#2807?= =?UTF-8?q?3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 21 +-- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 4 +- Marlin/src/pins/mega/pins_WANHAO_D9.h | 141 ++++++++++++++++++ Marlin/src/pins/pins.h | 2 + Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h | 2 +- Marlin/src/pins/stm32f4/pins_CREALITY_F401.h | 2 +- .../pins/stm32f4/pins_TRONXY_CXY_446_V10.h | 4 +- 7 files changed, 161 insertions(+), 15 deletions(-) create mode 100644 Marlin/src/pins/mega/pins_WANHAO_D9.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index e9e1a8fd89..1b95b2ba52 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -176,16 +176,17 @@ #define BOARD_GT2560_V41B 1322 // Geeetech GT2560 V4.1B for A10(M/T/D) #define BOARD_EINSTART_S 1323 // Einstart retrofit #define BOARD_WANHAO_ONEPLUS 1324 // Wanhao 0ne+ i3 Mini -#define BOARD_OVERLORD 1325 // Overlord/Overlord Pro -#define BOARD_HJC2560C_REV1 1326 // ADIMLab Gantry v1 -#define BOARD_HJC2560C_REV2 1327 // ADIMLab Gantry v2 -#define BOARD_LEAPFROG_XEED2015 1328 // Leapfrog Xeed 2015 -#define BOARD_PICA_REVB 1329 // PICA Shield (original version) -#define BOARD_PICA 1330 // PICA Shield (rev C or later) -#define BOARD_INTAMSYS40 1331 // Intamsys 4.0 (Funmat HT) -#define BOARD_MALYAN_M180 1332 // Malyan M180 Mainboard Version 2 (no display function, direct G-code only) -#define BOARD_PROTONEER_CNC_SHIELD_V3 1333 // Mega controller & Protoneer CNC Shield V3.00 -#define BOARD_WEEDO_62A 1334 // WEEDO 62A board (TINA2, Monoprice Cadet, etc.) +#define BOARD_WANHAO_D9 1325 // Wanhao D9 MK2 +#define BOARD_OVERLORD 1326 // Overlord/Overlord Pro +#define BOARD_HJC2560C_REV1 1327 // ADIMLab Gantry v1 +#define BOARD_HJC2560C_REV2 1328 // ADIMLab Gantry v2 +#define BOARD_LEAPFROG_XEED2015 1329 // Leapfrog Xeed 2015 +#define BOARD_PICA_REVB 1330 // PICA Shield (original version) +#define BOARD_PICA 1331 // PICA Shield (rev C or later) +#define BOARD_INTAMSYS40 1332 // Intamsys 4.0 (Funmat HT) +#define BOARD_MALYAN_M180 1333 // Malyan M180 Mainboard Version 2 (no display function, direct G-code only) +#define BOARD_PROTONEER_CNC_SHIELD_V3 1334 // Mega controller & Protoneer CNC Shield V3.00 +#define BOARD_WEEDO_62A 1335 // WEEDO 62A board (TINA2, Monoprice Cadet, etc.) // // ATmega1281, ATmega2561 diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h index 3afb7fe072..6879331d27 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -408,7 +408,7 @@ #define SD_DETECT_PIN EXP2_07_PIN - #else // !CR10_STOCKDISPLAY + #else #define LCD_PINS_RS EXP1_04_PIN @@ -495,7 +495,7 @@ #endif // !FYSETC_MINI_12864 - #endif // !CR10_STOCKDISPLAY + #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/mega/pins_WANHAO_D9.h b/Marlin/src/pins/mega/pins_WANHAO_D9.h new file mode 100644 index 0000000000..c810b8461d --- /dev/null +++ b/Marlin/src/pins/mega/pins_WANHAO_D9.h @@ -0,0 +1,141 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2025 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Wanhao Duplicator D9 MK2 pin assignments + * ATmega2560 + */ + +#include "env_validate.h" + +#if NOT_TARGET(__AVR_ATmega2560__) + #error "Oops! Select 'Arduino/Genuino Mega or Mega 2560' in 'Tools > Board.'" +#endif + +#define BOARD_INFO_NAME "Wanhao D9 MK2" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME +#define BOARD_WEBSITE_URL "wanhao.store" + +#define LARGE_FLASH true + +// +// Limit Switches +// +#ifndef X_MIN_PIN + #define X_MIN_PIN 54 +#endif +#ifndef Y_MIN_PIN + #define Y_MIN_PIN 24 +#endif +#ifndef Z_MIN_PIN + #define Z_MIN_PIN 6 +#endif + +// +// Steppers +// +#define X_STEP_PIN 61 +#define X_DIR_PIN 62 +#define X_ENABLE_PIN 60 + +#define Y_STEP_PIN 64 +#define Y_DIR_PIN 65 +#define Y_ENABLE_PIN 2 + +#define Z_STEP_PIN 67 +#define Z_DIR_PIN 69 +#define Z_ENABLE_PIN 66 + +#define E0_STEP_PIN 58 +#define E0_DIR_PIN 59 +#define E0_ENABLE_PIN 57 + +// +// Temperature Sensors +// +#define TEMP_0_PIN 1 +#define TEMP_BED_PIN 14 + +// +// Heaters / Fans +// +#define HEATER_0_PIN 4 +#define HEATER_BED_PIN 3 +#define FAN0_PIN 5 + +// +// Servos +// +#define SERVO0_PIN 7 + +// +// SD Card +// +#define SD_DETECT_PIN 49 +#define SD_SS_PIN 53 + +// +// Misc. Functions +// +#define LED_PIN 13 +#define KILL_PIN -1 + +#ifndef FILWIDTH_PIN + #define FILWIDTH_PIN 12 +#endif + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN 8 +#endif + +// +// LCD / Controller +// +#if HAS_WIRED_LCD + #define BEEPER_PIN 27 // EXP1-1 + + #define LCD_PINS_RS 37 // EXP1-4 + #define LCD_PINS_EN 36 // EXP1-8 + + #define LCD_PINS_D4 34 // EXP1-4 + #define LCD_PINS_D5 35 // EXP1-6 + #define LCD_PINS_D6 32 // EXP1-7 + #define LCD_PINS_D7 33 // EXP1-8 + + #define BTN_ENC 30 // EXP1-2 + #define BTN_EN1 29 // EXP1-3 or EXP2-3 + #define BTN_EN2 28 // EXP1-5 or EXP2-5 +#endif // HAS_WIRED_LCD + +// +// Power Loss Recovery +// +#ifndef POWER_LOSS_PIN + #define POWER_LOSS_PIN 63 +#endif +#ifndef POWER_LOSS_STATE + #define POWER_LOSS_STATE LOW +#endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index d928123a0d..ecf15758e0 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -295,6 +295,8 @@ #include "mega/pins_EINSTART-S.h" // ATmega2560, ATmega1280 env:mega2560ext env:mega1280 #elif MB(WANHAO_ONEPLUS) #include "mega/pins_WANHAO_ONEPLUS.h" // ATmega2560 env:mega2560 +#elif MB(WANHAO_D9) + #include "mega/pins_WANHAO_D9.h" // ATmega2560 env:mega2560 #elif MB(OVERLORD) #include "mega/pins_OVERLORD.h" // ATmega2560 env:mega2560 #elif MB(HJC2560C_REV1) diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h index 58e3a2e1bd..dd3567be6a 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h @@ -78,7 +78,7 @@ // // Filament Runout Sensor // -#if ENABLED(FILAMENT_RUNOUT_SENSOR) +#ifndef FIL_RUNOUT_PIN #define FIL_RUNOUT_PIN PA15 // "Pulled-high" #endif diff --git a/Marlin/src/pins/stm32f4/pins_CREALITY_F401.h b/Marlin/src/pins/stm32f4/pins_CREALITY_F401.h index eecb5c8bc3..e611d22905 100644 --- a/Marlin/src/pins/stm32f4/pins_CREALITY_F401.h +++ b/Marlin/src/pins/stm32f4/pins_CREALITY_F401.h @@ -75,7 +75,7 @@ // // Filament runout // -#if ENABLED(FILAMENT_RUNOUT_SENSOR) +#ifndef FIL_RUNOUT_PIN #define FIL_RUNOUT_PIN PC15 #endif diff --git a/Marlin/src/pins/stm32f4/pins_TRONXY_CXY_446_V10.h b/Marlin/src/pins/stm32f4/pins_TRONXY_CXY_446_V10.h index 6648b131e4..b8de6f7641 100644 --- a/Marlin/src/pins/stm32f4/pins_TRONXY_CXY_446_V10.h +++ b/Marlin/src/pins/stm32f4/pins_TRONXY_CXY_446_V10.h @@ -103,8 +103,10 @@ // // Filament Sensors // -#if ENABLED(FILAMENT_RUNOUT_SENSOR) +#ifndef FIL_RUNOUT_PIN #define FIL_RUNOUT_PIN PE6 +#endif +#ifndef FIL_RUNOUT2_PIN #define FIL_RUNOUT2_PIN PF12 #endif