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
 
29
 
30
 #include HAL_PATH(.,HAL.h)
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
 #define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION)
32
 #define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION)
39
 
33
 
40
 #ifndef I2C_ADDRESS
34
 #ifndef I2C_ADDRESS

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

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

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

654
   #define UNUSED_E(E) UNUSED(E)
654
   #define UNUSED_E(E) UNUSED(E)
655
 #endif
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
  * The BLTouch Probe emulates a servo probe
658
  * The BLTouch Probe emulates a servo probe
666
  * and uses "special" angles for its state.
659
  * and uses "special" angles for its state.
950
   #define HAS_CLASSIC_E_JERK 1
943
   #define HAS_CLASSIC_E_JERK 1
951
 #endif
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
 #if SERIAL_PORT == -1 || SERIAL_PORT_2 == -1
958
 #if SERIAL_PORT == -1 || SERIAL_PORT_2 == -1
954
   #define HAS_USB_SERIAL 1
959
   #define HAS_USB_SERIAL 1
955
 #endif
960
 #endif
957
   #define HAS_ETHERNET 1
962
   #define HAS_ETHERNET 1
958
 #endif
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
 // Fallback Stepper Driver types that don't depend on Configuration_adv.h
972
 // Fallback Stepper Driver types that don't depend on Configuration_adv.h
961
 #ifndef X_DRIVER_TYPE
973
 #ifndef X_DRIVER_TYPE
962
   #define X_DRIVER_TYPE  A4988
974
   #define X_DRIVER_TYPE  A4988

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

542
 #else
542
 #else
543
   #define HAS_USER_ITEM(N) 0
543
   #define HAS_USER_ITEM(N) 0
544
 #endif
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
 #if BUTTONS_EXIST(EN1, EN2, ENC)
2906
 #if BUTTONS_EXIST(EN1, EN2, ENC)
2907
   #define HAS_ROTARY_ENCODER 1
2907
   #define HAS_ROTARY_ENCODER 1
2908
 #endif
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
  * Used by common-dependencies.py
26
  * Used by common-dependencies.py
27
  */
27
  */
28
 
28
 
29
-#define NUM_SERIAL 1 // Normally provided by HAL/HAL.h
30
-
31
 #include "../../../../Marlin/src/inc/MarlinConfig.h"
29
 #include "../../../../Marlin/src/inc/MarlinConfig.h"
32
 
30
 
33
 //
31
 //

Loading…
Cancel
Save