🎨 Check flags without ENABLED
This commit is contained in:
@ -63,7 +63,7 @@ enum CalEnum : char { // the 7 main calibration points -
|
||||
#define LOOP_CAL_RAD(VAR) LOOP_CAL_PT(VAR, __A, _7P_STEP)
|
||||
#define LOOP_CAL_ACT(VAR, _4P, _OP) LOOP_CAL_PT(VAR, _OP ? _AB : __A, _4P ? _4P_STEP : _7P_STEP)
|
||||
|
||||
#if ENABLED(HAS_MULTI_HOTEND)
|
||||
#if HAS_MULTI_HOTEND
|
||||
const uint8_t old_tool_index = active_extruder;
|
||||
#endif
|
||||
|
||||
|
@ -81,11 +81,11 @@ void GcodeSuite::G34() {
|
||||
const uint16_t target_current = parser.intval('S', GANTRY_CALIBRATION_CURRENT);
|
||||
const uint32_t previous_current = stepper.motor_current_setting[Z_AXIS];
|
||||
stepper.set_digipot_current(1, target_current);
|
||||
#elif ENABLED(HAS_MOTOR_CURRENT_DAC)
|
||||
#elif HAS_MOTOR_CURRENT_DAC
|
||||
const float target_current = parser.floatval('S', GANTRY_CALIBRATION_CURRENT);
|
||||
const float previous_current = dac_amps(Z_AXIS, target_current);
|
||||
stepper_dac.set_current_value(Z_AXIS, target_current);
|
||||
#elif ENABLED(HAS_MOTOR_CURRENT_I2C)
|
||||
#elif HAS_MOTOR_CURRENT_I2C
|
||||
const uint16_t target_current = parser.intval('S', GANTRY_CALIBRATION_CURRENT);
|
||||
previous_current = dac_amps(Z_AXIS);
|
||||
digipot_i2c.set_current(Z_AXIS, target_current)
|
||||
@ -127,9 +127,9 @@ void GcodeSuite::G34() {
|
||||
stepper.set_digipot_current(Z_AXIS, previous_current);
|
||||
#elif HAS_MOTOR_CURRENT_PWM
|
||||
stepper.set_digipot_current(1, previous_current);
|
||||
#elif ENABLED(HAS_MOTOR_CURRENT_DAC)
|
||||
#elif HAS_MOTOR_CURRENT_DAC
|
||||
stepper_dac.set_current_value(Z_AXIS, previous_current);
|
||||
#elif ENABLED(HAS_MOTOR_CURRENT_I2C)
|
||||
#elif HAS_MOTOR_CURRENT_I2C
|
||||
digipot_i2c.set_current(Z_AXIS, previous_current)
|
||||
#elif HAS_TRINAMIC_CONFIG
|
||||
#if AXIS_IS_TMC(Z)
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "../../../feature/digipot/digipot.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_MOTOR_CURRENT_DAC)
|
||||
#if HAS_MOTOR_CURRENT_DAC
|
||||
#include "../../../feature/dac/stepper_dac.h"
|
||||
#endif
|
||||
|
||||
@ -73,7 +73,7 @@ void GcodeSuite::M907() {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_MOTOR_CURRENT_DAC)
|
||||
#if HAS_MOTOR_CURRENT_DAC
|
||||
if (parser.seenval('S')) {
|
||||
const float dac_percent = parser.value_float();
|
||||
LOOP_LE_N(i, 4) stepper_dac.set_current_percent(i, dac_percent);
|
||||
@ -92,7 +92,7 @@ void GcodeSuite::M907() {
|
||||
TERN_(HAS_MOTOR_CURRENT_DAC, stepper_dac.set_current_value(parser.byteval('P', -1), parser.ushortval('S', 0)));
|
||||
}
|
||||
|
||||
#if ENABLED(HAS_MOTOR_CURRENT_DAC)
|
||||
#if HAS_MOTOR_CURRENT_DAC
|
||||
|
||||
void GcodeSuite::M909() { stepper_dac.print_values(); }
|
||||
void GcodeSuite::M910() { stepper_dac.commit_eeprom(); }
|
||||
|
@ -908,7 +908,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
case 907: M907(); break; // M907: Set digital trimpot motor current using axis codes.
|
||||
#if EITHER(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC)
|
||||
case 908: M908(); break; // M908: Control digital trimpot directly.
|
||||
#if ENABLED(HAS_MOTOR_CURRENT_DAC)
|
||||
#if HAS_MOTOR_CURRENT_DAC
|
||||
case 909: M909(); break; // M909: Print digipot/DAC current value
|
||||
case 910: M910(); break; // M910: Commit digipot/DAC value to external EEPROM
|
||||
#endif
|
||||
|
@ -524,7 +524,7 @@ private:
|
||||
static void G38(const int8_t subcode);
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_MESH)
|
||||
#if HAS_MESH
|
||||
static void G42();
|
||||
#endif
|
||||
|
||||
@ -557,7 +557,7 @@ private:
|
||||
static void G425();
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_RESUME_CONTINUE)
|
||||
#if HAS_RESUME_CONTINUE
|
||||
static void M0_M1();
|
||||
#endif
|
||||
|
||||
@ -612,7 +612,7 @@ private:
|
||||
static void M31();
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#if ENABLED(HAS_MEDIA_SUBCALLS)
|
||||
#if HAS_MEDIA_SUBCALLS
|
||||
static void M32();
|
||||
#endif
|
||||
#if ENABLED(LONG_FILENAME_HOST_SUPPORT)
|
||||
@ -743,7 +743,7 @@ private:
|
||||
static void M149();
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_COLOR_LEDS)
|
||||
#if HAS_COLOR_LEDS
|
||||
static void M150();
|
||||
#endif
|
||||
|
||||
@ -777,7 +777,7 @@ private:
|
||||
static void M204();
|
||||
static void M205();
|
||||
|
||||
#if ENABLED(HAS_M206_COMMAND)
|
||||
#if HAS_M206_COMMAND
|
||||
static void M206();
|
||||
#endif
|
||||
|
||||
@ -791,11 +791,11 @@ private:
|
||||
|
||||
static void M211();
|
||||
|
||||
#if ENABLED(HAS_MULTI_EXTRUDER)
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
static void M217();
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_HOTEND_OFFSET)
|
||||
#if HAS_HOTEND_OFFSET
|
||||
static void M218();
|
||||
#endif
|
||||
|
||||
@ -813,7 +813,7 @@ private:
|
||||
static void M240();
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_LCD_CONTRAST)
|
||||
#if HAS_LCD_CONTRAST
|
||||
static void M250();
|
||||
#endif
|
||||
|
||||
@ -833,7 +833,7 @@ private:
|
||||
static void M290();
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_BUZZER)
|
||||
#if HAS_BUZZER
|
||||
static void M300();
|
||||
#endif
|
||||
|
||||
@ -845,7 +845,7 @@ private:
|
||||
static void M302();
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_PID_HEATING)
|
||||
#if HAS_PID_HEATING
|
||||
static void M303();
|
||||
#endif
|
||||
|
||||
@ -853,7 +853,7 @@ private:
|
||||
static void M304();
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_USER_THERMISTORS)
|
||||
#if HAS_USER_THERMISTORS
|
||||
static void M305();
|
||||
#endif
|
||||
|
||||
@ -894,7 +894,7 @@ private:
|
||||
static void M402();
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_PRUSA_MMU2)
|
||||
#if HAS_PRUSA_MMU2
|
||||
static void M403();
|
||||
#endif
|
||||
|
||||
@ -905,11 +905,11 @@ private:
|
||||
static void M407();
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_FILAMENT_SENSOR)
|
||||
#if HAS_FILAMENT_SENSOR
|
||||
static void M412();
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_MULTI_LANGUAGE)
|
||||
#if HAS_MULTI_LANGUAGE
|
||||
static void M414();
|
||||
#endif
|
||||
|
||||
@ -922,11 +922,11 @@ private:
|
||||
static void M425();
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_M206_COMMAND)
|
||||
#if HAS_M206_COMMAND
|
||||
static void M428();
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_POWER_MONITOR)
|
||||
#if HAS_POWER_MONITOR
|
||||
static void M430();
|
||||
#endif
|
||||
|
||||
@ -977,11 +977,11 @@ private:
|
||||
static void M603();
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_DUPLICATION_MODE)
|
||||
#if HAS_DUPLICATION_MODE
|
||||
static void M605();
|
||||
#endif
|
||||
|
||||
#if ENABLED(IS_KINEMATIC)
|
||||
#if IS_KINEMATIC
|
||||
static void M665();
|
||||
#endif
|
||||
|
||||
@ -1006,7 +1006,7 @@ private:
|
||||
static void M810_819();
|
||||
#endif
|
||||
|
||||
#if ENABLED(HAS_BED_PROBE)
|
||||
#if HAS_BED_PROBE
|
||||
static void M851();
|
||||
#endif
|
||||
|
||||
@ -1039,7 +1039,7 @@ private:
|
||||
#if HAS_TRINAMIC_CONFIG
|
||||
static void M122();
|
||||
static void M906();
|
||||
#if ENABLED(HAS_STEALTHCHOP)
|
||||
#if HAS_STEALTHCHOP
|
||||
static void M569();
|
||||
#endif
|
||||
#if ENABLED(MONITOR_DRIVER_STATUS)
|
||||
@ -1066,7 +1066,7 @@ private:
|
||||
static void M907();
|
||||
#if EITHER(HAS_MOTOR_CURRENT_SPI, HAS_MOTOR_CURRENT_DAC)
|
||||
static void M908();
|
||||
#if ENABLED(HAS_MOTOR_CURRENT_DAC)
|
||||
#if HAS_MOTOR_CURRENT_DAC
|
||||
static void M909();
|
||||
static void M910();
|
||||
#endif
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
struct CommandLine {
|
||||
char buffer[MAX_CMD_SIZE]; //!< The command buffer
|
||||
bool skip_ok; //!< Skip sending ok when command is processed?
|
||||
#if ENABLED(HAS_MULTI_SERIAL)
|
||||
#if HAS_MULTI_SERIAL
|
||||
serial_index_t port; //!< Serial port the command was received on
|
||||
#endif
|
||||
};
|
||||
|
Reference in New Issue
Block a user