Skip to content

Commit

Permalink
Add support MKS PWC function in configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mks-viva committed Aug 6, 2021
1 parent 3e16bde commit 7b7c1f7
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 17 deletions.
6 changes: 5 additions & 1 deletion Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@
//
// Misc. Functions
//
#define PS_ON_PIN P0_25 // TH3 Connector
#if ENABLED(MKS_PWC)
#define PS_ON_PIN P0_25 //SERVO interface, you can change it to other pin
#define KILL_PIN P1_29 //Z+ interface, you can change it to other pin
#define KILL_PIN_STATE true //true : HIGH level trigger
#endif

//
// Ethernet pins
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@
#define FAN_PIN P2_04
#endif

#if ENABLED(MKS_PWC)
#define PS_ON_PIN P2_00 //SERVO interface, you can change it to other pin
#define KILL_PIN P1_24 //Z+ interface, you can change it to other pin
#define KILL_PIN_STATE true //true : HIGH level trigger
#endif

//
// Misc. Functions
//
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@
//
#define LED_PIN P1_18 // Used as a status indicator

#if ENABLED(MKS_PWC)
#define PS_ON_PIN P2_00 //SERVO interface, you can change it to other pin
#define KILL_PIN P1_24 //Z+ interface, you can change it to other pin
#define KILL_PIN_STATE true //true : HIGH level trigger
#endif

//
// RGB LED
//
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@

#define FIL_RUNOUT_PIN PB10 // MT_DET

#if ENABLED(MKS_PWC)
#define PS_ON_PIN PA14 //PW_OFF, you can change it to other pin
#define KILL_PIN PB10 //PW_DET, you can change it to other pin
#define KILL_PIN_STATE true //true : HIGH level trigger
#endif

/**
* _____ _____ _____
* (BEEPER) PC1 | 1 2 | PC3 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SD_SCK) 5V | 1 2 | GND
Expand Down
19 changes: 13 additions & 6 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,24 @@
//#define TEMP_0_CS_PIN PE5 // TC1 - CS1
//#define TEMP_0_CS_PIN PE6 // TC2 - CS2

//
// Misc. Functions
//
#if HAS_TFT_LVGL_UI
//#define MKSPWC
#ifdef MKSPWC
#if ENABLED(MKS_PWC)
#if ENABLED(TFT_LVGL_UI)
#undef PSU_CONTROL
#define SUICIDE_PIN PB2 // Enable MKSPWC SUICIDE PIN
#define SUICIDE_PIN_INVERTING false // Enable MKSPWC PIN STATE
#define KILL_PIN PA2 // Enable MKSPWC DET PIN
#define KILL_PIN_STATE true // Enable MKSPWC PIN STATE
#else
#define PS_ON_PIN PB2 //PW_OFF, you can change it to other pin
#define KILL_PIN PA2 //PW_DET, you can change it to other pin
#define KILL_PIN_STATE true //true : HIGH level trigger
#endif
#endif

//
// Misc. Functions
//
#if HAS_TFT_LVGL_UI

#define MT_DET_1_PIN PA4 // LVGL UI FILAMENT RUNOUT1 PIN
#define MT_DET_2_PIN PE6 // LVGL UI FILAMENT RUNOUT2 PIN
Expand Down
19 changes: 13 additions & 6 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,17 +191,24 @@
//#define TEMP_0_CS_PIN PE5 // TC1 - CS1
//#define TEMP_0_CS_PIN PE6 // TC2 - CS2

//
// Misc. Functions
//
#if HAS_TFT_LVGL_UI
//#define MKSPWC
#ifdef MKSPWC
#if ENABLED(MKS_PWC)
#if ENABLED(TFT_LVGL_UI)
#undef PSU_CONTROL
#define SUICIDE_PIN PB2 // Enable MKSPWC SUICIDE PIN
#define SUICIDE_PIN_INVERTING false // Enable MKSPWC PIN STATE
#define KILL_PIN PA2 // Enable MKSPWC DET PIN
#define KILL_PIN_STATE true // Enable MKSPWC PIN STATE
#else
#define PS_ON_PIN PB2 //PW_OFF, you can change it to other pin
#define KILL_PIN PA2 //PW_DET, you can change it to other pin
#define KILL_PIN_STATE true //true : HIGH level trigger
#endif
#endif

//
// Misc. Functions
//
#if HAS_TFT_LVGL_UI

#define MT_DET_1_PIN PA4 // LVGL UI FILAMENT RUNOUT1 PIN
#define MT_DET_2_PIN PE6 // LVGL UI FILAMENT RUNOUT2 PIN
Expand Down
15 changes: 14 additions & 1 deletion Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,24 @@
//#define TEMP_0_CS_PIN PF11 // TC2 - CS2

#define POWER_LOSS_PIN PA2 // PW_DET
#define PS_ON_PIN PG11 // PW_OFF
#define FIL_RUNOUT_PIN PA4 // MT_DET1
//#define FIL_RUNOUT_PIN PE6 // MT_DET2
//#define FIL_RUNOUT_PIN PG14 // MT_DET3

#if ENABLED(MKS_PWC)
#if ENABLED(TFT_LVGL_UI)
#undef PSU_CONTROL
#define SUICIDE_PIN PG11 // Enable MKSPWC SUICIDE PIN
#define SUICIDE_PIN_INVERTING false // Enable MKSPWC PIN STATE
#define KILL_PIN PA2 // Enable MKSPWC DET PIN
#define KILL_PIN_STATE true // Enable MKSPWC PIN STATE
#else
#define PS_ON_PIN PG11 //PW_OFF, you can change it to other pin
#define KILL_PIN PA2 //PW_DET, you can change it to other pin
#define KILL_PIN_STATE true //true : HIGH level trigger
#endif
#endif

//
// SD Card
//
Expand Down
8 changes: 6 additions & 2 deletions Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,12 @@
#define FIL_RUNOUT2_PIN MT_DET_2
#endif

#define POWER_LOSS_PIN PW_DET
#define PS_ON_PIN PW_OFF
#if ENABLED(MKS_PWC)
#define PS_ON_PIN PB12 //Z+ interface, you can change it to other pin
#define KILL_PIN PC5 //Y+ interface, you can change it to other pin
#define KILL_PIN_INVERTING true //true : HIGH level trigger
#define KILL_PIN_STATE KILL_PIN_INVERTING
#endif

// Random Info
#define USB_SERIAL -1 // USB Serial
Expand Down
16 changes: 15 additions & 1 deletion Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,21 @@
#ifndef POWER_LOSS_PIN
#define POWER_LOSS_PIN PA13 // PW_DET
#endif
#define PS_ON_PIN PB2 // PW_OFF

#if ENABLED(MKS_PWC)
#if ENABLED(TFT_LVGL_UI)
#undef PSU_CONTROL
#define SUICIDE_PIN PB2 // Enable MKSPWC SUICIDE PIN
#define SUICIDE_PIN_INVERTING false // Enable MKSPWC PIN STATE
#define KILL_PIN PA13 // Enable MKSPWC DET PIN
#define KILL_PIN_STATE true // Enable MKSPWC PIN STATE
#else
#define PS_ON_PIN PB2 //PW_OFF, you can change it to other pin
#define KILL_PIN PA13 //PW_DET, you can change it to other pin
#define KILL_PIN_INVERTING true //true : HIGH level trigger
#define KILL_PIN_STATE KILL_PIN_INVERTING
#endif
#endif

//
// Enable MKSPWC support
Expand Down

0 comments on commit 7b7c1f7

Please sign in to comment.