More useful ENABLED / DISABLED macros (#17054)
This commit is contained in:
@ -31,10 +31,10 @@
|
||||
* Templatized 01 October 2018 by Eduardo José Tagle to allow multiple instances
|
||||
*/
|
||||
|
||||
#include "../shared/MarlinSerial.h"
|
||||
|
||||
#include <WString.h>
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#ifndef SERIAL_PORT
|
||||
#define SERIAL_PORT 0
|
||||
#endif
|
||||
@ -261,12 +261,12 @@
|
||||
static constexpr int PORT = serial;
|
||||
static constexpr unsigned int RX_SIZE = RX_BUFFER_SIZE;
|
||||
static constexpr unsigned int TX_SIZE = TX_BUFFER_SIZE;
|
||||
static constexpr bool XONOFF = bSERIAL_XON_XOFF;
|
||||
static constexpr bool EMERGENCYPARSER = bEMERGENCY_PARSER;
|
||||
static constexpr bool DROPPED_RX = bSERIAL_STATS_DROPPED_RX;
|
||||
static constexpr bool RX_OVERRUNS = bSERIAL_STATS_RX_BUFFER_OVERRUNS;
|
||||
static constexpr bool RX_FRAMING_ERRORS = bSERIAL_STATS_RX_FRAMING_ERRORS;
|
||||
static constexpr bool MAX_RX_QUEUED = bSERIAL_STATS_MAX_RX_QUEUED;
|
||||
static constexpr bool XONOFF = ENABLED(SERIAL_XON_XOFF);
|
||||
static constexpr bool EMERGENCYPARSER = ENABLED(EMERGENCY_PARSER);
|
||||
static constexpr bool DROPPED_RX = ENABLED(SERIAL_STATS_DROPPED_RX);
|
||||
static constexpr bool RX_OVERRUNS = ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS);
|
||||
static constexpr bool RX_FRAMING_ERRORS = ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS);
|
||||
static constexpr bool MAX_RX_QUEUED = ENABLED(SERIAL_STATS_MAX_RX_QUEUED);
|
||||
};
|
||||
extern MarlinSerial<MarlinSerialCfg<SERIAL_PORT>> customizedSerial1;
|
||||
|
||||
@ -304,7 +304,7 @@
|
||||
static constexpr bool XONOFF = false;
|
||||
static constexpr bool EMERGENCYPARSER = false;
|
||||
static constexpr bool DROPPED_RX = false;
|
||||
static constexpr bool RX_OVERRUNS = bDGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS;
|
||||
static constexpr bool RX_OVERRUNS = HAS_DGUS_LCD && ENABLED(DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS);
|
||||
static constexpr bool RX_FRAMING_ERRORS = false;
|
||||
static constexpr bool MAX_RX_QUEUED = false;
|
||||
};
|
||||
|
@ -27,10 +27,10 @@
|
||||
* Based on MarlinSerial for AVR, copyright (c) 2006 Nicholas Zambetti. All right reserved.
|
||||
*/
|
||||
|
||||
#include "../shared/MarlinSerial.h"
|
||||
|
||||
#include <WString.h>
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#define DEC 10
|
||||
#define HEX 16
|
||||
#define OCT 8
|
||||
@ -163,12 +163,12 @@ struct MarlinSerialCfg {
|
||||
static constexpr int PORT = serial;
|
||||
static constexpr unsigned int RX_SIZE = RX_BUFFER_SIZE;
|
||||
static constexpr unsigned int TX_SIZE = TX_BUFFER_SIZE;
|
||||
static constexpr bool XONOFF = bSERIAL_XON_XOFF;
|
||||
static constexpr bool EMERGENCYPARSER = bEMERGENCY_PARSER;
|
||||
static constexpr bool DROPPED_RX = bSERIAL_STATS_DROPPED_RX;
|
||||
static constexpr bool RX_OVERRUNS = bSERIAL_STATS_RX_BUFFER_OVERRUNS;
|
||||
static constexpr bool RX_FRAMING_ERRORS = bSERIAL_STATS_RX_FRAMING_ERRORS;
|
||||
static constexpr bool MAX_RX_QUEUED = bSERIAL_STATS_MAX_RX_QUEUED;
|
||||
static constexpr bool XONOFF = ENABLED(SERIAL_XON_XOFF);
|
||||
static constexpr bool EMERGENCYPARSER = ENABLED(EMERGENCY_PARSER);
|
||||
static constexpr bool DROPPED_RX = ENABLED(SERIAL_STATS_DROPPED_RX);
|
||||
static constexpr bool RX_OVERRUNS = ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS);
|
||||
static constexpr bool RX_FRAMING_ERRORS = ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS);
|
||||
static constexpr bool MAX_RX_QUEUED = ENABLED(SERIAL_STATS_MAX_RX_QUEUED);
|
||||
};
|
||||
|
||||
#if SERIAL_PORT >= 0
|
||||
|
@ -57,9 +57,7 @@
|
||||
* Because PWM hardware channels all share the same frequency, along with the
|
||||
* fallback software channels, FAST_PWM_FAN is incompatible with Servos.
|
||||
*/
|
||||
#if NUM_SERVOS > 0 && ENABLED(FAST_PWM_FAN)
|
||||
#error "BLTOUCH and Servos are incompatible with FAST_PWM_FAN on LPC176x boards."
|
||||
#endif
|
||||
static_assert(!(NUM_SERVOS && ENABLED(FAST_PWM_FAN)), "BLTOUCH and Servos are incompatible with FAST_PWM_FAN on LPC176x boards.");
|
||||
|
||||
/**
|
||||
* Test LPC176x-specific configuration values for errors at compile-time.
|
||||
@ -69,13 +67,13 @@
|
||||
// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
|
||||
//#endif
|
||||
|
||||
#if IS_RE_ARM_BOARD && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI)
|
||||
#error "Re-ARM with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and TMC2130 require TMC_USE_SW_SPI"
|
||||
#if MB(RAMPS_14_RE_ARM_EFB, RAMPS_14_RE_ARM_EEB, RAMPS_14_RE_ARM_EFF, RAMPS_14_RE_ARM_EEF, RAMPS_14_RE_ARM_SF)
|
||||
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI)
|
||||
#error "Re-ARM with REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER and TMC2130 requires TMC_USE_SW_SPI."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(BAUD_RATE_GCODE)
|
||||
#error "BAUD_RATE_GCODE is not yet supported on LPC176x."
|
||||
#endif
|
||||
static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported on LPC176x.");
|
||||
|
||||
/**
|
||||
* Flag any serial port conflicts
|
||||
|
@ -1,67 +0,0 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* HAL/shared/MarlinSerial.h
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
constexpr bool
|
||||
#if HAS_DGUS_LCD
|
||||
bDGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS = (false
|
||||
#if ENABLED(DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS)
|
||||
|| true
|
||||
#endif
|
||||
),
|
||||
#endif
|
||||
bSERIAL_XON_XOFF = (false
|
||||
#if ENABLED(SERIAL_XON_XOFF)
|
||||
|| true
|
||||
#endif
|
||||
),
|
||||
bEMERGENCY_PARSER = (false
|
||||
#if ENABLED(EMERGENCY_PARSER)
|
||||
|| true
|
||||
#endif
|
||||
),
|
||||
bSERIAL_STATS_DROPPED_RX = (false
|
||||
#if ENABLED(SERIAL_STATS_DROPPED_RX)
|
||||
|| true
|
||||
#endif
|
||||
),
|
||||
bSERIAL_STATS_RX_BUFFER_OVERRUNS = (false
|
||||
#if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS)
|
||||
|| true
|
||||
#endif
|
||||
),
|
||||
bSERIAL_STATS_RX_FRAMING_ERRORS = (false
|
||||
#if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS)
|
||||
|| true
|
||||
#endif
|
||||
),
|
||||
bSERIAL_STATS_MAX_RX_QUEUED = (false
|
||||
#if ENABLED(SERIAL_STATS_MAX_RX_QUEUED)
|
||||
|| true
|
||||
#endif
|
||||
);
|
Reference in New Issue
Block a user