diff --git a/Marlin/src/HAL/HAL.h b/Marlin/src/HAL/HAL.h index 9eefda8fb..0cd836af2 100644 --- a/Marlin/src/HAL/HAL.h +++ b/Marlin/src/HAL/HAL.h @@ -29,12 +29,6 @@ #include HAL_PATH(.,HAL.h) -#ifdef SERIAL_PORT_2 - #define NUM_SERIAL 2 -#else - #define NUM_SERIAL 1 -#endif - #define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION) #ifndef I2C_ADDRESS diff --git a/Marlin/src/feature/meatpack.cpp b/Marlin/src/feature/meatpack.cpp index 178831c9b..44567ac48 100644 --- a/Marlin/src/feature/meatpack.cpp +++ b/Marlin/src/feature/meatpack.cpp @@ -42,7 +42,6 @@ #if HAS_MEATPACK #include "meatpack.h" -MeatPack meatpack; #define MeatPack_ProtocolVersion "PV01" //#define MP_DEBUG diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index e5f7441e7..b9b86a7bf 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -654,13 +654,6 @@ #define UNUSED_E(E) UNUSED(E) #endif -#if ENABLED(DWIN_CREALITY_LCD) - #define SERIAL_CATCHALL 0 - #ifndef LCD_SERIAL_PORT - #define LCD_SERIAL_PORT 3 // Creality 4.x board - #endif -#endif - /** * The BLTouch Probe emulates a servo probe * and uses "special" angles for its state. @@ -950,6 +943,18 @@ #define HAS_CLASSIC_E_JERK 1 #endif +// +// Serial Port Info +// +#ifdef SERIAL_PORT_2 + #define NUM_SERIAL 2 + #define HAS_MULTI_SERIAL 1 +#elif defined(SERIAL_PORT) + #define NUM_SERIAL 1 +#else + #define NUM_SERIAL 0 + #undef BAUD_RATE_GCODE +#endif #if SERIAL_PORT == -1 || SERIAL_PORT_2 == -1 #define HAS_USB_SERIAL 1 #endif @@ -957,6 +962,13 @@ #define HAS_ETHERNET 1 #endif +#if ENABLED(DWIN_CREALITY_LCD) + #define SERIAL_CATCHALL 0 + #ifndef LCD_SERIAL_PORT + #define LCD_SERIAL_PORT 3 // Creality 4.x board + #endif +#endif + // Fallback Stepper Driver types that don't depend on Configuration_adv.h #ifndef X_DRIVER_TYPE #define X_DRIVER_TYPE A4988 diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 00b9b1fae..490766bd7 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -542,3 +542,10 @@ #else #define HAS_USER_ITEM(N) 0 #endif + +#if !HAS_MULTI_SERIAL + #undef MEATPACK_ON_SERIAL_PORT_2 +#endif +#if EITHER(MEATPACK_ON_SERIAL_PORT_1, MEATPACK_ON_SERIAL_PORT_2) + #define HAS_MEATPACK 1 +#endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index a6567e971..fb06a7a3f 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2906,16 +2906,3 @@ #if BUTTONS_EXIST(EN1, EN2, ENC) #define HAS_ROTARY_ENCODER 1 #endif - -#if !NUM_SERIAL - #undef BAUD_RATE_GCODE -#elif NUM_SERIAL > 1 - #define HAS_MULTI_SERIAL 1 -#endif - -#if !HAS_MULTI_SERIAL - #undef MEATPACK_ON_SERIAL_PORT_2 -#endif -#if EITHER(MEATPACK_ON_SERIAL_PORT_1, MEATPACK_ON_SERIAL_PORT_2) - #define HAS_MEATPACK 1 -#endif diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.h b/buildroot/share/PlatformIO/scripts/common-dependencies.h index ed2f46aba..03fae56fd 100644 --- a/buildroot/share/PlatformIO/scripts/common-dependencies.h +++ b/buildroot/share/PlatformIO/scripts/common-dependencies.h @@ -26,8 +26,6 @@ * Used by common-dependencies.py */ -#define NUM_SERIAL 1 // Normally provided by HAL/HAL.h - #include "../../../../Marlin/src/inc/MarlinConfig.h" //