Skip to content

Commit f6f5ed1

Browse files
X-Ryl669thinkyhead
andcommitted
Fix build with Meatpack only on 2nd port (#21336)
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
1 parent b644aca commit f6f5ed1

File tree

6 files changed

+26
-29
lines changed

6 files changed

+26
-29
lines changed

Marlin/src/HAL/HAL.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@
2929

3030
#include HAL_PATH(.,HAL.h)
3131

32-
#ifdef SERIAL_PORT_2
33-
#define NUM_SERIAL 2
34-
#else
35-
#define NUM_SERIAL 1
36-
#endif
37-
3832
#define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION)
3933

4034
#ifndef I2C_ADDRESS

Marlin/src/feature/meatpack.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#if HAS_MEATPACK
4343

4444
#include "meatpack.h"
45-
MeatPack meatpack;
4645

4746
#define MeatPack_ProtocolVersion "PV01"
4847
//#define MP_DEBUG

Marlin/src/inc/Conditionals_LCD.h

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -654,13 +654,6 @@
654654
#define UNUSED_E(E) UNUSED(E)
655655
#endif
656656

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-
664657
/**
665658
* The BLTouch Probe emulates a servo probe
666659
* and uses "special" angles for its state.
@@ -950,13 +943,32 @@
950943
#define HAS_CLASSIC_E_JERK 1
951944
#endif
952945

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
953958
#if SERIAL_PORT == -1 || SERIAL_PORT_2 == -1
954959
#define HAS_USB_SERIAL 1
955960
#endif
956961
#if SERIAL_PORT_2 == -2
957962
#define HAS_ETHERNET 1
958963
#endif
959964

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+
960972
// Fallback Stepper Driver types that don't depend on Configuration_adv.h
961973
#ifndef X_DRIVER_TYPE
962974
#define X_DRIVER_TYPE A4988

Marlin/src/inc/Conditionals_adv.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,3 +542,10 @@
542542
#else
543543
#define HAS_USER_ITEM(N) 0
544544
#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

Marlin/src/inc/Conditionals_post.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2906,16 +2906,3 @@
29062906
#if BUTTONS_EXIST(EN1, EN2, ENC)
29072907
#define HAS_ROTARY_ENCODER 1
29082908
#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

buildroot/share/PlatformIO/scripts/common-dependencies.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
* Used by common-dependencies.py
2727
*/
2828

29-
#define NUM_SERIAL 1 // Normally provided by HAL/HAL.h
30-
3129
#include "../../../../Marlin/src/inc/MarlinConfig.h"
3230

3331
//

0 commit comments

Comments
 (0)