From bc6d8f99b23bbf613b81d7a4d562f113fc32c2e2 Mon Sep 17 00:00:00 2001
From: ellensp <ellensp@hotmail.com>
Date: Sun, 6 Jun 2021 19:50:14 +1200
Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=EF=B8=8F=20Malyan=20M200=20with=20?=
 =?UTF-8?q?HAL/STM32=20(#22052)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Marlin/src/pins/pins.h |  2 +-
 ini/stm32f1-maple.ini  |  2 +-
 ini/stm32f1.ini        | 11 +++++++++++
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h
index b0463d44980..514665d8263 100644
--- a/Marlin/src/pins/pins.h
+++ b/Marlin/src/pins/pins.h
@@ -466,7 +466,7 @@
 #elif MB(STM32F103RE)
   #include "stm32f1/pins_STM32F1R.h"            // STM32F103RE                            env:STM32F103RE env:STM32F103RE_maple
 #elif MB(MALYAN_M200)
-  #include "stm32f1/pins_MALYAN_M200.h"         // STM32F103CB                            env:STM32F103CB_malyan
+  #include "stm32f1/pins_MALYAN_M200.h"         // STM32F103CB                            env:STM32F103CB_malyan env:STM32F103CB_malyan_maple
 #elif MB(STM3R_MINI)
   #include "stm32f1/pins_STM3R_MINI.h"          // STM32F103VE?                           env:STM32F103VE env:STM32F103RE_maple
 #elif MB(GTM32_PRO_VB)
diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini
index 4daf04263a2..349016145c3 100644
--- a/ini/stm32f1-maple.ini
+++ b/ini/stm32f1-maple.ini
@@ -330,7 +330,7 @@ build_flags   = ${common_stm32f1.build_flags}
 #
 # Malyan M200 (STM32F103CB)
 #
-[env:STM32F103CB_malyan]
+[env:STM32F103CB_malyan_maple]
 platform      = ${common_stm32f1.platform}
 extends       = common_stm32f1
 board         = marlin_malyanM200
diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini
index 2e197ccb4d6..150ddba01e5 100644
--- a/ini/stm32f1.ini
+++ b/ini/stm32f1.ini
@@ -282,3 +282,14 @@ build_unflags        = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
 extra_scripts        = ${common_stm32.extra_scripts}
   pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
   buildroot/share/PlatformIO/scripts/stm32_bootloader.py
+
+#
+# Malyan M200 (STM32F103CB)
+#
+[env:STM32F103CB_malyan]
+platform    = ${common_stm32.platform}
+extends     = common_stm32
+board       = malyanm200_f103cb
+build_flags = ${common_stm32.build_flags}
+  -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED
+src_filter  = ${common.default_src_filter} +<src/HAL/STM32>