Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MKS PWC module adds macro definition #22528

Merged
merged 26 commits into from
Aug 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
23021e2
Merge pull request #1 from MarlinFirmware/bugfix-2.0.x
mks-viva Jul 21, 2021
a5cdf57
Merge pull request #2 from MarlinFirmware/bugfix-2.0.x
mks-viva Jul 23, 2021
c632f12
Merge pull request #3 from MarlinFirmware/bugfix-2.0.x
mks-viva Jul 27, 2021
751676e
Merge pull request #4 from MarlinFirmware/bugfix-2.0.x
mks-viva Jul 28, 2021
c5f2515
Merge pull request #5 from MarlinFirmware/bugfix-2.0.x
mks-viva Jul 29, 2021
ccfcc2e
Add support mini12864 v3 for e3p board
mks-viva Jul 29, 2021
54916c2
Update pins_MKS_ROBIN_E3P.h
mks-viva Jul 29, 2021
12a95be
Tweak formatting
thinkyhead Jul 29, 2021
1114e86
Merge pull request #6 from MarlinFirmware/bugfix-2.0.x
mks-viva Jul 29, 2021
45d9815
Add support MKS new board: MKS Monster8 V1.x
mks-viva Jul 29, 2021
e1447d8
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/22455
thinkyhead Jul 31, 2021
71b8828
Update stm32f4.ini
thinkyhead Jul 31, 2021
6c8b634
apply formatter
thinkyhead Jul 31, 2021
a169e63
Merge pull request #7 from MarlinFirmware/bugfix-2.0.x
mks-viva Jul 31, 2021
88c3407
Merge pull request #8 from MarlinFirmware/bugfix-2.0.x
mks-viva Jul 31, 2021
e30f40d
Merge pull request #9 from MarlinFirmware/bugfix-2.0.x
mks-viva Aug 2, 2021
3e16bde
Merge pull request #10 from MarlinFirmware/bugfix-2.0.x
mks-viva Aug 6, 2021
7b7c1f7
Add support MKS PWC function in configuration
mks-viva Aug 6, 2021
1d77003
mks pwc function
mks-viva Aug 6, 2021
3c3f792
Update Configuration.h
mks-viva Aug 6, 2021
0d20548
Update pins_MKS_MONSTER8.h
mks-viva Aug 6, 2021
744b65a
Update pins_MKS_ROBIN_NANO_V3.h
mks-viva Aug 6, 2021
a7c2ef6
Update Configuration.h
mks-viva Aug 6, 2021
86915fc
Enforce MKS_PWC with sanity check
thinkyhead Aug 6, 2021
9b68967
Replace MKS_PWC/MKSPWC with PSU_CONTROL
thinkyhead Aug 6, 2021
f8a2118
cleanup
thinkyhead Aug 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Marlin/src/gcode/lcd/M995.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "../gcode.h"

