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

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
X-Ryl669 2021-03-14 18:11:11 +01:00 committed by Scott Lahteine
parent b644aca98c
commit f6f5ed166f
6 changed files with 26 additions and 29 deletions

View File

@ -29,12 +29,6 @@
#include HAL_PATH(.,HAL.h) #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) #define HAL_ADC_RANGE _BV(HAL_ADC_RESOLUTION)
#ifndef I2C_ADDRESS #ifndef I2C_ADDRESS

View File

@ -42,7 +42,6 @@
#if HAS_MEATPACK #if HAS_MEATPACK
#include "meatpack.h" #include "meatpack.h"
MeatPack meatpack;
#define MeatPack_ProtocolVersion "PV01" #define MeatPack_ProtocolVersion "PV01"
//#define MP_DEBUG //#define MP_DEBUG

View File

@ -654,13 +654,6 @@
#define UNUSED_E(E) UNUSED(E) #define UNUSED_E(E) UNUSED(E)
#endif #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 * The BLTouch Probe emulates a servo probe
* and uses "special" angles for its state. * and uses "special" angles for its state.
@ -950,6 +943,18 @@
#define HAS_CLASSIC_E_JERK 1 #define HAS_CLASSIC_E_JERK 1
#endif #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 #if SERIAL_PORT == -1 || SERIAL_PORT_2 == -1
#define HAS_USB_SERIAL 1 #define HAS_USB_SERIAL 1
#endif #endif
@ -957,6 +962,13 @@
#define HAS_ETHERNET 1 #define HAS_ETHERNET 1
#endif #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 // Fallback Stepper Driver types that don't depend on Configuration_adv.h
#ifndef X_DRIVER_TYPE #ifndef X_DRIVER_TYPE
#define X_DRIVER_TYPE A4988 #define X_DRIVER_TYPE A4988

View File

@ -542,3 +542,10 @@
#else #else
#define HAS_USER_ITEM(N) 0 #define HAS_USER_ITEM(N) 0
#endif #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

View File

@ -2906,16 +2906,3 @@
#if BUTTONS_EXIST(EN1, EN2, ENC) #if BUTTONS_EXIST(EN1, EN2, ENC)
#define HAS_ROTARY_ENCODER 1 #define HAS_ROTARY_ENCODER 1
#endif #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

View File

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