1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-23 12:04:19 +00:00

Apply remaining ENABLED/DISABLED conditionals

This commit is contained in:
Scott Lahteine 2015-08-03 12:30:37 -07:00 committed by Richard Wackerbarth
parent 4a72d2ba9c
commit 46453905d6
29 changed files with 61 additions and 61 deletions

View File

@ -75,7 +75,7 @@
#define NEWPANEL
#endif
#ifdef MINIPANEL
#if ENABLED(MINIPANEL)
#define DOGLCD
#define SDSUPPORT
#define ULTIPANEL

View File

@ -23,7 +23,7 @@
#include "Marlin.h"
#ifdef M100_FREE_MEMORY_WATCHER
#if ENABLED(M100_FREE_MEMORY_WATCHER)
extern void *__brkval;
extern size_t __heap_start, __heap_end, __flp;
@ -73,7 +73,7 @@ int i, j, n;
// the right hand column to help spotting them.
//
#ifdef M100_FREE_MEMORY_DUMPER // Comment out to remove Dump sub-command
#if ENABLED(M100_FREE_MEMORY_DUMPER) // Disable to remove Dump sub-command
if ( code_seen('D') ) {
ptr = (unsigned char *) __brkval;
@ -163,7 +163,7 @@ int i, j, n;
// M100 C x Corrupts x locations in the free memory pool and reports the locations of the corruption.
// This is useful to check the correctness of the M100 D and the M100 F commands.
//
#ifdef M100_FREE_MEMORY_CORRUPTOR
#if ENABLED(M100_FREE_MEMORY_CORRUPTOR)
if ( code_seen('C') ) {
int x; // x gets the # of locations to corrupt within the memory pool
x = code_value();

View File

@ -4900,7 +4900,7 @@ inline void gcode_M503() {
LCD_ALERTMESSAGEPGM(MSG_FILAMENTCHANGE);
millis_t next_tick = 0;
while (!lcd_clicked()) {
#ifndef AUTO_FILAMENT_CHANGE
#if DISABLED(AUTO_FILAMENT_CHANGE)
millis_t ms = millis();
if (ms >= next_tick) {
lcd_quick_feedback();
@ -4918,7 +4918,7 @@ inline void gcode_M503() {
} // while(!lcd_clicked)
lcd_quick_feedback(); // click sound feedback
#ifdef AUTO_FILAMENT_CHANGE
#if ENABLED(AUTO_FILAMENT_CHANGE)
current_position[E_AXIS] = 0;
st_synchronize();
#endif
@ -5377,7 +5377,7 @@ void process_next_command() {
break;
#endif // ENABLE_AUTO_BED_LEVELING && Z_PROBE_REPEATABILITY_TEST
#ifdef M100_FREE_MEMORY_WATCHER
#if ENABLED(M100_FREE_MEMORY_WATCHER)
case 100:
gcode_M100();
break;
@ -6228,9 +6228,9 @@ void plan_arc(
clamp_to_software_endstops(arc_target);
#if defined(DELTA) || defined(SCARA)
#if ENABLED(DELTA) || ENABLED(SCARA)
calculate_delta(arc_target);
#ifdef ENABLE_AUTO_BED_LEVELING
#if ENABLED(ENABLE_AUTO_BED_LEVELING)
adjust_delta(arc_target);
#endif
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], arc_target[E_AXIS], feed_rate, active_extruder);
@ -6240,9 +6240,9 @@ void plan_arc(
}
// Ensure last segment arrives at target location.
#if defined(DELTA) || defined(SCARA)
#if ENABLED(DELTA) || ENABLED(SCARA)
calculate_delta(target);
#ifdef ENABLE_AUTO_BED_LEVELING
#if ENABLED(ENABLE_AUTO_BED_LEVELING)
adjust_delta(target);
#endif
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], target[E_AXIS], feed_rate, active_extruder);

View File

@ -9,7 +9,7 @@
lcd_buzz(duration, freq);
#elif PIN_EXISTS(BEEPER) // on-board buzzers have no further condition
SET_OUTPUT(BEEPER_PIN);
#ifdef SPEAKER // a speaker needs a AC ore a pulsed DC
#if ENABLED(SPEAKER) // a speaker needs a AC ore a pulsed DC
//tone(BEEPER_PIN, freq, duration); // needs a PWMable pin
unsigned int delay = 1000000 / freq / 2;
int i = duration * freq / 1000;

View File

@ -125,10 +125,10 @@
#elif ENABLED(U8GLIB_LM6059_AF)
// Based on the Adafruit ST7565 (http://www.adafruit.com/products/250)
U8GLIB_LM6059 u8g(DOGLCD_CS, DOGLCD_A0);
#elif defined U8GLIB_SSD1306
#elif ENABLED(U8GLIB_SSD1306)
// Generic support for SSD1306 OLED I2C LCDs
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);
#elif defined(MINIPANEL)
#elif ENABLED(MINIPANEL)
// The MINIPanel display
U8GLIB_MINI12864 u8g(DOGLCD_CS, DOGLCD_A0);
#else
@ -206,7 +206,7 @@ static void lcd_implementation_init() {
pinMode(LCD_PIN_RESET, OUTPUT);
digitalWrite(LCD_PIN_RESET, HIGH);
#endif
#ifndef MINIPANEL//setContrast not working for Mini Panel
#if DISABLED(MINIPANEL) // setContrast not working for Mini Panel
u8g.setContrast(lcd_contrast);
#endif
// FIXME: remove this workaround

View File

@ -301,7 +301,7 @@ Here are some standard links for getting your machine calibrated:
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX

View File

@ -286,7 +286,7 @@ Here are some standard links for getting your machine calibrated:
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX
@ -727,7 +727,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
// With this option servos are powered only during movement, then turned off to prevent jitter.
//#define DEACTIVATE_SERVOS_AFTER_MOVE
#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
// Delay (in microseconds) before turning the servo off. This depends on the servo speed.
// 300ms is a good value but you can try less delay.
// If the servo can't reach the requested position, increase it.

View File

@ -311,7 +311,7 @@ Here are some standard links for getting your machine calibrated:
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX

View File

@ -307,7 +307,7 @@ Here are some standard links for getting your machine calibrated:
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX

View File

@ -319,7 +319,7 @@ Here are some standard links for getting your machine calibrated:
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX

View File

@ -327,7 +327,7 @@ Here are some standard links for getting your machine calibrated:
// coarse Endstop Settings
//#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX

View File

@ -311,7 +311,7 @@ Here are some standard links for getting your machine calibrated:
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX

View File

@ -319,7 +319,7 @@ Here are some standard links for getting your machine calibrated:
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX

View File

@ -354,7 +354,7 @@ Here are some standard links for getting your machine calibrated:
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX

View File

@ -354,7 +354,7 @@ Here are some standard links for getting your machine calibrated:
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX

View File

@ -354,7 +354,7 @@ Here are some standard links for getting your machine calibrated:
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX

View File

@ -341,7 +341,7 @@ Here are some standard links for getting your machine calibrated:
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX

View File

@ -322,7 +322,7 @@ Here are some standard links for getting your machine calibrated:
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX

View File

@ -309,7 +309,7 @@ Here are some standard links for getting your machine calibrated:
// coarse Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
#ifndef ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS)
// fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
// #define ENDSTOPPULLUP_XMAX
// #define ENDSTOPPULLUP_YMAX

View File

@ -80,7 +80,7 @@
#define TEMP_BED_PIN 1 // ANALOG NUMBERING
#endif
#ifdef MINIPANEL
#if ENABLED(MINIPANEL)
#define BEEPER_PIN 46
// Pins for DOGM SPI LCD Support
#define DOGLCD_A0 47

View File

@ -60,7 +60,7 @@
#define BEEPER_PIN 33 // AUX-4
#if defined(ULTRA_LCD) && defined(NEWPANEL)
#if ENABLED(ULTRA_LCD) && ENABLED(NEWPANEL)
#define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 17

View File

@ -45,7 +45,7 @@
#endif
#define X_STOP_PIN 35
#ifdef SDSUPPORT
#if ENABLED(SDSUPPORT)
#define Y_STOP_PIN 37 // Move Ystop to Estop socket
#else
#define Y_STOP_PIN 8 // Ystop in Ystop socket

View File

@ -182,7 +182,7 @@
#define DOGLCD_CS 29
#define DOGLCD_A0 27
#define LCD_PIN_BL 33
#elif defined(MINIPANEL)
#elif ENABLED(MINIPANEL)
#define BEEPER_PIN 42
// Pins for DOGM SPI LCD Support
#define DOGLCD_A0 44

View File

@ -46,7 +46,7 @@
#undef SD_DETECT_PIN
#define SD_DETECT_PIN 22
#elif defined(REPRAP_DISCOUNT_SMART_CONTROLLER)
#elif ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER)
#undef BEEPER_PIN
#define BEEPER_PIN -1
@ -61,10 +61,10 @@
// SPI for Max6675 Thermocouple
#undef MAX6675_SS
#ifndef SDSUPPORT
#define MAX6675_SS 53 // Don't use pin 53 if there is even the remote possibility of using Display/SD card
#else
#if ENABLED(SDSUPPORT)
#define MAX6675_SS 49 // Don't use pin 49 as this is tied to the switch inside the SD card socket to detect if there is an SD card present
#else
#define MAX6675_SS 53 // Don't use pin 53 if there is even the remote possibility of using Display/SD card
#endif
// RigidBot swaps E0 / E1 plugs vs RAMPS 1.3

View File

@ -542,7 +542,7 @@ float junction_deviation = 0.1;
block->steps[A_AXIS] = labs(dx + dy);
block->steps[B_AXIS] = labs(dx - dy);
block->steps[Z_AXIS] = labs(dz);
#elif defined(COREXZ)
#elif ENABLED(COREXZ)
// corexz planning
block->steps[A_AXIS] = labs(dx + dz);
block->steps[Y_AXIS] = labs(dy);
@ -577,7 +577,7 @@ float junction_deviation = 0.1;
if (dz < 0) db |= BIT(Z_AXIS);
if (dx + dy < 0) db |= BIT(A_AXIS); // Motor A direction
if (dx - dy < 0) db |= BIT(B_AXIS); // Motor B direction
#elif defined(COREXZ)
#elif ENABLED(COREXZ)
if (dx < 0) db |= BIT(X_HEAD); // Save the real Extruder (head) direction in X Axis
if (dy < 0) db |= BIT(Y_AXIS);
if (dz < 0) db |= BIT(Z_HEAD); // ...and Z
@ -599,10 +599,10 @@ float junction_deviation = 0.1;
enable_x();
enable_y();
}
#ifndef Z_LATE_ENABLE
#if DISABLED(Z_LATE_ENABLE)
if (block->steps[Z_AXIS]) enable_z();
#endif
#elif defined(COREXZ)
#elif ENABLED(COREXZ)
if (block->steps[A_AXIS] || block->steps[C_AXIS]) {
enable_x();
enable_z();
@ -611,7 +611,7 @@ float junction_deviation = 0.1;
#else
if (block->steps[X_AXIS]) enable_x();
if (block->steps[Y_AXIS]) enable_y();
#ifndef Z_LATE_ENABLE
#if DISABLED(Z_LATE_ENABLE)
if (block->steps[Z_AXIS]) enable_z();
#endif
#endif
@ -700,7 +700,7 @@ float junction_deviation = 0.1;
delta_mm[Z_AXIS] = dz / axis_steps_per_unit[Z_AXIS];
delta_mm[A_AXIS] = (dx + dy) / axis_steps_per_unit[A_AXIS];
delta_mm[B_AXIS] = (dx - dy) / axis_steps_per_unit[B_AXIS];
#elif defined(COREXZ)
#elif ENABLED(COREXZ)
float delta_mm[6];
delta_mm[X_HEAD] = dx / axis_steps_per_unit[A_AXIS];
delta_mm[Y_AXIS] = dy / axis_steps_per_unit[Y_AXIS];

View File

@ -307,7 +307,7 @@ bool Servo::attached() { return servo_info[this->servoIndex].Pin.isActive; }
void Servo::move(int value) {
if (this->attach(0) >= 0) {
this->write(value);
#ifdef DEACTIVATE_SERVOS_AFTER_MOVE
#if ENABLED(DEACTIVATE_SERVOS_AFTER_MOVE)
delay(SERVO_DEACTIVATION_DELAY);
this->detach();
#endif

View File

@ -289,7 +289,7 @@ void enable_endstops(bool check) { check_endstops = check; }
// Check endstops
inline void update_endstops() {
#ifdef Z_DUAL_ENDSTOPS
#if ENABLED(Z_DUAL_ENDSTOPS)
uint16_t
#else
byte
@ -317,12 +317,12 @@ inline void update_endstops() {
step_events_completed = current_block->step_event_count; \
}
#ifdef COREXY
#if ENABLED(COREXY)
// Head direction in -X axis for CoreXY bots.
// If DeltaX == -DeltaY, the movement is only in Y axis
if ((current_block->steps[A_AXIS] != current_block->steps[B_AXIS]) || (TEST(out_bits, A_AXIS) == TEST(out_bits, B_AXIS))) {
if (TEST(out_bits, X_HEAD))
#elif defined(COREXZ)
#elif ENABLED(COREXZ)
// Head direction in -X axis for CoreXZ bots.
// If DeltaX == -DeltaZ, the movement is only in Z axis
if ((current_block->steps[A_AXIS] != current_block->steps[C_AXIS]) || (TEST(out_bits, A_AXIS) == TEST(out_bits, C_AXIS))) {
@ -331,7 +331,7 @@ inline void update_endstops() {
if (TEST(out_bits, X_AXIS)) // stepping along -X axis (regular Cartesian bot)
#endif
{ // -direction
#ifdef DUAL_X_CARRIAGE
#if ENABLED(DUAL_X_CARRIAGE)
// with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
if ((current_block->active_extruder == 0 && X_HOME_DIR == -1) || (current_block->active_extruder != 0 && X2_HOME_DIR == -1))
#endif
@ -342,7 +342,7 @@ inline void update_endstops() {
}
}
else { // +direction
#ifdef DUAL_X_CARRIAGE
#if ENABLED(DUAL_X_CARRIAGE)
// with 2 x-carriages, endstops are only checked in the homing direction for the active extruder
if ((current_block->active_extruder == 0 && X_HOME_DIR == 1) || (current_block->active_extruder != 0 && X2_HOME_DIR == 1))
#endif
@ -352,11 +352,11 @@ inline void update_endstops() {
#endif
}
}
#if defined(COREXY) || defined(COREXZ)
#if ENABLED(COREXY) || ENABLED(COREXZ)
}
#endif
#ifdef COREXY
#if ENABLED(COREXY)
// Head direction in -Y axis for CoreXY bots.
// If DeltaX == DeltaY, the movement is only in X axis
if ((current_block->steps[A_AXIS] != current_block->steps[B_AXIS]) || (TEST(out_bits, A_AXIS) != TEST(out_bits, B_AXIS))) {
@ -374,11 +374,11 @@ inline void update_endstops() {
UPDATE_ENDSTOP(Y, MAX);
#endif
}
#if defined(COREXY)
#if ENABLED(COREXY)
}
#endif
#ifdef COREXZ
#if ENABLED(COREXZ)
// Head direction in -Z axis for CoreXZ bots.
// If DeltaX == DeltaZ, the movement is only in X axis
if ((current_block->steps[A_AXIS] != current_block->steps[C_AXIS]) || (TEST(out_bits, A_AXIS) != TEST(out_bits, C_AXIS))) {
@ -389,7 +389,7 @@ inline void update_endstops() {
{ // z -direction
#if HAS_Z_MIN
#ifdef Z_DUAL_ENDSTOPS
#if ENABLED(Z_DUAL_ENDSTOPS)
SET_ENDSTOP_BIT(Z, MIN);
#if HAS_Z2_MIN
SET_ENDSTOP_BIT(Z2, MIN);
@ -411,7 +411,7 @@ inline void update_endstops() {
#endif // !Z_DUAL_ENDSTOPS
#endif // Z_MIN_PIN
#ifdef Z_PROBE_ENDSTOP
#if ENABLED(Z_PROBE_ENDSTOP)
UPDATE_ENDSTOP(Z, PROBE);
if (TEST_ENDSTOP(Z_PROBE))
@ -424,7 +424,7 @@ inline void update_endstops() {
else { // z +direction
#if HAS_Z_MAX
#ifdef Z_DUAL_ENDSTOPS
#if ENABLED(Z_DUAL_ENDSTOPS)
SET_ENDSTOP_BIT(Z, MAX);
#if HAS_Z2_MAX
@ -449,7 +449,7 @@ inline void update_endstops() {
#endif // !Z_DUAL_ENDSTOPS
#endif // Z_MAX_PIN
#ifdef Z_PROBE_ENDSTOP
#if ENABLED(Z_PROBE_ENDSTOP)
UPDATE_ENDSTOP(Z, PROBE);
if (TEST_ENDSTOP(Z_PROBE))
@ -459,7 +459,7 @@ inline void update_endstops() {
}
#endif
}
#if defined(COREXZ)
#if ENABLED(COREXZ)
}
#endif
old_endstop_bits = current_endstop_bits;

View File

@ -275,7 +275,7 @@ static void lcd_status_screen() {
#if ENABLED(LCD_PROGRESS_BAR)
millis_t ms = millis();
#ifndef PROGRESS_MSG_ONCE
#if DISABLED(PROGRESS_MSG_ONCE)
if (ms > progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME) {
progress_bar_ms = ms;
}

View File

@ -6,7 +6,7 @@
* When selecting the Russian language, a slightly different LCD implementation is used to handle UTF8 characters.
**/
//#ifndef REPRAPWORLD_KEYPAD
//#if DISABLED(REPRAPWORLD_KEYPAD)
// extern volatile uint8_t buttons; //the last checked buttons in a bit array.
//#else
extern volatile uint8_t buttons; //an extended version of the last checked buttons in a bit array.