Browse Source

Fix build with Meatpack only on 2nd port (#21336)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
X-Ryl669 3 years ago
parent
commit
d787cd3076
No account linked to committer's email address

+ 0
- 6
Marlin/src/HAL/HAL.h View File

@@ -29,12 +29,6 @@
29 29
 
30 30
 #include HAL_PATH(.,HAL.h)
31 31
 
32
-#ifdef SERIAL_PORT_2
33
-  #define NUM_SERIAL 2
34
-#else
35
-  #define NUM_SERIAL 1
36
-#endif
37
-
38 32
 #define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION)
39 33
 
40 34
 #ifndef I2C_ADDRESS

+ 0
- 1
Marlin/src/feature/meatpack.cpp View File

@@ -42,7 +42,6 @@
42 42
 #if HAS_MEATPACK
43 43
 
44 44
 #include "meatpack.h"
45
-MeatPack meatpack;
46 45
 
47 46
 #define MeatPack_ProtocolVersion "PV01"
48 47
 //#define MP_DEBUG

+ 19
- 7
Marlin/src/inc/Conditionals_LCD.h View File

@@ -654,13 +654,6 @@
654 654
   #define UNUSED_E(E) UNUSED(E)
655 655
 #endif
656 656
 
657
-#if ENABLED(DWIN_CREALITY_LCD)
658
-  #define SERIAL_CATCHALL 0
659
-  #ifndef LCD_SERIAL_PORT
660
-    #define LCD_SERIAL_PORT 3 // Creality 4.x board
661
-  #endif
662
-#endif
663
-
664 657
 /**
665 658
  * The BLTouch Probe emulates a servo probe
666 659
  * and uses "special" angles for its state.
@@ -950,6 +943,18 @@
950 943
   #define HAS_CLASSIC_E_JERK 1
951 944
 #endif
952 945
 
946
+//
947
+// Serial Port Info
948
+//
949
+#ifdef SERIAL_PORT_2
950
+  #define NUM_SERIAL 2
951
+  #define HAS_MULTI_SERIAL 1
952
+#elif defined(SERIAL_PORT)
953
+  #define NUM_SERIAL 1
954
+#else
955
+  #define NUM_SERIAL 0
956
+  #undef BAUD_RATE_GCODE
957
+#endif
953 958
 #if SERIAL_PORT == -1 || SERIAL_PORT_2 == -1
954 959
   #define HAS_USB_SERIAL 1
955 960
 #endif
@@ -957,6 +962,13 @@
957 962
   #define HAS_ETHERNET 1
958 963
 #endif
959 964
 
965
+#if ENABLED(DWIN_CREALITY_LCD)
966
+  #define SERIAL_CATCHALL 0
967
+  #ifndef LCD_SERIAL_PORT
968
+    #define LCD_SERIAL_PORT 3 // Creality 4.x board
969
+  #endif
970
+#endif
971
+
960 972
 // Fallback Stepper Driver types that don't depend on Configuration_adv.h
961 973
 #ifndef X_DRIVER_TYPE
962 974
   #define X_DRIVER_TYPE  A4988

+ 7
- 0
Marlin/src/inc/Conditionals_adv.h View File

@@ -542,3 +542,10 @@
542 542
 #else
543 543
   #define HAS_USER_ITEM(N) 0
544 544
 #endif
545
+
546
+#if !HAS_MULTI_SERIAL
547
+  #undef MEATPACK_ON_SERIAL_PORT_2
548
+#endif
549
+#if EITHER(MEATPACK_ON_SERIAL_PORT_1, MEATPACK_ON_SERIAL_PORT_2)
550
+  #define HAS_MEATPACK 1
551
+#endif

+ 0
- 13
Marlin/src/inc/Conditionals_post.h View File

@@ -2906,16 +2906,3 @@
2906 2906
 #if BUTTONS_EXIST(EN1, EN2, ENC)
2907 2907
   #define HAS_ROTARY_ENCODER 1
2908 2908
 #endif
2909
-
2910
-#if !NUM_SERIAL
2911
-  #undef BAUD_RATE_GCODE
2912
-#elif NUM_SERIAL > 1
2913
-  #define HAS_MULTI_SERIAL 1
2914
-#endif
2915
-
2916
-#if !HAS_MULTI_SERIAL
2917
-  #undef MEATPACK_ON_SERIAL_PORT_2
2918
-#endif
2919
-#if EITHER(MEATPACK_ON_SERIAL_PORT_1, MEATPACK_ON_SERIAL_PORT_2)
2920
-  #define HAS_MEATPACK 1
2921
-#endif

+ 0
- 2
buildroot/share/PlatformIO/scripts/common-dependencies.h View File

@@ -26,8 +26,6 @@
26 26
  * Used by common-dependencies.py
27 27
  */
28 28
 
29
-#define NUM_SERIAL 1 // Normally provided by HAL/HAL.h
30
-
31 29
 #include "../../../../Marlin/src/inc/MarlinConfig.h"
32 30
 
33 31
 //

Loading…
Cancel
Save