#if ENABLED(TFT_LVGL_UI)
#if HAS_TFT_LVGL_UI
#include "../../lcd/extui/mks_ui/draw_touch_calibration.h"
#else
#include "../../lcd/menu/menu.h"
Expand All @@ -37,7 +37,7 @@
*/
void GcodeSuite::M995() {

#if ENABLED(TFT_LVGL_UI)
#if HAS_TFT_LVGL_UI
lv_draw_touch_calibration_screen();
#else
ui.goto_screen(touch_screen_calibration);
Expand Down
12 changes: 10 additions & 2 deletions Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,17 @@
#endif

//
// Misc. Functions
// Power Supply Control
//
#define PS_ON_PIN P0_25 // TH3 Connector
#if ENABLED(PSU_CONTROL) // MKSPWC
#ifndef PS_ON_PIN
#define PS_ON_PIN P0_25 // SERVO
#endif
#ifndef KILL_PIN
#define KILL_PIN P1_29 // Z+
#define KILL_PIN_STATE HIGH
#endif
#endif

//
// Ethernet pins
Expand Down
13 changes: 13 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,19 @@
#define FAN_PIN P2_04
#endif

//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#ifndef PS_ON_PIN
#define PS_ON_PIN P2_00 // SERVO
#endif
#ifndef KILL_PIN
#define KILL_PIN P1_24 // Z+
#define KILL_PIN_STATE HIGH
#endif
#endif

//
// Misc. Functions
//
Expand Down
13 changes: 13 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,19 @@
//
#define LED_PIN P1_18 // Used as a status indicator

//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#ifndef PS_ON_PIN
#define PS_ON_PIN P2_00 // Suggestion (SERVO)
#endif
#ifndef KILL_PIN
#define KILL_PIN P1_24 // Suggestion (Z+)
#define KILL_PIN_STATE HIGH
#endif
#endif

//
// RGB LED
//
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_CHITU3D_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
#define TFT_RS_PIN FSMC_RS_PIN
#endif

#if ENABLED(TFT_LVGL_UI)
#if HAS_TFT_LVGL_UI
// LVGL
#define HAS_SPI_FLASH_FONT 1
#define HAS_GCODE_PREVIEW 1
Expand Down
5 changes: 3 additions & 2 deletions Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,10 @@
//
// Misc. Functions
//
//#define POWER_LOSS_PIN PA1 // PW_SO
#if ENABLED(BACKUP_POWER_SUPPLY)
#define POWER_LOSS_PIN PA2 // PW_DET (UPS) MKSPWC
#else
//#define POWER_LOSS_PIN PA1 // PW_SO
#endif

/**
Expand All @@ -217,7 +218,7 @@
//
#if ENABLED(PSU_CONTROL)
#define KILL_PIN PA2 // PW_DET
#define KILL_PIN_INVERTING true
#define KILL_PIN_STATE HIGH
//#define PS_ON_PIN PA3 // PW_CN /PW_OFF
#endif

Expand Down
11 changes: 5 additions & 6 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,11 @@
// Misc. Functions
//
#if HAS_TFT_LVGL_UI
//#define MKSPWC
#ifdef MKSPWC
#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
#if ENABLED(PSU_CONTROL) // MKSPWC
#define SUICIDE_PIN PB2 // PW_OFF
#define SUICIDE_PIN_INVERTING false
#define KILL_PIN PA2 // PW_DET
#define KILL_PIN_STATE HIGH
#endif

#define MT_DET_1_PIN PA4 // LVGL UI FILAMENT RUNOUT1 PIN
Expand Down
19 changes: 16 additions & 3 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,19 @@

#define FIL_RUNOUT_PIN PB10 // MT_DET

//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#ifndef PS_ON_PIN
#define PS_ON_PIN PA14 // PW_OFF
#endif
#ifndef KILL_PIN
#define KILL_PIN PB10 // PW_DET
#define KILL_PIN_STATE HIGH
#endif
#endif

/**
* _____ _____ _____
* (BEEPER) PC1 | 1 2 | PC3 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SD_SCK) 5V | 1 2 | GND
Expand Down Expand Up @@ -158,7 +171,7 @@
#elif ENABLED(MKS_MINI_12864_V3)
#define DOGLCD_CS PA4
#define DOGLCD_A0 PA5
#define LCD_PINS_DC DOGLCD_A0
#define LCD_PINS_DC DOGLCD_A0
#define LCD_BACKLIGHT_PIN -1
#define LCD_RESET_PIN PA6
#define NEOPIXEL_PIN PA7
Expand Down Expand Up @@ -189,8 +202,8 @@
//
// SD Card
//
#define SPI_DEVICE 2
#define ONBOARD_SPI_DEVICE 2
#define SPI_DEVICE 2
#define ONBOARD_SPI_DEVICE 2
#define SDSS SD_SS_PIN
#define SDCARD_CONNECTION ONBOARD
#define SD_DETECT_PIN PC10
Expand Down
27 changes: 19 additions & 8 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,28 @@
//#define TEMP_0_CS_PIN PE6 // TC2 - CS2

//
// Misc. Functions
// Power Supply Control
//
#if HAS_TFT_LVGL_UI
//#define MKSPWC
#ifdef MKSPWC
#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
#if ENABLED(PSU_CONTROL) // MKSPWC
#if HAS_TFT_LVGL_UI
#error "PSU_CONTROL cannot be used with TFT_LVGL_UI. Disable PSU_CONTROL to continue."
#endif
#ifndef PS_ON_PIN
#define PS_ON_PIN PB2 // SUICIDE
#endif
#ifndef KILL_PIN
#define KILL_PIN PA2
#define KILL_PIN_STATE HIGH
#endif
#else
#define SUICIDE_PIN PB2
#define SUICIDE_PIN_INVERTING false
#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
#define MT_DET_PIN_INVERTING false // LVGL UI filament RUNOUT PIN STATE
Expand Down
26 changes: 19 additions & 7 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,29 @@
//#define TEMP_0_CS_PIN PE5 // TC1 - CS1
//#define TEMP_0_CS_PIN PE6 // TC2 - CS2

//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#if HAS_TFT_LVGL_UI
#error "PSU_CONTROL cannot be used with TFT_LVGL_UI. Disable PSU_CONTROL to continue."
#endif
#ifndef PS_ON_PIN
#define PS_ON_PIN PB2 // SUICIDE
#endif
#ifndef KILL_PIN
#define KILL_PIN PA2
#define KILL_PIN_STATE HIGH
#endif
#else
#define SUICIDE_PIN PB2
#define SUICIDE_PIN_INVERTING false
#endif

//
// Misc. Functions
//
#if HAS_TFT_LVGL_UI
//#define MKSPWC
#ifdef MKSPWC
#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
#endif

#define MT_DET_1_PIN PA4 // LVGL UI FILAMENT RUNOUT1 PIN
#define MT_DET_2_PIN PE6 // LVGL UI FILAMENT RUNOUT2 PIN
Expand Down
24 changes: 21 additions & 3 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,28 @@
//#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
#define FIL_RUNOUT2_PIN PE6 // MT_DET2
#define FIL_RUNOUT3_PIN PG14 // MT_DET3

//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#if HAS_TFT_LVGL_UI
#error "PSU_CONTROL cannot be used with TFT_LVGL_UI. Disable PSU_CONTROL to continue."
#endif
#ifndef PS_ON_PIN
#define PS_ON_PIN PG11 // SUICIDE
#endif
#ifndef KILL_PIN
#define KILL_PIN PA2
#define KILL_PIN_STATE HIGH
#endif
#else
#define SUICIDE_PIN PG11
#define SUICIDE_PIN_INVERTING false
#endif

//
// SD Card
Expand Down
25 changes: 19 additions & 6 deletions Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,8 @@
//
// Misc. Functions
//
#define MT_DET_1 Y_MAX_PIN
#define MT_DET_2 Z_MAX_PIN
#define PW_DET Y_MAX_PIN
#define PW_OFF Z_MAX_PIN
#define MT_DET_1 PC5 // Y+
#define MT_DET_2 PB12 // Z+

#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN MT_DET_1
Expand All @@ -222,8 +220,23 @@
#define FIL_RUNOUT2_PIN MT_DET_2
#endif

#define POWER_LOSS_PIN PW_DET
#define PS_ON_PIN PW_OFF
//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#ifndef PS_ON_PIN
#define PS_ON_PIN MT_DET_2 // Z+
#endif
#ifndef KILL_PIN
#define KILL_PIN MT_DET_1 // Y+
#define KILL_PIN_STATE HIGH
#endif
#else
#define PW_DET MT_DET_1
#define PW_OFF MT_DET_2
#define POWER_LOSS_PIN PW_DET
#define PS_ON_PIN PW_OFF
#endif

// Random Info
#define USB_SERIAL -1 // USB Serial
Expand Down
35 changes: 26 additions & 9 deletions Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,36 @@
#define FIL_RUNOUT2_PIN MT_DET_2_PIN
#endif

#ifndef POWER_LOSS_PIN
#define POWER_LOSS_PIN PA13 // PW_DET
#endif
#define PS_ON_PIN PB2 // PW_OFF

//
// Enable MKSPWC support
//
//#define SUICIDE_PIN PB2
//#define LED_PIN PB2
//#define KILL_PIN PA2
//#define KILL_PIN_INVERTING true
//#define KILL_PIN_STATE HIGH

//#define LED_PIN PB2
//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
#if HAS_TFT_LVGL_UI
#error "PSU_CONTROL cannot be used with TFT_LVGL_UI. Disable PSU_CONTROL to continue."
#endif
#ifndef PS_ON_PIN
#define PS_ON_PIN PB2 // SUICIDE
#endif
#ifndef KILL_PIN
#define KILL_PIN PA13 // PW_DET
#define KILL_PIN_STATE HIGH
#endif
#else
#define SUICIDE_PIN PB2
#define SUICIDE_PIN_INVERTING false
#endif

#ifndef POWER_LOSS_PIN
#define POWER_LOSS_PIN PA13 // PW_DET
#endif

// Random Info
#define USB_SERIAL -1 // USB Serial
Expand All @@ -222,8 +239,8 @@

// MKS TEST
#if ENABLED(MKS_TEST)
#define MKS_TEST_POWER_LOSS_PIN PA13 // PW_DET
#define MKS_TEST_PS_ON_PIN PB2 // PW_OFF
#define MKS_TEST_POWER_LOSS_PIN PA13 // PW_DET
#define MKS_TEST_PS_ON_PIN PB2 // PW_OFF
#endif

//
Expand Down
17 changes: 12 additions & 5 deletions Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,19 @@
//
// Misc. Functions
//
//#define POWER_LOSS_PIN PA2 // PW_DET
//#define PS_ON_PIN PA3 // PW_OFF
//#define SUICIDE_PIN PB2 // Enable MKSPWC support
//#define KILL_PIN PA2 // Enable MKSPWC support
//#define KILL_PIN_INVERTING true // Enable MKSPWC support
//#define LED_PIN PB2

//
// Power Supply Control
//
#if ENABLED(PSU_CONTROL) // MKSPWC
//#define SUICIDE_PIN PB2 // LED
//#define KILL_PIN PA2 // PW_DET
//#define KILL_PIN_STATE HIGH
#else
//#define POWER_LOSS_PIN PA2 // PW_DET
//#define LED_PIN PB2
#endif

#ifndef SDCARD_CONNECTION
#define SDCARD_CONNECTION ONBOARD
Expand Down